Documentation ¶
Overview ¶
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index ¶
- Constants
- Variables
- type Access
- func (a Access) ActivateCDNContainer(container string) error
- func (a Access) AuthToken() string
- func (a Access) CreateDBInstance(db DatabaseReq) (*NewDBInstance, error)
- func (a Access) CreateDBSecRule(Req DBSecRuleReq) (*DBSecRule, error)
- func (a Access) CreateDomain(name, email string, ttl int64) (*Domain, error)
- func (a Access) CreateImage(server_id string, metadata *map[string]string) error
- func (a Access) CreateRecord(domain Domain, t, data string) (*Record, error)
- func (a Access) CreateServer(s Server) (*ServerResponse, error)
- func (a Access) DBSecGroupDetails(sg string) (*SecurityGroup, error)
- func (a Access) DeleteCDNEnabledContainer(container string) error
- func (a Access) DeleteDBInstance(instanceID string) error
- func (a Access) DeleteDomain(domain Domain) error
- func (a Access) DeleteImage(image_id string) error
- func (a Access) DeleteServer(server_id string) error
- func (a Access) DetachVolume(at Attachment) error
- func (a Access) DisableCDNEnabledContainer(container string) error
- func (a Access) EnableCDNEnabledContainer(container string) error
- func (a Access) GetConsoleOutput(server_id string, length int) (string, error)
- func (a Access) GetDBFlavor(ID string) (*DBFlavor, error)
- func (a Access) GetDBInstance(id string) (*InstDetails, error)
- func (a Access) GetDBSecurityGroups() (*[]SecurityGroup, error)
- func (a Access) GetEndpointURL(servName string, region string) string
- func (a *Access) GetTenants() error
- func (a Access) GetVNCConsole(server_id int64) (string, error)
- func (a Access) HMAC(secret_key, tenant, hmac_body string) string
- func (a Access) HMAC_PostBody(max_file_size, max_file_count, path, redirect, expires, tenant string) string
- func (a Access) ListAllFlavors() (*DBFlavors, error)
- func (a Access) ListCDNEnabledContainers(enabled_only bool) (*CDNContainers, error)
- func (a Access) ListDBInstances() (*DBInstances, error)
- func (a Access) ListDomains() ([]Domain, error)
- func (a Access) ListFlavors() (*Flavors, error)
- func (a Access) ListImage(image_id string) (*Image, error)
- func (a Access) ListImages() (*Images, error)
- func (a Access) ListObjects(directory string) (*FileList, error)
- func (a Access) ListServerAddresses(server_id int64) ([]Address, error)
- func (a Access) ListServers() ([]Server, error)
- func (a Access) ListSnapshots() ([]Volume, error)
- func (a Access) ListVolumes() ([]Volume, error)
- func (a Access) ListVolumesForServer(server_id string) ([]Attachment, error)
- func (a Access) NewVolume(v *Volume) error
- func (a Access) ObjectStoreDelete(filename string) error
- func (a Access) ObjectStoreUpload(filename, container string, header *http.Header) error
- func (a Access) RebootServer(server_id string) error
- func (a Access) RemoveDBSecRule(ruleID string) error
- func (a Access) ResetDBPassword(id string) (*DBCredentials, error)
- func (a Access) RestartDBInstance(instanceID string) error
- func (a Access) RetrieveCDNEnabledContainerMetadata(container string) (*http.Header, error)
- func (a Access) ScopeToken(name string) (*Access, error)
- func (a Access) TemporaryURL(filename, expires string) string
- func (a Access) TenantForName(name string) (string, error)
- func (a Access) UpdateCDNEnabledContainerMetadata(container string, data map[string]string) error
- type Address
- type Addresses
- type Attachment
- type BadRequest
- type CDNContainer
- type CDNContainers
- type DBCredentials
- type DBFlavor
- type DBFlavors
- type DBInstance
- type DBInstances
- type DBSecGroups
- type DBSecRule
- type DBSecRuleReq
- type DNSError
- type DNSErrorResponse
- type Database
- type DatabaseReq
- type Domain
- type Endpoint
- type FailureResponse
- type File
- type FileList
- type Flavor
- type Flavor_
- type Flavors
- type Forbidden
- type HashedFile
- type IDLink
- type Image
- type Images
- type InstDetails
- type InternalServerError
- type Link
- type Login
- type NewDBInstance
- type NotFound
- type Record
- type Role
- type Rule
- type Scope
- type SecurityGroup
- type Server
- type ServerImage
- type ServerResponse
- type ServiceCatalog
- type SubToken
- type Tenant
- type TenantScope
- type Tenants
- type Token
- type Unauthorized
- type User
- type Volume
Constants ¶
const ( XSmall = Flavor(100) + iota Small Medium Large XLarge DblXLarge )
Variables ¶
var ( UbuntuLucid10_04Kernel = ServerImage(1235) UbuntuLucid10_04 = ServerImage(1236) UbuntuMaverick10_10Kernel = ServerImage(1237) UbuntuMaverick10_10 = ServerImage(1238) UbuntuNatty11_04Kernel = ServerImage(1239) UbuntuNatty11_04 = ServerImage(1240) UbuntuOneiric11_10 = ServerImage(5579) UbuntuPrecise12_04 = ServerImage(8419) CentOS5_8Server64 = ServerImage(54021) CentOS6_2Server64Kernel = ServerImage(1356) CentOS6_2Server64Ramdisk = ServerImage(1357) CentOS6_2Server64 = ServerImage(1358) DebianSqueeze6_0_3Kernel = ServerImage(1359) DebianSqueeze6_0_3Ramdisk = ServerImage(1360) DebianSqueeze6_0_3Server = ServerImage(1361) Fedora16Server64 = ServerImage(16291) BitNamiDrupal7_14_0 = ServerImage(22729) BitNamiWebPack1_2_0 = ServerImage(22731) BitNamiDevPack1_0_0 = ServerImage(4654) ActiveStateStackatov1_2_6 = ServerImage(14345) ActiveStateStackatov2_2_2 = ServerImage(59297) ActiveStateStackatov2_2_3 = ServerImage(60815) EnterpriseDBPPAS9_1_2 = ServerImage(9953) EnterpriseDBPSQL9_1_3 = ServerImage(9995) )
var CDN_URL = "https://region-b.geo-1.cdnmgmt.hpcloudsvc.com/v1.0/"
CDN
var COMPUTE_URL = "https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/"
Compute
var DNS_URL = "https://region-a.geo-1.dns.hpcloudsvc.com/v1/"
DNS
var OBJECT_STORE = "https://region-b.geo-1.objects.hpcloudsvc.com/v1.0/"
Object store
var RDB_URL = "https://region-a.geo-1.dbaas-mysql.hpcloudsvc.com/v1.0/"
RDB
var REGION_URL = "https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/"
Identity
var TENANT_URL = REGION_URL + "tenants"
var TOKEN_URL = REGION_URL + "tokens"
Functions ¶
This section is empty.
Types ¶
type Access ¶
type Access struct { A struct { Token Token `json:"token"` User User `json:"user"` Catalogs []ServiceCatalog `json:"serviceCatalog"` } `json:"access"` Authenticated bool Tenants []Tenant SecretKey string AccessKey string TenantID string Client http.Client }
Access describes the reponse received from the /tokens endpoint when posting with username and password.
func Authenticate ¶
Authenticate will send an authentication request to the HP Cloud and return an instance of the Access type.
func (Access) ActivateCDNContainer ¶
Activates a container for the CDN network.
func (Access) AuthToken ¶
Token is a helper method to traverse the Access type to retrieve the auth_token
func (Access) CreateDBInstance ¶
func (a Access) CreateDBInstance(db DatabaseReq) (*NewDBInstance, error)
CreateDBInstance creates new database instance in the HPCloud using
settings found in the DatabaseReq instance passed to this function
This function implements the interface as described in: http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/create-instance.html
func (Access) CreateDBSecRule ¶
func (a Access) CreateDBSecRule(Req DBSecRuleReq) (*DBSecRule, error)
Creates new security group rule
This function implements the interface as described in: http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/create-security-group-rule.html
func (Access) CreateDomain ¶
func (Access) CreateImage ¶
CreateImage will make a snapshot of the server_id along with associating the relevant metadata with it.
func (Access) CreateRecord ¶
func (Access) CreateServer ¶
func (a Access) CreateServer(s Server) (*ServerResponse, error)
CreateServer creates a new server in the HPCloud using the settings found in the Server instance passed to this function.
This function implements the interface as described in:- * https://docs.hpcloud.com/api/compute/ * section 4.4.5.2 Create Server
func (Access) DBSecGroupDetails ¶
func (a Access) DBSecGroupDetails(sg string) (*SecurityGroup, error)
This function lists specific security group.
This function implements the interface as described in: http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/get-security-group.html
func (Access) DeleteCDNEnabledContainer ¶
Entirely deletes a container from the CDN, note: this does not delete the container from the objectstore.
func (Access) DeleteDBInstance ¶
This function takes instance ID and deletes database instance with this ID.
This function implements the interface as described in: http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/delete-instance.html
func (Access) DeleteDomain ¶
func (Access) DeleteImage ¶
func (Access) DeleteServer ¶
DeleteServer deletes the server with the `server_id`.
This function implements the interface described in:- * https://docs.hpcloud.com/api/compute/ * Section 4.4.6.3 Delete Server
func (Access) DetachVolume ¶
func (a Access) DetachVolume(at Attachment) error
DetachVolume will remove a volume from whatever server it is attached to.
func (Access) DisableCDNEnabledContainer ¶
Disables a container from the CDN. This is usually preferred over deleting the CDN container since the the container will remain in the CDN and thus can be activated at a later time with no overhead.
func (Access) EnableCDNEnabledContainer ¶
Re-enables a container.
func (Access) GetConsoleOutput ¶
func (Access) GetDBFlavor ¶
This function returns flavor specs for given flavor.
This function implements the interface as described in: http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/get-flavor.html
func (Access) GetDBInstance ¶
func (a Access) GetDBInstance(id string) (*InstDetails, error)
This function retrieves details of the instance with provided ID.
This function implements the interface as described in: http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/get-instance.html
func (Access) GetDBSecurityGroups ¶
func (a Access) GetDBSecurityGroups() (*[]SecurityGroup, error)
This function lists all the security groups available for tenant.
This function implements the interface as described in: http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/list-security-groups.html
func (Access) GetEndpointURL ¶
This function takes service name and region as parameters and returns
public URL for endpoint, that can be queried later on.
func (*Access) GetTenants ¶
func (Access) GetVNCConsole ¶
GetVNCConsole retrieves the VNC URL for the specified server.
func (Access) HMAC ¶
HMAC is a helper method to interpolate and properly format the HMAC signature which is used on the HPCloud.
func (Access) HMAC_PostBody ¶
func (a Access) HMAC_PostBody(max_file_size, max_file_count, path, redirect, expires, tenant string) string
Generates the FilePOST body which should be hashed with using the HMAC-SHA1 hash and used as the signature for the POST request.
func (Access) ListAllFlavors ¶
ListAllFlavors lists all available database flavors. This function implements interface as described in:-
http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/list-flavors.html
func (Access) ListCDNEnabledContainers ¶
func (a Access) ListCDNEnabledContainers(enabled_only bool) (*CDNContainers, error)
Lists available containers.
When enabled_only == true you will only receive the containers which are enabled and the disabled containers will be ignored.
func (Access) ListDBInstances ¶
func (a Access) ListDBInstances() (*DBInstances, error)
ListDBInstances will list all the available database instances
This function implements the interface as described in: http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/list-database-instances.html
func (Access) ListDomains ¶
func (Access) ListFlavors ¶
ListFlavors will list all the available flavours on the HPCloud compute API.
func (Access) ListImages ¶
func (Access) ListServerAddresses ¶
ListServerAddresses will list all the addresses associated with the provided server_id.
func (Access) ListServers ¶
func (Access) ListSnapshots ¶
ListSnapshots will return a slice of Volumes for which are in-fact snapshots of your systems.
func (Access) ListVolumes ¶
ListVolumes returns a slice of volumes which are currently associated with the token_id you provide.
func (Access) ListVolumesForServer ¶
func (a Access) ListVolumesForServer(server_id string) ([]Attachment, error)
func (Access) NewVolume ¶
NewVolume takes a volume instance and will create that in the cloud. This function will return *before* the instance is created. In order to know when the instance has been created you will need to check the status using the provided methods.
func (Access) ObjectStoreDelete ¶
func (Access) ObjectStoreUpload ¶
ObjectStoreUpload allows you to upload a file onto the HPCloud, it will hash the file and check the returned hash to ensure end-to-end integrity.
It also takes an optional header which will have it's contents added to the request.
func (Access) RebootServer ¶
RebootServer will reboot the server with the `server_id`.
This function implements the interface described in:- * https://docs.hpcloud.com/api/compute/ * Section 4.4.7.1 Reboot Server
func (Access) RemoveDBSecRule ¶
Deletes security rule
This function implements the interface as described in: http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/delete-security-group-rule.html
func (Access) ResetDBPassword ¶
func (a Access) ResetDBPassword(id string) (*DBCredentials, error)
This function takes instance ID and resets password for this instance. It returns a new instance password.
This function implements the interface as decribed in: http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/reset-instance-password.html
func (Access) RestartDBInstance ¶
This function takes instance ID and restarts DB instance with this ID.
This function implements the interface as described in: http://api-docs.hpcloud.com/hpcloud-rdb-mysql/1.0/content/restart-instance.html
func (Access) RetrieveCDNEnabledContainerMetadata ¶
Will return the metadata associated with a single container.
func (Access) ScopeToken ¶
ScopeToken will scope or rescope an Auth Token to a different tenantID
func (Access) TemporaryURL ¶
TemporaryURL will generate the temporary URL for the supplied filename.
func (Access) TenantForName ¶
On the HP Cloud, tenants have name strings associated with them, you can find the tenantID associated with a name with this function
type Attachment ¶
type BadRequest ¶
type BadRequest struct { B struct { Message string `json:"message"` Details string `json:"details"` Code int64 `json:"code"` } `json:"BadRequest"` }
BadRequest describes the response from a JSON resource when the data which was sent in the original request was malformed or not compliant with the layout specified in the HPCloud documentation
func (BadRequest) Code ¶
func (b BadRequest) Code() int64
func (BadRequest) Details ¶
func (b BadRequest) Details() string
func (BadRequest) Message ¶
func (b BadRequest) Message() string
type CDNContainer ¶
type CDNContainers ¶
type CDNContainers []CDNContainer
type DBCredentials ¶
This type describes Database Credentials
type DBFlavor ¶
type DBFlavor struct { Id int `json:"id"` Links []Link `json:"links"` Name string `json:"name"` Ram int `json:"ram"` Vcpu int `json:"vcpu"` }
Type describing database flavor
type DBFlavors ¶
type DBFlavors struct {
Flavors []DBFlavor `json:"flavors"`
}
func (DBFlavors) GetFlavorRef ¶
type DBInstance ¶
type DBInstances ¶
type DBInstances struct {
Instances []DBInstance `json:"instances"`
}
type DBSecGroups ¶
This type describes Database Security groups
type DBSecRuleReq ¶
type DBSecRuleReq struct { SecurityGroupID string `json:"security_group_rule"` Cidr string `json:"cidr"` FromPort int64 `json:"from_port"` ToPort int64 `json:"to_port"` }
DB Security Group Create request struct
func (DBSecRuleReq) MarshalJSON ¶
func (rq DBSecRuleReq) MarshalJSON() ([]byte, error)
type DNSErrorResponse ¶
type DatabaseReq ¶
type DatabaseReq struct {
Instance Database `json:"instance"`
}
This type describes the JSON data which should be sent to the
create database instance resource.
func (DatabaseReq) MarshalJSON ¶
func (db DatabaseReq) MarshalJSON() ([]byte, error)
Creates JSON string for Create DB request
type FailureResponse ¶
type Forbidden ¶
type Forbidden struct { F struct { Code int64 `json:"code"` Details string `json:"details"` Message string `json:"message"` OtherAttributes struct { } `json:"otherAttributes"` } `json:"forbidden"` }
Forbidden describes the response from a JSON resource when the request could not be completed due to the user making the request being disabled or suspended.
type HashedFile ¶
type HashedFile struct { MD5 hash.Hash FileContents *bytes.Reader Length int // contains filtered or unexported fields }
HashedFile is an io.ReadWriter which reads a file into memory whilst giving you access to the hashed contents and only reading the file once
func OpenAndHashFile ¶
func OpenAndHashFile(filename string) (*HashedFile, error)
Helper function to open, hash and return an io.ReadWriter of the file.
type InstDetails ¶
type InstDetails struct { Created string `json:"created"` Hostname string `json:"hostname"` ID string `json:"id"` Links []Link `json:"links"` Name string `json:"name"` Port int `json:"port"` SecurityGroups []SecurityGroup `json:"security_groups"` Status string `json:"status"` Updated string `json:"updated"` Flavor struct { Name string `json:"name"` ID string `json:"id"` Links []Link `json:"links"` } `json:"flavor"` }
Instance Details type that is returned by server
type InternalServerError ¶
type InternalServerError struct { ISE struct { Code int64 `json:"code"` Details string `json:"details"` Message string `json:"message"` OtherAttributes struct { } `json:"otherAttributes"` } `json:"internalServerError"` }
InternalServerError describes the response from a JSON resource when the request could not be completed due to the request causing the service to return a 500 status code.
func (InternalServerError) Code ¶
func (ise InternalServerError) Code() int64
func (InternalServerError) Details ¶
func (ise InternalServerError) Details() string
func (InternalServerError) Message ¶
func (ise InternalServerError) Message() string
type NewDBInstance ¶
type NewDBInstance struct { Created string `json:"created"` Credential DBCredentials `json:"credential"` Flavor struct { Name string `json:"name"` ID string `json:"id"` Links []Link `json:"links"` } `json:"flavor"` Hostname string `json:"hostname"` Id string `json:"id"` Links []Link `json:"links"` Name string `json:"name"` SecurityGroups []DBSecGroups `json:"security_groups"` Status string `json:"status"` }
This type describes JSON response from a successful CreateDBInstance call.
type NotFound ¶
type NotFound struct { NF struct { Message string `json:"message"` Details string `json:"details"` Code int64 `json:"code"` } `json:"itemNotFound"` }
NotFound describes the response from a JSON resource when the resource which was interacted with in the original request was not able to be found.
type Role ¶
type Role struct { ID string `json:"id"` ServiceID string `json:"serviceId"` Name string `json:"name"` }
Role describes in-part the response you will receive when making an authentication request.
Roles are services for with the user making an authentication request is authenticated to use.
A personality that a user assumes when performing a specific set of operations. A role includes a set of rights and privileges.
{ "id": "00000000004003", "serviceId": "100", "name": "domainadmin" }
type Rule ¶
type Rule struct { FromPort int `json:"from_port"` ToPort int `json:"to_port"` ID int64 `json:"id"` IPProtocol string `json:"ip_protocol"` ParentGroupID int64 `json:"parent_group_id"` IPRange struct { CIDR string `json:"cidr"` } `json:"ip_range"` Group struct { Name string `json:"name"` TenandID string `json:"tenant_id"` } `json:"group"` }
type SecurityGroup ¶
type Server ¶
type Server struct { ID int64 `json:"id"` ConfigDrive bool `json:"config_drive"` FlavorRef Flavor `json:"flavorRef"` ImageRef ServerImage `json:"imageRef"` MaxCount int `json:"max_count"` MinCount int `json:"min_count"` Name string `json:"name"` Key string `json:"key_name"` Personality string `json:"personality"` UserData string `json:"user_data"` SecurityGroups []SecurityGroup `json:"security_groups"` Links []Link `json:"links"` Metadata map[string]string `json:"metadata"` UUID string `json:"uuid"` }
This type describes the JSON data which should be sent to the create server resource.
func (Server) MarshalJSON ¶
MarshalJSON implements the Marshaler interface for the Server type.
We implement this interface because when creating a server we have optional values and since Go has zero-values and does *not* have configurable zero values we need to make sure that zero-values are converted to known good values.
As such:
- FlavorRef is checked if it's a valid reference.
- Ditto for ImageRef.
- Name cannot be blank.
- If the key is missing, it'll not put anything in.
- The config_drive defaults to false anyway, no need to send a false value.
- Min/MaxCount are ignored if they are zero.
- UserData is ignored if it's a blank string.
- Personality is ignored if it's a blank string.
- Metadata/SecurityGroups are ignored if they have len(0)
type ServerResponse ¶
type ServerResponse struct { S struct { Status string `json:"status"` Updated string `json:"update"` HostID string `json:"hostId"` UserID string `json:"user_id"` Name string `json:"name"` Links []Link `json:"links"` Addresses Addresses `json:"addresses"` TenantID string `json:"tenant_id"` Image IDLink `json:"image"` Created string `json:"created"` UUID string `json:"uuid"` AccessIPv4 string `json:"accessIPv4"` AccessIPv6 string `json:"accessIPv6"` KeyName string `json:"key_name"` AdminPass string `json:"adminPass"` Flavor IDLink `json:"flavor"` ConfigDrive string `json:"config_drive"` ID int64 `json:"id"` SecurityGroups []SecurityGroup `json:"security_groups"` Metadata map[string]string `json:"metadata"` } `json:"server"` }
This type describes the JSON response from a successful CreateServer call.
type ServiceCatalog ¶
type Tenant ¶
type Tenant struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Enabled bool `json:"enabled"` Created string `json:"created"` Updated string `json:"updated"` }
Tenant describes the response which is returned from any resource which contains Tenant information
type TenantScope ¶
type TenantScope struct {
S Scope `json:"auth"`
}
type Token ¶
type Token struct { Expires string `json:"expires"` ID string `json:"id"` Tenant *Tenant `json:"tenant"` }
Token describes in-part the response you will receive when making an authentication request.
If you didn't supply a tenantID (currently this library does not support unscoped authorization requests.) then the tenant section will be null, hence using a pointer type for this field.
"token": { "expires": "<token_expiry_date>", "id": "<your_auth_token>", "tenant": { "id": "<tenant_id>", "name": "<tenant_name>" }
type Unauthorized ¶
type Unauthorized struct { int64 `json:"code"` Details string `json:"details"` Message string `json:"message"` OtherAttributes struct { } `json:"otherAttributes"` } `json:"unauthorized"` }Code
Unauthorized describes the response from a JSON resource when the request could not be completed due to none or incorrect authentication was used to make the request.
func (Unauthorized) Code ¶
func (u Unauthorized) Code() int64
func (Unauthorized) Details ¶
func (u Unauthorized) Details() string
func (Unauthorized) Message ¶
func (u Unauthorized) Message() string
type User ¶
User describes in-part the response you will receive when making an authentication request.
"user": { "id": "<tenant_id>", "name": "<username>", "roles": [<array_of_roles] }
type Volume ¶
type Volume struct { Status string `json:"status"` CreatedAt string `json:"createdAt"` Size int64 `json:"size"` DisplayName string `json:"display_name"` DisplayDesc string `json:"display_description"` SnapshotID int64 `json:"snapshot_id"` ImageRef int64 `json:"imageRef"` Metadata map[string]string `json:"metadata"` AvailabilityZone string `json:"availability_zone"` VolumeType string `json:"volume_type"` Attachments []Attachment `json:"attachments"` }
Volume encapsulates the volumes available in the OpenStack/HP Cloud system *as well as* the volumes you are actually running.
Typically you would create a value of this type and pass it to the CreateVolume function. This type will be returned from any query endpoints which return containers of info about the volumes you may have.
func (Volume) MarshalJSON ¶
We override MarshalJSON because we want to provide additional marshaling logic when creating new compute nodes. This is because the zero values of Volumes are not valid parameters for the compute API.