Documentation
¶
Index ¶
- Constants
- type AttachElasticIp
- type AttachedNetworkInterface
- type AuthenticatedUser
- type AuthenticationService
- type Client
- func (c *Client) AddUserAgent(userAgent string)
- func (c *Client) AuthenticationToken(ctx context.Context) (string, error)
- func (c *Client) Do(req *http.Request, val interface{}) (*Response, error)
- func (c *Client) NewRequest(ctx context.Context, method string, path string, body interface{}, ...) (*http.Request, error)
- type ClientError
- type ClientFlag
- type ClientRequestCallback
- type ClientResponseCallback
- type Country
- type CredentialsProvider
- type DeploymentFee
- type ElasticIp
- type ElasticIpCreate
- type ElasticIpProduct
- type ElasticIpService
- type ErrorResponse
- type Id
- type Image
- type ImageService
- type KeyPair
- type KeyPairCreate
- type KeyPairService
- type Links
- type Location
- type LocationService
- type MemoryTokenStorage
- type Module
- type ModuleService
- type Network
- type NetworkInterface
- type NetworkInterfaceCreate
- type NetworkInterfaceService
- type NetworkService
- type Order
- type OrderService
- type OrderStatus
- type Ordering
- type Organization
- type OrganizationService
- type Pagination
- type PaginationOptions
- type Product
- type ProductAvailability
- type ProductItem
- type ProductService
- type ProductType
- type ProductUsageCycle
- type Response
- type SecurityGroup
- type Server
- type ServerAction
- type ServerAttachmentService
- type ServerCreate
- type ServerNetworkAttachment
- type ServerService
- type ServerStatus
- type TokenStorage
- type User
Constants ¶
View Source
const ( VersionMajor = 1 VersionMinor = 0 VersionPatch = 0 FlagNoAuthentication ClientFlag = 1 ErrorMissingCredentials = ClientError("missing credentials provider for authenticated request") ErrorUnsupportedContentType = ClientError("received unsupported content type") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttachElasticIp ¶
type AuthenticatedUser ¶
type AuthenticationService ¶
type Client ¶
type Client struct {
Base *url.URL
UserAgent string
SelectedOrganization Id
Flags ClientFlag
Client *http.Client
CredentialsProvider CredentialsProvider
TokenStorage TokenStorage
OnRequest ClientRequestCallback
OnResponse ClientResponseCallback
// General entities
Organization OrganizationService
Product ProductService
Location LocationService
Module ModuleService
Image ImageService
// Compute
Server ServerService
ServerAttachment ServerAttachmentService
KeyPair KeyPairService
Network NetworkService
ElasticIp ElasticIpService
// Other
Authentication AuthenticationService
Order OrderService
}
func (*Client) AddUserAgent ¶
func (*Client) AuthenticationToken ¶
type ClientError ¶
type ClientError string
func (ClientError) Error ¶
func (e ClientError) Error() string
type ClientFlag ¶
type ClientFlag uint
type ClientRequestCallback ¶
type ClientResponseCallback ¶
type CredentialsProvider ¶
type DeploymentFee ¶
type ElasticIp ¶
type ElasticIpCreate ¶
type ElasticIpCreate struct {
LocationId Id `json:"location_id"`
}
type ElasticIpProduct ¶
type ElasticIpService ¶
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type Image ¶
type Image struct {
Id Id `json:"id"`
OperatingSystem string `json:"os"`
Version string `json:"version"`
Key string `json:"key"`
Category string `json:"category"`
Type string `json:"type"`
MinRootDiskSize int `json:"min_root_disk_size"`
Sorting int `json:"sorting"`
RequiredLicenses []*Product `json:"required_licenses"`
AvailableLocations []Id `json:"available_locations"`
}
func (*Image) AvailableAt ¶
type ImageService ¶
type KeyPair ¶
type KeyPairCreate ¶
type KeyPairService ¶
type Location ¶
type LocationService ¶
type MemoryTokenStorage ¶
type MemoryTokenStorage struct {
// contains filtered or unexported fields
}
func (*MemoryTokenStorage) IsValid ¶
func (t *MemoryTokenStorage) IsValid() bool
func (*MemoryTokenStorage) SetToken ¶
func (t *MemoryTokenStorage) SetToken(token string)
func (*MemoryTokenStorage) Token ¶
func (t *MemoryTokenStorage) Token() string
type Module ¶
type Module struct {
Id Id `json:"id"`
Name string `json:"name"`
Parent *Module `json:"parent"`
Sorting int `json:"sorting"`
Locations []*Location `json:"locations"`
}
func (*Module) AvailableAt ¶
type ModuleService ¶
type Network ¶
type Network struct {
Id Id `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Cidr string `json:"cidr"`
Location 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 NetworkInterface ¶
type NetworkInterface struct {
Id Id `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 NetworkInterfaceService ¶
type NetworkInterfaceService interface {
List(ctx context.Context, options PaginationOptions) ([]*NetworkInterface, *Response, error)
Create(ctx context.Context, data *NetworkInterfaceCreate) (*NetworkInterface, *Response, error)
Delete(ctx context.Context, id Id) (*Response, error)
}
type NetworkService ¶
type NetworkService interface {
List(ctx context.Context, options PaginationOptions) ([]*Network, *Response, error)
Get(ctx context.Context, id Id) (*Network, *Response, error)
Create(ctx context.Context, data *KeyPairCreate) (*Network, *Response, error)
Delete(ctx context.Context, id Id) (*Response, error)
}
type Order ¶
type Order struct {
Id Id `json:"id"`
Status OrderStatus `json:"status"`
}
type OrderService ¶
type OrderStatus ¶
type Organization ¶
type Organization struct {
Id Id `json:"id"`
Name string `json:"name"`
Address string `json:"address"`
Zip string `json:"zip"`
City string `json:"city"`
PhoneNumber string `json:"phone_number"`
InvoiceDeploymentFees bool `json:"invoice_deployment_fees"`
CreatedAt time.Time `json:"created_at"`
Status struct {
Id Id `json:"id"`
Name string `json:"name"`
RetentionTime *time.Time `json:"retention_time"`
} `json:"status"`
RegisteredModules []*Module `json:"registered_modules"`
Contacts struct {
Primary *User `json:"primary"`
Billing *User `json:"billing"`
Technical []User `json:"technical"`
} `json:"contacts"`
}
type OrganizationService ¶
type OrganizationService interface {
List(ctx context.Context, options PaginationOptions) ([]*Organization, *Response, error)
Get(ctx context.Context, id Id) (*Organization, *Response, error)
GetCurrent(ctx context.Context) (*Organization, *Response, error)
}
type Pagination ¶
type PaginationOptions ¶
type Product ¶
type Product struct {
Id Id `json:"id"`
Name string `json:"product_name"`
Type ProductType `json:"type"`
Visibility string `json:"visibility"`
UsageCycle ProductUsageCycle `json:"usage_cycle"`
Items []*ProductItem `json:"items"`
Price float64 `json:"price"`
Availability []ProductAvailability `json:"availability"`
Category string `json:"category"`
DeploymentFees []*DeploymentFee `json:"deployment_fees"`
}
func (*Product) AvailableAt ¶
func (*Product) FindItem ¶
func (p *Product) FindItem(id Id) *ProductItem
type ProductAvailability ¶
type ProductItem ¶
type ProductService ¶
type ProductType ¶
type ProductUsageCycle ¶
type Response ¶
type Response struct {
*http.Response
Pagination
}
type SecurityGroup ¶
type Server ¶
type Server struct {
Id Id `json:"id"`
Name string `json:"name"`
Status ServerStatus `json:"status"`
Image Image `json:"image"`
Product Product `json:"product"`
Location Location `json:"location"`
Networks []*ServerNetworkAttachment `json:"networks"`
KeyPair KeyPair `json:"key_pair"`
}
type ServerAction ¶
type ServerAttachmentService ¶
type ServerAttachmentService interface {
ListAttachedElasticIps(ctx context.Context, server Id, options PaginationOptions) ([]*ElasticIp, *Response, error)
AttachElasticIp(ctx context.Context, server Id, data *AttachElasticIp) (*ElasticIp, *Response, error)
DetachElasticIp(ctx context.Context, server Id, elasticIp Id) (*Response, error)
}
type ServerCreate ¶
type ServerCreate struct {
Name string `json:"name"`
LocationId Id `json:"location_id"`
ImageId Id `json:"image_id"`
ProductId Id `json:"product_id"`
AttachExternalIp bool `json:"attach_external_ip"`
NetworkId Id `json:"network_id"`
PrivateIp string `json:"private_ip,omitempty"`
KeyPairId Id `json:"key_pair_id,omitempty"`
Password string `json:"password,omitempty"`
CloudInit string `json:"cloud_init,omitempty"`
}
type ServerNetworkAttachment ¶
type ServerNetworkAttachment struct {
Network
Interfaces []AttachedNetworkInterface `json:"network_interfaces"`
}
type ServerService ¶
type ServerService interface {
List(ctx context.Context, options PaginationOptions) ([]*Server, *Response, error)
Get(ctx context.Context, id Id) (*Server, *Response, error)
Create(ctx context.Context, data *ServerCreate) (*Ordering, *Response, error)
Update(ctx context.Context, id Id) (*Server, *Response, error)
Delete(ctx context.Context, id Id) (*Response, error)
RunAction(ctx context.Context, id Id, command string) (*Server, *Response, error)
}
type ServerStatus ¶
type ServerStatus struct {
Id Id `json:"id"`
Name string `json:"name"`
Key string `json:"key"`
Actions []ServerAction `json:"actions"`
}
type TokenStorage ¶
type User ¶
type User struct {
Id uint `json:"id"`
Username string `json:"username"`
FirstName string `json:"firstname"`
LastName string `json:"lastname"`
PhoneNumber string `json:"phone_number"`
AssignedOrganizations []*Organization `json:"assigned_organizations"`
DefaultOrganization *Organization `json:"default_organization"`
}
Click to show internal directories.
Click to hide internal directories.