Documentation
¶
Index ¶
- Constants
- func LoadConfig(fpath string, v interface{}) error
- func PrintXMLStruct(s interface{}, indent ...int)
- type AddIP
- type Admin
- type ApplicationList
- type ApplicationTemplate
- type Autoscale
- type AutoscaleData
- type AutoscaleRule
- type Backup
- type BackupSchedule
- type BackupScheduleList
- type CPU
- type ChangeCPU
- type Client
- type Config
- type Console
- type CreateVe
- type CustomNs
- type DropIP
- type Firewall
- type IPAddr
- type IPAddrList
- type ImageList
- type LbList
- type LoadBalancer
- type Network
- type PasswordResponse
- type Platform
- type ReconfigureIP
- type ReconfigureVe
- type ResourceConsumptionAndAutoscaleHistory
- type Response
- type Server
- type Template
- type TemplateList
- type Threshold
- type Timestamp
- type Traffic
- type Ve
- type VeBackups
- type VeDisk
- type VeHistory
- type VeImage
- type VeList
- type VeResourceUsageReport
Constants ¶
View Source
const ( DataTimestampFormat string = "2006-01-02 15:04:05.000000-0700" ArgTimestampFormat string = "2006-01-02 15:04 MST" )
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func PrintXMLStruct ¶
func PrintXMLStruct(s interface{}, indent ...int)
Types ¶
type ApplicationList ¶
type ApplicationList struct {
XMLName xml.Name `xml:"application-list" json:"-" toml:"-"`
ApplicationTemplate []ApplicationTemplate `xml:"application-template"`
}
type ApplicationTemplate ¶
type Autoscale ¶
type Autoscale struct {
XMLName xml.Name `xml:"autoscale" json:"-" toml:"-"`
Current *struct {
AutoscaleRule []AutoscaleRule `xml:"autoscale-rule"`
} `xml:"current"`
Ongoing *struct {
AutoscaleRule []AutoscaleRule `xml:"autoscale-rule"`
} `xml:"ongoing"`
}
type AutoscaleData ¶
type AutoscaleData struct {
XMLName xml.Name `xml:"autoscale-data" json:"-" toml:"-"`
AutoscaleRule []AutoscaleRule
}
type AutoscaleRule ¶
type AutoscaleRule struct {
XMLName xml.Name `xml:"autoscale-rule" json:"-" toml:"-"`
Enabled *bool `xml:"enabled,attr"`
Deleted *bool `xml:"deleted,attr"`
Metric string `xml:"metric,attr"`
Version *int `xml:"version,attr"`
Updated *Timestamp `xml:"updated,attr,omitempty"`
UpdateDeliveredOk *bool `xml:"update-delivered-ok,attr"`
UpdateDelivered *Timestamp `xml:"update-delivered,attr,omitempty"`
AllowMigration *bool `xml:"allow-migration,attr"`
AllowRestart *bool `xml:"allow-restart,attr"`
Limits *struct {
Min int `xml:"min,attr"`
Max int `xml:"max,attr"`
Step int `xml:"step,attr"`
} `xml:"limits"`
Thresholds *struct {
Up *Threshold `xml:"up"`
Down *Threshold `xml:"down"`
} `xml:"thresholds"`
}
type Backup ¶
type Backup struct {
XMLName xml.Name `xml:"backup" json:"-" toml:"-"`
ImBackupID int `xml:"im-backup-id,attr"`
CloudBackupID string `xml:"cloud-backup-id,attr"`
ScheduleName string `xml:"schedule-name,attr"`
Started Timestamp `xml:"started,attr"`
Ended Timestamp `xml:"ended,attr"`
Successful bool `xml:"successful,attr"`
BackupSize int `xml:"backup-size,attr"`
BackupNodeName string `xml:"backup-node-name,attr"`
Description string `xml:"description"`
}
type BackupSchedule ¶
type BackupSchedule struct {
Name string `xml:"name,attr"`
}
type BackupScheduleList ¶
type BackupScheduleList struct {
XMLName xml.Name `xml:"backup-schedule-list" json:"-" toml:"-"`
BackupSchedule []struct {
ID int `xml:"id,attr"`
Name string `xml:"name,attr"`
// CronExpression string `xml:"cron-expression,attr"`
Description string `xml:"description"`
Enabled bool `xml:"enabled,attr"`
BackupsToKeep int `xml:"backups-to-keep,attr"`
NoOfIncremental int `xml:"no-of-incremental,attr"`
} `xml:"backup-schedule"`
}
type CreateVe ¶
type CreateVe struct {
XMLName xml.Name `xml:"ve" json:"-" toml:"-"`
CustomNs bool `xml:"custom-ns,attr,omitempty"`
Name string `xml:"name"`
Hostname string `xml:"hostname"`
Description string `xml:"description"`
SubscriptionID int `xml:"subscription-id,omitempty"`
CPU CPU `xml:"cpu"`
RAMSize int `xml:"ram-size"`
Bandwidth int `xml:"bandwidth"`
NoOfPublicIP int `xml:"no-of-public-ip,omitempty"`
NoOfPublicIPv6 int `xml:"no-of-public-ipv6,omitempty"`
VeDisk struct {
Local bool `xml:"local,attr"`
Primary bool `xml:"primary,attr,omitempty"`
Size int `xml:"size,attr"`
} `xml:"ve-disk"`
Platform Platform `xml:"platform"`
BackupSchedule *struct {
Name string `xml:"name,attr"`
} `xml:"backup-schedule"`
}
type DropIP ¶
type DropIP struct {
IP IPAddrList `xml:"ip,attr"`
}
type Firewall ¶
type Firewall struct {
XMLName xml.Name `xml:"firewall" json:"-" toml:"-"`
Rule []struct {
ID int `xml:"id,attr,omitempty" json:"-" toml:"-"`
Name string `xml:"name,attr"`
Protocol string `xml:"protocol,attr"`
LocalPort int `xml:"local-port,attr"`
RemotePort int `xml:"remote-port,attr"`
RemoteNet []IPAddr `xml:"remote-net"`
} `xml:"rule"`
}
type IPAddrList ¶
type IPAddrList []IPAddr
func (IPAddrList) MarshalText ¶
func (as IPAddrList) MarshalText() (text []byte, err error)
func (IPAddrList) String ¶
func (as IPAddrList) String() string
type ImageList ¶
type ImageList struct {
XMLName xml.Name `xml:"image-list" json:"-" toml:"-"`
ImageInfo []struct {
Name string `xml:"name,attr"`
Description string `xml:"description,attr"`
Size int `xml:"size,attr"`
Created Timestamp `xml:"created,attr"`
SubscriptionID int `xml:"subscription-id,attr"`
ImageOf string `xml:"image-of,attr"`
Location string `xml:location,attr"`
} `xml:"image-info"`
}
type LoadBalancer ¶
type LoadBalancer struct {
XMLName xml.Name `xml:"load-balancer" json:"-" toml:"-"`
ID int `xml:"id"`
UUID string `xml:"uuid"`
Hnid int `xml:"hnId"`
CustomerID int `xml:"customer-id"`
Name string `xml:"name"`
Hostname string `xml:"hostname"`
Description string `xml:"description"`
SubscriptionID int `xml:"subscription-id"`
CPU CPU `xml:"cpu"`
RAMSize int `xml:"ram-size"`
Bandwidth int `xml:"bandwidth"`
VeDisk VeDisk `xml:"ve-disk"`
Platform Platform `xml:"platform"`
Network Network `xml:"network"`
BackupSchedule BackupSchedule `xml:"backup-schedule"`
Console Console `xml:"console"`
State string `xml:"state"`
PrimaryDiskID int `xml:"primary-disk-id"`
TemplateID int `xml:"template-id"`
Admin Admin `xml:"admin"`
LastOperationRc int `xml:"last-operation-rc"`
UsedBy []struct {
VeName string `xml:"ve-name,attr"`
IP IPAddr `xml:"ip,attr"`
} `xml:"used-by"`
}
type Network ¶
type Network struct {
PrivateIP IPAddr `xml:"private-ip,attr"`
PublicIP []struct {
ChunkRef int `xml:"chunk-ref,attr"`
ID int `xml:"id,attr"`
Address IPAddr `xml:"address,attr"`
Gateway IPAddr `xml:"gateway,attr"`
} `xml:"public-ip"`
PublicIP6 []struct {
ID int `xml:"id,attr"`
Address IPAddr `xml:"address,attr"`
Gateway IPAddr `xml:"gateway,attr"`
} `xml:"public-ip6"`
}
type PasswordResponse ¶
type ReconfigureIP ¶
type ReconfigureVe ¶
type ReconfigureVe struct {
XMLName xml.Name `xml:"reconfigure-ve" json:"-" toml:"-"`
Description string `xml:"description,omitempty"`
ChangeCPU *ChangeCPU `xml:"change-cpu"`
RAMSize int `xml:"ram-size,omitempty"`
Bandwidth int `xml:"bandwidth,omitempty"`
ReconfigureIPv4 *ReconfigureIP `xml:"reconfigure-ipv4"`
ReconfigureIPv6 *ReconfigureIP `xml:"reconfigure-ipv6"`
PrimaryDiskSize int `xml:"primary-disk-size,omitempty"`
CustomNs *int `xml:"custom-ns"`
}
type ResourceConsumptionAndAutoscaleHistory ¶
type ResourceConsumptionAndAutoscaleHistory struct {
XMLName xml.Name `xml:"resource-consumption-and-autoscale-history" json:"-" toml:"-"`
ResourceConsumptionSample []struct {
RAMUsage int `xml:"ram-usage,attr"`
CPUUsage int `xml:"cpu-usage,attr"`
PrivateIncomingTraffic int `xml:"private-incoming-traffic,attr"`
PrivateOutgoingTraffic int `xml:"private-outgoing-traffic,attr"`
PublicIncomingTraffic int `xml:"public-incoming-traffic,attr"`
PublicOutgoingTraffic int `xml:"public-outgoing-traffic,attr"`
NodeSeqNo int `xml:"node-seq-no,attr"`
NodeTimestamp Timestamp `xml:"node-timestamp,attr"`
PaciTimestamp Timestamp `xml:"paci-timestamp,attr"`
CPU int `xml:"cpu,attr"`
RAM int `xml:"ram,attr"`
Bandwidth int `xml:"bandwidth,attr"`
} `xml:"resource-consumption-sample"`
AutoscaleEvent struct {
Direction string `xml:"direction,attr"`
RuleVersion int `xml:"rule-version,attr"`
NodeSeqNo int `xml:"node-seq-no,attr"`
NodeTimestamp Timestamp `xml:"node-timestamp,attr"`
Metric string `xml:"metric,attr"`
NewValue int `xml:"new-value,attr"`
NodeUUID string `xml:"node-uuid,attr"`
Started string `xml:"started,attr"`
Ended string `xml:"ended,attr"`
EndedOk bool `xml:"ended-ok,attr"`
} `xml:"autoscale-event"`
AutoscaleRule []AutoscaleRule `xml:"autoscale-rule"`
}
type Server ¶
type Server struct {
Spec *CreateVe // xml struct
Firewall Firewall // xml struct
AutoscaleRule []AutoscaleRule // xml struct
}
type Template ¶
type Template struct {
XMLName xml.Name `xml:"template" json:"-" toml:"-"`
ID int `xml:"id,attr"`
Name string `xml:"name,attr"`
OSType string `xml:"osType,attr"`
Technology string `xml:"technology,attr"`
Active bool `xml:"active,attr"`
Default bool `xml:"default,attr"`
RootLogin string `xml:"root-login,attr"`
MinHddSize int `xml:"min-hdd-size,attr"`
PwdRegex string `xml:"pwd-regex,attr"`
HighWaterMarkForDelivery int `xml:"high-watermark-for-delivery,attr"`
LowWaterMarkForDelivery int `xml:"low-watermark-for-delivery,attr"`
Option []struct {
Name string `xml:"name,attr"`
Value string `xml:"value,attr"`
} `xml:"option"`
}
type TemplateList ¶
type Ve ¶
type Ve struct {
XMLName xml.Name `xml:"ve" json:"-" toml:"-"`
ID int `xml:"id"`
UUID string `xml:"uuid"`
Hnid int `xml:"hnId"`
CustomerID int `xml:"customer-id"`
Name string `xml:"name"`
Hostname string `xml:"hostname"`
Description string `xml:"description"`
SubscriptionID int `xml:"subscription-id"`
CPU CPU `xml:"cpu"`
RAMSize int `xml:"ram-size"`
Bandwidth int `xml:"bandwidth"`
VeDisk VeDisk `xml:"ve-disk"`
Platform Platform `xml:"platform"`
Network Network `xml:"network"`
BackupSchedule BackupSchedule `xml:"backup-schedule"`
Console Console `xml:"console"`
State string `xml:"state"`
PrimaryDiskID int `xml:"primary-disk-id"`
TemplateID int `xml:"template-id"`
Admin Admin `xml:"admin"`
LastOperationRc int `xml:"last-operation-rc"`
AppInfo []struct {
AppTemplate string `xml:"app-template,attr"`
ForOS string `xml:"for-os,attr"`
InstalledAt string `xml:"installed-at,attr"`
InstalledOk bool `xml:"installed-ok,attr"`
UninstalledAt string `xml:"uninstalled-at,attr"`
UninstalledOk bool `xml:"uninstalled-ok,attr"`
AppTemplateID int `xml:"app-template-id,attr"`
} `xml:"app-info"`
LoadBalancer string `xml:"load-balancer"`
SteadyState string `xml:"steady-state"`
//AutoScale string `xml:"autoscale"`
CurrentResourceConsumption struct {
CPU int `xml:"cpu,attr"`
RAM int `xml:"ram,attr"`
PrivateTraffic Traffic `xml:"private-traffic"`
PublicTraffic Traffic `xml:"public-traffic"`
} `xml:"current-resource-consumption"`
}
type VeHistory ¶
type VeHistory struct {
XMLName xml.Name `xml:"ve-history" json:"-" toml:"-"`
VeSnapshot []struct {
CPU int `xml:"cpu,attr"`
RAM int `xml:"ram,attr"`
LocalDisk int `xml:"local-disk,attr"`
Nbd int `xml:"nbd,attr"`
Bandwidth int `xml:"bandwidth,attr"`
LastTouchedFrom string `xml:"last-touched-from,attr"`
State string `xml:"state,attr"`
SteadyState string `xml:"steady-state,attr"`
LastChangedBy string `xml:"last-changed-by,attr"`
EventTimestamp Timestamp `xml:"event-timestamp,attr"`
NoOfPublicIP int `xml:"no-of-public-ip,attr"`
NoOfPublicIPv6 int `xml:"no-of-public-ipv6,attr"`
IsLb bool `xml:"is-lb,attr"`
PrivateIncomingTraffic int `xml:"private-incoming-traffic,attr"`
PrivateOutgoingTraffic int `xml:"private-outgoing-traffic,attr"`
PublicIncomingTraffic int `xml:"public-incoming-traffic,attr"`
PublicOutgoingTraffic int `xml:"public-outgoing-traffic,attr"`
} `xml:"ve-snapshot"`
}
type VeImage ¶
type VeImage struct {
XMLName xml.Name `xml:"ve-image" json:"-" toml:"-"`
ID int `xml:"id,attr"`
BnodeUUID string `xml:"bnode-uuid,attr"`
CustomerID int `xml:"customer-id,attr"`
SubscriptionID int `xml:"subscription-id,attr"`
Name string `xml:"name,attr"`
Hostname string `xml:"hostname,attr"`
Description string `xml:"description"`
CPUNumber int `xml:"cpu-number,attr"`
CPUPower int `xml:"cpu-power,attr"`
RAMSize int `xml:"ram-size,attr"`
Bandwidth int `xml:"bandwidth,attr"`
Login string `xml:"login,attr"`
PrimaryDiskID int `xml:"primary-disk-id,attr"`
ImageSize int `xml:"image-size,attr"`
Created Timestamp `xml:"created,attr"`
ImageOf string `xml:"image-of,attr"`
NoOfPublicIP int `xml:"no-of-public-ip,attr"`
NoOfPublicIPv6 int `xml:"no-of-public-ipv6,attr"`
CustomNs bool `xml:"custom-ns,attr"`
Disks []struct {
ID int `xml:"id,attr"`
Type string `xml:"type,attr"`
Primary bool `xml:"primary,attr"`
Size int `xml:"size,attr"`
} `xml:"disks"`
Platform Platform `xml:"platform"`
}
type VeResourceUsageReport ¶
type VeResourceUsageReport struct {
XMLName xml.Name `xml:"ve-resource-usage-report" json:"-" toml:"-"`
VeName string `xml:"ve-name,attr"`
VeID int `xml:"ve-id,attr"`
OS string `xml:"os,attr"`
Technology string `xml:"technology,attr"`
LifeTimeInMinutes int `xml:"life-time-in-minutes,attr"`
IsLoadBalancer bool `xml:"is-load-balancer,attr"`
ResourceUsage []struct {
Value int `xml:"value,attr"`
ResourceUsageType string `xml:"resource-usage-type,attr"`
ResourceType string `xml:"resource-type,attr"`
} `xml:"resource-usage"`
VeTraffic []struct {
TrafficType string `xml:"traffic-type,attr"`
Used int `xml:"used,attr"`
} `xml:"ve-traffic"`
ActiveBackupSchedule []struct {
ScheduleName string `xml:"schedule-name,attr"`
} `xml:"active-backup-schedule"`
}
Click to show internal directories.
Click to hide internal directories.