ah

package
v0.11.8 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 5

Documentation

Index

Constants

View Source
const InstanceShutDownStatus = "stopped"

InstanceShutDownStatus represents instance's shutdown statuse

Variables

View Source
var (
	// ErrPrimaryIPNotFound is returned when primary is not found
	ErrPrimaryIPNotFound = errors.New("primary ip is not found")
)
View Source
var (
	// ErrResourceNotFound is returned when resource is not found
	ErrResourceNotFound = errors.New("resource not found")
)

Functions

func BuildFilterQuery

func BuildFilterQuery(filters []FilterInterface) string

BuildFilterQuery returns Ransack filter expression

func BuildSortingQuery

func BuildSortingQuery(sortings []*Sorting) string

BuildSortingQuery returns Ransack sorting expression

Types

type APIClient

type APIClient struct {
	Instances               InstancesAPI
	IPAddresses             IPAddressesAPI
	IPAddressAssignments    IPAddressAssignmentsAPI
	PrivateNetworks         PrivateNetworksAPI
	InstancePrivateNetworks InstancePrivateNetworksAPI
	Volumes                 VolumesAPI
	InstancePlans           InstancePlansAPI
	VolumePlans             VolumePlansAPI
	SSHKeys                 SSHKeysAPI
	Backups                 BackupsAPI
	Datacenters             DatacentersAPI
	Images                  ImagesAPI
	LoadBalancers           LoadBalancersAPI
	KubernetesClusters      KubernetesClustersAPI
	Tokens                  TokensAPI
	// Deprecated: Please use VolumePlans instead.
	VolumeProducts VolumeProductsAPI
	// Deprecated: Please use InstancePlans instead.
	InstanceProducts InstanceProductsAPI
	// contains filtered or unexported fields
}

APIClient implements communication with AH API

func NewAPIClient

func NewAPIClient(options *ClientOptions) (*APIClient, error)

NewAPIClient returns APIClient instance

func (*APIClient) Do

func (c *APIClient) Do(ctx context.Context, req *http.Request, v interface{}) (*http.Response, error)

Do sends an API request

type Action

type Action struct {
	ID           string `json:"id,omitempty"`
	State        string `json:"state,omitempty"`
	ResourceID   string `json:"resource_id,omitempty"`
	CreatedAt    string `json:"created_at,omitempty"`
	ResourceType string `json:"resource_type,omitempty"`
	Type         string `json:"type,omitempty"`
	UserID       string `json:"user_id,omitempty"`
	Note         string `json:"note,omitempty"`
	UpdatedAt    string `json:"updated_at,omitempty"`
	StartedAt    string `json:"started_at,omitempty"`
	CompletedAt  string `json:"completed_at,omitempty"`
}

Action object

type BackUpUpdateRequest added in v0.3.3

type BackUpUpdateRequest struct {
	Note string `json:"note,omitempty"`
	Name string `json:"name,omitempty"`
}

BackUpUpdateRequest represents a request to update a volume.

type Backup added in v0.3.3

type Backup struct {
	ID          string `json:"id,omitempty"`
	InstanceID  string `json:"instance_id,omitempty"`
	CreatedAt   string `json:"created_at,omitempty"`
	UpdatedAt   string `json:"updated_at,omitempty"`
	Name        string `json:"name,omitempty"`
	Status      string `json:"status,omitempty"`
	Type        string `json:"type,omitempty"`
	Note        string `json:"note,omitempty"`
	Public      bool   `json:"public,omitempty"`
	Size        int    `json:"size,omitempty"`
	MinDiskSize int    `json:"min_disk_size,omitempty"`
}

Backup object

type BackupsAPI added in v0.3.3

BackupsAPI is an interface for backups.

type BackupsService added in v0.3.3

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

BackupsService implements BackupsAPI interface.

func (*BackupsService) Delete added in v0.3.3

func (bs *BackupsService) Delete(ctx context.Context, backupID string) (*Action, error)

Delete backup

func (*BackupsService) Get added in v0.3.3

func (bs *BackupsService) Get(ctx context.Context, backupID string) (*Backup, error)

Get backup info

func (*BackupsService) List added in v0.3.3

func (bs *BackupsService) List(ctx context.Context, options *ListOptions) ([]InstanceBackups, error)

List returns all available private networks

func (*BackupsService) Update added in v0.3.3

func (bs *BackupsService) Update(ctx context.Context, backupID string, request *BackUpUpdateRequest) (*Backup, error)

Update backup

type ClientOptions

type ClientOptions struct {
	HTTPClient *http.Client
	BaseURL    string
	Token      string
}

ClientOptions represents options to communicate with AH API

type ClusterDeleteWorkerRequest added in v0.11.5

type ClusterDeleteWorkerRequest struct {
	Replace bool `json:"replace,omitempty"`
}

type ContFilter

type ContFilter struct {
	Value string
	Keys  []string
}

ContFilter represents Ransack "*_cont" filter .

func (*ContFilter) Encode

func (f *ContFilter) Encode() []string

Encode returns Ransack "*_eq" filter expression

type CreateKubernetesWorkerPoolRequest added in v0.10.7

type CreateKubernetesWorkerPoolRequest struct {
	PrivateProperties *PrivateProperties `json:"private_properties,omitempty"`
	PublicProperties  *PublicProperties  `json:"public_properties,omitempty"`
	Labels            *Labels            `json:"labels,omitempty"`
	Type              string             `json:"type"`
	Count             int                `json:"count,omitempty"`
	MinCount          int                `json:"min_count,omitempty"`
	MaxCount          int                `json:"max_count,omitempty"`
	AutoScale         bool               `json:"autoscale,omitempty"`
}

CreateKubernetesWorkerPoolRequest represents a request to create a worker pool.

type Datacenter added in v0.3.3

type Datacenter struct {
	Region            *DatacenterRegion `json:"region,omitempty"`
	ID                string            `json:"id,omitempty"`
	Name              string            `json:"name,omitempty"`
	FullName          string            `json:"full_name,omitempty"`
	Slug              string            `json:"slug,omitempty"`
	InstancesRunning  int               `json:"instances_running,omitempty"`
	PrivateNodesCount int               `json:"private_nodes_count,omitempty"`
}

Datacenter object

type DatacenterRegion added in v0.3.3

type DatacenterRegion struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	CountryCode string `json:"country_code,omitempty"`
}

DatacenterRegion object

type DatacentersAPI added in v0.3.3

type DatacentersAPI interface {
	List(context.Context, *ListOptions) ([]Datacenter, error)
	Get(context.Context, string) (*Datacenter, error)
}

DatacentersAPI is an interface for datacenters.

type DatacentersService added in v0.3.3

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

DatacentersService implements DatacentersAPI interface.

func (*DatacentersService) Get added in v0.4.0

func (ds *DatacentersService) Get(ctx context.Context, datacenterID string) (*Datacenter, error)

Get datacenter info by ID

func (*DatacentersService) List added in v0.3.3

func (ds *DatacentersService) List(ctx context.Context, options *ListOptions) ([]Datacenter, error)

List returns all available datacenters

type EqFilter

type EqFilter struct {
	Value string
	Keys  []string
}

EqFilter represents Ransack "*_eq" filter .

func (*EqFilter) Encode

func (f *EqFilter) Encode() []string

Encode returns Ransack "*_eq" filter expression

type FilterInterface

type FilterInterface interface {
	Encode() []string
}

FilterInterface is an interface for Filter.

type IPAddress

type IPAddress struct {
	Address                      string   `json:"address,omitempty"`
	Type                         string   `json:"address_type,omitempty"`
	CreatedAt                    string   `json:"created_at,omitempty"`
	DatacenterFullName           string   `json:"datacenter_full_name,omitempty"`
	ID                           string   `json:"id,omitempty"`
	ReverseDNS                   string   `json:"reverse_dns,omitempty"`
	UpdatedAt                    string   `json:"updated_at,omitempty"`
	InstanceIDs                  []string `json:"instance_ids,omitempty"`
	DeleteProtection             bool     `json:"delete_protection,omitempty"`
	NetworkUsedForPrivateCluster bool     `json:"network_used_for_private_cluster,omitempty"`
}

IPAddress object

type IPAddressAssignment

type IPAddressAssignment struct {
	ID          string `json:"id,omitempty"`
	InstanceID  string `json:"instance_id,omitempty"`
	IPAddressID string `json:"ip_address_id,omitempty"`
	State       string `json:"state,omitempty"`
	CreatedAt   string `json:"created_at,omitempty"`
	UpdatedAt   string `json:"updated_at,omitempty"`
}

