Documentation
¶
Index ¶
- Constants
- Variables
- func BuildFilterQuery(filters []FilterInterface) string
- func BuildSortingQuery(sortings []*Sorting) string
- type APIClient
- type Action
- type BackUpUpdateRequest
- type Backup
- type BackupsAPI
- type BackupsService
- func (bs *BackupsService) Delete(ctx context.Context, backupID string) (*Action, error)
- func (bs *BackupsService) Get(ctx context.Context, backupID string) (*Backup, error)
- func (bs *BackupsService) List(ctx context.Context, options *ListOptions) ([]InstanceBackups, error)
- func (bs *BackupsService) Update(ctx context.Context, backupID string, request *BackUpUpdateRequest) (*Backup, error)
- type ClientOptions
- type ClusterDeleteWorkerRequest
- type ContFilter
- type CreateKubernetesWorkerPoolRequest
- type Datacenter
- type DatacenterRegion
- type DatacentersAPI
- type DatacentersService
- type EqFilter
- type FilterInterface
- type IPAddress
- type IPAddressAssignment
- type IPAddressAssignmentCreateRequest
- type IPAddressAssignmentsAPI
- type IPAddressAssignmentsService
- func (ips *IPAddressAssignmentsService) Create(ctx context.Context, createRequest *IPAddressAssignmentCreateRequest) (*IPAddressAssignment, error)
- func (ips *IPAddressAssignmentsService) Delete(ctx context.Context, isntanceIPAssignmentID string) error
- func (ips *IPAddressAssignmentsService) Get(ctx context.Context, IPAddressAssignmentID string) (*IPAddressAssignment, error)
- func (ips *IPAddressAssignmentsService) List(ctx context.Context, options *ListOptions) ([]IPAddressAssignment, error)
- type IPAddressCreateRequest
- type IPAddressUpdateRequest
- type IPAddressesAPI
- type IPAddressesService
- func (ips *IPAddressesService) Create(ctx context.Context, createRequest *IPAddressCreateRequest) (*IPAddress, error)
- func (ips *IPAddressesService) Delete(ctx context.Context, ipAddressID string) error
- func (ips *IPAddressesService) Get(ctx context.Context, ipAddressID string) (*IPAddress, error)
- func (ips *IPAddressesService) List(ctx context.Context, options *ListOptions) ([]IPAddress, error)
- func (ips *IPAddressesService) Update(ctx context.Context, ipAddressID string, request *IPAddressUpdateRequest) (*IPAddress, error)
- type Image
- type ImagesAPI
- type ImagesService
- type InFilter
- type Instance
- type InstanceAction
- type InstanceActionRequest
- type InstanceBackups
- type InstanceCreateRequest
- type InstanceDestroyRequest
- type InstanceIPAddress
- type InstanceImage
- type InstanceNetworks
- type InstancePlan
- type InstancePlanAttributes
- type InstancePlansAPI
- type InstancePlansService
- type InstancePrivateNetwork
- type InstancePrivateNetworkAttributes
- type InstancePrivateNetworkCreateRequest
- type InstancePrivateNetworkInfo
- type InstancePrivateNetworkUpdateRequest
- type InstancePrivateNetworksAPI
- type InstancePrivateNetworksService
- func (ipns *InstancePrivateNetworksService) Create(ctx context.Context, addRequest *InstancePrivateNetworkCreateRequest) (*InstancePrivateNetwork, error)
- func (ipns *InstancePrivateNetworksService) Delete(ctx context.Context, instancePrivateNetworkID string) (*InstancePrivateNetwork, error)
- func (ipns *InstancePrivateNetworksService) Get(ctx context.Context, instancePrivateNetworkID string) (*InstancePrivateNetwork, error)
- func (ipns *InstancePrivateNetworksService) Update(ctx context.Context, instancePrivateNetworkID string, ...) (*InstancePrivateNetwork, error)
- type InstanceProduct
- type InstanceProductTariff
- type InstanceProductsAPI
- type InstanceProductsService
- type InstanceRegion
- type InstanceRenameRequest
- type InstanceSSHKey
- type InstanceUpgradeRequest
- type InstanceV4Network
- type InstancesAPI
- type InstancesService
- func (is *InstancesService) ActionInfo(ctx context.Context, instanceID, actionID string) (*InstanceAction, error)
- func (is *InstancesService) Actions(ctx context.Context, instanceID string) ([]InstanceAction, error)
- func (is *InstancesService) AttachVolume(ctx context.Context, instanceID, volumeID string) (*Action, error)
- func (is *InstancesService) AvailableVolumes(ctx context.Context, instanceID string, options *ListOptions) ([]Volume, *Meta, error)
- func (is *InstancesService) Create(ctx context.Context, createRequest *InstanceCreateRequest) (*Instance, error)
- func (is *InstancesService) CreateBackup(ctx context.Context, instanceID, note string) (*InstanceAction, error)
- func (is *InstancesService) Destroy(ctx context.Context, instanceID string) error
- func (is *InstancesService) DetachVolume(ctx context.Context, instanceID, volumeID string) (*Action, error)
- func (is *InstancesService) Get(ctx context.Context, instanceID string) (*Instance, error)
- func (is *InstancesService) List(ctx context.Context, options *ListOptions) ([]Instance, *Meta, error)
- func (is *InstancesService) PowerOff(ctx context.Context, instanceID string) error
- func (is *InstancesService) Rename(ctx context.Context, instanceID, name string) (*Instance, error)
- func (is *InstancesService) SetPrimaryIP(ctx context.Context, instanceID, ipAssignmentID string) (*Action, error)
- func (is *InstancesService) Shutdown(ctx context.Context, instanceID string) error
- func (is *InstancesService) Upgrade(ctx context.Context, instanceID string, request *InstanceUpgradeRequest) error
- type KubernetesCluster
- type KubernetesClusterConfig
- type KubernetesClusterCreateRequest
- type KubernetesClusterRoot
- type KubernetesClusterUpdateRequest
- type KubernetesClustersAPI
- type KubernetesClustersRoot
- type KubernetesClustersService
- func (kcs *KubernetesClustersService) Create(ctx context.Context, createRequest *KubernetesClusterCreateRequest) (*KubernetesCluster, error)
- func (kcs *KubernetesClustersService) CreateWorkerPool(ctx context.Context, clusterId string, ...) (*KubernetesWorkerPool, error)
- func (kcs *KubernetesClustersService) Delete(ctx context.Context, clusterId string) error
- func (kcs *KubernetesClustersService) DeleteWorker(ctx context.Context, clusterID, workerPoolID, workerID string, ...) error
- func (kcs *KubernetesClustersService) DeleteWorkerPool(ctx context.Context, clusterId string, workerPoolId string, replace bool) error
- func (kcs *KubernetesClustersService) Get(ctx context.Context, clusterID string) (*KubernetesCluster, error)
- func (kcs KubernetesClustersService) GetConfig(ctx context.Context, clusterId string) (string, error)
- func (kcs *KubernetesClustersService) GetKubernetesClustersVersions(ctx context.Context) ([]string, error)
- func (kcs *KubernetesClustersService) GetWorkerPool(ctx context.Context, clusterId, workerPoolId string) (*KubernetesWorkerPool, error)
- func (kcs *KubernetesClustersService) List(ctx context.Context, options *ListOptions) ([]KubernetesCluster, error)
- func (kcs *KubernetesClustersService) ListWorkerPools(ctx context.Context, options *ListOptions, clusterId string) ([]KubernetesWorkerPool, error)
- func (kcs *KubernetesClustersService) Update(ctx context.Context, clusterId string, request *KubernetesClusterUpdateRequest) error
- func (kcs *KubernetesClustersService) UpdateWorkerPool(ctx context.Context, clusterId, workerPoolId string, ...) error
- type KubernetesWorker
- type KubernetesWorkerPool
- type KubernetesWorkerPoolRoot
- type KubernetesWorkerPoolsRoot
- type LBBackendNode
- type LBBackendNodeCreateRequest
- type LBForwardingRule
- type LBForwardingRuleCreateRequest
- type LBHealthCheck
- type LBHealthCheckCreateRequest
- type LBHealthCheckUpdateRequest
- type LBIPAddress
- type LBPrivateNetwork
- type LBPrivateNetworkAddress
- type Labels
- type ListMetaOptions
- type ListOptions
- type LoadBalancer
- type LoadBalancerCreateRequest
- type LoadBalancerUpdateRequest
- type LoadBalancersAPI
- type LoadBalancersService
- func (lb *LoadBalancersService) AddBackendNodes(ctx context.Context, lbID string, bnIDs []string) ([]LBBackendNode, error)
- func (lb *LoadBalancersService) AssignIPAddresses(ctx context.Context, lbID string, ipIDs []string) ([]LBIPAddress, error)
- func (lb *LoadBalancersService) ConnectPrivateNetworks(ctx context.Context, lbID string, pnIDs []string) ([]LBPrivateNetwork, error)
- func (lb *LoadBalancersService) Create(ctx context.Context, createRequest *LoadBalancerCreateRequest) (*LoadBalancer, error)
- func (lb *LoadBalancersService) CreateForwardingRule(ctx context.Context, lbID string, request *LBForwardingRuleCreateRequest) (*LBForwardingRule, error)
- func (lb *LoadBalancersService) CreateHealthCheck(ctx context.Context, lbID string, request *LBHealthCheckCreateRequest) (*LBHealthCheck, error)
- func (lb *LoadBalancersService) Delete(ctx context.Context, lbID string) error
- func (lb *LoadBalancersService) DeleteBackendNode(ctx context.Context, lbID, bnID string) error
- func (lb *LoadBalancersService) DeleteForwardingRule(ctx context.Context, lbID, frID string) error
- func (lb *LoadBalancersService) DeleteHealthCheck(ctx context.Context, lbID, hcID string) error
- func (lb *LoadBalancersService) DisconnectPrivateNetwork(ctx context.Context, lbID, pnID string) error
- func (lb *LoadBalancersService) Get(ctx context.Context, lbID string) (*LoadBalancer, error)
- func (lb *LoadBalancersService) GetBackendNode(ctx context.Context, lbID, bnID string) (*LBBackendNode, error)
- func (lb *LoadBalancersService) GetForwardingRule(ctx context.Context, lbID, frID string) (*LBForwardingRule, error)
- func (lb *LoadBalancersService) GetHealthCheck(ctx context.Context, lbID, hcID string) (*LBHealthCheck, error)
- func (lb *LoadBalancersService) GetIPAddress(ctx context.Context, lbID, ipID string) (*LBIPAddress, error)
- func (lb *LoadBalancersService) GetPrivateNetwork(ctx context.Context, lbID, pnID string) (*LBPrivateNetwork, error)
- func (lb *LoadBalancersService) List(ctx context.Context, filters map[string]string) ([]LoadBalancer, error)
- func (lb *LoadBalancersService) ListBackendNodes(ctx context.Context, lbID string) ([]LBBackendNode, error)
- func (lb *LoadBalancersService) ListForwardingRules(ctx context.Context, lbID string) ([]LBForwardingRule, error)
- func (lb *LoadBalancersService) ListHealthChecks(ctx context.Context, lbID string) ([]LBHealthCheck, error)
- func (lb *LoadBalancersService) ListIPAddresses(ctx context.Context, lbID string) ([]LBIPAddress, error)
- func (lb *LoadBalancersService) ListPrivateNetworks(ctx context.Context, lbID string) ([]LBPrivateNetwork, error)
- func (lb *LoadBalancersService) ReleaseIPAddress(ctx context.Context, lbID, ipID string) error
- func (lb *LoadBalancersService) Update(ctx context.Context, lbID string, updateRequest *LoadBalancerUpdateRequest) error
- func (lb *LoadBalancersService) UpdateHealthCheck(ctx context.Context, lbID, hcID string, request *LBHealthCheckUpdateRequest) error
- type Meta
- type Plan
- type PlanPrice
- type PrivateNetwork
- type PrivateNetworkCreateRequest
- type PrivateNetworkInfo
- type PrivateNetworkUpdateRequest
- type PrivateNetworksAPI
- type PrivateNetworksService
- func (pns *PrivateNetworksService) Create(ctx context.Context, createRequest *PrivateNetworkCreateRequest) (*PrivateNetworkInfo, error)
- func (pns *PrivateNetworksService) Delete(ctx context.Context, privateNetworkID string) error
- func (pns *PrivateNetworksService) Get(ctx context.Context, privateNetworkID string) (*PrivateNetworkInfo, error)
- func (pns *PrivateNetworksService) List(ctx context.Context, options *ListOptions) ([]PrivateNetwork, error)
- func (pns *PrivateNetworksService) Update(ctx context.Context, privateNetworkID string, ...) (*PrivateNetworkInfo, error)
- type PrivateProperties
- type PublicProperties
- type SSHKey
- type SSHKeyCreateRequest
- type SSHKeyUpdateRequest
- type SSHKeysAPI
- type SSHKeysService
- func (sk *SSHKeysService) Create(ctx context.Context, createRequest *SSHKeyCreateRequest) (*SSHKey, error)
- func (sk *SSHKeysService) Delete(ctx context.Context, sshKeyID string) error
- func (sk *SSHKeysService) Get(ctx context.Context, sshKeyID string) (*SSHKey, error)
- func (sk *SSHKeysService) List(ctx context.Context, options *ListOptions) ([]SSHKey, *Meta, error)
- func (sk *SSHKeysService) Update(ctx context.Context, sshKeyID string, updateRequest *SSHKeyUpdateRequest) (*SSHKey, error)
- type Sorting
- type Token
- type TokenCreateRequest
- type TokensAPI
- type TokensService
- func (s *TokensService) Create(ctx context.Context, request *TokenCreateRequest) (*Token, error)
- func (s *TokensService) Delete(ctx context.Context, tokenId string) error
- func (s *TokensService) Get(ctx context.Context, tokenId string) (*Token, error)
- func (s *TokensService) List(ctx context.Context, options *ListOptions) ([]Token, error)
- type UpdateKubernetesWorkerPoolRequest
- type Volume
- type VolumeAction
- type VolumeCopyActionRequest
- type VolumeCreateRequest
- type VolumePlan
- type VolumePlanAttributes
- type VolumePlansAPI
- type VolumePlansService
- type VolumeProduct
- type VolumeProductTariff
- type VolumeProductsAPI
- type VolumeProductsService
- type VolumeUpdateRequest
- type VolumesAPI
- type VolumesService
- func (vs *VolumesService) ActionInfo(ctx context.Context, volumeID, actionID string) (*VolumeAction, error)
- func (vs *VolumesService) Actions(ctx context.Context, volumeID string) ([]VolumeAction, error)
- func (vs *VolumesService) Copy(ctx context.Context, volumeID string, request *VolumeCopyActionRequest) (*VolumeAction, error)
- func (vs *VolumesService) Create(ctx context.Context, createRequest *VolumeCreateRequest) (*Volume, error)
- func (vs *VolumesService) Delete(ctx context.Context, volumeID string) error
- func (vs *VolumesService) Get(ctx context.Context, volumeID string) (*Volume, error)
- func (vs *VolumesService) List(ctx context.Context, options *ListOptions) ([]Volume, *Meta, error)
- func (vs *VolumesService) Resize(ctx context.Context, volumeID string, size int) (*Action, error)
- func (vs *VolumesService) Update(ctx context.Context, volumeID string, request *VolumeUpdateRequest) (*Volume, error)
Constants ¶
const InstanceShutDownStatus = "stopped"
InstanceShutDownStatus represents instance's shutdown statuse
Variables ¶
var ( // ErrPrimaryIPNotFound is returned when primary is not found ErrPrimaryIPNotFound = errors.New("primary ip is not found") )
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 ¶
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
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
type BackupsAPI interface {
List(context.Context, *ListOptions) ([]InstanceBackups, error)
Get(context.Context, string) (*Backup, error)
Update(context.Context, string, *BackUpUpdateRequest) (*Backup, error)
Delete(context.Context, string) (*Action, error)
}
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) 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 ¶
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 ¶
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 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 ¶
type IPAddressAssignmentsAPI interface {
Create(context.Context, *IPAddressAssignmentCreateRequest) (*IPAddressAssignment, error)
Get(context.Context, string) (*IPAddressAssignment, error)
List(context.Context, *ListOptions) ([]IPAddressAssignment, error)
Delete(context.Context, string) error
}
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 ¶
func (ips *IPAddressAssignmentsService) Create(ctx context.Context, createRequest *IPAddressAssignmentCreateRequest) (*IPAddressAssignment, error)
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
func (ips *IPAddressAssignmentsService) List(ctx context.Context, options *ListOptions) ([]IPAddressAssignment, error)
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 ¶
type IPAddressesAPI interface {
List(context.Context, *ListOptions) ([]IPAddress, error)
Create(context.Context, *IPAddressCreateRequest) (*IPAddress, error)
Get(context.Context, string) (*IPAddress, error)
Delete(context.Context, string) error
Update(context.Context, string, *IPAddressUpdateRequest) (*IPAddress, error)
}
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) 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 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 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 ¶
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 ¶
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
func (ips *InstancePlansService) List(ctx context.Context) ([]InstancePlan, error)
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
type InstancePrivateNetworksAPI interface {
Create(context.Context, *InstancePrivateNetworkCreateRequest) (*InstancePrivateNetwork, error)
Get(context.Context, string) (*InstancePrivateNetwork, error)
Update(context.Context, string, *InstancePrivateNetworkUpdateRequest) (*InstancePrivateNetwork, error)
Delete(context.Context, string) (*InstancePrivateNetwork, error)
}
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
func (ipns *InstancePrivateNetworksService) Create( ctx context.Context, addRequest *InstancePrivateNetworkCreateRequest) (*InstancePrivateNetwork, error)
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
func (ips *InstanceProductsService) List(ctx context.Context, options *ListOptions) ([]InstanceProduct, *Meta, error)
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 ¶
type InstancesAPI interface {
List(context.Context, *ListOptions) ([]Instance, *Meta, error)
Get(context.Context, string) (*Instance, error)
Create(context.Context, *InstanceCreateRequest) (*Instance, error)
Rename(context.Context, string, string) (*Instance, error)
Upgrade(context.Context, string, *InstanceUpgradeRequest) error
Shutdown(context.Context, string) error
PowerOff(context.Context, string) error
Destroy(context.Context, string) error
SetPrimaryIP(context.Context, string, string) (*Action, error)
AttachVolume(context.Context, string, string) (*Action, error)
DetachVolume(context.Context, string, string) (*Action, error)
ActionInfo(context.Context, string, string) (*InstanceAction, error)
Actions(context.Context, string) ([]InstanceAction, error)
AvailableVolumes(context.Context, string, *ListOptions) ([]Volume, *Meta, error)
CreateBackup(context.Context, string, string) (*InstanceAction, error)
}
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) 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) 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 KubernetesClustersAPI ¶ added in v0.10.3
type KubernetesClustersAPI interface {
Get(context.Context, string) (*KubernetesCluster, error)
List(context.Context, *ListOptions) ([]KubernetesCluster, error)
Create(context.Context, *KubernetesClusterCreateRequest) (*KubernetesCluster, error)
Update(context.Context, string, *KubernetesClusterUpdateRequest) error
GetConfig(context.Context, string) (string, error)
Delete(context.Context, string) error
GetKubernetesClustersVersions(context.Context) ([]string, error)
GetWorkerPool(context.Context, string, string) (*KubernetesWorkerPool, error)
ListWorkerPools(context.Context, *ListOptions, string) ([]KubernetesWorkerPool, error)
CreateWorkerPool(context.Context, string, *CreateKubernetesWorkerPoolRequest) (*KubernetesWorkerPool, error)
UpdateWorkerPool(context.Context, string, string, *UpdateKubernetesWorkerPoolRequest) error
DeleteWorkerPool(context.Context, string, string, bool) error
DeleteWorker(context.Context, string, string, string, *ClusterDeleteWorkerRequest) error
}
KubernetesClustersAPI is an interface for cluster API.
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
func (kcs *KubernetesClustersService) Create(ctx context.Context, createRequest *KubernetesClusterCreateRequest) (*KubernetesCluster, error)
Create kubernetes cluster
func (*KubernetesClustersService) CreateWorkerPool ¶ added in v0.10.7
func (kcs *KubernetesClustersService) CreateWorkerPool(ctx context.Context, clusterId string, request *CreateKubernetesWorkerPoolRequest) (*KubernetesWorkerPool, error)
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
func (kcs *KubernetesClustersService) Get(ctx context.Context, clusterID string) (*KubernetesCluster, error)
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
func (kcs *KubernetesClustersService) List(ctx context.Context, options *ListOptions) ([]KubernetesCluster, error)
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
func (kcs *KubernetesClustersService) Update(ctx context.Context, clusterId string, request *KubernetesClusterUpdateRequest) error
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 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"`
CUCount int `json:"cu_count,omitempty"`
CUMax int `json:"cu_max,omitempty"`
InstanceCount int `json:"instance_count,omitempty"`
HAOn bool `json:"ha_on,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"`
CUCount int `json:"cu_count"`
CUMax int `json:"cu_max,omitempty"`
InstanceCount int `json:"instance_count,omitempty"`
CreatePublicIPAddress bool `json:"create_public_ip_address"`
HAOn bool `json:"ha_on,omitempty"`
}
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"`
HAOn bool `json:"ha_on,omitempty"`
CUCount int `json:"cu_count,omitempty"`
CUMax int `json:"cu_max,omitempty"`
InstanceCount int `json:"instance_count,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
func (lb *LoadBalancersService) Create(ctx context.Context, createRequest *LoadBalancerCreateRequest) (*LoadBalancer, error)
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
func (lb *LoadBalancersService) Get(ctx context.Context, lbID string) (*LoadBalancer, error)
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 ¶
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
type PrivateNetworksAPI interface {
List(context.Context, *ListOptions) ([]PrivateNetwork, error)
Get(context.Context, string) (*PrivateNetworkInfo, error)
Create(context.Context, *PrivateNetworkCreateRequest) (*PrivateNetworkInfo, error)
Update(context.Context, string, *PrivateNetworkUpdateRequest) (*PrivateNetworkInfo, error)
Delete(context.Context, string) error
}
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
func (pns *PrivateNetworksService) Create(ctx context.Context, createRequest *PrivateNetworkCreateRequest) (*PrivateNetworkInfo, error)
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
type SSHKeysAPI interface {
List(context.Context, *ListOptions) ([]SSHKey, *Meta, error)
Get(context.Context, string) (*SSHKey, error)
Create(context.Context, *SSHKeyCreateRequest) (*SSHKey, error)
Update(context.Context, string, *SSHKeyUpdateRequest) (*SSHKey, error)
Delete(context.Context, string) error
}
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) 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 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) 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
type VolumesAPI interface {
List(context.Context, *ListOptions) ([]Volume, *Meta, error)
Get(context.Context, string) (*Volume, error)
Create(context.Context, *VolumeCreateRequest) (*Volume, error)
Update(context.Context, string, *VolumeUpdateRequest) (*Volume, error)
Copy(context.Context, string, *VolumeCopyActionRequest) (*VolumeAction, error)
Resize(context.Context, string, int) (*Action, error)
ActionInfo(context.Context, string, string) (*VolumeAction, error)
Actions(context.Context, string) ([]VolumeAction, error)
Delete(context.Context, string) error
}
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) 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) Update ¶ added in v0.3.1
func (vs *VolumesService) Update(ctx context.Context, volumeID string, request *VolumeUpdateRequest) (*Volume, error)
Update volume
Source Files
¶
- actions.go
- api.go
- backups.go
- common.go
- datacenters.go
- images.go
- instance_plans.go
- instance_private_networks.go
- instance_products.go
- instances.go
- ip_address_assignments.go
- ip_addresses.go
- kubernetes_clusters.go
- kubernetes_workers.go
- kubernetes_workers_pools.go
- loadbalancers.go
- meta.go
- plans.go
- private_networks.go
- ransack.go
- ssh_keys.go
- test_helpers.go
- tokens.go
- volume_plans.go
- volume_products.go
- volumes.go