Documentation
¶
Index ¶
- func Provider() terraform.ResourceProvider
- type Client
- type Config
- type Image
- type ImageTemplate
- type Images
- type Permissions
- type SecurityGroup
- type SecurityGroupRule
- type SecurityGroupTemplate
- type SecurityGroups
- type StringMap
- type UserTemplate
- type UserTemplates
- type UserVm
- type UserVms
- type UserVnet
- type UserVnets
- type VirtualMachineDisk
- type VirtualMachineGraphics
- type VirtualMachineNIC
- type VirtualMachineOS
- type VirtualMachineRAW
- type VmTemplate
- type VnetTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Provider ¶
func Provider() terraform.ResourceProvider
Types ¶
type Client ¶
type Image ¶
type Image struct { XMLName xml.Name Name string `xml:"NAME"` Description string `xml:"DESCRIPTION,omitempty"` Id int `xml:"ID,omitempty"` Uid int `xml:"UID,omitempty"` Gid int `xml:"GID,omitempty"` Uname string `xml:"UNAME,omitempty"` Gname string `xml:"GNAME,omitempty"` Permissions *Permissions `xml:"PERMISSIONS,omitempty"` RegTime string `xml:"REG,omitempty"` Size int `xml:"SIZE,omitempty"` State int `xml:"STATE,omitempty"` Source string `xml:"SOURCE,omitempty"` Path string `xml:"PATH,omitempty"` Persistent string `xml:"PERSISTENT,omitempty"` DatastoreID int `xml:"DATASTORE_ID,omitempty"` Datastore string `xml:"DATASTORE,omitempty"` FsType string `xml:"FSTYPE,omitempty"` Type string `xml:"TYPE,omitempty"` DevPrefix string `xml:"DEV_PREFIX,omitempty"` //For image creation Target string `xml:"TARGET,omitempty"` //For image creation Driver string `xml:"DRIVER,omitempty"` //For image creation Format string `xml:"FORMAT,omitempty"` //For image creation MD5 string `xml:"MD5,omitempty"` //For image creation SHA1 string `xml:"SHA1,omitempty"` //For image creation Template *ImageTemplate `xml:"TEMPLATE,omitempty"` }
type ImageTemplate ¶
type Permissions ¶
type SecurityGroup ¶
type SecurityGroup struct { XMLName xml.Name `xml:"SECURITY_GROUP"` Id string `xml:"ID"` Name string `xml:"NAME"` Uid string `xml:"UID"` Gid string `xml:"GID"` Uname string `xml:"UNAME"` Gname string `xml:"GNAME"` Permissions *Permissions `xml:"PERMISSIONS"` SecurityGroupTemplate *SecurityGroupTemplate `xml:"TEMPLATE"` }
type SecurityGroupRule ¶
type SecurityGroupRule struct { Protocol string `xml:"PROTOCOL" structs:"protocol"` Range string `xml:"RANGE,omitempty" structs:"range,omitempty"` RuleType string `xml:"RULE_TYPE" structs:"rule_type,omitempty"` IP string `xml:"IP,omitempty" structs:"ip,omitempty"` Size string `xml:"SIZE,omitempty" structs:"size,omitempty"` NetworkId string `xml:"NETWORK_ID,omitempty" structs:"network_id,omitempty"` IcmpType string `xml:"ICMP_TYPE,omitempty" structs:"icmp_type,omitempty"` }
type SecurityGroupTemplate ¶
type SecurityGroupTemplate struct { XMLName xml.Name Name string `xml:"NAME"` Description string `xml:"DESCRIPTION,omitempty"` SecurityGroupRules []SecurityGroupRule `xml:"RULE"` }
type SecurityGroups ¶
type SecurityGroups struct { XMLName xml.Name `xml:"SECURITY_GROUP_POOL"` SecurityGroup []*SecurityGroup `xml:"SECURITY_GROUP"` }
type StringMap ¶
This type and the MarshalXML functions are needed to handle converting the CONTEXT map to xml and back From: https://stackoverflow.com/questions/30928770/marshall-map-to-xml-in-go/33110881
func (StringMap) MarshalXML ¶
MarshalXML marshals the map to XML, with each key in the map being a tag and it's corresponding value being it's contents.
func (*StringMap) UnmarshalXML ¶
UnmarshalXML unmarshals the XML into a map of string to strings, creating a key in the map for each tag and setting it's value to the tags contents.
The fact this function is on the pointer of Map is important, so that if m is nil it can be initialized, which is often the case if m is nested in another xml structurel. This is also why the first thing done on the first line is initialize it.
type UserTemplate ¶
type UserTemplates ¶
type UserTemplates struct {
UserTemplate []*UserTemplate `xml:"VMTEMPLATE"`
}
type UserVm ¶
type UserVm struct { Id string `xml:"ID"` Name string `xml:"NAME"` Uid int `xml:"UID"` Gid int `xml:"GID"` Uname string `xml:"UNAME"` Gname string `xml:"GNAME"` Permissions *Permissions `xml:"PERMISSIONS"` State int `xml:"STATE"` LcmState int `xml:"LCM_STATE"` VmTemplate *VmTemplate `xml:"TEMPLATE"` VmUserTemplate StringMap `xml:"USER_TEMPLATE"` }
type UserVnet ¶
type UserVnet struct { Name string `xml:"NAME"` Id int `xml:"ID"` Uid int `xml:"UID"` Gid int `xml:"GID"` Uname string `xml:"UNAME"` Gname string `xml:"GNAME"` Permissions *Permissions `xml:"PERMISSIONS"` Bridge string `xml:"BRIDGE"` ParentVnet int `xml:"PARENT_NETWORK_ID,omitempty"` Template *VnetTemplate `xml:"TEMPLATE,omitempty"` }
type VirtualMachineDisk ¶
type VirtualMachineGraphics ¶
type VirtualMachineNIC ¶
type VirtualMachineOS ¶
type VirtualMachineRAW ¶
type VmTemplate ¶
type VmTemplate struct { //Context *Context `xml:"CONTEXT"` XMLName xml.Name `xml:"TEMPLATE"` Name string `xml:"NAME,omitempty"` VCPU int `xml:"VCPU"` CPU float64 `xml:"CPU"` Memory int `xml:"MEMORY"` ContextVars StringMap `xml:"CONTEXT"` NICs []VirtualMachineNIC `xml:"NIC"` Disks []VirtualMachineDisk `xml:"DISK"` Graphics VirtualMachineGraphics `xml:"GRAPHICS"` OS VirtualMachineOS `xml:"OS"` RAW VirtualMachineRAW `xml:"RAW"` }