compute

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

View Source
const (
	LoadBalancerStatusActive = iota + 1
	LoadBalancerStatusDisabled
	LoadBalancerStatusWorking
	LoadBalancerStatusDegraded
	LoadBalancerStatusError
)
View Source
const (
	DirectionIngress = "ingress"
	DirectionEgress  = "egress"

	ProtocolAny  = -1
	ProtocolICMP = 1
	ProtocolTCP  = 6
	ProtocolUDP  = 17
)
View Source
const (
	ServerStatusRunning   = 1
	ServerStatusStopped   = 2
	ServerStatusSuspended = 3
	ServerStatusStarting  = 4
	ServerStatusStopping  = 5
	ServerStatusError     = 6
	ServerStatusUpgrading = 9

	ApplicationStatusUnhealthy = 7
	ApplicationStatusHealthy   = 8

	ClusterStatusHealthy     = 14
	ClusterStatusWorking     = 15
	ClusterStatusUnhealthy   = 16
	ClusterStatusUnavailable = 17

	TaskStatusCreating   = 18
	TaskStatusNeutral    = 10
	TaskStatusCordoned   = 11
	TaskStatusDraining   = 12
	TaskStatusRebuilding = 13
)
View Source
const (
	SnapshotStatusAvailable = 1
	SnapshotStatusCreating  = 2
	SnapshotStatusError     = 3
)
View Source
const (
	VolumeStatusAvailable = iota + 1
	VolumeStatusInUse
	VolumeStatusWorking
	VolumeStatusError
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachedLoadBalancerInterface

type AttachedLoadBalancerInterface struct {
	ID        int    `json:"id"`
	PrivateIP string `json:"private_ip"`
	PublicIP  string `json:"public_ip"`
}

type AttachedNetworkInterface

type AttachedNetworkInterface struct {
	ID        int    `json:"id"`
	PrivateIP string `json:"private_ip"`
	PublicIP  string `json:"public_ip"`
}

type Certificate added in v0.2.1

type Certificate struct {
	ID       int                `json:"id"`
	Name     string             `json:"name"`
	Location common.Location    `json:"location"`
	Type     string             `json:"type"`
	Details  CertificateDetails `json:"certificate"`
}

type CertificateCreate added in v0.2.1

type CertificateCreate struct {
	Name        string `json:"name"`
	LocationID  int    `json:"location_id"`
	Certificate string `json:"certificate"`
	PrivateKey  string `json:"private_key"`
}

type CertificateDetails added in v0.2.1

type CertificateDetails struct {
	Subject   map[string]string `json:"subject"`
	Issuer    map[string]string `json:"issuer"`
	ValidFrom common.Time       `json:"valid_from"`
	ValidTo   common.Time       `json:"valid_to"`
	Serial    string            `json:"serial"`
}

type CertificateList added in v0.2.1

type CertificateList struct {
	Items      []Certificate
	Pagination goclient.Pagination
}

type CertificateService added in v0.2.1

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

func NewCertificateService added in v0.2.1

func NewCertificateService(client goclient.Client) CertificateService

func (CertificateService) Create added in v0.2.1

func (r CertificateService) Create(ctx context.Context, body CertificateCreate) (certificate Certificate, err error)

func (CertificateService) Delete added in v0.2.1

func (r CertificateService) Delete(ctx context.Context, id int) (err error)

func (CertificateService) Get added in v0.2.1

func (r CertificateService) Get(ctx context.Context, id int) (certificate Certificate, err error)

func (CertificateService) List added in v0.2.1

func (r CertificateService) List(ctx context.Context, cursor goclient.Cursor) (list CertificateList, err error)

type ElasticIP added in v0.2.1

type ElasticIP struct {
	ID         int                 `json:"id"`
	Product    ElasticIPProduct    `json:"product"`
	Location   common.Location     `json:"location"`
	Price      float64             `json:"price"`
	PublicIP   string              `json:"public_ip"`
	PrivateIP  string              `json:"private_ip"`
	Attachment ElasticIPAttachment `json:"attached_instance"`
}

type ElasticIPAttach added in v0.2.1

type ElasticIPAttach struct {
	ElasticIPID        int `json:"elastic_ip_id"`
	NetworkInterfaceID int `json:"network_interface_id"`
}

type ElasticIPAttachment added in v0.2.1

type ElasticIPAttachment struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

type ElasticIPCreate added in v0.2.1

type ElasticIPCreate struct {
	LocationID int `json:"location_id"`
}

type ElasticIPList added in v0.2.1

type ElasticIPList struct {
	Items      []ElasticIP
	Pagination goclient.Pagination
}

type ElasticIPProduct added in v0.2.1

type ElasticIPProduct = common.BriefProduct

type ElasticIPService added in v0.2.1

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

func NewElasticIPService added in v0.2.1

func NewElasticIPService(client goclient.Client) ElasticIPService

func (ElasticIPService) Create added in v0.2.1

func (e ElasticIPService) Create(ctx context.Context, body ElasticIPCreate) (elasticIP ElasticIP, err error)

func (ElasticIPService) Delete added in v0.2.1

func (e ElasticIPService) Delete(ctx context.Context, id int) (err error)

func (ElasticIPService) List added in v0.2.1

func (e ElasticIPService) List(ctx context.Context, cursor goclient.Cursor) (list ElasticIPList, err error)

type Image

type Image struct {
	ID                 int              `json:"id"`
	OperatingSystem    string           `json:"os"`
	Version            string           `json:"version"`
	Key                string           `json:"key"`
	Category           string           `json:"category"`
	Type               string           `json:"type"`
	Username           string           `json:"username"`
	MinRootDiskSize    int              `json:"min_root_disk_size"`
	Sorting            int              `json:"sorting"`
	RequiredLicenses   []common.Product `json:"required_licenses"`
	AvailableLocations []int            `json:"available_locations"`
}

type ImageList

type ImageList struct {
	Items      []Image
	Pagination goclient.Pagination
}

type ImageService

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

func NewImageService

func NewImageService(client goclient.Client) ImageService

func (ImageService) Get

func (i ImageService) Get(ctx context.Context, id int) (image Image, err error)

func (ImageService) List

func (i ImageService) List(ctx context.Context, cursor goclient.Cursor) (list ImageList, err error)

type KeyPair

type KeyPair struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Fingerprint string `json:"fingerprint"`
}