IPAddressAssignment object

type IPAddressAssignmentCreateRequest

type IPAddressAssignmentCreateRequest struct {
	IPAddressID string `json:"ip_address_id"`
	InstanceID  string `json:"instance_id"`
}

IPAddressAssignmentCreateRequest represents a request to assign an ip address to isntance.

type IPAddressAssignmentsAPI

IPAddressAssignmentsAPI is an interface for ip address assignments.

type IPAddressAssignmentsService

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

IPAddressAssignmentsService implements IPAddressAssignmentsAPI interface.

func (*IPAddressAssignmentsService) Create

Create ip address assignment

func (*IPAddressAssignmentsService) Delete

func (ips *IPAddressAssignmentsService) Delete(ctx context.Context, isntanceIPAssignmentID string) error

Delete assignment

func (*IPAddressAssignmentsService) Get added in v0.3.3

func (ips *IPAddressAssignmentsService) Get(ctx context.Context, IPAddressAssignmentID string) (*IPAddressAssignment, error)

Get an ip address assignment

func (*IPAddressAssignmentsService) List added in v0.3.3

List returns all available ip address assignments

type IPAddressCreateRequest

type IPAddressCreateRequest struct {
	Type             string   `json:"address_type"`
	DatacenterID     string   `json:"datacenter_id,omitempty"`
	DatacenterSlug   string   `json:"datacenter_slug,omitempty"`
	ReverseDNS       string   `json:"reverse_dns,omitempty"`
	InstanceIDs      []string `json:"instance_ids,omitempty"`
	DeleteProtection bool     `json:"delete_protection,omitempty"`
}

IPAddressCreateRequest represents a request to create an ip address.

type IPAddressUpdateRequest

type IPAddressUpdateRequest struct {
	ReverseDNS       string `json:"reverse_dns,omitempty"`
	DeleteProtection bool   `json:"delete_protection,omitempty"`
}

IPAddressUpdateRequest represents a request to update an ip address resource.

type IPAddressesAPI

IPAddressesAPI is an interface for ip addresses.

type IPAddressesService

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

IPAddressesService implements IPAddressesAPI interface.

func (*IPAddressesService) Create

func (ips *IPAddressesService) Create(ctx context.Context, createRequest *IPAddressCreateRequest) (*IPAddress, error)

Create ip address

func (*IPAddressesService) Delete

func (ips *IPAddressesService) Delete(ctx context.Context, ipAddressID string) error

Delete ip address

func (*IPAddressesService) Get

func (ips *IPAddressesService) Get(ctx context.Context, ipAddressID string) (*IPAddress, error)

Get ip address

func (*IPAddressesService) List

func (ips *IPAddressesService) List(ctx context.Context, options *ListOptions) ([]IPAddress, error)

List returns all available ip addresses

func (*IPAddressesService) Update

func (ips *IPAddressesService) Update(ctx context.Context, ipAddressID string, request *IPAddressUpdateRequest) (*IPAddress, error)

Update ip address resource

type Image added in v0.3.3

type Image struct {
	ID           string `json:"id,omitempty"`
	CreatedAt    string `json:"created_at,omitempty"`
	UpdatedAt    string `json:"updated_at,omitempty"`
	Name         string `json:"name,omitempty"`
	Distribution string `json:"distribution,omitempty"`
	Version      string `json:"version,omitempty"`
	Architecture string `json:"architecture,omitempty"`
	Slug         string `json:"slug,omitempty"`
	Public       bool   `json:"public,omitempty"`
}

Image object

type ImagesAPI added in v0.3.3

type ImagesAPI interface {
	List(context.Context, *ListOptions) ([]Image, *Meta, error)
}

ImagesAPI is an interface for images.

type ImagesService added in v0.3.3

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

ImagesService implements ImagesAPI interface.

func (*ImagesService) List added in v0.3.3

func (is *ImagesService) List(ctx context.Context, options *ListOptions) ([]Image, *Meta, error)

List returns all available images

type InFilter

type InFilter struct {
	Keys   []string
	Values []string
}

InFilter represents Ransack "*_in" filter .

func (*InFilter) Encode

func (f *InFilter) Encode() []string

Encode returns Ransack "*_in" filter expression

type Instance

type Instance struct {
	Region                     *InstanceRegion          `json:"region,omitempty"`
	Datacenter                 *Datacenter              `json:"datacenter,omitempty"`
	Networks                   *InstanceNetworks        `json:"networks,omitempty"`
	CurrentAction              *InstanceAction          `json:"current_action,omitempty"`
	LastAction                 *InstanceAction          `json:"last_action,omitempty"`
	Image                      *InstanceImage           `json:"image,omitempty"`
	ID                         string                   `json:"id,omitempty"`
	CreatedAt                  string                   `json:"created_at,omitempty"`
	UpdatedAt                  string                   `json:"updated_at,omitempty"`
	Number                     string                   `json:"number,omitempty"`
	Name                       string                   `json:"name,omitempty"`
	State                      string                   `json:"state,omitempty"`
	StateDescription           string                   `json:"state_description,omitempty"`
	ProductID                  string                   `json:"product_id,omitempty"`
	PrimaryInstanceIPAddressID string                   `json:"primary_instance_ip_address_id,omitempty"`
	IPScheme                   string                   `json:"ip_scheme,omitempty"`
	Reason                     string                   `json:"reason,omitempty"`
	SnapshotPeriod             string                   `json:"snapshot_period,omitempty"`
	Tags                       []string                 `json:"tags,omitempty"`
	Features                   []string                 `json:"features,omitempty"`
	SSHKeys                    []InstanceSSHKey         `json:"ssh_keys,omitempty"`
	PrivateNetworks            []InstancePrivateNetwork `json:"instance_private_networks,omitempty"`
	IPAddresses                []InstanceIPAddress      `json:"instance_ip_addresses,omitempty"`
	Volumes                    []Volume                 `json:"volumes,omitempty"`
	Locked                     bool                     `json:"locked,omitempty"`
	UseSSHPassword             bool                     `json:"use_ssh_password,omitempty"`
	SnapshotBySchedule         bool                     `json:"snapshot_by_schedule,omitempty"`
	Disk                       int                      `json:"disk,omitempty"`
	Vcpu                       int                      `json:"vcpu,omitempty"`
	RAM                        int                      `json:"ram,omitempty"`
	Traffic                    int                      `json:"traffic,omitempty"`
	MaxVolumesNumber           int                      `json:"max_volumes_number,omitempty"`
	PlanID                     int                      `json:"plan_id,omitempty"`
}

Instance object

func (*Instance) PrimaryIPAddr

func (i *Instance) PrimaryIPAddr() (*InstanceIPAddress, error)

PrimaryIPAddr returns primary IP object of the instance

type InstanceAction

type InstanceAction struct {
	*Action
	ResultParams *struct {
		SnapshotID string `json:"snapshot_id,omitempty"`
	} `json:"result_params,omitempty"`
}

InstanceAction object

type InstanceActionRequest

type InstanceActionRequest struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

InstanceActionRequest represents an action request.

type InstanceBackups added in v0.3.3

type InstanceBackups struct {
	InstanceID                 string   `json:"instance_id,omitempty"`
	InstanceName               string   `json:"instance_name,omitempty"`
	Backups                    []Backup `json:"backups,omitempty"`
	InstanceRemoved            bool     `json:"instance_removed,omitempty"`
	InstanceSnapshotBySchedule bool     `json:"instance_snapshot_by_schedule,omitempty"`
}

InstanceBackups object

type InstanceCreateRequest

