Documentation
¶
Index ¶
- Variables
- func GetNames(cn base.Connection, dataCenter string) ([]string, error)
- func IDByName(cn base.Connection, name string) (string, error)
- func LoadTemplates(cn base.Connection) ([]string, error)
- type AddDiskRequest
- type AddIPAddressReq
- type AddNetwork
- type AvailableImport
- type CreateReq
- type CreateSnapshotReq
- type DeleteReq
- type DeleteSnapshotReq
- type Details
- type Disk
- type ExecutePackage
- type GetCredentialsReq
- type GetCredentialsRes
- type GetIPAddressReq
- type GetIPAddressRes
- type GetImportsReq
- type GetImportsRes
- type GetReq
- type GetRes
- type IPAddresses
- type Import
- type KeepDiskRequest
- type List
- type MaintenanceRequest
- type PackageDef
- type Partition
- type PowerReq
- type RemoveIPAddressReq
- type RemoveNetwork
- type RestoreReq
- type RevertToSnapshotReq
- type Server
- type ServerPatchOperation
- type ServerRes
- type Snapshot
- type UpdateDisksDescription
- type UpdateIPAddressReq
- type UpdateReq
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ListTimeout = 200
)
View Source
var (
TemplateTimeout = 200
)
Functions ¶
func LoadTemplates ¶
func LoadTemplates(cn base.Connection) ([]string, error)
Types ¶
type AddDiskRequest ¶
type AddIPAddressReq ¶
type AddIPAddressReq struct {
Server `json:"-" argument:"composed" URIParam:"ServerId"`
InternalIpAddress string `json:",omitempty"`
Ports []models.PortRestriction `json:",omitempty"`
SourceRestrictions []models.SourceRestriction `json:",omitempty"`
}
func (*AddIPAddressReq) Validate ¶
func (ar *AddIPAddressReq) Validate() error
type AddNetwork ¶
type AddNetwork struct {
ServerId string `json:"-" URIParam:"yes"`
ServerName string `json:"-"`
NetworkId string
NetworkName string `json:"-"`
IpAddress string
}
func (*AddNetwork) GetNames ¶
func (a *AddNetwork) GetNames(cn base.Connection, property string) ([]string, error)
func (*AddNetwork) InferID ¶
func (a *AddNetwork) InferID(cn base.Connection) error
func (*AddNetwork) Validate ¶
func (a *AddNetwork) Validate() error
type AvailableImport ¶
type CreateReq ¶
type CreateReq struct {
Name string `valid:"required"`
Description string `json:",omitempty"`
GroupId string
GroupName string `json:",omitempty"`
SourceServerId string
SourceServerName string `json:"-"`
TemplateName string `json:"-"`
IsManagedOs bool `json:"IsManagedOS"`
IsManagedBackup bool
PrimaryDns string `json:",omitempty"`
SecondaryDns string `json:",omitempty"`
NetworkId string `json:",omitempty"`
NetworkName string `json:",omitempty"`
IpAddress string `json:",omitempty"`
RootPassword string `json:"Password,omitempty"`
SourceServerPassword string `json:",omitempty"`
Cpu int64 `json:",omitempty`
CpuAutoscalePolicyId string `json:",omitempty"`
MemoryGb int64 `json:",omitempty`
Type string `valid:"required" oneOf:"standard,hyperscale,bareMetal"`
AntiAffinityPolicyId string `json:",omitempty"`
AntiAffinityPolicyName string `json:",omitempty"`
CustomFields []customfields.Def `json:",omitempty"`
AdditionalDisks []AddDiskRequest `json:",omitempty"`
Ttl time.Time `json:"-"`
TtlString string `json:"Ttl,omitempty" argument:"ignore"`
Packages []PackageDef `json:",omitempty"`
ConfigurationId string `json:",omitempty"`
OsType string `json:",omitempty"`
}
func (*CreateReq) ApplyDefaultBehaviour ¶
type CreateSnapshotReq ¶
type CreateSnapshotReq struct {
SnapshotExpirationDays int64 `valid:"required"`
ServerIds []string
}
func (*CreateSnapshotReq) Validate ¶
func (cr *CreateSnapshotReq) Validate() error
type DeleteReq ¶
type DeleteReq struct {
Server `argument:"composed" URIParam:"ServerId" json:"-"`
}
type DeleteSnapshotReq ¶
type Details ¶
type Details struct {
IpAddresses []IPAddresses
SecondaryIPAddresses []IPAddresses
AlertPolicies []alert.AlertPolicy
Cpu int64
DiskCount int64
HostName string
InMaintenanceMode bool
MemoryMB int64
PowerState string
StorageGB int64
Disks []Disk
Partitions []Partition
Snapshots []Snapshot
CustomFields []customfields.FullDef
ProcessorDescription string `json:",omitempty"`
StorageDescription string `json:",omitempty"`
IsManagedBackup bool `json:",omitempty"`
}
type ExecutePackage ¶
type ExecutePackage struct {
ServerIds []string `json:"servers"`
Package PackageDef `valid:"required"`
}
func (*ExecutePackage) Validate ¶
func (e *ExecutePackage) Validate() error
type GetCredentialsReq ¶
type GetCredentialsReq struct {
Server `argument:"composed" URIParam:"ServerId"`
}
type GetCredentialsRes ¶
type GetIPAddressReq ¶
type GetIPAddressRes ¶
type GetIPAddressRes struct {
InternalIPAddress string
Ports []models.PortRestriction
SourceRestrictions []models.SourceRestriction
}
type GetImportsReq ¶
type GetImportsReq struct {
DataCenter string `valid:"required" URIParam:"yes"`
}
type GetImportsRes ¶
type GetImportsRes []AvailableImport
type GetRes ¶
type IPAddresses ¶
type Import ¶
type Import struct {
Name string `valid:"required"`
Description string `json:",omitempty"`
GroupId string
GroupName string `json:"-"`
PrimaryDns string `json:",omitempty"`
SecondaryDns string `json:",omitempty"`
NetworkId string `json:",omitempty"`
NetworkName string `json:"-"`
RootPassword string `json:"Password" valid:"required"`
Cpu int64 `valid:"required"`
MemoryGb int64 `valid:"required"`
Type string `valid:"required" oneOf:"standard,hyperscale"`
CustomFields []customfields.Def `json:",omitempty"`
OvfId string `valid:"required"`
OvfOsType string `valid:"required"`
}
type KeepDiskRequest ¶
type MaintenanceRequest ¶
type MaintenanceRequest struct {
ServerIds []string
}
func (*MaintenanceRequest) ApplyDefaultBehaviour ¶
func (s *MaintenanceRequest) ApplyDefaultBehaviour() error
This method replaces all of the ids with their upper case versions because the API call only accepts ids written in upper case.
func (*MaintenanceRequest) MarshalJSON ¶
func (s *MaintenanceRequest) MarshalJSON() ([]byte, error)
func (*MaintenanceRequest) Validate ¶
func (s *MaintenanceRequest) Validate() error
type PackageDef ¶
type RemoveIPAddressReq ¶
type RemoveNetwork ¶
type RemoveNetwork struct {
ServerId string `URIParam:"yes" json:"-"`
ServerName string `json:"-"`
NetworkId string `URIParam:"yes" json:"-"`
NetworkName string `json:"-"`
}
func (*RemoveNetwork) GetNames ¶
func (r *RemoveNetwork) GetNames(cn base.Connection, property string) ([]string, error)
func (*RemoveNetwork) InferID ¶
func (r *RemoveNetwork) InferID(cn base.Connection) error
func (*RemoveNetwork) Validate ¶
func (r *RemoveNetwork) Validate() error
type RestoreReq ¶
type RevertToSnapshotReq ¶
type ServerPatchOperation ¶
type ServerRes ¶
type ServerRes struct {
Server string
IsQueued bool
ErrorMessage string
Links []models.LinkEntity
}
type Snapshot ¶
type Snapshot struct {
Name string
Id string
Links []models.LinkEntity
}
func (*Snapshot) UnmarshalJSON ¶
type UpdateDisksDescription ¶
type UpdateDisksDescription struct {
Add []AddDiskRequest
Keep []KeepDiskRequest
}
func (*UpdateDisksDescription) Flatten ¶
func (udd *UpdateDisksDescription) Flatten() []interface{}
type UpdateIPAddressReq ¶
type UpdateIPAddressReq struct {
Server `json:"-" argument:"composed" URIParam:"ServerId"`
PublicIp string `json:"-" valid:"required" URIParam:"yes"`
Ports []models.PortRestriction
SourceRestrictions []models.SourceRestriction
}
func (*UpdateIPAddressReq) Validate ¶
func (ur *UpdateIPAddressReq) Validate() error
type UpdateReq ¶
type UpdateReq struct {
Server `argument:"composed" URIParam:"ServerId"`
PatchOperation []ServerPatchOperation `argument:"ignore"`
Cpu int64
MemoryGb int64
RootPassword []string
CustomFields []customfields.Def
Description string
GroupId string
GroupName string
Disks UpdateDisksDescription
}
func (*UpdateReq) ApplyDefaultBehaviour ¶
func (*UpdateReq) MarshalJSON ¶
Source Files
¶
- add_ip_address.go
- create.go
- create_snapshot.go
- delete.go
- delete_snapshot.go
- entities.go
- executepackage.go
- get.go
- get_credentials.go
- get_imports.go
- get_ip_address.go
- import.go
- list.go
- load.go
- power.go
- remove_ip_address.go
- restore.go
- revert_to_snapshot.go
- secondary_network.go
- server.go
- server_res.go
- start_maintenance_mode.go
- template.go
- update.go
- update_ip_address.go
Click to show internal directories.
Click to hide internal directories.