type KeyPairCreate

type KeyPairCreate struct {
	Name      string `json:"name"`
	PublicKey string `json:"public_key"`
}

type KeyPairList

type KeyPairList struct {
	Items      []KeyPair
	Pagination goclient.Pagination
}

type KeyPairService

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

func NewKeyPairService

func NewKeyPairService(client goclient.Client) KeyPairService

func (KeyPairService) Create

func (k KeyPairService) Create(ctx context.Context, body KeyPairCreate) (keyPair KeyPair, err error)

func (KeyPairService) Delete

func (k KeyPairService) Delete(ctx context.Context, id int) (err error)

func (KeyPairService) List

func (k KeyPairService) List(ctx context.Context, cursor goclient.Cursor) (list KeyPairList, err error)

type LoadBalancer

type LoadBalancer struct {
	ID       int                             `json:"id"`
	Name     string                          `json:"name"`
	Location common.Location                 `json:"location"`
	Product  common.Product                  `json:"product"`
	Status   LoadBalancerStatus              `json:"status"`
	Networks []LoadBalancerNetworkAttachment `json:"networks"`
}

type LoadBalancerAlgorithm

type LoadBalancerAlgorithm struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Key  string `json:"key"`
}

type LoadBalancerAlgorithmList

type LoadBalancerAlgorithmList struct {
	Items      []LoadBalancerAlgorithm
	Pagination goclient.Pagination
}

type LoadBalancerCreate

type LoadBalancerCreate struct {
	Name             string `json:"name"`
	LocationID       int    `json:"location_id"`
	AttachExternalIP bool   `json:"attach_external_ip"`
	NetworkID        int    `json:"network_id"`
	PrivateIP        string `json:"private_ip"`
}

type LoadBalancerEntityService

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

func NewLoadBalancerEntityService

func NewLoadBalancerEntityService(client goclient.Client) LoadBalancerEntityService

func (LoadBalancerEntityService) ListAlgorithms

func (l LoadBalancerEntityService) ListAlgorithms(ctx context.Context, cursor goclient.Cursor) (list LoadBalancerAlgorithmList, err error)

func (LoadBalancerEntityService) ListHealthCheckTypes

func (l LoadBalancerEntityService) ListHealthCheckTypes(ctx context.Context, cursor goclient.Cursor) (list LoadBalancerHealthCheckTypeList, err error)

