Documentation ¶
Index ¶
- type Account
- type AssignedTo
- type AvailableRegions
- type Bandwidth
- type Billing
- type Client
- type ClientOpt
- type Cpus
- type CreateIPAddress
- type CreateProject
- type CreateSSHKey
- type CreateServer
- type Credit
- type DeleteProject
- type DeleteSSHKey
- type DeleteServer
- type ErrorResponse
- type GetIP
- type GetIPS
- type GetImages
- type GetPlans
- type GetProject
- type GetProjects
- type GetSSHKey
- type GetSSHKeys
- type GetServer
- type GetServers
- type GetTeams
- type IPAddresses
- type IPClient
- func (i *IPClient) Create(projectID string, request *CreateIPAddress) (IPAddresses, *Response, error)
- func (i *IPClient) List(projectID string, ipID string) (IPAddresses, *Response, error)
- func (i *IPClient) Remove(projectID string, request *RemoveIPAddress) (IPAddresses, *Response, error)
- func (i *IPClient) Update(projectID string, ipID string, request *UpdateIPAddress) (IPAddresses, *Response, error)
- type IPSClient
- type Images
- type ImagesClient
- type Memory
- type Nics
- type Plans
- type PlansClient
- type PowerState
- type Pricing
- type Pricing2
- type Project
- type ProjectClient
- func (p *ProjectClient) Create(teamID int, request *CreateProject) (Project, *Response, error)
- func (p *ProjectClient) Delete(projectID string, request *DeleteProject) (Project, *Response, error)
- func (p *ProjectClient) List(projectID string) (Project, *Response, error)
- func (p *ProjectClient) Update(projectID string, request *UpdateProject) (Project, *Response, error)
- type Projects
- type ProjectsClient
- type Promo
- type Raid
- type Region
- type RemoveIPAddress
- type Resources
- type Response
- type RoutedTo
- type SSHKey
- type SSHKeyClient
- func (s *SSHKeyClient) Create(request *CreateSSHKey) (SSHKeys, *Response, error)
- func (s *SSHKeyClient) Delete(request *DeleteSSHKey) (SSHKeys, *Response, error)
- func (s *SSHKeyClient) List(sshKeyID string) (SSHKey, *Response, error)
- func (s *SSHKeyClient) Update(sshKeyID string, request *UpdateSSHKey) (SSHKeys, *Response, error)
- type SSHKeys
- type SSHKeysClient
- type Server
- type ServerAction
- type ServerClient
- func (s *ServerClient) Create(projectID string, request *CreateServer) (Server, *Response, error)
- func (s *ServerClient) Delete(request *DeleteServer) (Server, *Response, error)
- func (s *ServerClient) List(serverID string) (Server, *Response, error)
- func (s *ServerClient) PowerOff(serverID string) (Server, *Response, error)
- func (s *ServerClient) PowerOn(serverID string) (Server, *Response, error)
- func (s *ServerClient) PowerState(serverID string) (PowerState, *Response, error)
- func (s *ServerClient) Reboot(serverID string) (Server, *Response, error)
- func (s *ServerClient) Update(serverID string, request *UpdateServer) (Server, *Response, error)
- type Servers
- type ServersClient
- type Specs
- type Storage
- type Teams
- type TeamsClient
- type UpdateIPAddress
- type UpdateProject
- type UpdateSSHKey
- type UpdateServer
- type Vat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Remaining float32 `json:"remaining,omitempty"` Usage float32 `json:"usage,omitempty"` Currency string `json:"currency,omitempty"` }
Account fields
type AssignedTo ¶
type AssignedTo struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Href string `json:"href,omitempty"` Hostname string `json:"hostname,omitempty"` Image string `json:"image,omitempty"` Region Region `json:"region,omitempty"` State string `json:"state,omitempty"` Pricing Pricing `json:"pricing,omitempty"` }
AssignedTo fields
type AvailableRegions ¶
type AvailableRegions struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` RegionIso2 string `json:"region_iso_2,omitempty"` StockQty int `json:"stock_qty,omitempty"` }
AvailableRegions specifies fields for specs
type Billing ¶
type Billing struct { Type string `json:"type,omitempty"` CompanyName string `json:"company_name,ommitempty"` CompanyCode string `json:"company_code,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Address1 string `json:"address_1,omitempty"` Address2 string `json:"address_2,omitempty"` CountryIso2 string `json:"country_iso_2,omitempty"` City string `json:"city,omitempty"` Vat Vat `json:"vat,omitempty"` Currency string `json:"currency,omitempty"` }
Billing fields
type Client ¶
type Client struct { BaseURL *url.URL UserAgent string AuthToken string Teams GetTeams Plans GetPlans Images GetImages Project GetProject Projects GetProjects SSHKeys GetSSHKeys SSHKey GetSSHKey Servers GetServers Server GetServer IPAddresses GetIPS IPAddress GetIP // contains filtered or unexported fields }
Client returns struct for client
func NewClientBase ¶
NewClientBase is for new client base creation
func NewClientWithAuthVar ¶
NewClientWithAuthVar needed for auth without env variable
type ClientOpt ¶
func SetUserAgent ¶
type Cpus ¶
type Cpus struct { Count int `json:"count,omitempty"` Name string `json:"name,omitempty"` Cores int `json:"cores,omitempty"` Frequency float32 `json:"frequency,omitempty"` Unit string `json:"unit,omitempty"` }
Cpus fields
type CreateIPAddress ¶
type CreateIPAddress struct { Type string `json:"type,omitempty"` Region string `json:"region,omitempty"` PtrRecord string `json:"ptr_record,omitempty"` ARecord string `json:"a_record,omitempty"` RoutedTo string `json:"routed_to,omitempty"` AssignedTo string `json:"assigned_to,omitempty"` }
CreateIPAddress fields for adding addition IP address
type CreateProject ¶
type CreateProject struct {
Name string `json:"name,omitempty"`
}
CreateProject fields for adding new project with specified name
type CreateSSHKey ¶
type CreateSSHKey struct { Label string `json:"label,omitempty"` Key string `json:"key,omitempty"` }
CreateSSHKey fields for adding new key with label and raw key
type CreateServer ¶
type CreateServer struct { ProjectID string `json:"project_id,omitempty"` PlanID string `json:"plan_id,omitempty"` Hostname string `json:"hostname,omitempty"` Image string `json:"image,omitempty"` Region string `json:"region,omitempty"` SSHKeys []string `json:"ssh_keys"` IPAddresses []string `json:"ip_addresses"` UserData string `json:"user_data,omitempty"` Tags map[string]string `json:"tags,omitempty"` }
CreateServer fields for ordering new server
type Credit ¶
type Credit struct { Account Account `json:"account,omitempty"` Promo Promo `json:"promo,omitempty"` Resources Resources `json:"resources,omitempty"` }
Credit fields
type DeleteProject ¶
type DeleteProject struct {
ID string `json:"id,omitempty"`
}
DeleteProject fields for key delition by its ID
type DeleteSSHKey ¶
type DeleteSSHKey struct {
ID string `json:"id,omitempty"`
}
DeleteSSHKey fields for key delition by its ID
type DeleteServer ¶
type DeleteServer struct {
ID string `json:"id,omitempty"`
}
DeleteServer field for removing server
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response Errors []string `json:"errors"` SingleError string `json:"error"` }
ErrorResponse fields
type GetIP ¶
type GetIP interface { List(projectID string, ipID string) (IPAddresses, *Response, error) Create(projectID string, request *CreateIPAddress) (IPAddresses, *Response, error) Remove(projectID string, request *RemoveIPAddress) (IPAddresses, *Response, error) Update(projectID string, ipID string, request *UpdateIPAddress) (IPAddresses, *Response, error) }
GetIP interface metodas isgauti team'sus
type GetIPS ¶
type GetIPS interface {
List(projectID string) ([]IPAddresses, *Response, error)
}
GetIPS interface metodas isgauti team'sus
type GetProject ¶
type GetProject interface { List(projectID string) (Project, *Response, error) Create(teamID int, request *CreateProject) (Project, *Response, error) Update(projectID string, request *UpdateProject) (Project, *Response, error) Delete(projectID string, request *DeleteProject) (Project, *Response, error) }
GetProject interface metodas isgauti team'sus
type GetProjects ¶
GetProjects interface metodas isgauti team'sus
type GetSSHKey ¶
type GetSSHKey interface { List(sshKeyID string) (SSHKey, *Response, error) Create(request *CreateSSHKey) (SSHKeys, *Response, error) Delete(request *DeleteSSHKey) (SSHKeys, *Response, error) Update(sshKeyID string, request *UpdateSSHKey) (SSHKeys, *Response, error) }
GetSSHKey interface
type GetSSHKeys ¶
GetSSHKeys interface metodas isgauti team'sus
type GetServer ¶
type GetServer interface { List(serverID string) (Server, *Response, error) PowerOff(serverID string) (Server, *Response, error) PowerOn(serverID string) (Server, *Response, error) Create(projectID string, request *CreateServer) (Server, *Response, error) Delete(request *DeleteServer) (Server, *Response, error) PowerState(serverID string) (PowerState, *Response, error) Reboot(serverID string) (Server, *Response, error) Update(serverID string, request *UpdateServer) (Server, *Response, error) }
GetServer interface metodas isgauti team'sus
type GetServers ¶
GetServers interface metodas isgauti team'sus
type IPAddresses ¶
type IPAddresses struct { ID string `json:"id,omitempty"` Address string `json:"address,omitempty"` AddressFamily int `json:"address_family,omitempty"` Cidr string `json:"cidr,omitempty"` Gateway string `json:"gateway,omitempty"` Type string `json:"type,omitempty"` Region Region `json:"region,omitempty"` RoutedTo RoutedTo `json:"routed_to,omitempty"` AssignedTo AssignedTo `json:"assigned_to,omitempty"` PtrRecord string `json:"ptr_record,omitempty"` ARecord string `json:"a_record,omitempty"` Href string `json:"href,omitempty"` }
IPAddresses fields
type IPClient ¶
type IPClient struct {
// contains filtered or unexported fields
}
IPClient paveldi client
func (*IPClient) Create ¶
func (i *IPClient) Create(projectID string, request *CreateIPAddress) (IPAddresses, *Response, error)
Create function orders new floating IP address
func (*IPClient) Remove ¶
func (i *IPClient) Remove(projectID string, request *RemoveIPAddress) (IPAddresses, *Response, error)
Remove function remove existing floating IP address
func (*IPClient) Update ¶
func (i *IPClient) Update(projectID string, ipID string, request *UpdateIPAddress) (IPAddresses, *Response, error)
Update function updates existing floating IP address
type IPSClient ¶
type IPSClient struct {
// contains filtered or unexported fields
}
IPSClient paveldi client
type Images ¶
type Images struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Pricing []Pricing `json:"pricing,omitempty"` }
Images tai ka grazina api
type ImagesClient ¶
type ImagesClient struct {
// contains filtered or unexported fields
}
ImagesClient paveldi client
type Memory ¶
type Memory struct { Count int `json:"count,omitempty"` Total int `json:"total,omitempty"` Unit string `json:"unit,omitempty"` Name string `json:"name,omitempty"` }
Memory fields
type Plans ¶
type Plans struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Custom bool `json:"custom,omitempty"` Specs Specs `json:"specs,omitempty"` Pricing []Pricing `json:"pricing,omitempty"` AvailableRegions []AvailableRegions `json:"available_regions,omitempty"` }
Plans tai ka grazina api
type PlansClient ¶
type PlansClient struct {
// contains filtered or unexported fields
}
PlansClient paveldi client
type PowerState ¶
type PowerState struct {
Power string `json:"power,omitempty"`
}
PowerState fields
type Pricing ¶
type Pricing struct { Price float32 `json:"price,omitempty"` Taxed bool `json:"taxed,omitempty"` Currency string `json:"currency,omitempty"` Unit string `json:"unit,omitempty"` }
Pricing for resources
type Pricing2 ¶
type Pricing2 struct { Price float32 `json:"price,omitempty"` Currency string `json:"currency,omitempty"` Taxed bool `json:"taxed,omitempty"` Unit string `json:"unit,omitempty"` }
Pricing2 specifies fields for specs
type Project ¶
type Project struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Href string `json:"href,omitempty"` }
Project tai ka grazina api
type ProjectClient ¶
type ProjectClient struct {
// contains filtered or unexported fields
}
ProjectClient paveldi client
func (*ProjectClient) Create ¶
func (p *ProjectClient) Create(teamID int, request *CreateProject) (Project, *Response, error)
Create func will create new Project for specified team
func (*ProjectClient) Delete ¶
func (p *ProjectClient) Delete(projectID string, request *DeleteProject) (Project, *Response, error)
Delete func will delete a project
func (*ProjectClient) List ¶
func (p *ProjectClient) List(projectID string) (Project, *Response, error)
List project
func (*ProjectClient) Update ¶
func (p *ProjectClient) Update(projectID string, request *UpdateProject) (Project, *Response, error)
Update func will update a project
type Projects ¶
type Projects struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Href string `json:"href,omitempty"` }
Projects tai ka grazina api
type ProjectsClient ¶
type ProjectsClient struct {
// contains filtered or unexported fields
}
ProjectsClient paveldi client
type Promo ¶
type Promo struct { Remaining float32 `json:"remaining,omitempty"` Usage float32 `json:"usage,omitempty"` Currency string `json:"currency,omitempty"` }
Promo fields
type Region ¶
type Region struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` RegionIso2 string `json:"region_iso_2,omitempty"` Href string `json:"href,omitempty"` }
Region fields
type RemoveIPAddress ¶
type RemoveIPAddress struct {
ID string `json:"id,omitempty"`
}
RemoveIPAddress fields for removing IP address
type Resources ¶
type Resources struct {
Pricing Pricing `json:"pricing,omitempty"`
}
Resources fields
type RoutedTo ¶
type RoutedTo struct { ID string `json:"id,omitempty"` Address string `json:"address,omitempty"` AddressFamily int `json:"address_family,omitempty"` Cidr string `json:"cidr,omitempty"` Gateway string `json:"gateway,omitempty"` Type string `json:"type,omitempty"` Region Region `json:"region,omitempty"` }
RoutedTo fields
type SSHKey ¶
type SSHKey struct { ID int `json:"id,omitempty"` Label string `json:"label,omitempty"` Key string `json:"key,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` Updated string `json:"updated,omitempty"` Created string `json:"created,omitempty"` Href string `json:"href,omitempty"` }
SSHKey fields for return values after creation
type SSHKeyClient ¶
type SSHKeyClient struct {
// contains filtered or unexported fields
}
SSHKeyClient paveldi client
func (*SSHKeyClient) Create ¶
func (s *SSHKeyClient) Create(request *CreateSSHKey) (SSHKeys, *Response, error)
Create adds new SSH key
func (*SSHKeyClient) Delete ¶
func (s *SSHKeyClient) Delete(request *DeleteSSHKey) (SSHKeys, *Response, error)
Delete removes desired SSH key by its ID
func (*SSHKeyClient) List ¶
func (s *SSHKeyClient) List(sshKeyID string) (SSHKey, *Response, error)
List func lists all available ssh keys
func (*SSHKeyClient) Update ¶
func (s *SSHKeyClient) Update(sshKeyID string, request *UpdateSSHKey) (SSHKeys, *Response, error)
Update function updates keys Label or key itself
type SSHKeys ¶
type SSHKeys struct { ID int `json:"id,omitempty"` Label string `json:"label,omitempty"` Key string `json:"key,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` Updated string `json:"updated,omitempty"` Created string `json:"created,omitempty"` Href string `json:"href,omitempty"` }
SSHKeys fields for return values after creation
type SSHKeysClient ¶
type SSHKeysClient struct {
// contains filtered or unexported fields
}
SSHKeysClient paveldi client
type Server ¶
type Server struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Href string `json:"href,omitempty"` Hostname string `json:"hostname,omitempty"` Image string `json:"image,omitempty"` Region Region `json:"region,omitempty"` State string `json:"state,omitempty"` Plans Plans `json:"plan,omitempty"` AvailableRegions AvailableRegions `json:"availableregions,omitempty"` Pricing Pricing `json:"pricing,omitempty"` IPAddresses []IPAddresses `json:"ip_addresses,omitempty"` SSHKeys []SSHKeys `json:"ssh_keys,omitempty"` Tags map[string]string `json:"tags,omitempty"` }
Server tai ka grazina api
type ServerAction ¶
type ServerAction struct {
Type string `json:"type,omitempty"`
}
ServerAction fields for performed action on server
type ServerClient ¶
type ServerClient struct {
// contains filtered or unexported fields
}
ServerClient paveldi client
func (*ServerClient) Create ¶
func (s *ServerClient) Create(projectID string, request *CreateServer) (Server, *Response, error)
Create function orders new floating IP address
func (*ServerClient) Delete ¶
func (s *ServerClient) Delete(request *DeleteServer) (Server, *Response, error)
Delete removes desired SSH key by its ID
func (*ServerClient) List ¶
func (s *ServerClient) List(serverID string) (Server, *Response, error)
List func lists teams
func (*ServerClient) PowerOff ¶
func (s *ServerClient) PowerOff(serverID string) (Server, *Response, error)
PowerOff function turns server off
func (*ServerClient) PowerOn ¶
func (s *ServerClient) PowerOn(serverID string) (Server, *Response, error)
PowerOn function turns server on
func (*ServerClient) PowerState ¶
func (s *ServerClient) PowerState(serverID string) (PowerState, *Response, error)
PowerState func
func (*ServerClient) Reboot ¶
func (s *ServerClient) Reboot(serverID string) (Server, *Response, error)
Reboot function restarts desired server
func (*ServerClient) Update ¶
func (s *ServerClient) Update(serverID string, request *UpdateServer) (Server, *Response, error)
Update update server with tags
type Servers ¶
type Servers struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Href string `json:"href,omitempty"` Hostname string `json:"hostname,omitempty"` Image string `json:"image,omitempty"` Region Region `json:"region,omitempty"` State string `json:"state,omitempty"` Plans Plans `json:"plan,omitempty"` AvailableRegions AvailableRegions `json:"availableregions,omitempty"` Pricing Pricing `json:"pricing,omitempty"` IPAddresses []IPAddresses `json:"ip_addresses,omitempty"` SSHKeys []SSHKeys `json:"ssh_keys,omitempty"` Tags map[string]string `json:"tags,omitempty"` }
Servers tai ka grazina api
type ServersClient ¶
type ServersClient struct {
// contains filtered or unexported fields
}
ServersClient paveldi client
type Specs ¶
type Specs struct { Cpus Cpus `json:"cpus,omitempty"` Memory Memory `json:"memory,omitempty"` Storage []Storage `json:"storage,omitempty"` Raid Raid `json:"raid,omitempty"` Nics Nics `json:"nics,omitempty"` Bandwidth Bandwidth `json:"bandwidth,omitempty"` }
Specs specifies fields for specs
type Storage ¶
type Storage struct { Count int `json:"count,omitempty"` Name string `json:"name,omitempty"` Size float32 `json:"size,omitempty"` Unit string `json:"unit,omitempty"` }
Storage fields
type Teams ¶
type Teams struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Credit Credit `json:"credit,omitempty"` Billing Billing `json:"billing,omitempty"` Href string `json:"href,omitempty"` }
Teams tai ka grazina api
type TeamsClient ¶
type TeamsClient struct {
// contains filtered or unexported fields
}
TeamsClient paveldi client
type UpdateIPAddress ¶
type UpdateIPAddress struct { PtrRecord string `json:"ptr_record,omitempty"` ARecord string `json:"a_record,omitempty"` RoutedTo string `json:"routed_to,omitempty"` AssignedTo string `json:"assigned_to,omitempty"` }
UpdateIPAddress fields for updating IP address
type UpdateProject ¶
type UpdateProject struct {
Name string `json:"name,omitempty"`
}
UpdateProject fields for updating a project with specified name
type UpdateSSHKey ¶
type UpdateSSHKey struct { Label string `json:"label,omitempty"` Key string `json:"key,omitempty"` }
UpdateSSHKey fields for label or key update
type UpdateServer ¶
UpdateServer fields for updating a server with specified tags