type InstanceCreateRequest struct {
	Name           string `json:"name"`
	DatacenterID   string `json:"datacenter_id,omitempty"`
	DatacenterSlug string `json:"datacenter_slug,omitempty"`
	ImageID        string `json:"image_id,omitempty"`
	ImageSlug      string `json:"image_slug,omitempty"`
	// Deprecated: Please use PlanID instead.
	ProductID string `json:"product_id,omitempty"`
	// Deprecated: Please use PlanSlug instead.
	ProductSlug           string   `json:"product_slug,omitempty"`
	PlanSlug              string   `json:"plan_slug,omitempty"`
	SnapshotPeriod        string   `json:"snapshot_period"`
	ClusterID             string   `json:"clusterID,omitempty"`
	NodeID                string   `json:"nodeID,omitempty"`
	IPNetworkID           string   `json:"networkID,omitempty"`
	Tags                  []string `json:"tags"`
	SSHKeyIDs             []string `json:"ssh_key_ids"`
	UseSSHPassword        bool     `json:"use_ssh_password"`
	CreatePublicIPAddress bool     `json:"create_public_ip_address"`
	SnapshotBySchedule    bool     `json:"snapshot_by_schedule"`
	PrivateCloud          bool     `json:"private_cloud,omitempty"`
	PlanID                int      `json:"plan_id,omitempty"`
	Vcpu                  int      `json:"vcpu,omitempty"`
	Ram                   int      `json:"ram,omitempty"`
	Disk                  int      `json:"disk,omitempty"`
}

InstanceCreateRequest represents a request to create a instance.

type InstanceDestroyRequest

type InstanceDestroyRequest struct {
	BackupsStrategy string `json:"backups_strategy"`
}

InstanceDestroyRequest represents a request to destroy the instance.

type InstanceIPAddress

type InstanceIPAddress struct {
	ID          string `json:"id,omitempty"`
	InstanceID  string `json:"instance_id,omitempty"`
	CreatedAt   string `json:"created_at,omitempty"`
	UpdatedAt   string `json:"updated_at,omitempty"`
	IPAddressID string `json:"ip_address_id,omitempty"`
	Address     string `json:"address,omitempty"`
}

InstanceIPAddress object

type InstanceImage

type InstanceImage struct {
	*Image
	Type string `json:"type,omitempty"`
}

InstanceImage object

type InstanceNetworks

type InstanceNetworks struct {
	V4 []InstanceV4Network `json:"v4,omitempty"`
}

InstanceNetworks object

type InstancePlan added in v0.8.1

type InstancePlan struct {
	CustomAttributes *InstancePlanAttributes `json:"custom_attributes,omitempty"`
	Plan
}

type InstancePlanAttributes added in v0.8.1

type InstancePlanAttributes struct {
	RAM              string `json:"ram,omitempty"`
	Disk             string `json:"disk,omitempty"`
	Slug             string `json:"slug,omitempty"`
	Vcpu             string `json:"vcpu,omitempty"`
	Traffic          string `json:"traffic,omitempty"`
	WebsaProductId   string `json:"websaProductId,omitempty"`
	Hot              bool   `json:"hot,omitempty"`
	AvailableOnTrial bool   `json:"available_on_trial,omitempty"`
}

type InstancePlansAPI added in v0.8.0

type InstancePlansAPI interface {
	List(context.Context) ([]InstancePlan, error)
}

InstancePlansAPI is an interface for instance plans.

type InstancePlansService added in v0.8.0

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

InstancePlansService implements InstancePlansAPI interface.

func (*InstancePlansService) List added in v0.8.0

List returns all available instance plans

type InstancePrivateNetwork

type InstancePrivateNetwork struct {
	PrivateNetwork *PrivateNetwork `json:"private_network,omitempty"`
	InstancePrivateNetworkInfo
}

InstancePrivateNetwork object

type InstancePrivateNetworkAttributes added in v0.2.0

type InstancePrivateNetworkAttributes struct {
	InstanceID string `json:"instance_id,omitempty"`
	IP         string `json:"ip,omitempty"`
}

InstancePrivateNetworkAttributes object

type InstancePrivateNetworkCreateRequest added in v0.2.0

type InstancePrivateNetworkCreateRequest struct {
	PrivateNetworkID string `json:"private_network_id"`
	InstanceID       string `json:"instance_id"`
	IP               string `json:"ip,omitempty"`
}

InstancePrivateNetworkCreateRequest object

type InstancePrivateNetworkInfo added in v0.2.0

type InstancePrivateNetworkInfo struct {
	Instance *struct {
		ID      string `json:"id,omitempty"`
		ImageID string `json:"image_id"`
		Name    string `json:"name"`
		Number  string `json:"number,omitempty"`
	} `json:"instance,omitempty"`
	ID          string `json:"id,omitempty"`
	IP          string `json:"ip"`
	MACAddress  string `json:"mac_address"`
	State       string `json:"state,omitempty"`
	ConnectedAt string `json:"connected_at,omitempty"`
}

InstancePrivateNetworkInfo object

type InstancePrivateNetworkUpdateRequest added in v0.2.0

type InstancePrivateNetworkUpdateRequest struct {
	IP string `json:"ip"`
}

InstancePrivateNetworkUpdateRequest object

type InstancePrivateNetworksAPI added in v0.2.0

InstancePrivateNetworksAPI is an interface for instance connection to private network.

type InstancePrivateNetworksService added in v0.2.0

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

InstancePrivateNetworksService implements InstancePrivateNetworkConnectionsAPI interface.

func (*InstancePrivateNetworksService) Create added in v0.2.0

Create instance connection to the private network

func (*InstancePrivateNetworksService) Delete added in v0.2.0

func (ipns *InstancePrivateNetworksService) Delete(ctx context.Context, instancePrivateNetworkID string) (*InstancePrivateNetwork, error)

Delete disconnects instance from the private network

func (*InstancePrivateNetworksService) Get added in v0.3.3

func (ipns *InstancePrivateNetworksService) Get(ctx context.Context, instancePrivateNetworkID string) (*InstancePrivateNetwork, error)

Get instance private network info

func (*InstancePrivateNetworksService) Update added in v0.2.0

func (ipns *InstancePrivateNetworksService) Update(
	ctx context.Context,
	instancePrivateNetworkID string,
	updateRequest *InstancePrivateNetworkUpdateRequest) (*InstancePrivateNetwork, error)

Update instance connection to private network

type InstanceProduct added in v0.4.0

type InstanceProduct struct {
	Category *struct {
		ID   string `json:"id,omitempty"`
		Name string `json:"name,omitempty"`
	} `json:"category,omitempty"`
	ID               string                  `json:"id,omitempty"`
	CreatedAt        string                  `json:"created_at,omitempty"`
	UpdatedAt        string                  `json:"updated_at,omitempty"`
	Name             string                  `json:"name,omitempty"`
	Type             string                  `json:"type,omitempty"`
	Price            string                  `json:"price,omitempty"`
	Currency         string                  `json:"currency,omitempty"`
	Vcpu             string                  `json:"vcpu,omitempty"`
	RAM              string                  `json:"ram,omitempty"`
	Disk             string                  `json:"disk,omitempty"`
	Traffic          string                  `json:"traffic,omitempty"`
	Slug             string                  `json:"slug,omitempty"`
	Tariff           []InstanceProductTariff `json:"tariff,omitempty"`
	Hot              bool                    `json:"hot,omitempty"`
	AvailableOnTrial bool                    `json:"available_on_trial,omitempty"`
}

InstanceProduct object

type InstanceProductTariff added in v0.4.0

type InstanceProductTariff struct {
	Component              string  `json:"component,omitempty"`
	Measure                string  `json:"measure,omitempty"`
	TariffPrice            float64 `json:"tariff_price,omitempty"`
	AdditionalServicePrice int     `json:"additional_service_price,omitempty"`
	IncludedValue          int     `json:"included_value,omitempty"`
}

InstanceProductTariff object

type InstanceProductsAPI added in v0.4.0

type InstanceProductsAPI interface {
	List(context.Context, *ListOptions) ([]InstanceProduct, *Meta, error)
}

InstanceProductsAPI is an interface for instance products.

type InstanceProductsService added in v0.4.0

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

InstanceProductsService implements InstanceProductsAPI interface.

func (*InstanceProductsService) List added in v0.4.0

List returns all available volume products

type InstanceRegion

type InstanceRegion struct {
	ID           string   `json:"id,omitempty"`
	Name         string   `json:"name,omitempty"`
	Slug         string   `json:"slug,omitempty"`
	CountryCode  string   `json:"country_code,omitempty"`
	Country      string   `json:"country,omitempty"`
	City         string   `json:"city,omitempty"`
	ParentID     string   `json:"parent_id,omitempty"`
	Services     []string `json:"services,omitempty"`
	Group        bool     `json:"group,omitempty"`
	RegionsCount int      `json:"regions_count,omitempty"`
}

InstanceRegion object

type InstanceRenameRequest

type InstanceRenameRequest struct {
	Name string `json:"name"`
}

InstanceRenameRequest represents a request to rename the instance.