func (LoadBalancerEntityService) ListProtocols

func (l LoadBalancerEntityService) ListProtocols(ctx context.Context, cursor goclient.Cursor) (list LoadBalancerProtocolList, err error)

type LoadBalancerHealthCheck

type LoadBalancerHealthCheck struct {
	Type               LoadBalancerHealthCheckType `json:"type"`
	HTTPMethod         string                      `json:"http_method"`
	HTTPPath           string                      `json:"http_path"`
	Interval           int                         `json:"interval"`
	Timeout            int                         `json:"timeout"`
	HealthyThreshold   int                         `json:"healthy_threshold"`
	UnhealthyThreshold int                         `json:"unhealthy_threshold"`
}

type LoadBalancerHealthCheckOptions

type LoadBalancerHealthCheckOptions struct {
	TypeID             int    `json:"type_id"`
	HTTPMethod         string `json:"http_method,omitempty"`
	HTTPPath           string `json:"http_path,omitempty"`
	Interval           int    `json:"interval,omitempty"`
	Timeout            int    `json:"timeout,omitempty"`
	HealthyThreshold   int    `json:"healthy_threshold,omitempty"`
	UnhealthyThreshold int    `json:"unhealthy_threshold,omitempty"`
}

type LoadBalancerHealthCheckType

type LoadBalancerHealthCheckType struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Key  string `json:"key"`
}

type LoadBalancerHealthCheckTypeList

type LoadBalancerHealthCheckTypeList struct {
	Items      []LoadBalancerHealthCheckType
	Pagination goclient.Pagination
}

type LoadBalancerList

type LoadBalancerList struct {
	Items      []LoadBalancer
	Pagination goclient.Pagination
}

type LoadBalancerMember

type LoadBalancerMember struct {
	ID      int                `json:"id"`
	Name    string             `json:"name"`
	Address string             `json:"address"`
	Port    int                `json:"port"`
	Status  LoadBalancerStatus `json:"status"`
}

type LoadBalancerMemberCreate

type LoadBalancerMemberCreate struct {
	Name    string `json:"name"`
	Address string `json:"address"`
	Port    int    `json:"port"`
}

type LoadBalancerMemberList

type LoadBalancerMemberList struct {
	Items      []LoadBalancerMember
	Pagination goclient.Pagination
}

type LoadBalancerMemberService

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

func NewLoadBalancerMemberService

func NewLoadBalancerMemberService(client goclient.Client, loadBalancerID, poolID int) LoadBalancerMemberService

func (LoadBalancerMemberService) Create

func (LoadBalancerMemberService) Delete

func (m LoadBalancerMemberService) Delete(ctx context.Context, id int) (err error)

func (LoadBalancerMemberService) List

type LoadBalancerNetworkAttachment

type LoadBalancerNetworkAttachment struct {
	Network
	Interfaces []AttachedLoadBalancerInterface `json:"network_interfaces"`
}

type LoadBalancerPerform

type LoadBalancerPerform struct {
	Action string `json:"action"`
}

type LoadBalancerPool

type LoadBalancerPool struct {
	ID             int                     `json:"id"`
	Name           string                  `json:"name"`
	Status         LoadBalancerStatus      `json:"status"`
	EntryProtocol  LoadBalancerProtocol    `json:"entry_protocol"`
	TargetProtocol LoadBalancerProtocol    `json:"target_protocol"`
	Certificate    Certificate             `json:"certificate"`
	EntryPort      int                     `json:"entry_port"`
	Algorithm      LoadBalancerAlgorithm   `json:"algorithm"`
	StickySession  bool                    `json:"sticky_session"`
	HealthCheck    LoadBalancerHealthCheck `json:"health_check"`
}

type LoadBalancerPoolCreate

type LoadBalancerPoolCreate struct {
	EntryProtocolID      int                            `json:"entry_protocol_id"`
	TargetProtocolID     int                            `json:"target_protocol_id"`
	CertificateID        int                            `json:"certificate_id,omitempty"`
	EntryPort            int                            `json:"entry_port"`
	BalancingAlgorithmID int                            `json:"balancing_algorithm_id"`
	StickySession        bool                           `json:"sticky_session"`
	Members              []LoadBalancerMemberCreate     `json:"members,omitempty"`
	HealthCheck          LoadBalancerHealthCheckOptions `json:"health_check"`
}

type LoadBalancerPoolList

