Documentation ¶
Index ¶
- Constants
- Variables
- func NewSoapRequest(body string) string
- type Body
- type Client
- func (client *Client) CreateServer(req *CreateServerRequest) error
- func (client *Client) CreateSnapshot(req *UpdateSnapshotRequest) error
- func (client *Client) CreateStorage(req *CreateStorageRequest) error
- func (client *Client) DeleteServer(id string) error
- func (client *Client) DeleteStorage(id string) error
- func (client *Client) GetAllDataCenters() (dcs []*DataCenter, e error)
- func (client *Client) GetAllImages() (images []*Image, e error)
- func (client *Client) GetAllServers() (servers []*Server, e error)
- func (client *Client) GetAllSnapshots() (snapshots []*Snapshot, e error)
- func (client *Client) GetAllStorages() (storages []*Storage, e error)
- func (client *Client) GetDataCenter(id string) (dc *DataCenter, e error)
- func (client *Client) ResetServer(id string) error
- func (client *Client) RollbackSnapshot(req *RollbackSnapshotRequest) error
- func (client *Client) StartServer(id string) error
- func (client *Client) StopServer(id string) error
- func (client *Client) UpdateSnapshot(req *UpdateSnapshotRequest) error
- type ConnectedStorage
- type CreateServerRequest
- type CreateStorageRequest
- type DataCenter
- type Envelope
- type Firewall
- type GetAllDataCenters
- type GetAllDataCentersResponse
- type GetAllSnapshotsResponse
- type GetDataCenterResponse
- type Image
- type Nic
- type Output
- type Price
- type Pricing
- type RollbackSnapshotRequest
- type Server
- type Snapshot
- type SoapAddress
- type SoapBinding
- type SoapBody
- type SoapOperation
- type StartServerRequest
- type Storage
- type UpdateServerRequest
- type UpdateSnapshotRequest
- type WsdlBinding
- type WsdlDefinitions
- type WsdlImport
- type WsdlMessage
- type WsdlMessagePart
- type WsdlOperation
- type WsdlOperationFault
- type WsdlOperationInput
- type WsdlOperationOutput
- type WsdlPort
- type WsdlPortTypes
- type WsdlService
- type WsdlTypes
- type XsdComplexContent
- type XsdComplexType
- type XsdElement
- type XsdExtension
- type XsdImport
- type XsdMaxInclusive
- type XsdMinInclusive
- type XsdPattern
- type XsdRestriction
- type XsdSchema
- type XsdSequence
- type XsdSimpleType
Constants ¶
View Source
const ( PROFITBRICKS_USER = "PROFITBRICKS_USER" PROFITBRICKS_PASSWORD = "PROFITBRICKS_PASSWORD" GetAllDataCentersRequest = `<tns:getAllDataCenters></tns:getAllDataCenters>` )
View Source
const ( SOAP_HEADER = `` /* 259-byte string literal not displayed */ SOAP_FOOTER = `</env:Body></env:Envelope>` )
Variables ¶
View Source
var ( HoursPerMonth float64 = 24 * 30 DE = &Pricing{ CpuPerHour: 2, GbRamPerHour: 0.45, GbStoragePerMonth: 9, } US = &Pricing{ CpuPerHour: 2.5, GbRamPerHour: 0.75, GbStoragePerMonth: 9, } )
Functions ¶
func NewSoapRequest ¶
Types ¶
type Body ¶
type Body struct { XMLName xml.Name `xml:"Body"` GetAllDataCenters []*DataCenter `xml:"getAllDataCentersResponse>return"` GetDataCenterResponse *GetDataCenterResponse `xml:"getDataCenterResponse>return"` GetAllImagesResponse []*Image `xml:"getAllImagesResponse>return"` GetAllSnapshotsResponse []*Snapshot `xml:"getAllSnapshotsResponse>return"` GetAllStoragesResponse []*Storage `xml:"getAllStoragesResponse>return"` GetAllServersResponse []*Server `xml:"getAllServersResponse>return"` }
type Client ¶
func NewFromEnv ¶
func NewFromEnv() *Client
func (*Client) CreateServer ¶
func (client *Client) CreateServer(req *CreateServerRequest) error
func (*Client) CreateSnapshot ¶
func (client *Client) CreateSnapshot(req *UpdateSnapshotRequest) error
func (*Client) CreateStorage ¶
func (client *Client) CreateStorage(req *CreateStorageRequest) error
func (*Client) DeleteServer ¶
func (*Client) DeleteStorage ¶
func (*Client) GetAllDataCenters ¶
func (client *Client) GetAllDataCenters() (dcs []*DataCenter, e error)
func (*Client) GetAllImages ¶
func (*Client) GetAllServers ¶
func (*Client) GetAllSnapshots ¶
func (*Client) GetAllStorages ¶
func (*Client) GetDataCenter ¶
func (client *Client) GetDataCenter(id string) (dc *DataCenter, e error)
func (*Client) ResetServer ¶
func (*Client) RollbackSnapshot ¶
func (client *Client) RollbackSnapshot(req *RollbackSnapshotRequest) error
func (*Client) StartServer ¶
func (*Client) StopServer ¶
func (*Client) UpdateSnapshot ¶
func (client *Client) UpdateSnapshot(req *UpdateSnapshotRequest) error
type ConnectedStorage ¶
type ConnectedStorage struct { BootDevice bool `xml:"bootDevice"` // >true</bootDevice> BusType string `xml:"busType"` // >VIRTIO</busType> DeviceNumber int `xml:"deviceNumber"` // >1</deviceNumber> Size int `xml:"size"` // >10</size> StorageId string `xml:"storageId"` // >dd24d153-6cf7-4476-aab3-0b1d32d5e15c</storageId> StorageName string `xml:"storageName"` // >Ubuntu</storageName> }
type CreateServerRequest ¶
type CreateServerRequest struct { XMLName xml.Name `xml:"request"` DataCenterId string `xml:"dataCenterId,omitempty"` Cores int `xml:"cores,omitempty"` Ram int `xml:"ram,omitempty"` ServerName string `xml:"serverName,omitempty"` BootFromStorageId string `xml:"bootFromStorageId,omitempty"` BootFromImageId string `xml:"bootFromImageId,omitempty"` InternetAccess bool `xml:"internetAccess,omitempty"` LanId int `xml:"lanId,omitempty"` OsType string `xml:"osType,omitempty"` AvailabilityZone string `xml:"availabilityZone,omitempty"` }
type CreateStorageRequest ¶
type CreateStorageRequest struct { XMLName xml.Name `xml:"request"` DataCenterId string `xml:"dataCenterId,omitempty"` StorageName string `xml:"storageName,omitempty"` Size int `xml:"size,omitempty"` MountImageId string `xml:"mountImageId,omitempty"` ProfitBricksImagePassword string `xml:"profitBricksImagePassword,omitempty"` }
type DataCenter ¶
type DataCenter struct { DataCenterId string `xml:"dataCenterId"` DataCenterName string `xml:"dataCenterName"` DataCenterVersion int `xml:"dataCenterVersion"` Servers []*Server `xml:"servers"` Storages []*Storage `xml:"storages"` ProvisioningState string `xml:"provisioningState"` Region string `xml:"region"` }
type Firewall ¶
type Firewall struct { Active string `xml:"active"` // >false</active> FirewallId string `xml:"firewallId"` // >29f279de-027e-40e4-99f2-4f09aa086903</firewallId> NicId string `xml:"nicId"` // >910910a2-a4c5-45fe-aeff-fe7ec4d8d4d9</nicId> ProvisioningState string `xml:"provisioningState"` // >AVAILABLE</provisioningState> }
type GetAllDataCenters ¶
type GetAllDataCenters struct { }
type GetAllDataCentersResponse ¶
type GetAllDataCentersResponse struct {
*DataCenter
}
type GetAllSnapshotsResponse ¶
type GetAllSnapshotsResponse struct {
*DataCenter
}
type GetDataCenterResponse ¶
type GetDataCenterResponse struct {
*DataCenter
}
type Image ¶
type Image struct { CpuHotpluggable bool `xml:"cpuHotpluggable"` // type="xs:boolean" minOccurs="0"/> ImageId string `xml:"imageId"` // type="xs:string" minOccurs="0"/> ImageName string `xml:"imageName"` // type="xs:string" minOccurs="0"/> ImageSize int `xml:"imageSize"` // type="xs:long" minOccurs="0"/> ImageType string `xml:"imageType"` // type="tns:imageType" minOccurs="0"/> MemoryHotpluggable bool `xml:"memoryHotpluggable"` // type="xs:boolean" minOccurs="0"/> OsType string `xml:"osType"` // type="tns:osType" minOccurs="0"/> Region string `xml:"region"` // type="tns:region" minOccurs="0"/> ServerIds string `xml:"serverIds"` // type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/> Writeable bool `xml:"writeable"` // type="xs:boolean" minOccurs="0"/> }
type Nic ¶
type Nic struct { DataCenterId string `xml:"dataCenterId"` // eb394325-b2f1-418c-93e4-377697e3c597</dataCenterId> DataCenterVersion int `xml:"dataCenterVersion"` // 4</dataCenterVersion> NicId string `xml:"nicId"` // 910910a2-a4c5-45fe-aeff-fe7ec4d8d4d9</nicId> LanId int `xml:"lanId"` // 1</lanId> InternetAccess bool `xml:"internetAccess"` // true</internetAccess> ServerId string `xml:"serverId"` // 5d0a9936-94c0-44a8-85cc-9a9cae082202</serverId> Ips string `xml:"ips"` // 46.16.78.173</ips> MacAddress string `xml:"macAddress"` // 02:01:0f:f6:2c:b5</macAddress> Firewall *Firewall `xml:"firewall"` DhcpActive bool `xml:"dhcpActive"` // >true</dhcpActive> GatewayIp string `xml:"gatewayIp"` // >46.16.78.1</gatewayIp> ProvisioningState string `xml:"provisioningState"` // >AVAILABLE</provisioningState> }
type Price ¶
func (*Price) TotalPrice ¶
type RollbackSnapshotRequest ¶
type Server ¶
type Server struct { ServerId string `xml:"serverId"` ServerName string `xml:"serverName"` Cores int `xml:"cores"` Ram int `xml:"ram"` InternetAccess bool `xml:"internetAccess"` ProvisioningState string `xml:"provisioningState"` Ips []string `xml:"ips"` LastModificationTime time.Time `xml:"lastModificationTime"` CreationTime time.Time `xml:"creationTime"` VirtualMachineState string `xml:"virtualMachineState"` AvailabilityZone string `xml:"availabilityZone"` Region string `xml:"region"` Nics []*Nic `xml:"nics"` ConnectedStorages []*ConnectedStorage `xml:"connectedStorages"` }
type Snapshot ¶
type Snapshot struct { SnapshotId string `xml:"snapshotId"` // type="xs:string"/> Description string `xml:"description"` // type="xs:string" minOccurs="0"/> SnapshotSize int `xml:"snapshotSize"` // type="xs:long"/> SnapshotName string `xml:"snapshotName"` // type="xs:string" minOccurs="0"/> ProvisioningState string `xml:"provisioningState"` // type="tns:provisioningState"/> Bootable bool `xml:"bootable"` // type="xs:boolean" minOccurs="0"/> OsType string `xml:"osType"` // type="tns:osType" minOccurs="0"/> CpuHotPlug bool `xml:"cpuHotPlug"` // type="xs:boolean" minOccurs="0"/> RamHotPlug bool `xml:"ramHotPlug"` // type="xs:boolean" minOccurs="0"/> NicHotPlug bool `xml:"nicHotPlug"` // type="xs:boolean" minOccurs="0"/> NicHotUnPlug bool `xml:"nicHotUnPlug"` // type="xs:boolean" minOccurs="0"/> Region string `xml:"region"` // type="tns:region"/> }
type SoapAddress ¶
type SoapAddress struct {
Location string `xml:"location,attr"`
}
type SoapBinding ¶
type SoapBinding struct {
Transport string `xml:"transport,attr"`
}
type SoapOperation ¶
type StartServerRequest ¶
type Storage ¶
type Storage struct { DataCenterId string `xml:"dataCenterId,omitempty"` DataCenterVersion string `xml:"dataCenterVersion,omitempty"` StorageId string `xml:"storageId"` Size int `xml:"size"` StorageName string `xml:"storageName"` BootDevice bool `xml:"bootDevice"` BusType string `xml:"busType"` DeviceNumber int `xml:"deviceNumber"` ImageId string `xml:"mountImage>imageId,omitempty"` ImageName string `xml:"mountImage>imageName,omitempty"` ServerIds []string `xml:"serverIds,omitempty"` ProvisioningState string `xml:"provisioningState,omitempty"` CreationTime time.Time `xml:"creationTime,omitempty"` LastModificationTime time.Time `xml:"lastModificationTime,omitempty"` }
type UpdateServerRequest ¶
type UpdateServerRequest struct { }
type UpdateSnapshotRequest ¶
type UpdateSnapshotRequest struct { XMLName xml.Name `xml:"request"` SnapshotId string `xml:"snapshotId"` // type="xs:string"/> Description string `xml:"description"` // type="xs:string" minOccurs="0"/> SnapshotName string `xml:"snapshotName"` // type="xs:string" minOccurs="0"/> Bootable bool `xml:"bootable"` // type="xs:boolean" minOccurs="0"/> OsType string `xml:"osType"` // type="tns:osType" minOccurs="0"/> CpuHotPlug string `xml:"cpuHotPlug"` // type="xs:boolean" minOccurs="0"/> RamHotPlug string `xml:"ramHotPlug"` // type="xs:boolean" minOccurs="0"/> NicHotPlug string `xml:"nicHotPlug"` // type="xs:boolean" minOccurs="0"/> NicHotUnPlug string `xml:"nicHotUnPlug"` // type="xs:boolean" minOccurs="0"/> }
type WsdlBinding ¶
type WsdlBinding struct { Name string `xml:"name,attr"` Type string `xml:"type,attr"` Operations []*WsdlOperation `xml:"http://schemas.xmlsoap.org/wsdl/ operation"` SoapBindings []*SoapBinding `xml:"http://schemas.xmlsoap.org/wsdl/soap/ binding"` }
type WsdlDefinitions ¶
type WsdlDefinitions struct { Name string `xml:"name,attr"` TargetNamespace string `xml:"targetNamespace,attr"` Imports []*WsdlImport `xml:"http://schemas.xmlsoap.org/wsdl/ import"` Types []*WsdlTypes `xml:"http://schemas.xmlsoap.org/wsdl/ types"` Messages []*WsdlMessage `xml:"http://schemas.xmlsoap.org/wsdl/ message"` PortTypes []*WsdlPortTypes `xml:"http://schemas.xmlsoap.org/wsdl/ portType"` Services []*WsdlService `xml:"http://schemas.xmlsoap.org/wsdl/ service"` Bindings []*WsdlBinding `xml:"http://schemas.xmlsoap.org/wsdl/ binding"` }
func ParseWSDL ¶
func ParseWSDL(b []byte) (def *WsdlDefinitions, e error)
func (*WsdlDefinitions) FindComplexType ¶
func (wsdl *WsdlDefinitions) FindComplexType(name string) *XsdComplexType
func (*WsdlDefinitions) FindMessage ¶
func (wsdl *WsdlDefinitions) FindMessage(name string) *WsdlMessage
func (*WsdlDefinitions) Operations ¶
func (wsdl *WsdlDefinitions) Operations()
type WsdlImport ¶
type WsdlMessage ¶
type WsdlMessage struct { Name string `xml:"name,attr"` Parts []*WsdlMessagePart `xml:"http://schemas.xmlsoap.org/wsdl/ part"` }
type WsdlMessagePart ¶
type WsdlOperation ¶
type WsdlOperation struct { Name string `xml:"name,attr"` Inputs []*WsdlOperationInput `xml:"http://schemas.xmlsoap.org/wsdl/ input"` Outputs []*WsdlOperationOutput `xml:"http://schemas.xmlsoap.org/wsdl/ output"` Faults []*WsdlOperationFault `xml:"http://schemas.xmlsoap.org/wsdl/ fault"` SoapOperations []*SoapOperation `xml:"http://schemas.xmlsoap.org/wsdl/soap/ operation"` }
type WsdlOperationFault ¶
type WsdlOperationInput ¶
type WsdlOperationOutput ¶
type WsdlPort ¶
type WsdlPort struct { Name string `xml:"name,attr"` Binding string `xml:"binding,attr"` SoapAddresses []*SoapAddress `xml:"http://schemas.xmlsoap.org/wsdl/soap/ address"` }
type WsdlPortTypes ¶
type WsdlPortTypes struct { Name string `xml:"name,attr"` Operations []*WsdlOperation `xml:"operation"` }
type WsdlService ¶
type WsdlTypes ¶
type WsdlTypes struct {
XsdSchema []*XsdSchema `xml:"http://www.w3.org/2001/XMLSchema schema"`
}
type XsdComplexContent ¶
type XsdComplexContent struct {
Extension *XsdExtension `xml:"http://www.w3.org/2001/XMLSchema extension"`
}
type XsdComplexType ¶
type XsdComplexType struct { Name string `xml:"name,attr"` Sequence *XsdSequence `xml:"http://www.w3.org/2001/XMLSchema sequence"` ComplexContent *XsdComplexContent `xml:"http://www.w3.org/2001/XMLSchema complexContent"` }
type XsdElement ¶
type XsdElement struct { Name string `xml:"name,attr"` Nillable bool `xml:"nillable,attr"` Type string `xml:"type,attr"` MinOccurs string `xml:"minOccurs,attr"` MaxOccurs string `xml:"maxOccurs,attr"` ComplexType *XsdComplexType `xml:"http://www.w3.org/2001/XMLSchema complexType"` SimpleType *XsdSimpleType `xml:"http://www.w3.org/2001/XMLSchema simpleType"` }
type XsdExtension ¶
type XsdExtension struct {
Sequence *XsdSequence `xml:"http://www.w3.org/2001/XMLSchema sequence"`
}
type XsdMaxInclusive ¶
type XsdMaxInclusive struct {
Value string `xml:"value,attr"`
}
type XsdMinInclusive ¶
type XsdMinInclusive struct {
Value string `xml:"value,attr"`
}
type XsdPattern ¶
type XsdPattern struct {
Value string `xml:"value,attr"`
}
type XsdRestriction ¶
type XsdRestriction struct { Base string `xml:"base,attr"` Pattern *XsdPattern `xml:"http://www.w3.org/2001/XMLSchema pattern"` MinInclusive *XsdMinInclusive `xml:"http://www.w3.org/2001/XMLSchema minInclusive"` MaxInclusive *XsdMaxInclusive `xml:"http://www.w3.org/2001/XMLSchema maxInclusive"` }
type XsdSchema ¶
type XsdSchema struct { TargetNamespace string `xml:"targetNamespace,attr"` ElementFormDefault string `xml:"elementFormDefault,attr"` Imports []*XsdImport `xml:"http://www.w3.org/2001/XMLSchema import"` Elements []*XsdElement `xml:"http://www.w3.org/2001/XMLSchema element"` ComplexTypes []*XsdComplexType `xml:"http://www.w3.org/2001/XMLSchema complexType"` SimpleTypes []*XsdSimpleType `xml:"http://www.w3.org/2001/XMLSchema simpleType"` }
type XsdSequence ¶
type XsdSequence struct {
Elements []*XsdElement `xml:"http://www.w3.org/2001/XMLSchema element"`
}
type XsdSimpleType ¶
type XsdSimpleType struct { Name string `xml:"name,attr"` Sequence *XsdRestriction `xml:"http://www.w3.org/2001/XMLSchema restriction"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.