type InstanceSSHKey

type InstanceSSHKey struct {
	CreatedAt   string `json:"created_at,omitempty"`
	Name        string `json:"name,omitempty"`
	ID          string `json:"id,omitempty"`
	Fingerprint string `json:"fingerprint,omitempty"`
	PublicKey   string `json:"public_key,omitempty"`
}

InstanceSSHKey object

type InstanceUpgradeRequest

type InstanceUpgradeRequest struct {
	// Deprecated: Please use PlanID instead.
	ProductID string
	// Deprecated: Please use PlanSlug instead.
	ProductSlug string
	PlanSlug    string
	PlanID      int
}

InstanceUpgradeRequest represents a request to upgrade the instance.

type InstanceV4Network

type InstanceV4Network struct {
	Type      string `json:"type,omitempty"`
	IPAddress string `json:"ip_address,omitempty"`
	Netmask   string `json:"netmask,omitempty"`
	Gateway   string `json:"gateway,omitempty"`
}

InstanceV4Network object

type InstancesAPI

InstancesAPI is an interface for instances.

type InstancesService

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

InstancesService implements InstancesApi interface.

func (*InstancesService) ActionInfo

func (is *InstancesService) ActionInfo(ctx context.Context, instanceID, actionID string) (*InstanceAction, error)

ActionInfo returns instance's action info by action ID

func (*InstancesService) Actions

func (is *InstancesService) Actions(ctx context.Context, instanceID string) ([]InstanceAction, error)

Actions returns instance's actions list

func (*InstancesService) AttachVolume added in v0.3.2

func (is *InstancesService) AttachVolume(ctx context.Context, instanceID, volumeID string) (*Action, error)

AttachVolume connects volume to the instance

func (*InstancesService) AvailableVolumes added in v0.3.2

func (is *InstancesService) AvailableVolumes(ctx context.Context, instanceID string, options *ListOptions) ([]Volume, *Meta, error)

AvailableVolumes return all attached volumes to the instance.

func (*InstancesService) Create

func (is *InstancesService) Create(ctx context.Context, createRequest *InstanceCreateRequest) (*Instance, error)

Create new instance.

func (*InstancesService) CreateBackup added in v0.3.3

func (is *InstancesService) CreateBackup(ctx context.Context, instanceID, note string) (*InstanceAction, error)

CreateBackup creates instance's backups

func (*InstancesService) Destroy

func (is *InstancesService) Destroy(ctx context.Context, instanceID string) error

Destroy isntance.

func (*InstancesService) DetachVolume added in v0.3.2

func (is *InstancesService) DetachVolume(ctx context.Context, instanceID, volumeID string) (*Action, error)

DetachVolume disconnects volume to the instance

func (*InstancesService) Get

func (is *InstancesService) Get(ctx context.Context, instanceID string) (*Instance, error)

Get returns all instance by instanceID

func (*InstancesService) List

func (is *InstancesService) List(ctx context.Context, options *ListOptions) ([]Instance, *Meta, error)

List returns all available instances

func (*InstancesService) PowerOff

func (is *InstancesService) PowerOff(ctx context.Context, instanceID string) error

PowerOff instance.

func (*InstancesService) Rename

func (is *InstancesService) Rename(ctx context.Context, instanceID, name string) (*Instance, error)

Rename instance.

func (*InstancesService) SetPrimaryIP

func (is *InstancesService) SetPrimaryIP(ctx context.Context, instanceID, ipAssignmentID string) (*Action, error)

SetPrimaryIP makes ip primary for instance

func (*InstancesService) Shutdown

func (is *InstancesService) Shutdown(ctx context.Context, instanceID string) error

Shutdown instance.

func (*InstancesService) Upgrade

func (is *InstancesService) Upgrade(ctx context.Context, instanceID string, request *InstanceUpgradeRequest) error

Upgrade instance.

type KubernetesCluster added in v0.10.3

type KubernetesCluster struct {
	ID                 string                 `json:"id,omitempty"`
	Name               string                 `json:"name,omitempty"`
	TokenID            string                 `json:"token_id,omitempty"`
	DatacenterID       string                 `json:"datacenter_id,omitempty"`
	DatacenterSlug     string                 `json:"datacenter_slug,omitempty"`
	State              string                 `json:"state,omitempty"`
	Number             string                 `json:"number"`
	CreatedAt          string                 `json:"created_at"`
	AccountID          string                 `json:"account_id"`
	PrivateNetworkID   string                 `json:"private_network_id"`
	PrivateNetworkName string                 `json:"private_network_name,omitempty"`
	K8sVersion         string                 `json:"k8s_version"`
	WorkerPools        []KubernetesWorkerPool `json:"worker_pools,omitempty"`
}

KubernetesCluster object

type KubernetesClusterConfig added in v0.10.3

type KubernetesClusterConfig struct {
	Config string `json:"config"`
}

KubernetesClusterConfig object

type KubernetesClusterCreateRequest added in v0.10.3

type KubernetesClusterCreateRequest struct {
	Name         string                              `json:"name"`
	DatacenterID string                              `json:"datacenter_id,omitempty"`
	K8sVersion   string                              `json:"k8s_version"`
	WorkerPools  []CreateKubernetesWorkerPoolRequest `json:"worker_pools"`
}

KubernetesClusterCreateRequest represents a request to create a cluster.

type KubernetesClusterRoot added in v0.10.3

type KubernetesClusterRoot struct {
	KubernetesCluster *KubernetesCluster `json:"cluster,omitempty"`
}

type KubernetesClusterUpdateRequest added in v0.10.3

type KubernetesClusterUpdateRequest struct {
	Name string `json:"name,omitempty"`
}

KubernetesClusterUpdateRequest represents a request to update a cluster

type KubernetesClustersRoot added in v0.10.3

type KubernetesClustersRoot struct {
	KubernetesClusters []KubernetesCluster `json:"clusters,omitempty"`
}

type KubernetesClustersService added in v0.10.3

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

KubernetesClustersService implements ClustersAPI interface.

func (*KubernetesClustersService) Create added in v0.10.3

Create kubernetes cluster

func (*KubernetesClustersService) CreateWorkerPool added in v0.10.7

CreateWorkerPool creates worker pool

func (*KubernetesClustersService) Delete added in v0.10.3

func (kcs *KubernetesClustersService) Delete(ctx context.Context, clusterId string) error

Delete kubernetes cluster. Returns error

func (*KubernetesClustersService) DeleteWorker added in v0.11.5

func (kcs *KubernetesClustersService) DeleteWorker(ctx context.Context, clusterID, workerPoolID, workerID string, request *ClusterDeleteWorkerRequest) error

DeleteWorker deletes worker pool

func (*KubernetesClustersService) DeleteWorkerPool added in v0.10.7

func (kcs *KubernetesClustersService) DeleteWorkerPool(ctx context.Context, clusterId string, workerPoolId string, replace bool) error

DeleteWorkerPool deletes worker pool

func (*KubernetesClustersService) Get added in v0.10.3

Get kubernetes cluster

func (KubernetesClustersService) GetConfig added in v0.10.3

func (kcs KubernetesClustersService) GetConfig(ctx context.Context, clusterId string) (string, error)

GetConfig returns kubernetes cluster config

func (*KubernetesClustersService) GetKubernetesClustersVersions added in v0.10.4

func (kcs *KubernetesClustersService) GetKubernetesClustersVersions(ctx context.Context) ([]string, error)

GetKubernetesClustersVersions returns kubernetes version

func (*KubernetesClustersService) GetWorkerPool added in v0.10.7

func (kcs *KubernetesClustersService) GetWorkerPool(ctx context.Context, clusterId, workerPoolId string) (*KubernetesWorkerPool, error)

GetWorkerPool returns worker pool

func (*KubernetesClustersService) List added in v0.10.3

List returns list of kubernetes clusters

func (*KubernetesClustersService) ListWorkerPools added in v0.10.7

func (kcs *KubernetesClustersService) ListWorkerPools(ctx context.Context, options *ListOptions, clusterId string) ([]KubernetesWorkerPool, error)

ListWorkerPools returns list of worker pools

func (*KubernetesClustersService) Update added in v0.10.3

Update kubernetes cluster. Returns error

func (*KubernetesClustersService) UpdateWorkerPool added in v0.10.7

func (kcs *KubernetesClustersService) UpdateWorkerPool(ctx context.Context, clusterId, workerPoolId string, request *UpdateKubernetesWorkerPoolRequest) error