type LoadBalancerPoolList struct {
	Items      []LoadBalancerPool
	Pagination goclient.Pagination
}

type LoadBalancerPoolService

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

func NewLoadBalancerPoolService

func NewLoadBalancerPoolService(client goclient.Client, loadBalancerID int) LoadBalancerPoolService

func (LoadBalancerPoolService) Create

func (LoadBalancerPoolService) Delete

func (l LoadBalancerPoolService) Delete(ctx context.Context, id int) (err error)

func (LoadBalancerPoolService) Get

func (l LoadBalancerPoolService) Get(ctx context.Context, id int) (pool LoadBalancerPool, err error)

func (LoadBalancerPoolService) List

func (LoadBalancerPoolService) Members

func (LoadBalancerPoolService) Update

type LoadBalancerPoolUpdate

type LoadBalancerPoolUpdate struct {
	CertificateID        int                            `json:"certificate_id,omitempty"`
	BalancingAlgorithmID int                            `json:"balancing_algorithm_id,omitempty"`
	StickySession        bool                           `json:"sticky_session,omitempty"`
	HealthCheck          LoadBalancerHealthCheckOptions `json:"health_check,omitempty"`
}

type LoadBalancerProtocol

type LoadBalancerProtocol struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Key  string `json:"key"`
}

type LoadBalancerProtocolList

type LoadBalancerProtocolList struct {
	Items      []LoadBalancerProtocol
	Pagination goclient.Pagination
}

type LoadBalancerService

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

func NewLoadBalancerService

func NewLoadBalancerService(client goclient.Client) LoadBalancerService

func (LoadBalancerService) Create

func (l LoadBalancerService) Create(ctx context.Context, body LoadBalancerCreate) (ordering common.Ordering, err error)

func (LoadBalancerService) Delete

func (l LoadBalancerService) Delete(ctx context.Context, id int) (err error)

func (LoadBalancerService) Get

func (l LoadBalancerService) Get(ctx context.Context, id int) (loadBalancer LoadBalancer, err error)

func (LoadBalancerService) List

func (l LoadBalancerService) List(ctx context.Context, cursor goclient.Cursor) (list LoadBalancerList, err error)

func (LoadBalancerService) Perform

func (l LoadBalancerService) Perform(ctx context.Context, id int, body LoadBalancerPerform) (loadBalancer LoadBalancer, err error)

func (LoadBalancerService) Pools

func (l LoadBalancerService) Pools(loadBalancerID int) LoadBalancerPoolService

func (LoadBalancerService) Update

func (l LoadBalancerService) Update(ctx context.Context, id int, body LoadBalancerUpdate) (loadBalancer LoadBalancer, err error)

func (LoadBalancerService) WaitUntilMutable

func (l LoadBalancerService) WaitUntilMutable(ctx context.Context, id int) error

type LoadBalancerStatus

type LoadBalancerStatus struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Key  string `json:"key"`
}

type LoadBalancerUpdate

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

type Network

type Network struct {
	ID                  int             `json:"id"`
	Name                string          `json:"name"`
	Description         string          `json:"description"`
	CIDR                string          `json:"cidr"`
	Location            common.Location `json:"location"`
	DomainNameServers   []string        `json:"domain_name_servers"`
	AllocationPoolStart string          `json:"allocation_pool_start"`
	AllocationPoolEnd   string          `json:"allocation_pool_end"`
	GatewayIP           string          `json:"gateway_ip"`
	UsedIPs             int             `json:"used_ips"`
	TotalIPs            int             `json:"total_ips"`
}

type NetworkCreate

type NetworkCreate struct {
	Name                string   `json:"name,omitempty"`
	Description         string   `json:"description,omitempty"`
	LocationID          int      `json:"location_id,omitempty"`
	DomainNameServers   []string `json:"domain_name_servers,omitempty"`
	CIDR                string   `json:"cidr,omitempty"`
	AllocationPoolStart string   `json:"allocation_pool_start,omitempty"`
	AllocationPoolEnd   string   `json:"allocation_pool_end,omitempty"`
	GatewayIP           string   `json:"gateway_ip,omitempty"`
}

type NetworkInterface

type NetworkInterface struct {
	ID                int             `json:"id"`
	PrivateIP         string          `json:"private_ip"`
	MacAddress        string          `json:"mac_address"`
	Network           Network         `json:"network"`
	AttachedElasticIP ElasticIP       `json:"attached_elastic_ip"`
	SecurityGroups    []SecurityGroup `json:"security_groups"`
	Security          bool            `json:"security"`
}

