Documentation ¶
Index ¶
- Constants
- Variables
- func UpdateAdditionaldisks(disks []Disk) api.Update
- func UpdateCPU(num int) api.Update
- func UpdateCredentials(current, updated string) api.Update
- func UpdateCustomfields(fields []api.Customfields) api.Update
- func UpdateDescription(desc string) api.Update
- func UpdateGroup(group string) api.Update
- func UpdateMemory(num int) api.Update
- type Credentials
- type Disk
- type Package
- type Port
- type PowerState
- type PublicIP
- type Response
- type SecondaryNetwork
- type Server
- type Service
- func (s *Service) AddPublicIP(name string, ip PublicIP) (*status.Status, error)
- func (s *Service) AddSecondaryNetwork(name, networkId, ip string) (*status.Status, error)
- func (s *Service) Archive(servers ...string) ([]*status.QueuedResponse, error)
- func (s *Service) Create(server Server) (*status.QueuedResponse, error)
- func (s *Service) CreateSnapshot(expiration int, servers ...string) ([]*status.QueuedResponse, error)
- func (s *Service) Delete(name string) (*status.QueuedResponse, error)
- func (s *Service) DeletePublicIP(name, ip string) (*status.Status, error)
- func (s *Service) DeleteSnapshot(server, id string) (*status.Status, error)
- func (s *Service) Edit(name string, updates ...api.Update) error
- func (s *Service) ExecutePackage(pkg Package, servers ...string) ([]*status.QueuedResponse, error)
- func (s *Service) Get(name string) (*Response, error)
- func (s *Service) GetCredentials(name string) (Credentials, error)
- func (s *Service) GetPublicIP(name string, ip string) (*PublicIP, error)
- func (s *Service) PowerState(state PowerState, servers ...string) ([]*status.QueuedResponse, error)
- func (s *Service) Restore(name, group string) (*status.Status, error)
- func (s *Service) RevertSnapshot(server, id string) (*status.Status, error)
- func (s *Service) Update(name string, updates ...api.Update) (*status.Status, error)
- func (s *Service) UpdatePublicIP(name string, public string, ip PublicIP) (*status.Status, error)
- type Snapshot
- type SourceRestriction
Constants ¶
View Source
const ( On = iota Off Pause Reboot Reset ShutDown StartMaintenance StopMaintenance )
Variables ¶
View Source
var (
ErrInvalidServer = fmt.Errorf("server: server missing required field(s). (Name, CPU, MemoryGB, GroupID, SourceServerID, Type)")
)
Functions ¶
func UpdateAdditionaldisks ¶
func UpdateCredentials ¶
func UpdateCustomfields ¶
func UpdateCustomfields(fields []api.Customfields) api.Update
func UpdateDescription ¶
func UpdateGroup ¶
func UpdateMemory ¶
Types ¶
type Credentials ¶
type PowerState ¶
type PowerState int
func (PowerState) String ¶
func (p PowerState) String() string
type PublicIP ¶
type PublicIP struct { InternalIP string `json:"internalIPAddress,omitempty"` Ports []Port `json:"ports,omitempty"` SourceRestrictions []SourceRestriction `json:"sourceRestrictions,omitempty"` }
type Response ¶
type Response struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` GroupID string `json:"groupId"` IsTemplate bool `json:"isTemplate"` LocationID string `json:"locationId"` OStype string `json:"osType"` OS string `json:"os"` Status string `json:"status"` Details struct { IPaddresses []struct { Internal string `json:"internal"` Public string `json:"public"` } `json:"ipAddresses"` AlertPolicies []struct { ID string `json:"id"` Name string `json:"name"` Links api.Links `json:"links"` } `json:"alertPolicies"` CPU int `json:"cpu"` Diskcount int `json:"diskCount"` Hostname string `json:"hostName"` InMaintenanceMode bool `json:"inMaintenanceMode"` MemoryMB int `json:"memoryMB"` Powerstate string `json:"powerState"` Storagegb int `json:"storageGB"` Disks []struct { ID string `json:"id"` SizeGB int `json:"sizeGB"` PartitionPaths []interface{} `json:"partitionPaths"` } `json:"disks"` Partitions []struct { SizeGB float64 `json:"sizeGB"` Path string `json:"path"` } `json:"partitions"` Snapshots []struct { Name string `json:"name"` Links api.Links `json:"links"` } `json:"snapshots"` Customfields []api.Customfields `json:"customFields,omitempty"` } `json:"details"` Type string `json:"type"` Storagetype string `json:"storageType"` ChangeInfo struct { CreatedDate string `json:"createdDate"` CreatedBy string `json:"createdBy"` ModifiedDate string `json:"modifiedDate"` ModifiedBy string `json:"modifiedBy"` } `json:"changeInfo"` Links api.Links `json:"links"` }
type SecondaryNetwork ¶
type Server ¶
type Server struct { Name string `json:"name"` Description string `json:"description,omitempty"` GroupID string `json:"groupId"` SourceServerID string `json:"sourceServerId"` IsManagedOS bool `json:"isManagedOS,omitempty"` IsManagedBackup bool `json:"isManagedBackup,omitempty"` PrimaryDNS string `json:"primaryDns,omitempty"` SecondaryDNS string `json:"secondaryDns,omitempty"` NetworkID string `json:"networkId,omitempty"` IPaddress string `json:"ipAddress,omitempty"` Password string `json:"password,omitempty"` SourceServerPassword string `json:"sourceServerPassword,omitempty"` CPU int `json:"cpu"` CPUAutoscalePolicyID string `json:"cpuAutoscalePolicyId,omitempty"` MemoryGB int `json:"memoryGB"` Type string `json:"type"` Storagetype string `json:"storageType,omitempty"` AntiAffinityPolicyID string `json:"antiAffinityPolicyId,omitempty"` Customfields []api.Customfields `json:"customFields,omitempty"` Additionaldisks []Disk `json:"additionalDisks,omitempty"` TTL *time.Time `json:"ttl,omitempty"` Packages []Package `json:"packages,omitempty"` ConfigurationID string `json:"configurationId,omitempty"` OSType string `json:"osType,omitempty"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AddPublicIP ¶
func (*Service) AddSecondaryNetwork ¶
func (*Service) Archive ¶
func (s *Service) Archive(servers ...string) ([]*status.QueuedResponse, error)
func (*Service) CreateSnapshot ¶
func (*Service) DeletePublicIP ¶
func (*Service) DeleteSnapshot ¶
func (*Service) ExecutePackage ¶
func (*Service) GetCredentials ¶
func (s *Service) GetCredentials(name string) (Credentials, error)
func (*Service) GetPublicIP ¶
func (*Service) PowerState ¶
func (s *Service) PowerState(state PowerState, servers ...string) ([]*status.QueuedResponse, error)
func (*Service) RevertSnapshot ¶
type SourceRestriction ¶
type SourceRestriction struct {
CIDR string `json:"cidr"`
}
Click to show internal directories.
Click to hide internal directories.