UpdateWorkerPool updates worker pool

type KubernetesWorker added in v0.11.5

type KubernetesWorker struct {
	Labels           map[string]string `json:"labels,omitempty"`
	ID               string            `json:"id,omitempty"`
	Name             string            `json:"name,omitempty"`
	State            string            `json:"state,omitempty"`
	Type             string            `json:"type,omitempty"`
	CreatedAt        string            `json:"created_at,omitempty"`
	ExternalIpID     string            `json:"external_ip_id,omitempty"`
	PrivateNetworkID string            `json:"private_network_id,omitempty"`
	CloudServerID    string            `json:"cloud_server_id,omitempty"`
}

KubernetesWorker object

type KubernetesWorkerPool added in v0.10.7

type KubernetesWorkerPool struct {
	Labels            Labels             `json:"labels,omitempty"`
	ID                string             `json:"id,omitempty"`
	Name              string             `json:"name,omitempty"`
	Type              string             `json:"type"`
	CreatedAt         string             `json:"created_at,omitempty"`
	Workers           []KubernetesWorker `json:"workers,omitempty"`
	PrivateProperties PrivateProperties  `json:"private_properties,omitempty"`
	PublicProperties  PublicProperties   `json:"public_properties,omitempty"`
	Count             int                `json:"count,omitempty"`
	AutoScale         bool               `json:"autoscale,omitempty"`
	MinCount          int                `json:"min_count,omitempty"`
	MaxCount          int                `json:"max_count,omitempty"`
}

KubernetesWorkerPool object

type KubernetesWorkerPoolRoot added in v0.10.7

type KubernetesWorkerPoolRoot struct {
	KubernetesWorkerPool *KubernetesWorkerPool `json:"worker_pool,omitempty"`
}

type KubernetesWorkerPoolsRoot added in v0.10.7

type KubernetesWorkerPoolsRoot struct {
	KubernetesWorkerPools []KubernetesWorkerPool `json:"worker_pools,omitempty"`
}

type LBBackendNode added in v0.7.0

type LBBackendNode struct {
	ID            string `json:"id,omitempty"`
	State         string `json:"state,omitempty"`
	CloudServerID string `json:"cloud_server_id,omitempty"`
}

LBBackendNode object

type LBBackendNodeCreateRequest added in v0.7.0

type LBBackendNodeCreateRequest struct {
	CloudServerID string `json:"cloud_server_id"`
}

LBBackendNodeCreateRequest object

type LBForwardingRule added in v0.7.0

type LBForwardingRule struct {
	ID                    string `json:"id,omitempty"`
	State                 string `json:"state,omitempty"`
	RequestProtocol       string `json:"request_protocol,omitempty"`
	CommunicationProtocol string `json:"communication_protocol,omitempty"`
	RequestPort           int    `json:"request_port,omitempty"`
	CommunicationPort     int    `json:"communication_port,omitempty"`
}

LBForwardingRule object

type LBForwardingRuleCreateRequest added in v0.7.0

type LBForwardingRuleCreateRequest struct {
	RequestProtocol       string `json:"request_protocol"`
	CommunicationProtocol string `json:"communication_protocol"`
	RequestPort           int    `json:"request_port"`
	CommunicationPort     int    `json:"communication_port"`
}

LBForwardingRuleCreateRequest object

type LBHealthCheck added in v0.7.0

type LBHealthCheck struct {
	ID                 string `json:"id,omitempty"`
	State              string `json:"state,omitempty"`
	Type               string `json:"type,omitempty"`
	URL                string `json:"url,omitempty"`
	Interval           int    `json:"interval,omitempty"`
	Timeout            int    `json:"timeout,omitempty"`
	UnhealthyThreshold int    `json:"unhealthy_threshold,omitempty"`
	HealthyThreshold   int    `json:"Healthy_threshold,omitempty"`
	Port               int    `json:"port,omitempty"`
}

LBHealthCheck object

type LBHealthCheckCreateRequest added in v0.7.0

type LBHealthCheckCreateRequest struct {
	Type               string `json:"type"`
	URL                string `json:"url,omitempty"`
	Interval           int    `json:"interval,omitempty"`
	Timeout            int    `json:"timeout,omitempty"`
	UnhealthyThreshold int    `json:"unhealthy_threshold,omitempty"`
	HealthyThreshold   int    `json:"Healthy_threshold,omitempty"`
	Port               int    `json:"port"`
}

LBHealthCheckCreateRequest object

type LBHealthCheckUpdateRequest added in v0.7.0

type LBHealthCheckUpdateRequest struct {
	Type               string `json:"type,omitempty"`
	URL                string `json:"url,omitempty"`
	Interval           int    `json:"interval,omitempty"`
	Timeout            int    `json:"timeout,omitempty"`
	UnhealthyThreshold int    `json:"unhealthy_threshold,omitempty"`
	HealthyThreshold   int    `json:"Healthy_threshold,omitempty"`
	Port               int    `json:"port,omitempty"`
}

LBHealthCheckUpdateRequest object

type LBIPAddress added in v0.7.0

type LBIPAddress struct {
	ID      string `json:"id,omitempty"`
	Type    string `json:"type,omitempty"`
	Address string `json:"address,omitempty"`
	State   string `json:"state,omitempty"`
}

LBIPAddress object

type LBPrivateNetwork added in v0.7.0

type LBPrivateNetwork struct {
	ID        string                    `json:"id,omitempty"`
	State     string                    `json:"state,omitempty"`
	Addresses []LBPrivateNetworkAddress `json:"addresses,omitempty"`
}

LBPrivateNetwork object

type LBPrivateNetworkAddress added in v0.7.0

type LBPrivateNetworkAddress struct {
	ID       string `json:"id,omitempty"`
	ServerID string `json:"server_id,omitempty"`
	Address  string `json:"address,omitempty"`
}

LBPrivateNetworkAddress object

type Labels added in v0.10.5

type Labels map[string]string

Labels object

type ListMetaOptions

type ListMetaOptions struct {
	Page int `url:"page,omitempty"`
}

ListMetaOptions represents meta options.

type ListOptions

type ListOptions struct {
	Meta     *ListMetaOptions
	Filters  []FilterInterface
	Sortings []*Sorting
}

ListOptions represents options to get list of resources.

type LoadBalancer added in v0.7.0

type LoadBalancer struct {
	Meta               map[string]interface{} `json:"meta,omitempty"`
	ID                 string                 `json:"id,omitempty"`
	Name               string                 `json:"name,omitempty"`
	DatacenterID       string                 `json:"datacenter_id,omitempty"`
	State              string                 `json:"state,omitempty"`
	BalancingAlgorithm string                 `json:"balancing_algorithm,omitempty"`
	ProxyProtocol      string                 `json:"proxy_protocol,omitempty"`
	IPAddresses        []LBIPAddress          `json:"ip_addresses,omitempty"`
	PrivateNetworks    []LBPrivateNetwork     `json:"private_networks,omitempty"`
	ForwardingRules    []LBForwardingRule     `json:"forwarding_rules,omitempty"`
	BackendNodes       []LBBackendNode        `json:"backend_nodes,omitempty"`
	HealthCheck        LBHealthCheck          `json:"health_check,omitempty"`
}

LoadBalancer object

type LoadBalancerCreateRequest added in v0.7.0

type LoadBalancerCreateRequest struct {
	HealthCheck           *LBHealthCheckCreateRequest     `json:"health_check,omitempty"`
	Meta                  map[string]interface{}          `json:"meta,omitempty"`
	Name                  string                          `json:"name"`
	DatacenterID          string                          `json:"datacenter_id"`
	BalancingAlgorithm    string                          `json:"balancing_algorithm,omitempty"`
	ProxyProtocol         string                          `json:"proxy_protocol,omitempty"`
	IPAddressIDs          []string                        `json:"ip_address_ids,omitempty"`
	PrivateNetworkIDs     []string                        `json:"private_network_ids,omitempty"`
	ForwardingRules       []LBForwardingRuleCreateRequest `json:"forwarding_rules,omitempty"`
	BackendNodes          []LBBackendNodeCreateRequest    `json:"backend_nodes,omitempty"`
	CreatePublicIPAddress bool                            `json:"create_public_ip_address"`
}

LoadBalancerCreateRequest object

type LoadBalancerUpdateRequest added in v0.7.0