type NetworkInterfaceCreate

type NetworkInterfaceCreate struct {
	NetworkID int    `json:"network_id"`
	PrivateIP string `json:"private_ip"`
}

type NetworkInterfaceList

type NetworkInterfaceList struct {
	Items      []NetworkInterface
	Pagination goclient.Pagination
}

type NetworkInterfaceSecurityGroupUpdate

type NetworkInterfaceSecurityGroupUpdate struct {
	SecurityGroupIDs []int `json:"security_group_ids"`
}

type NetworkInterfaceSecurityUpdate

type NetworkInterfaceSecurityUpdate struct {
	Security bool `json:"security"`
}

type NetworkInterfaceService

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

func NewNetworkInterfaceService

func NewNetworkInterfaceService(client goclient.Client, serverID int) NetworkInterfaceService

func (NetworkInterfaceService) Create

func (n NetworkInterfaceService) Create(ctx context.Context, body NetworkInterfaceCreate) (networkInterface NetworkInterface, err error)

func (NetworkInterfaceService) Delete

func (n NetworkInterfaceService) Delete(ctx context.Context, id int) (err error)

func (NetworkInterfaceService) List

func (NetworkInterfaceService) UpdateSecurity

func (n NetworkInterfaceService) UpdateSecurity(ctx context.Context, id int, body NetworkInterfaceSecurityUpdate) (networkInterface NetworkInterface, err error)

func (NetworkInterfaceService) UpdateSecurityGroups

func (n NetworkInterfaceService) UpdateSecurityGroups(ctx context.Context, id int, body NetworkInterfaceSecurityGroupUpdate) (networkInterface NetworkInterface, err error)

type NetworkList

type NetworkList struct {
	Items      []Network
	Pagination goclient.Pagination
}

type NetworkService

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

func NewNetworkService

func NewNetworkService(client goclient.Client) NetworkService

func (NetworkService) Create

func (n NetworkService) Create(ctx context.Context, body NetworkCreate) (network Network, err error)

func (NetworkService) Delete

func (n NetworkService) Delete(ctx context.Context, id int) (err error)

func (NetworkService) Get

func (n NetworkService) Get(ctx context.Context, id int) (network Network, err error)

func (NetworkService) List

func (n NetworkService) List(ctx context.Context, cursor goclient.Cursor) (list NetworkList, err error)

func (NetworkService) Update

func (n NetworkService) Update(ctx context.Context, id int, body NetworkUpdate) (network Network, err error)

type NetworkUpdate

type NetworkUpdate struct {
	Name                string   `json:"name,omitempty"`
	Description         string   `json:"description,omitempty"`
	DomainNameServers   []string `json:"domain_name_servers,omitempty"`
	AllocationPoolStart string   `json:"allocation_pool_start,omitempty"`
	AllocationPoolEnd   string   `json:"allocation_pool_end,omitempty"`
	GatewayIP           string   `json:"gateway_ip,omitempty"`
}

type Route

type Route struct {
	ID          int    `json:"id"`
	Destination string `json:"destination"`
	NextHop     string `json:"nexthop"`
}

type RouteCreate

type RouteCreate struct {
	Destination string `json:"destination"`
	NextHop     string `json:"nexthop"`
}

type RouteList

type RouteList struct {
	Items      []Route
	Pagination goclient.Pagination
}

type RouteService

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

func NewRouteService

func NewRouteService(client goclient.Client, routerID int) RouteService

func (RouteService) Create

func (r RouteService) Create(ctx context.Context, body RouteCreate) (route Route, err error)

func (RouteService) Delete

func (r RouteService) Delete(ctx context.Context, id int) (err error)

func (RouteService) List

func (r RouteService) List(ctx context.Context, cursor goclient.Cursor) (list RouteList, err error)

type Router

type Router struct {
	ID          int             `json:"id"`
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Location    common.Location `json:"location"`
	Public      bool            `json:"public"`
	SourceNAT   bool            `json:"snat"`
	PublicIP    string          `json:"public_ip"`
}

type RouterCreate

type RouterCreate struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	LocationID  int    `json:"location_id"`
	Public      bool   `json:"public"`
}

type RouterInterface

