Documentation ¶
Index ¶
- type AssignIPAddress
- type AssignedTo
- type AttachTo
- type AttachedTo
- type AvailableRegions
- type BGPRoute
- type BMC
- type BackupMethod
- type BackupStorage
- type BackupStoragePlan
- type BackupsClient
- func (s *BackupsClient) Create(request *CreateBackup) (BackupStorage, *Response, error)
- func (s *BackupsClient) Delete(backupID int) (*Response, error)
- func (s *BackupsClient) Get(backupID int, opts *GetOptions) (BackupStorage, *Response, error)
- func (s *BackupsClient) ListBackups(projectID int, opts *GetOptions) ([]BackupStorage, *Response, error)
- func (s *BackupsClient) ListPlans(opts *GetOptions) ([]BackupStoragePlan, *Response, error)
- func (s *BackupsClient) Update(request *UpdateBackupStorage) (BackupStorage, *Response, error)
- func (s *BackupsClient) UpdateBackupMethod(request *UpdateBackupMethod) ([]BackupMethod, *Response, error)
- type BackupsService
- type Bandwidth
- type Billing
- type BlockStorage
- type Client
- type ClientOpt
- type Cpus
- type CreateBackup
- type CreateIPAddress
- type CreateProject
- type CreateSSHKey
- type CreateServer
- type CreateStorage
- type CreateTeam
- type Credit
- type CreditDetails
- type EnabledMethods
- type ErrorResponse
- type GetOptions
- type IPAddress
- type IPsClient
- func (i *IPsClient) Assign(ipID string, request *AssignIPAddress) (IPAddress, *Response, error)
- func (i *IPsClient) Create(projectID int, request *CreateIPAddress) (IPAddress, *Response, error)
- func (i *IPsClient) Get(ipID string, opts *GetOptions) (IPAddress, *Response, error)
- func (i *IPsClient) List(projectID int, opts *GetOptions) ([]IPAddress, *Response, error)
- func (i *IPsClient) Remove(ipID string) (*Response, error)
- func (i *IPsClient) Unassign(ipID string) (*Response, error)
- func (i *IPsClient) Update(ipID string, request *UpdateIPAddress) (IPAddress, *Response, error)
- type Image
- type ImagesClient
- type ImagesService
- type IpAddressesService
- type Membership
- type Memory
- type Meta
- type Nics
- type Plan
- type PlansClient
- type PlansService
- type PowerState
- type Pricing
- type Project
- type ProjectBGP
- type ProjectsClient
- func (p *ProjectsClient) Create(teamID int, request *CreateProject) (Project, *Response, error)
- func (p *ProjectsClient) Delete(projectID int) (*Response, error)
- func (p *ProjectsClient) Get(projectID int, opts *GetOptions) (Project, *Response, error)
- func (p *ProjectsClient) List(teamID int, opts *GetOptions) ([]Project, *Response, error)
- func (p *ProjectsClient) ListSSHKeys(projectID int, opts *GetOptions) ([]SSHKey, *Response, error)
- func (p *ProjectsClient) Update(projectID int, request *UpdateProject) (Project, *Response, error)
- type ProjectsService
- type Raid
- type Region
- type RegionBGP
- type RegionsClient
- type RegionsService
- type ReinstallServer
- type ReinstallServerFields
- type RemainingTime
- type Resources
- type Response
- type RoutedTo
- type Rule
- type SSHKey
- type SSHKeysClient
- func (s *SSHKeysClient) Create(request *CreateSSHKey) (SSHKey, *Response, error)
- func (s *SSHKeysClient) Delete(sshKeyID int) (SSHKey, *Response, error)
- func (s *SSHKeysClient) Get(sshKeyID int, opts *GetOptions) (SSHKey, *Response, error)
- func (s *SSHKeysClient) List(opts *GetOptions) ([]SSHKey, *Response, error)
- func (s *SSHKeysClient) Update(sshKeyID int, request *UpdateSSHKey) (SSHKey, *Response, error)
- type SSHKeysService
- type Server
- type ServerAction
- type ServerBGP
- type ServersClient
- func (s *ServersClient) Create(request *CreateServer) (Server, *Response, error)
- func (s *ServersClient) Delete(serverID int) (Server, *Response, error)
- func (s *ServersClient) Get(serverID int, opts *GetOptions) (Server, *Response, error)
- func (s *ServersClient) List(projectID int, opts *GetOptions) ([]Server, *Response, error)
- func (s *ServersClient) ListSSHKeys(serverID int, opts *GetOptions) ([]SSHKey, *Response, error)
- func (s *ServersClient) PowerOff(serverID int) (Server, *Response, error)
- func (s *ServersClient) PowerOn(serverID int) (Server, *Response, error)
- func (s *ServersClient) PowerState(serverID int) (PowerState, *Response, error)
- func (s *ServersClient) Reboot(serverID int) (Server, *Response, error)
- func (s *ServersClient) Reinstall(serverID int, fields *ReinstallServerFields) (Server, *Response, error)
- func (s *ServersClient) ResetBMCPassword(serverID int) (Server, *Response, error)
- func (s *ServersClient) Update(serverID int, request *UpdateServer) (Server, *Response, error)
- type ServersService
- type Specs
- type Storage
- type StorageClient
- type StoragesClient
- func (s *StoragesClient) Attach(request *AttachTo) (BlockStorage, *Response, error)
- func (s *StoragesClient) Create(request *CreateStorage) (BlockStorage, *Response, error)
- func (s *StoragesClient) Delete(storageID int) (*Response, error)
- func (s *StoragesClient) Detach(storageID int) (*Response, error)
- func (s *StoragesClient) Get(storageID int, opts *GetOptions) (BlockStorage, *Response, error)
- func (c *StoragesClient) List(projectID int, opts *GetOptions) ([]BlockStorage, *Response, error)
- func (s *StoragesClient) Update(request *UpdateStorage) (BlockStorage, *Response, error)
- type StoragesService
- type Team
- type TeamsClient
- func (p *TeamsClient) Create(request *CreateTeam) (Team, *Response, error)
- func (p *TeamsClient) Delete(teamID int) (*Response, error)
- func (p *TeamsClient) Get(teamID int, opts *GetOptions) (Team, *Response, error)
- func (t *TeamsClient) List(opts *GetOptions) ([]Team, *Response, error)
- func (p *TeamsClient) Update(teamID int, request *UpdateTeam) (Team, *Response, error)
- type TeamsService
- type UpdateBackupMethod
- type UpdateBackupStorage
- type UpdateIPAddress
- type UpdateProject
- type UpdateSSHKey
- type UpdateServer
- type UpdateStorage
- type UpdateTeam
- type User
- type UsersClient
- type UsersService
- type Vat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssignIPAddress ¶
type AssignIPAddress struct { ServerID int `json:"targeted_to,omitempty"` IpID string `json:"routed_to,omitempty"` }
Subnet type IP addresses can be only assigned to a server. Floating IP address can be assigned directly to a server or routed to subnet type IP address.
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 AttachedTo ¶
type AvailableRegions ¶
type BackupMethod ¶ added in v3.1.0
type BackupMethod struct { Name string `json:"name,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Port int `json:"port,omitempty"` Host string `json:"host,omitempty"` SSHKey string `json:"ssh_key,omitempty"` WhiteList []string `json:"whitelist,omitempty"` Enabled bool `json:"enabled,omitempty"` Processing bool `json:"processing,omitempty"` }
type BackupStorage ¶ added in v3.1.0
type BackupStorage struct { ID int `json:"id,omitempty"` Status string `json:"status,omitempty"` State string `json:"state,omitempty"` PrivateIP string `json:"private_ip,omitempty"` PublicIP string `json:"public_ip,omitempty"` SizeGigabytes int `json:"size_gigabytes,omitempty"` UsedGigabytes int `json:"used_gigabytes,omitempty"` AttachedTo AttachedTo `json:"attached_to,omitempty"` Methods []BackupMethod `json:"methods,omitempty"` AvailableIPAddresses []IPAddress `json:"available_addresses,omitempty"` Rules []Rule `json:"rules,omitempty"` Plan Plan `json:"plan,omitempty"` Pricing Pricing `json:"pricing,omitempty"` Region Region `json:"region,omitempty"` Href string `json:"href,omitempty"` }
type BackupStoragePlan ¶ added in v3.1.0
type BackupStoragePlan struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Slug string `json:"slug,omitempty"` SizeGigabytes int `json:"size_gigabytes,omitempty"` Pricing []Pricing `json:"pricing,omitempty"` Regions []Region `json:"regions,omitempty"` Href string `json:"href,omitempty"` }
type BackupsClient ¶ added in v3.1.0
type BackupsClient struct {
// contains filtered or unexported fields
}
func (*BackupsClient) Create ¶ added in v3.1.0
func (s *BackupsClient) Create(request *CreateBackup) (BackupStorage, *Response, error)
func (*BackupsClient) Delete ¶ added in v3.1.0
func (s *BackupsClient) Delete(backupID int) (*Response, error)
func (*BackupsClient) Get ¶ added in v3.1.0
func (s *BackupsClient) Get(backupID int, opts *GetOptions) (BackupStorage, *Response, error)
func (*BackupsClient) ListBackups ¶ added in v3.1.0
func (s *BackupsClient) ListBackups(projectID int, opts *GetOptions) ([]BackupStorage, *Response, error)
func (*BackupsClient) ListPlans ¶ added in v3.1.0
func (s *BackupsClient) ListPlans(opts *GetOptions) ([]BackupStoragePlan, *Response, error)
func (*BackupsClient) Update ¶ added in v3.1.0
func (s *BackupsClient) Update(request *UpdateBackupStorage) (BackupStorage, *Response, error)
func (*BackupsClient) UpdateBackupMethod ¶ added in v3.1.0
func (s *BackupsClient) UpdateBackupMethod(request *UpdateBackupMethod) ([]BackupMethod, *Response, error)
type BackupsService ¶ added in v3.1.0
type BackupsService interface { ListPlans(opts *GetOptions) ([]BackupStoragePlan, *Response, error) ListBackups(projectID int, opts *GetOptions) ([]BackupStorage, *Response, error) Get(backupID int, opts *GetOptions) (BackupStorage, *Response, error) Create(request *CreateBackup) (BackupStorage, *Response, error) Update(request *UpdateBackupStorage) (BackupStorage, *Response, error) UpdateBackupMethod(request *UpdateBackupMethod) ([]BackupMethod, *Response, error) Delete(backupID int) (*Response, error) }
type Billing ¶
type Billing struct { Type string `json:"type,omitempty"` CompanyName string `json:"company_name,omitempty"` 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"` }
type BlockStorage ¶
type BlockStorage struct { ID int `json:"id"` Name string `json:"name"` Href string `json:"href"` Size int `json:"size"` AllowEditSize bool `json:"allow_edit_size"` Unit string `json:"unit"` Description string `json:"description,omitempty"` AttachedTo AttachedTo `json:"attached_to,omitempty"` VlanID string `json:"vlan_id"` VlanIP string `json:"vlan_ip"` Initiator string `json:"initiator"` DiscoveryIP string `json:"discovery_ip"` Region Region `json:"region"` }
type Client ¶
type Client struct { BaseURL *url.URL UserAgent string AuthToken string Teams TeamsService Plans PlansService Images ImagesService Projects ProjectsService SSHKeys SSHKeysService Servers ServersService IPAddresses IpAddressesService Storages StoragesService Regions RegionsService Users UsersService Backups BackupsService // contains filtered or unexported fields }
Client returns struct for client
type ClientOpt ¶
type ClientOpt func(*options) error
func WithAuthToken ¶
WithAuthToken use provided auth token to make requests, defaults to environment variable CHERRY_AUTH_TOKEN
func WithHTTPClient ¶
WithHTTPClient use client as the http.Client to make API requests
func WithUserAgent ¶
WithUserAgent set user agent when making requests
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 CreateBackup ¶ added in v3.1.0
type CreateIPAddress ¶
type CreateIPAddress struct { 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"` TargetedTo string `json:"targeted_to,omitempty"` Tags *map[string]string `json:"tags,omitempty"` DDoSScrubbing bool `json:"ddos_scrubbing,omitempty"` }
CreateIPAddress fields for adding addition IP address
type CreateProject ¶
CreateProject fields for adding new project with specified name
type CreateSSHKey ¶
CreateSSHKey fields for adding new key with label and raw key
type CreateServer ¶
type CreateServer struct { ProjectID int `json:"project_id"` Plan string `json:"plan"` Hostname string `json:"hostname,omitempty"` Image string `json:"image,omitempty"` Region string `json:"region"` SSHKeys []string `json:"ssh_keys,omitempty"` IPAddresses []string `json:"ip_addresses,omitempty"` UserData string `json:"user_data,omitempty"` Tags *map[string]string `json:"tags,omitempty"` SpotInstance bool `json:"spot_market"` OSPartitionSize int `json:"os_partition_size,omitempty"` }
CreateServer fields for ordering new server
type CreateStorage ¶
type CreateTeam ¶
type Credit ¶
type Credit struct { Account CreditDetails `json:"account,omitempty"` Promo CreditDetails `json:"promo,omitempty"` Resources Resources `json:"resources,omitempty"` }
type CreditDetails ¶
type EnabledMethods ¶ added in v3.1.0
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response Errors []string `json:"errors"` SingleError string `json:"error"` }
ErrorResponse fields
type GetOptions ¶
type GetOptions struct { Fields []string `url:"fields,omitempty,comma"` Limit int `url:"limit,omitempty"` Offset int `url:"offset,omitempty"` Type []string `url:"type,ommitempty"` Status []string `url:"status,ommitempty"` // QueryParams for API URL, used for arbitrary filters QueryParams map[string]string `url:"-"` }
func (*GetOptions) Encode ¶
func (g *GetOptions) Encode() string
func (*GetOptions) WithQuery ¶
func (g *GetOptions) WithQuery(apiPath string) string
type IPAddress ¶
type IPAddress 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"` TargetedTo AssignedTo `json:"targeted_to,omitempty"` Project Project `json:"project,omitempty"` PtrRecord string `json:"ptr_record,omitempty"` ARecord string `json:"a_record,omitempty"` Tags *map[string]string `json:"tags,omitempty"` DDoSScrubbing bool `json:"ddos_scrubbing,omitempty"` Href string `json:"href,omitempty"` }
IPAddresses fields
type IPsClient ¶
type IPsClient struct {
// contains filtered or unexported fields
}
IPClient paveldi client
type ImagesClient ¶
type ImagesClient struct {
// contains filtered or unexported fields
}
func (*ImagesClient) List ¶
func (i *ImagesClient) List(plan string, opts *GetOptions) ([]Image, *Response, error)
List func lists images
type ImagesService ¶
type ImagesService interface {
List(plan string, opts *GetOptions) ([]Image, *Response, error)
}
ImagesService is an interface for interfacing with the the Images endpoints of the CherryServers API See: https://api.cherryservers.com/doc/#tag/Images
type IpAddressesService ¶
type IpAddressesService interface { List(projectID int, opts *GetOptions) ([]IPAddress, *Response, error) Get(ipID string, opts *GetOptions) (IPAddress, *Response, error) Create(projectID int, request *CreateIPAddress) (IPAddress, *Response, error) Remove(ipID string) (*Response, error) Update(ipID string, request *UpdateIPAddress) (IPAddress, *Response, error) Assign(ipID string, request *AssignIPAddress) (IPAddress, *Response, error) Unassign(ipID string) (*Response, error) }
IpAddressesService is an interface for interfacing with the the Server endpoints of the CherryServers API See: https://api.cherryservers.com/doc/#tag/Ip-Addresses
type Membership ¶ added in v3.0.1
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 Plan ¶
type Plan struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Slug string `json:"slug,omitempty"` Custom bool `json:"custom,omitempty"` Type string `json:"type,omitempty"` Specs Specs `json:"specs,omitempty"` Pricing []Pricing `json:"pricing,omitempty"` AvailableRegions []AvailableRegions `json:"available_regions,omitempty"` }
type PlansClient ¶
type PlansClient struct {
// contains filtered or unexported fields
}
func (*PlansClient) List ¶
func (p *PlansClient) List(teamID int, opts *GetOptions) ([]Plan, *Response, error)
List func lists plans
type PlansService ¶
type PlansService interface {
List(teamID int, opts *GetOptions) ([]Plan, *Response, error)
}
PlansService is an interface for interfacing with the Plan endpoints of the CherryServers API See: https://api.cherryservers.com/doc/#tag/Plans
type Project ¶
type Project struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Bgp ProjectBGP `json:"bgp,omitempty"` Href string `json:"href,omitempty"` }
type ProjectBGP ¶
type ProjectsClient ¶
type ProjectsClient struct {
// contains filtered or unexported fields
}
func (*ProjectsClient) Create ¶
func (p *ProjectsClient) Create(teamID int, request *CreateProject) (Project, *Response, error)
Create func will create new Project for specified team
func (*ProjectsClient) Delete ¶
func (p *ProjectsClient) Delete(projectID int) (*Response, error)
Delete func will delete a project
func (*ProjectsClient) Get ¶
func (p *ProjectsClient) Get(projectID int, opts *GetOptions) (Project, *Response, error)
func (*ProjectsClient) List ¶
func (p *ProjectsClient) List(teamID int, opts *GetOptions) ([]Project, *Response, error)
List func lists projects
func (*ProjectsClient) ListSSHKeys ¶
func (p *ProjectsClient) ListSSHKeys(projectID int, opts *GetOptions) ([]SSHKey, *Response, error)
func (*ProjectsClient) Update ¶
func (p *ProjectsClient) Update(projectID int, request *UpdateProject) (Project, *Response, error)
Update func will update a project
type ProjectsService ¶
type ProjectsService interface { List(teamID int, opts *GetOptions) ([]Project, *Response, error) Get(projectID int, opts *GetOptions) (Project, *Response, error) Create(teamID int, request *CreateProject) (Project, *Response, error) Update(projectID int, request *UpdateProject) (Project, *Response, error) ListSSHKeys(projectID int, opts *GetOptions) ([]SSHKey, *Response, error) Delete(projectID int) (*Response, error) }
ProjectsService is an interface for interfacing with the Projects endpoints of the CherryServers API See: https://api.cherryservers.com/doc/#tag/Projects
type Region ¶
type Region struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Slug string `json:"slug,omitempty"` RegionIso2 string `json:"region_iso_2,omitempty"` BGP RegionBGP `json:"bgp,omitempty"` Location string `json:"location,omitempty"` Href string `json:"href,omitempty"` }
Region fields
type RegionsClient ¶
type RegionsClient struct {
// contains filtered or unexported fields
}
func (*RegionsClient) Get ¶
func (i *RegionsClient) Get(region string, opts *GetOptions) (Region, *Response, error)
func (*RegionsClient) List ¶
func (i *RegionsClient) List(opts *GetOptions) ([]Region, *Response, error)
type RegionsService ¶
type RegionsService interface { List(opts *GetOptions) ([]Region, *Response, error) Get(region string, opts *GetOptions) (Region, *Response, error) }
RegionsService is an interface for interfacing with the the Images endpoints of the CherryServers API See: https://api.cherryservers.com/doc/#tag/Regions
type ReinstallServer ¶
type ReinstallServer struct { ServerAction *ReinstallServerFields }
type ReinstallServerFields ¶
type RemainingTime ¶ added in v3.0.1
type Resources ¶
type Resources struct { Pricing Pricing `json:"pricing,omitempty"` Remaining RemainingTime `json:"remaining,omitempty"` }
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 Rule ¶ added in v3.1.0
type Rule struct { IPAddress IPAddress `json:"ip,omitempty"` EnabledMethods EnabledMethods `json:"methods,omitempty"` }
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"` User User `json:"user,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
}
func (*SSHKeysClient) Create ¶
func (s *SSHKeysClient) Create(request *CreateSSHKey) (SSHKey, *Response, error)
Create adds new SSH key
func (*SSHKeysClient) Delete ¶
func (s *SSHKeysClient) Delete(sshKeyID int) (SSHKey, *Response, error)
Delete removes desired SSH key by its ID
func (*SSHKeysClient) Get ¶
func (s *SSHKeysClient) Get(sshKeyID int, opts *GetOptions) (SSHKey, *Response, error)
func (*SSHKeysClient) List ¶
func (s *SSHKeysClient) List(opts *GetOptions) ([]SSHKey, *Response, error)
List all available ssh keys
func (*SSHKeysClient) Update ¶
func (s *SSHKeysClient) Update(sshKeyID int, request *UpdateSSHKey) (SSHKey, *Response, error)
Update function updates keys Label or key itself
type SSHKeysService ¶
type SSHKeysService interface { List(opts *GetOptions) ([]SSHKey, *Response, error) Get(sshKeyID int, opts *GetOptions) (SSHKey, *Response, error) Create(request *CreateSSHKey) (SSHKey, *Response, error) Delete(sshKeyID int) (SSHKey, *Response, error) Update(sshKeyID int, request *UpdateSSHKey) (SSHKey, *Response, error) }
SSHKeysService is an interface for interfacing with the the SSH keys endpoints of the CherryServers API See: https://api.cherryservers.com/doc/#tag/SshKeys
type Server ¶
type Server struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Href string `json:"href,omitempty"` BMC BMC `json:"bmc,omitempty"` Hostname string `json:"hostname,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password"` Image string `json:"image,omitempty"` SpotInstance bool `json:"spot_instance"` BGP ServerBGP `json:"bgp,omitempty"` Project Project `json:"project,omitempty"` Region Region `json:"region,omitempty"` State string `json:"state,omitempty"` Plan Plan `json:"plan,omitempty"` AvailableRegions AvailableRegions `json:"availableregions,omitempty"` Pricing Pricing `json:"pricing,omitempty"` IPAddresses []IPAddress `json:"ip_addresses,omitempty"` SSHKeys []SSHKey `json:"ssh_keys,omitempty"` Tags map[string]string `json:"tags,omitempty"` Storage BlockStorage `json:"storage,omitempty"` Backup BackupStorage `json:"backup_storage,omitempty"` Created string `json:"created_at,omitempty"` TerminationDate string `json:"termination_date,omitempty"` }
Server response object
type ServerAction ¶
type ServerAction struct {
Type string `json:"type"`
}
ServerAction fields for performed action on server
type ServerBGP ¶
type ServerBGP struct { Enabled bool `json:"enabled"` Available bool `json:"available,omitempty"` Status string `json:"status,omitempty"` Routers int `json:"routers,omitempty"` Connected int `json:"connected,omitempty"` Limit int `json:"limit,omitempty"` Active int `json:"active,omitempty"` Routes []BGPRoute `json:"routes,omitempty"` Updated string `json:"updated,omitempty"` }
type ServersClient ¶
type ServersClient struct {
// contains filtered or unexported fields
}
func (*ServersClient) Create ¶
func (s *ServersClient) Create(request *CreateServer) (Server, *Response, error)
func (*ServersClient) Delete ¶
func (s *ServersClient) Delete(serverID int) (Server, *Response, error)
func (*ServersClient) Get ¶
func (s *ServersClient) Get(serverID int, opts *GetOptions) (Server, *Response, error)
func (*ServersClient) List ¶
func (s *ServersClient) List(projectID int, opts *GetOptions) ([]Server, *Response, error)
List func lists teams
func (*ServersClient) ListSSHKeys ¶
func (s *ServersClient) ListSSHKeys(serverID int, opts *GetOptions) ([]SSHKey, *Response, error)
func (*ServersClient) PowerOff ¶
func (s *ServersClient) PowerOff(serverID int) (Server, *Response, error)
PowerOff function turns server off
func (*ServersClient) PowerOn ¶
func (s *ServersClient) PowerOn(serverID int) (Server, *Response, error)
PowerOn function turns server on
func (*ServersClient) PowerState ¶
func (s *ServersClient) PowerState(serverID int) (PowerState, *Response, error)
func (*ServersClient) Reboot ¶
func (s *ServersClient) Reboot(serverID int) (Server, *Response, error)
Reboot function restarts desired server
func (*ServersClient) Reinstall ¶
func (s *ServersClient) Reinstall(serverID int, fields *ReinstallServerFields) (Server, *Response, error)
func (*ServersClient) ResetBMCPassword ¶ added in v3.2.0
func (s *ServersClient) ResetBMCPassword(serverID int) (Server, *Response, error)
func (*ServersClient) Update ¶
func (s *ServersClient) Update(serverID int, request *UpdateServer) (Server, *Response, error)
type ServersService ¶
type ServersService interface { List(projectID int, opts *GetOptions) ([]Server, *Response, error) Get(serverID int, opts *GetOptions) (Server, *Response, error) PowerOff(serverID int) (Server, *Response, error) PowerOn(serverID int) (Server, *Response, error) Create(request *CreateServer) (Server, *Response, error) Delete(serverID int) (Server, *Response, error) PowerState(serverID int) (PowerState, *Response, error) Reboot(serverID int) (Server, *Response, error) Update(serverID int, request *UpdateServer) (Server, *Response, error) Reinstall(serverID int, fields *ReinstallServerFields) (Server, *Response, error) ListSSHKeys(serverID int, opts *GetOptions) ([]SSHKey, *Response, error) ResetBMCPassword(serverID int) (Server, *Response, error) }
ServersService is an interface for interfacing with the the Server endpoints of the CherryServers API See: https://api.cherryservers.com/doc/#tag/Servers
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 StorageClient ¶
type StorageClient struct {
// contains filtered or unexported fields
}
type StoragesClient ¶
type StoragesClient struct {
// contains filtered or unexported fields
}
func (*StoragesClient) Attach ¶
func (s *StoragesClient) Attach(request *AttachTo) (BlockStorage, *Response, error)
func (*StoragesClient) Create ¶
func (s *StoragesClient) Create(request *CreateStorage) (BlockStorage, *Response, error)
func (*StoragesClient) Get ¶
func (s *StoragesClient) Get(storageID int, opts *GetOptions) (BlockStorage, *Response, error)
func (*StoragesClient) List ¶
func (c *StoragesClient) List(projectID int, opts *GetOptions) ([]BlockStorage, *Response, error)
func (*StoragesClient) Update ¶
func (s *StoragesClient) Update(request *UpdateStorage) (BlockStorage, *Response, error)
type StoragesService ¶
type StoragesService interface { List(projectID int, opts *GetOptions) ([]BlockStorage, *Response, error) Get(storageID int, opts *GetOptions) (BlockStorage, *Response, error) Create(request *CreateStorage) (BlockStorage, *Response, error) Delete(storageID int) (*Response, error) Attach(request *AttachTo) (BlockStorage, *Response, error) Detach(storageID int) (*Response, error) Update(request *UpdateStorage) (BlockStorage, *Response, error) }
StoragesService is an interface for interfacing with the Storages endpoints of the CherryServers API See: https://api.cherryservers.com/doc/#tag/Storage
type Team ¶
type Team struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Credit Credit `json:"credit,omitempty"` Billing Billing `json:"billing,omitempty"` Projects []Project `json:"projects,omitempty"` Memberships []Membership `json:"memberships,omitempty"` Href string `json:"href,omitempty"` }
type TeamsClient ¶
type TeamsClient struct {
// contains filtered or unexported fields
}
func (*TeamsClient) Create ¶
func (p *TeamsClient) Create(request *CreateTeam) (Team, *Response, error)
func (*TeamsClient) Get ¶
func (p *TeamsClient) Get(teamID int, opts *GetOptions) (Team, *Response, error)
func (*TeamsClient) List ¶
func (t *TeamsClient) List(opts *GetOptions) ([]Team, *Response, error)
List func lists teams
func (*TeamsClient) Update ¶
func (p *TeamsClient) Update(teamID int, request *UpdateTeam) (Team, *Response, error)
type TeamsService ¶
type TeamsService interface { List(opts *GetOptions) ([]Team, *Response, error) Get(teamID int, opts *GetOptions) (Team, *Response, error) Create(request *CreateTeam) (Team, *Response, error) Update(teamID int, request *UpdateTeam) (Team, *Response, error) Delete(teamID int) (*Response, error) }
TeamsService is an interface for interfacing with the Teams endpoints of the CherryServers API See: https://api.cherryservers.com/doc/#tag/Teams
type UpdateBackupMethod ¶ added in v3.1.0
type UpdateBackupStorage ¶ added in v3.1.0
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"` TargetedTo string `json:"targeted_to,omitempty"` Tags *map[string]string `json:"tags,omitempty"` }
UpdateIPAddress fields for updating IP address
type UpdateProject ¶
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 ¶
type UpdateServer struct { Name string `json:"name,omitempty"` Hostname string `json:"hostname,omitempty"` Tags *map[string]string `json:"tags,omitempty"` Bgp bool `json:"bgp"` }
UpdateServer fields for updating a server with specified tags
type UpdateStorage ¶
type UpdateTeam ¶
type User ¶
type User struct { ID int `json:"id,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Email string `json:"email,omitempty"` EmailVerified bool `json:"email_verified,omitempty"` Phone string `json:"phone,omitempty"` SecurityPhone string `json:"security_phone,omitempty"` SecurityPhoneVerified bool `json:"security_phone_verified,omitempty"` Href string `json:"href,omitempty"` }
type UsersClient ¶
type UsersClient struct {
// contains filtered or unexported fields
}
func (*UsersClient) CurrentUser ¶
func (s *UsersClient) CurrentUser(opts *GetOptions) (User, *Response, error)
func (*UsersClient) Get ¶
func (s *UsersClient) Get(userID int, opts *GetOptions) (User, *Response, error)
type UsersService ¶
type UsersService interface { CurrentUser(opts *GetOptions) (User, *Response, error) Get(userID int, opts *GetOptions) (User, *Response, error) }
UsersService is an interface for interfacing with the the User endpoints of the CherryServers API See: https://api.cherryservers.com/doc/#tag/Users