type LoadBalancerUpdateRequest struct {
	Name               string `json:"name,omitempty"`
	BalancingAlgorithm string `json:"balancing_algorithm,omitempty"`
	ProxyProtocol      string `json:"proxy_protocol,omitempty"`
}

LoadBalancerUpdateRequest represents a request to update a load balancer.

type LoadBalancersAPI added in v0.7.0

type LoadBalancersAPI interface {
	List(context.Context, map[string]string) ([]LoadBalancer, error)
	Get(context.Context, string) (*LoadBalancer, error)
	Create(context.Context, *LoadBalancerCreateRequest) (*LoadBalancer, error)
	Update(context.Context, string, *LoadBalancerUpdateRequest) error
	Delete(context.Context, string) error

	ListForwardingRules(context.Context, string) ([]LBForwardingRule, error)
	GetForwardingRule(context.Context, string, string) (*LBForwardingRule, error)
	CreateForwardingRule(context.Context, string, *LBForwardingRuleCreateRequest) (*LBForwardingRule, error)
	DeleteForwardingRule(context.Context, string, string) error

	ListPrivateNetworks(context.Context, string) ([]LBPrivateNetwork, error)
	GetPrivateNetwork(context.Context, string, string) (*LBPrivateNetwork, error)
	ConnectPrivateNetworks(context.Context, string, []string) ([]LBPrivateNetwork, error)
	DisconnectPrivateNetwork(context.Context, string, string) error

	ListBackendNodes(context.Context, string) ([]LBBackendNode, error)
	GetBackendNode(context.Context, string, string) (*LBBackendNode, error)
	AddBackendNodes(context.Context, string, []string) ([]LBBackendNode, error)
	DeleteBackendNode(context.Context, string, string) error

	ListHealthChecks(context.Context, string) ([]LBHealthCheck, error)
	GetHealthCheck(context.Context, string, string) (*LBHealthCheck, error)
	CreateHealthCheck(context.Context, string, *LBHealthCheckCreateRequest) (*LBHealthCheck, error)
	UpdateHealthCheck(context.Context, string, string, *LBHealthCheckUpdateRequest) error
	DeleteHealthCheck(context.Context, string, string) error

	ListIPAddresses(context.Context, string) ([]LBIPAddress, error)
	GetIPAddress(context.Context, string, string) (*LBIPAddress, error)
	AssignIPAddresses(context.Context, string, []string) ([]LBIPAddress, error)
	ReleaseIPAddress(context.Context, string, string) error
}

LoadBalancersAPI is an interface for load balancers.

type LoadBalancersService added in v0.7.0

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

LoadBalancersService implements LoadBalancersAPI interface.

func (*LoadBalancersService) AddBackendNodes added in v0.7.0

func (lb *LoadBalancersService) AddBackendNodes(ctx context.Context, lbID string, bnIDs []string) ([]LBBackendNode, error)

AddBackendNodes connects backend nodes to the LB

func (*LoadBalancersService) AssignIPAddresses added in v0.7.0

func (lb *LoadBalancersService) AssignIPAddresses(ctx context.Context, lbID string, ipIDs []string) ([]LBIPAddress, error)

AssignIPAddresses assigns ip addresses to the LB

func (*LoadBalancersService) ConnectPrivateNetworks added in v0.7.0

func (lb *LoadBalancersService) ConnectPrivateNetworks(ctx context.Context, lbID string, pnIDs []string) ([]LBPrivateNetwork, error)

ConnectPrivateNetworks connects LB to a private networks

func (*LoadBalancersService) Create added in v0.7.0

Create a load balancer

func (*LoadBalancersService) CreateForwardingRule added in v0.7.0

func (lb *LoadBalancersService) CreateForwardingRule(ctx context.Context, lbID string, request *LBForwardingRuleCreateRequest) (*LBForwardingRule, error)

CreateForwardingRule creates a forwarding rule

func (*LoadBalancersService) CreateHealthCheck added in v0.7.0

func (lb *LoadBalancersService) CreateHealthCheck(ctx context.Context, lbID string, request *LBHealthCheckCreateRequest) (*LBHealthCheck, error)

CreateHealthCheck creates new health check

func (*LoadBalancersService) Delete added in v0.7.0

func (lb *LoadBalancersService) Delete(ctx context.Context, lbID string) error

Delete load balancer

func (*LoadBalancersService) DeleteBackendNode added in v0.7.0

func (lb *LoadBalancersService) DeleteBackendNode(ctx context.Context, lbID, bnID string) error

DeleteBackendNode removes backend node from the LB

func (*LoadBalancersService) DeleteForwardingRule added in v0.7.0

func (lb *LoadBalancersService) DeleteForwardingRule(ctx context.Context, lbID, frID string) error

DeleteForwardingRule remove forwarding rule

func (*LoadBalancersService) DeleteHealthCheck added in v0.7.0

func (lb *LoadBalancersService) DeleteHealthCheck(ctx context.Context, lbID, hcID string) error

DeleteHealthCheck removes health check from the LB

func (*LoadBalancersService) DisconnectPrivateNetwork added in v0.7.0

func (lb *LoadBalancersService) DisconnectPrivateNetwork(ctx context.Context, lbID, pnID string) error

DisconnectPrivateNetwork removes lb from the private network

func (*LoadBalancersService) Get added in v0.7.0

Get load balancer

func (*LoadBalancersService) GetBackendNode added in v0.7.0

func (lb *LoadBalancersService) GetBackendNode(ctx context.Context, lbID, bnID string) (*LBBackendNode, error)

GetBackendNode returns backend node info

func (*LoadBalancersService) GetForwardingRule added in v0.7.0

func (lb *LoadBalancersService) GetForwardingRule(ctx context.Context, lbID, frID string) (*LBForwardingRule, error)

GetForwardingRule returns forwarding rule info

func (*LoadBalancersService) GetHealthCheck added in v0.7.0

func (lb *LoadBalancersService) GetHealthCheck(ctx context.Context, lbID, hcID string) (*LBHealthCheck, error)

GetHealthCheck returns health check info

func (*LoadBalancersService) GetIPAddress added in v0.7.0

func (lb *LoadBalancersService) GetIPAddress(ctx context.Context, lbID, ipID string) (*LBIPAddress, error)

GetIPAddress returns ip address info

func (*LoadBalancersService) GetPrivateNetwork added in v0.7.0

func (lb *LoadBalancersService) GetPrivateNetwork(ctx context.Context, lbID, pnID string) (*LBPrivateNetwork, error)

GetPrivateNetwork returns private network info

func (*LoadBalancersService) List added in v0.7.0

func (lb *LoadBalancersService) List(ctx context.Context, filters map[string]string) ([]LoadBalancer, error)

List returns all available load balancers

func (*LoadBalancersService) ListBackendNodes added in v0.7.0

func (lb *LoadBalancersService) ListBackendNodes(ctx context.Context, lbID string) ([]LBBackendNode, error)

ListBackendNodes returns all connected backend nodes

func (*LoadBalancersService) ListForwardingRules added in v0.7.0

func (lb *LoadBalancersService) ListForwardingRules(ctx context.Context, lbID string) ([]LBForwardingRule, error)

ListForwardingRules returns all available forwarding rules

func (*LoadBalancersService) ListHealthChecks added in v0.7.0

func (lb *LoadBalancersService) ListHealthChecks(ctx context.Context, lbID string) ([]LBHealthCheck, error)

ListHealthChecks returns all health checks

func (*LoadBalancersService) ListIPAddresses added in v0.7.0

func (lb *LoadBalancersService) ListIPAddresses(ctx context.Context, lbID string) ([]LBIPAddress, error)

ListIPAddresses returns all ip addresses

func (*LoadBalancersService) ListPrivateNetworks added in v0.7.0

func (lb *LoadBalancersService) ListPrivateNetworks(ctx context.Context, lbID string) ([]LBPrivateNetwork, error)

ListPrivateNetworks returns all connected private networks

func (*LoadBalancersService) ReleaseIPAddress added in v0.7.0

func (lb *LoadBalancersService) ReleaseIPAddress(ctx context.Context, lbID, ipID string) error

ReleaseIPAddress removes ip address from the LB

func (*LoadBalancersService) Update added in v0.7.0

func (lb *LoadBalancersService) Update(ctx context.Context, lbID string, updateRequest *LoadBalancerUpdateRequest) error

Update load balancer

func (*LoadBalancersService) UpdateHealthCheck added in v0.7.0