type RouterInterface struct {
	ID        int     `json:"id"`
	PrivateIP string  `json:"private_ip"`
	Network   Network `json:"network"`
}

type RouterInterfaceCreate

type RouterInterfaceCreate struct {
	NetworkID int    `json:"network_id"`
	PrivateIP string `json:"private_ip,omitempty"`
}

type RouterInterfaceList

type RouterInterfaceList struct {
	Items      []RouterInterface
	Pagination goclient.Pagination
}

type RouterInterfaceService

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

func NewRouterInterfaceService

func NewRouterInterfaceService(client goclient.Client, routerID int) RouterInterfaceService

func (RouterInterfaceService) Create

func (r RouterInterfaceService) Create(ctx context.Context, body RouterInterfaceCreate) (routerInterface RouterInterface, err error)

func (RouterInterfaceService) Delete

func (r RouterInterfaceService) Delete(ctx context.Context, id int) (err error)

func (RouterInterfaceService) List

type RouterList

type RouterList struct {
	Items      []Router
	Pagination goclient.Pagination
}

type RouterService

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

func NewRouterService

func NewRouterService(client goclient.Client) RouterService

func (RouterService) Create

func (r RouterService) Create(ctx context.Context, body RouterCreate) (router Router, err error)

func (RouterService) Delete

func (r RouterService) Delete(ctx context.Context, id int) (err error)

func (RouterService) Get

func (r RouterService) Get(ctx context.Context, id int) (router Router, err error)

func (RouterService) List

func (r RouterService) List(ctx context.Context, cursor goclient.Cursor) (list RouterList, err error)

func (RouterService) RouterInterfaces

func (r RouterService) RouterInterfaces(routerID int) RouterInterfaceService

func (RouterService) Routes

func (r RouterService) Routes(routerID int) RouteService

func (RouterService) Update

func (r RouterService) Update(ctx context.Context, id int, body RouterUpdate) (router Router, err error)

type RouterUpdate

type RouterUpdate struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Public      bool   `json:"public,omitempty"`
}

type SecurityGroup

type SecurityGroup struct {
	ID          int             `json:"id"`
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Location    common.Location `json:"location"`
	Default     bool            `json:"default"`
	Immutable   bool            `json:"immutable"`
}

type SecurityGroupCreate

type SecurityGroupCreate struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	LocationID  int    `json:"location_id"`
}

type SecurityGroupList

type SecurityGroupList struct {
	Items      []SecurityGroup
	Pagination goclient.Pagination
}

type SecurityGroupRule

type SecurityGroupRule struct {
	ID                  int           `json:"id"`
	Direction           string        `json:"direction"`
	Protocol            int           `json:"protocol"`
	FromPort            int           `json:"from_port"`
	ToPort              int           `json:"to_port"`
	ICMPType            int           `json:"icmp_type"`
	ICMPCode            int           `json:"icmp_code"`
	IPRange             string        `json:"ip_range"`
	RemoteSecurityGroup SecurityGroup `json:"remote_security_group"`
}

type SecurityGroupRuleList

type SecurityGroupRuleList struct {
	Items      []SecurityGroupRule
	Pagination goclient.Pagination
}

type SecurityGroupRuleOptions

type SecurityGroupRuleOptions struct {
	Direction             string `json:"direction"`
	Protocol              int    `json:"protocol"`
	FromPort              int    `json:"from_port,omitempty"`
	ToPort                int    `json:"to_port,omitempty"`
	ICMPType              int    `json:"icmp_type,omitempty"`
	ICMPCode              int    `json:"icmp_code,omitempty"`
	IPRange               string `json:"ip_range,omitempty"`
	RemoteSecurityGroupID int    `json:"remote_security_group_id,omitempty"`
}

type SecurityGroupRuleService

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

func NewSecurityGroupRuleService

func NewSecurityGroupRuleService(client goclient.Client, securityGroupID int) SecurityGroupRuleService

func (SecurityGroupRuleService) Create

func (SecurityGroupRuleService) Delete

func (s SecurityGroupRuleService) Delete(ctx context.Context, id int) (err error)

func (SecurityGroupRuleService) List

func (SecurityGroupRuleService) Update

type SecurityGroupService

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

func NewSecurityGroupService

func NewSecurityGroupService(client goclient.Client) SecurityGroupService

func (SecurityGroupService) Create

func (s SecurityGroupService) Create(ctx context.Context, body SecurityGroupCreate) (securityGroup SecurityGroup, err error)

func (SecurityGroupService) Delete

func (s SecurityGroupService) Delete(ctx context.Context, id int) (err error)

func (SecurityGroupService) Get added in v0.2.3

func (s SecurityGroupService) Get(ctx context.Context, id int) (securityGroup SecurityGroup, err error)

func (SecurityGroupService) List

func (s SecurityGroupService) List(ctx context.Context, cursor goclient.Cursor) (list SecurityGroupList, err error)

func (SecurityGroupService) Rules

func (s SecurityGroupService) Rules(securityGroupID int) SecurityGroupRuleService

func (SecurityGroupService) Update

func (s SecurityGroupService) Update(ctx context.Context, id int, body SecurityGroupUpdate) (securityGroup SecurityGroup, err error)

type SecurityGroupUpdate

type SecurityGroupUpdate struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type Server

type Server struct {
	ID       int                       `json:"id"`
	Name     string                    `json:"name"`
	Status   ServerStatus              `json:"status"`
	Image    Image                     `json:"image"`
	Product  common.Product            `json:"product"`
	Location common.Location           `json:"location"`
	Networks []ServerNetworkAttachment `json:"networks"`
	KeyPair  KeyPair                   `json:"key_pair"`
}

type ServerAction

type ServerAction struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Command string `json:"command"`
	Sorting int    `json:"sorting"`
}

type ServerCreate

type ServerCreate struct {
	Name             string `json:"name"`
	LocationID       int    `json:"location_id"`
	ImageID          int    `json:"image_id"`
	ProductID        int    `json:"product_id"`
	AttachExternalIP bool   `json:"attach_external_ip"`
	NetworkID        int    `json:"network_id"`
	PrivateIP        string `json:"private_ip,omitempty"`
	KeyPairID        int    `json:"key_pair_id,omitempty"`
	Password         string `json:"password,omitempty"`
	CloudInit        string `json:"cloud_init,omitempty"`
}

type ServerElasticIPService added in v0.2.1

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

func NewServerElasticIPService added in v0.2.1

func NewServerElasticIPService(client goclient.Client, serverID int) ServerElasticIPService

func (ServerElasticIPService) Attach added in v0.2.1

func (s ServerElasticIPService) Attach(ctx context.Context, body ElasticIPAttach) (elasticIP ElasticIP, err error)

func (ServerElasticIPService) Detach added in v0.2.1

func (s ServerElasticIPService) Detach(ctx context.Context, id int) (err error)

func (ServerElasticIPService) List added in v0.2.1

func (s ServerElasticIPService) List(ctx context.Context, cursor goclient.Cursor) (list ElasticIPList, err error)

type ServerList

type ServerList struct {
	Items      []Server
	Pagination goclient.Pagination
}

type ServerNetworkAttachment

type ServerNetworkAttachment struct {
	Network
	Interfaces []AttachedNetworkInterface `json:"network_interfaces"`
}

type ServerPerform

type ServerPerform struct {
	Action string `json:"action"`
}

type ServerService

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

func NewServerService

func NewServerService(client goclient.Client) ServerService

func (ServerService) Create

func (s ServerService) Create(ctx context.Context, body ServerCreate) (ordering common.Ordering, err error)

func (ServerService) Delete

func (s ServerService) Delete(ctx context.Context, id int, deleteElasticIP bool) (err error)

func (ServerService) Get

func (s ServerService) Get(ctx context.Context, id int) (server Server, err error)

func (ServerService) List

func (s ServerService) List(ctx context.Context, cursor goclient.Cursor) (list ServerList, err error)

func (ServerService) NetworkInterfaces

func (s ServerService) NetworkInterfaces(serverID int) NetworkInterfaceService

func (ServerService) Perform

func (s ServerService) Perform(ctx context.Context, id int, body ServerPerform) (server Server, err error)

func (ServerService) Update

func (s ServerService) Update(ctx context.Context, id int, body ServerUpdate) (server Server, err error)

func (ServerService) Upgrade

func (s ServerService) Upgrade(ctx context.Context, id int, body ServerUpgrade) (ordering common.Ordering, err error)

type ServerStatus

type ServerStatus struct {
	ID      int            `json:"id"`
	Name    string         `json:"name"`
	Key     string         `json:"key"`
	Actions []ServerAction `json:"actions"`
}