func (lb *LoadBalancersService) UpdateHealthCheck(ctx context.Context, lbID, hcID string, request *LBHealthCheckUpdateRequest) error

UpdateHealthCheck updates the health check

type Meta

type Meta struct {
	Page    int `json:"page,omitempty"`
	PerPage int `json:"per_page,omitempty"`
	Total   int `json:"total,omitempty"`
}

Meta object

func (*Meta) IsLastPage

func (m *Meta) IsLastPage() bool

IsLastPage returns true if the current page is the last

type Plan added in v0.8.0

type Plan struct {
	Prices   map[int]PlanPrice `json:"prices,omitempty"`
	Type     string            `json:"type,omitempty"`
	Currency string            `json:"currency,omitempty"`
	Name     string            `json:"name,omitempty"`
	ID       int               `json:"id"`
}

Plan object

type PlanPrice added in v0.8.0

type PlanPrice struct {
	Type     string `json:"type,omitempty"`
	Unit     string `json:"unit,omitempty"`
	Currency string `json:"currency,omitempty"`
	Quantity string `json:"quantity,omitempty"`
	Price    string `json:"price,omitempty"`
	ID       int    `json:"id,omitempty"`
	PlanID   int    `json:"plan_id,omitempty"`
}

PlanPrice object

type PrivateNetwork added in v0.2.0

type PrivateNetwork struct {
	ID             string `json:"id,omitempty"`
	Number         string `json:"number,omitempty"`
	CIDR           string `json:"cidr,omitempty"`
	Name           string `json:"name,omitempty"`
	State          string `json:"state,omitempty"`
	CreatedAt      string `json:"created_at,omitempty"`
	InstancesCount int    `json:"instances_count,omitempty"`
}

PrivateNetwork object

type PrivateNetworkCreateRequest added in v0.2.0

type PrivateNetworkCreateRequest struct {
	Name                             string                             `json:"name"`
	CIDR                             string                             `json:"cidr"`
	InstancePrivateNetworkAttributes []InstancePrivateNetworkAttributes `json:"instance_private_networks_attributes,omitempty"`
}

PrivateNetworkCreateRequest object

type PrivateNetworkInfo added in v0.2.0

type PrivateNetworkInfo struct {
	PrivateNetwork
	InstancePrivateNetworks []InstancePrivateNetworkInfo `json:"instance_private_networks,omitempty"`
}

PrivateNetworkInfo object

type PrivateNetworkUpdateRequest added in v0.2.0

type PrivateNetworkUpdateRequest struct {
	Name string `json:"name,omitempty"`
	CIDR string `json:"cidr,omitempty"`
}

PrivateNetworkUpdateRequest represents a request to update a private network.

type PrivateNetworksAPI added in v0.2.0

PrivateNetworksAPI is an interface for private networks.

type PrivateNetworksService added in v0.2.0

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

PrivateNetworksService implements PrivateNetworksAPI interface.

func (*PrivateNetworksService) Create added in v0.2.0

Create private network

func (*PrivateNetworksService) Delete added in v0.2.0

func (pns *PrivateNetworksService) Delete(ctx context.Context, privateNetworkID string) error

Delete private network

func (*PrivateNetworksService) Get added in v0.2.0

func (pns *PrivateNetworksService) Get(ctx context.Context, privateNetworkID string) (*PrivateNetworkInfo, error)

Get private network info

func (*PrivateNetworksService) List added in v0.2.0

func (pns *PrivateNetworksService) List(ctx context.Context, options *ListOptions) ([]PrivateNetwork, error)

List returns all available private networks

func (*PrivateNetworksService) Update added in v0.2.0

func (pns *PrivateNetworksService) Update(ctx context.Context, privateNetworkID string, request *PrivateNetworkUpdateRequest) (*PrivateNetworkInfo, error)

Update private network

type PrivateProperties added in v0.10.3

type PrivateProperties struct {
	NetworkID     string `json:"network_id,omitempty"`
	ClusterID     string `json:"cluster_id,omitempty"`
	ClusterNodeID string `json:"cluster_node_id,omitempty"`
	Vcpu          int    `json:"vcpu,omitempty"`
	Ram           int    `json:"ram,omitempty"`
	Disk          int    `json:"disk,omitempty"`
}

PrivateProperties object

type PublicProperties added in v0.10.3

type PublicProperties struct {
	PlanID int `json:"plan_id,omitempty"`
}

PublicProperties object

type SSHKey added in v0.3.2

type SSHKey struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	PublicKey   string `json:"public_key,omitempty"`
	Fingerprint string `json:"fingerprint,omitempty"`
	CreatedAt   string `json:"created_at,omitempty"`
}

SSHKey object

type SSHKeyCreateRequest added in v0.3.2

type SSHKeyCreateRequest struct {
	Name      string `json:"name"`
	PublicKey string `json:"public_key,omitempty"`
}

SSHKeyCreateRequest object

type SSHKeyUpdateRequest added in v0.3.2

type SSHKeyUpdateRequest struct {
	Name      string `json:"name,omitempty"`
	PublicKey string `json:"public_key,omitempty"`
}

SSHKeyUpdateRequest object

type SSHKeysAPI added in v0.3.2

SSHKeysAPI is an interface for ssh keys.

type SSHKeysService added in v0.3.2

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

SSHKeysService implements SSHKeysAPI interface.

func (*SSHKeysService) Create added in v0.3.2

func (sk *SSHKeysService) Create(ctx context.Context, createRequest *SSHKeyCreateRequest) (*SSHKey, error)

Create ssh key

func (*SSHKeysService) Delete added in v0.3.2

func (sk *SSHKeysService) Delete(ctx context.Context, sshKeyID string) error

Delete ssh key

func (*SSHKeysService) Get added in v0.3.2

func (sk *SSHKeysService) Get(ctx context.Context, sshKeyID string) (*SSHKey, error)

Get ssh key info

func (*SSHKeysService) List added in v0.3.2

func (sk *SSHKeysService) List(ctx context.Context, options *ListOptions) ([]SSHKey, *Meta, error)

List returns all available ssh keys

func (*SSHKeysService) Update added in v0.3.2

func (sk *SSHKeysService) Update(ctx context.Context, sshKeyID string, updateRequest *SSHKeyUpdateRequest) (*SSHKey, error)

Update ssh key

type Sorting

type Sorting struct {
	Key   string
	Order string
}

Sorting represents Ransack sorting expression

func (*Sorting) Encode

func (s *Sorting) Encode() []string

Encode returns Ransack sorting expression

type Token added in v0.9.11

type Token struct {
	ID        string   `json:"id,omitempty"`
	Name      string   `json:"name,omitempty"`
	Token     string   `json:"token,omitempty"`
	ExpiresIn string   `json:"expires_in,omitempty"`
	CreatedAt string   `json:"created_at,omitempty"`
	Scopes    []string `json:"scopes,omitempty"`
}

Token object

type TokenCreateRequest added in v0.9.11

type TokenCreateRequest struct {
	Name string `json:"name,omitempty"`
}

TokenCreateRequest object

type TokensAPI added in v0.9.11

type TokensAPI interface {
	List(context.Context, *ListOptions) ([]Token, error)
	Get(context.Context, string) (*Token, error)
	Create(context.Context, *TokenCreateRequest) (*Token, error)
	Delete(context.Context, string) error
}

TokensAPI is an interface for tokens.

type TokensService added in v0.9.11

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

TokensService implements TokensAPI interface.

func (*TokensService) Create added in v0.9.11

func (s *TokensService) Create(ctx context.Context, request *TokenCreateRequest) (*Token, error)

Create creates a new token

func (*TokensService) Delete added in v0.9.11

func (s *TokensService) Delete(ctx context.Context, tokenId string) error

Delete deletes a token by ID

func (*TokensService) Get added in v0.9.11

func (s *TokensService) Get(ctx context.Context, tokenId string) (*Token, error)

Get returns a token by ID

func (*TokensService) List added in v0.9.11

func (s *TokensService) List(ctx context.Context, options *ListOptions) ([]Token, error)

List returns all available tokens

type UpdateKubernetesWorkerPoolRequest added in v0.10.7

type UpdateKubernetesWorkerPoolRequest struct {
	Labels    *Labels `json:"labels,omitempty"`
	Count     int     `json:"count,omitempty"`
	AutoScale bool    `json:"autoscale,omitempty"`
	MinCount  int     `json:"min_count,omitempty"`
	MaxCount  int     `json:"max_count,omitempty"`
}