type ServerUpdate

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

type ServerUpgrade

type ServerUpgrade struct {
	ProductID int `json:"product_id"`
}

type Snapshot

type Snapshot struct {
	ID        int            `json:"id"`
	Name      string         `json:"name"`
	Size      int            `json:"size"`
	Status    SnapshotStatus `json:"status"`
	Volume    Volume         `json:"volume"`
	Product   common.Product `json:"product"`
	CreatedAt common.Time    `json:"created_at"`
}

type SnapshotCreate

type SnapshotCreate struct {
	Name     string `json:"name"`
	VolumeID int    `json:"volume_id"`
}

type SnapshotList

type SnapshotList struct {
	Items      []Snapshot
	Pagination goclient.Pagination
}

type SnapshotService

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

func NewSnapshotService

func NewSnapshotService(client goclient.Client) SnapshotService

func (SnapshotService) Create

func (s SnapshotService) Create(ctx context.Context, body SnapshotCreate) (snapshot Snapshot, err error)

func (SnapshotService) Delete

func (s SnapshotService) Delete(ctx context.Context, id int) (err error)

func (SnapshotService) Get added in v0.0.1

func (s SnapshotService) Get(ctx context.Context, id int) (snapshot Snapshot, err error)

func (SnapshotService) List

func (s SnapshotService) List(ctx context.Context, cursor goclient.Cursor) (list SnapshotList, err error)

func (SnapshotService) Update

func (s SnapshotService) Update(ctx context.Context, id int, body SnapshotUpdate) (snapshot Snapshot, err error)

type SnapshotStatus added in v0.0.1

type SnapshotStatus struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Key  string `json:"key"`
}

type SnapshotUpdate

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

type Volume

type Volume struct {
	ID           int             `json:"id"`
	Product      common.Product  `json:"product"`
	Location     common.Location `json:"location"`
	Status       VolumeStatus    `json:"status"`
	Name         string          `json:"name"`
	Size         int             `json:"size"`
	SerialNumber string          `json:"serial"`
	Snapshots    int             `json:"snapshots"`
	Bootable     bool            `json:"bootable"`
	RootVolume   bool            `json:"root_volume"`
	AttachedTo   Server          `json:"instance"`
	CreatedAt    common.Time     `json:"created_at"`
}

type VolumeAttach

type VolumeAttach struct {
	InstanceID int `json:"instance_id"`
}

type VolumeCreate

type VolumeCreate struct {
	Name       string `json:"name"`
	Size       int    `json:"size"`
	LocationID int    `json:"location_id"`
	SnapshotID int    `json:"snapshot_id,omitempty"`
	InstanceID int    `json:"instance_id,omitempty"`
}

type VolumeExpand

type VolumeExpand struct {
	Size int `json:"size"`
}

type VolumeList

type VolumeList struct {
	Items      []Volume
	Pagination goclient.Pagination
}

type VolumeRevert

type VolumeRevert struct {
	SnapshotID int `json:"snapshot_id"`
}

type VolumeService

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

func NewVolumeService

func NewVolumeService(client goclient.Client) VolumeService

func (VolumeService) Attach

func (v VolumeService) Attach(ctx context.Context, id int, body VolumeAttach) (volume Volume, err error)

func (VolumeService) Create

func (v VolumeService) Create(ctx context.Context, body VolumeCreate) (volume Volume, err error)

func (VolumeService) Delete

func (v VolumeService) Delete(ctx context.Context, id int) (err error)

func (VolumeService) Detach

func (v VolumeService) Detach(ctx context.Context, id int, instanceID int) (err error)

func (VolumeService) Expand

func (v VolumeService) Expand(ctx context.Context, id int, body VolumeExpand) (volume Volume, err error)

func (VolumeService) Get

func (v VolumeService) Get(ctx context.Context, id int) (volume Volume, err error)

func (VolumeService) List

func (v VolumeService) List(ctx context.Context, cursor goclient.Cursor) (list VolumeList, err error)

func (VolumeService) Revert

func (v VolumeService) Revert(ctx context.Context, id int, body VolumeRevert) (volume Volume, err error)

func (VolumeService) Update

func (v VolumeService) Update(ctx context.Context, id int, body VolumeUpdate) (volume Volume, err error)

type VolumeStatus

type VolumeStatus struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Key  string `json:"key"`
}

type VolumeUpdate

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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