UpdateKubernetesWorkerPoolRequest represents a request to update a worker pool

type Volume added in v0.3.1

type Volume struct {
	Instance *struct {
		ID   string `json:"id,omitempty"`
		Name string `json:"name,omitempty"`
	} `json:"instance,omitempty"`
	VolumePool *struct {
		Name             string   `json:"name,omitempty"`
		DatacenterIDs    []string `json:"datacenter_ids,omitempty"`
		ReplicationLevel int      `json:"replication_level,omitempty"`
	} `json:"volume_pool,omitempty"`
	ID         string          `json:"id,omitempty"`
	Name       string          `json:"name,omitempty"`
	FileSystem string          `json:"file_system,omitempty"`
	State      string          `json:"state,omitempty"`
	Number     string          `json:"number,omitempty"`
	OriginalID string          `json:"original_id,omitempty"`
	CreatedAt  string          `json:"created_at,omitempty"`
	AttachedAt string          `json:"attached_at,omitempty"`
	ProductID  string          `json:"product_id,omitempty"`
	Meta       json.RawMessage `json:"meta,omitempty"`
	Size       int             `json:"size,omitempty"`
	Port       int             `json:"port,omitempty"`
	PlanID     int             `json:"plan_id,omitempty"`
}

Volume object

type VolumeAction added in v0.3.3

type VolumeAction struct {
	*Action
	ResultParams *struct {
		CopiedVolumeID string `json:"copied_volume_id,omitempty"`
	} `json:"result_params,omitempty"`
}

VolumeAction object

type VolumeCopyActionRequest added in v0.5.0

type VolumeCopyActionRequest struct {
	Name string
	// Deprecated: Please use PlanID instead.
	ProductID string
	// Deprecated: Please use PlanSlug instead.
	ProductSlug string
	PlanSlug    string
	PlanID      int
}

VolumeCopyActionRequest represents a request to create new volume from origin.

type VolumeCreateRequest added in v0.3.1

type VolumeCreateRequest struct {
	Name string `json:"name"`
	Meta string `json:"meta,omitempty"`
	// Deprecated: Please use PlanID instead.
	ProductID string `json:"product_id,omitempty"`
	// Deprecated: Please use PlanSlug instead.
	ProductSlug string `json:"product_slug,omitempty"`
	PlanSlug    string `json:"plan_slug,omitempty"`
	FileSystem  string `json:"file_system,omitempty"`
	InstanceID  string `json:"instance_id,omitempty"`
	Size        int    `json:"size"`
	PlanID      int    `json:"plan_id,omitempty"`
}

VolumeCreateRequest object

type VolumePlan added in v0.8.1

type VolumePlan struct {
	CustomAttributes *VolumePlanAttributes `json:"custom_attributes,omitempty"`
	Plan
}

type VolumePlanAttributes added in v0.8.1

type VolumePlanAttributes struct {
	VolumeType *struct {
		ID               string `json:"id,omitempty"`
		DiskType         string `json:"disk_type,omitempty"`
		ReplicationLevel int    `json:"replication_level,omitempty"`
	} `json:"volume_type,omitempty"`

	WebsaProductId  string   `json:"websaProductId,omitempty"`
	Slug            string   `json:"slug,omitempty"`
	DatacenterIds   []string `json:"datacenter_ids,omitempty"`
	PredefinedSizes []struct {
		Name string `json:"name,omitempty"`
		Size int    `json:"size,omitempty"`
	} `json:"predefined_sizes,omitempty"`
	Hot     bool `json:"hot,omitempty"`
	MaxSize int  `json:"max_size,omitempty"`
	MinSize int  `json:"min_size,omitempty"`
}

type VolumePlansAPI added in v0.8.0

type VolumePlansAPI interface {
	List(context.Context) ([]VolumePlan, error)
}

VolumePlansAPI is an interface for volume plans.

type VolumePlansService added in v0.8.0

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

VolumePlansService implements VolumePlansAPI interface.

func (*VolumePlansService) List added in v0.8.0

func (vp *VolumePlansService) List(ctx context.Context) ([]VolumePlan, error)

List returns all available volume plans

type VolumeProduct added in v0.3.2

type VolumeProduct struct {
	Category *struct {
		ID   string `json:"id,omitempty"`
		Name string `json:"name,omitempty"`
	} `json:"category,omitempty"`
	VolumeType *struct {
		ID               string `json:"id,omitempty"`
		Name             string `json:"name,omitempty"`
		Description      string `json:"description,omitempty"`
		DiskType         string `json:"disk_type,omitempty"`
		ReplicationLevel int    `json:"replication_level,omitempty"`
	}
	ID            string                `json:"id,omitempty"`
	CreatedAt     string                `json:"created_at,omitempty"`
	UpdatedAt     string                `json:"updated_at,omitempty"`
	Name          string                `json:"name,omitempty"`
	Type          string                `json:"type,omitempty"`
	Price         string                `json:"price,omitempty"`
	Currency      string                `json:"currency,omitempty"`
	Slug          string                `json:"slug,omitempty"`
	DatacenterIDs []string              `json:"datacenter_ids,omitempty"`
	Tariff        []VolumeProductTariff `json:"tariff,omitempty"`
	Hot           bool                  `json:"hot,omitempty"`
	MinSize       int                   `json:"min_size,omitempty"`
	MaxSize       int                   `json:"max_size,omitempty"`
}

VolumeProduct object

type VolumeProductTariff added in v0.3.2

type VolumeProductTariff struct {
	Component    string  `json:"component,omitempty"`
	Measure      string  `json:"measure,omitempty"`
	TariffPrice  float64 `json:"tariff_price,omitempty"`
	MonthlyHours int     `json:"monthly_hours,omitempty"`
}

VolumeProductTariff object

type VolumeProductsAPI added in v0.3.2

type VolumeProductsAPI interface {
	List(context.Context, *ListOptions) ([]VolumeProduct, *Meta, error)
}

VolumeProductsAPI is an interface for volume products.

type VolumeProductsService added in v0.3.2

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

VolumeProductsService implements VolumeProductsAPI interface.

func (*VolumeProductsService) List added in v0.3.2

func (vps *VolumeProductsService) List(ctx context.Context, options *ListOptions) ([]VolumeProduct, *Meta, error)

List returns all available volume products

type VolumeUpdateRequest added in v0.3.1

type VolumeUpdateRequest struct {
	Meta map[string]string `json:"meta,omitempty"`
	Name string            `json:"name,omitempty"`
}

VolumeUpdateRequest represents a request to update a volume.

type VolumesAPI added in v0.3.1

VolumesAPI is an interface for volumes.

type VolumesService added in v0.3.1

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

VolumesService implements VolumesAPI interface.

func (*VolumesService) ActionInfo added in v0.3.3

func (vs *VolumesService) ActionInfo(ctx context.Context, volumeID, actionID string) (*VolumeAction, error)

ActionInfo returns volume's action info by action ID

func (*VolumesService) Actions added in v0.3.3

func (vs *VolumesService) Actions(ctx context.Context, volumeID string) ([]VolumeAction, error)

Actions returns volume's actions list

func (*VolumesService) Copy added in v0.3.1

func (vs *VolumesService) Copy(ctx context.Context, volumeID string, request *VolumeCopyActionRequest) (*VolumeAction, error)

Copy volume

func (*VolumesService) Create added in v0.3.1

func (vs *VolumesService) Create(ctx context.Context, createRequest *VolumeCreateRequest) (*Volume, error)

Create volume

func (*VolumesService) Delete added in v0.3.1

func (vs *VolumesService) Delete(ctx context.Context, volumeID string) error

Delete volume

func (*VolumesService) Get added in v0.3.1

func (vs *VolumesService) Get(ctx context.Context, volumeID string) (*Volume, error)

Get volume

func (*VolumesService) List added in v0.3.1

func (vs *VolumesService) List(ctx context.Context, options *ListOptions) ([]Volume, *Meta, error)

List returns all available private networks

func (*VolumesService) Resize added in v0.3.1

func (vs *VolumesService) Resize(ctx context.Context, volumeID string, size int) (*Action, error)

Resize volume

func (*VolumesService) Update added in v0.3.1

func (vs *VolumesService) Update(ctx context.Context, volumeID string, request *VolumeUpdateRequest) (*Volume, error)

Update volume

Jump to

Keyboard shortcuts

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