Documentation ¶
Index ¶
- Constants
- type AbnormalResp
- type Client
- func (client *Client) CheckInstanceStatus(region string, args *JobPara) (jobResp *JobRespDesc, err error)
- func (client *Client) CreateInstance(region, projectId string, args *CreateInstanceArgs) (retVal interface{}, err error)
- func (client *Client) CreateKeyPair(region, projectId string, arg *KeyPairAttr) (kp *KeyPairResponse, err error)
- func (client *Client) DeleteInstance(region, projectId string, arg *DeleteInstanceArg) (retVal interface{}, err error)
- func (client *Client) DeleteKeyPair(region, projectId, kpName string) error
- func (client *Client) Do(version, region, method, uri string, args interface{}) (respbytes []byte, err error)
- func (client *Client) GetInstanceState(region, projectId, instanceId string) (sr *StateResp, err error)
- func (client *Client) ListFlavors(region, projectId string) (flvList *FlavorResponse, err error)
- func (client *Client) QueryInterfaces(region, projectId, instanceId string) (ifList *InterfaceResponse, err error)
- func (client *Client) RestartInstance(region, projectId, instanceId string, arg *InstanceRestartAttr) error
- func (client *Client) StartInstance(region, projectId, instanceId string, arg *InstanceStartAttr) error
- func (client *Client) StopInstance(region, projectId, instanceId string, arg *InstanceStopAttr) error
- type CmdType
- type CreateInstanceArgs
- type CreateInstanceAttribute
- type CreateInstanceResponse
- type DeleteInstanceArg
- type EmbServer
- type Entity
- type ErrBody
- type FixIP
- type FlavorList
- type FlavorResponse
- type InstanceRestartAttr
- type InstanceStartAttr
- type InstanceStopAttr
- type Interface
- type InterfaceResponse
- type JobPara
- type JobRespDesc
- type KeyPair
- type KeyPairAttr
- type KeyPairDesc
- type KeyPairResponse
- type LinkDesc
- type NicDesc
- type NormalResp
- type OS_Ext_Spec
- type RootVolDesc
- type SecGrp
- type Server
- type StateResp
- type SubJob
- type Svr
Constants ¶
View Source
const ( ECSDefaultEndpoint = "https://10.175.38.51" ECSVersion = "v1" ECSName = "cloudservers" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbnormalResp ¶
type AbnormalResp struct {
Error ErrBody `json:"error"`
}
type Client ¶
func (*Client) CheckInstanceStatus ¶
func (client *Client) CheckInstanceStatus(region string, args *JobPara) (jobResp *JobRespDesc, err error)
func (*Client) CreateInstance ¶
func (client *Client) CreateInstance(region, projectId string, args *CreateInstanceArgs) (retVal interface{}, err error)
func (*Client) CreateKeyPair ¶
func (client *Client) CreateKeyPair(region, projectId string, arg *KeyPairAttr) (kp *KeyPairResponse, err error)
func (*Client) DeleteInstance ¶
func (client *Client) DeleteInstance(region, projectId string, arg *DeleteInstanceArg) (retVal interface{}, err error)
func (*Client) DeleteKeyPair ¶
func (*Client) GetInstanceState ¶
func (*Client) ListFlavors ¶
func (client *Client) ListFlavors(region, projectId string) (flvList *FlavorResponse, err error)
func (*Client) QueryInterfaces ¶
func (client *Client) QueryInterfaces(region, projectId, instanceId string) (ifList *InterfaceResponse, err error)
func (*Client) RestartInstance ¶
func (client *Client) RestartInstance(region, projectId, instanceId string, arg *InstanceRestartAttr) error
func (*Client) StartInstance ¶
func (client *Client) StartInstance(region, projectId, instanceId string, arg *InstanceStartAttr) error
func (*Client) StopInstance ¶
func (client *Client) StopInstance(region, projectId, instanceId string, arg *InstanceStopAttr) error
type CreateInstanceArgs ¶
type CreateInstanceArgs struct {
ServerAttr CreateInstanceAttribute `json:"server"`
}
type CreateInstanceAttribute ¶
type CreateInstanceAttribute struct { ImageId string `json:"imageRef"` FlavorId string `json:"flavorRef"` InstanceName string `json:"name"` VpcId string `json:"vpcid"` AvailableZone string `json:"availability_zone"` Nic []NicDesc `json:"nics"` RootVol RootVolDesc `json:"root_volume"` SecGrps []SecGrp `json:"security_groups"` AdminPass string `json:"adminPass"` KeyName string `json:"key_name"` }
type CreateInstanceResponse ¶
type CreateInstanceResponse struct { }
type DeleteInstanceArg ¶
type FlavorList ¶
type FlavorList struct { Id string `json:"id"` Name string `json:"name"` Vcpus string `json:"vcpus"` Ram uint32 `sjon:"ram"` Disk string `json:"disk"` Swap string `json:"swap"` Flavor_OS_Ext uint32 `json:"OS-FLV-EXT-DATA:ephemeral"` Flavor_OS_Dis bool `json:"OS-FLV-DISABLED:disabled"` RxTx_Factor float32 `json:"rxtx_factor"` RxTx_Quota string `json:"rxtx_quota"` RxTx_Cap string `json:"rxtx_cap"` Flavor_OS_Acc bool `json:"os-flavor-access:is_public"` Links []LinkDesc `json:"links"` Os_Ext_Specs OS_Ext_Spec `json:"os_extra_specs"` }
type FlavorResponse ¶
type FlavorResponse struct {
Flavors []FlavorList `json:"flavors"`
}
type InstanceRestartAttr ¶
type InstanceRestartAttr struct {
RebootCmd CmdType `json:"reboot"`
}
type InstanceStartAttr ¶
type InstanceStartAttr struct {
StartCmd string `json:"os-start"`
}
type InstanceStopAttr ¶
type InstanceStopAttr struct {
StopCmd string `json:"os-stop"`
}
type InterfaceResponse ¶
type InterfaceResponse struct {
InterfaceList []Interface `json:"interfaceAttachments"`
}
type JobRespDesc ¶
type JobRespDesc struct { Status string `json:"status"` ServerEntity Entity `json:"entities"` JobId string `json:"job_id"` JobType string `json:"job_type"` BeginTime string `json:"begin_time"` EndTime string `json:"end_time"` ErrorCode string `json:"error_code"` FailReason string `json:"fail_reason"` Message string `json:"message"` Code string `json:"code"` }
type KeyPairAttr ¶
type KeyPairAttr struct {
KP KeyPair `json:"keypair"`
}
type KeyPairDesc ¶
type KeyPairResponse ¶
type KeyPairResponse struct {
KPr KeyPairDesc `json:"keypair"`
}
type NormalResp ¶
type NormalResp struct {
Job_Id string `json:"job_id"`
}
type OS_Ext_Spec ¶
type RootVolDesc ¶
type Server ¶
type Server struct {
Id string `json:"server_id"`
}
{"status":"SUCCESS","entities":{"sub_jobs_total":1,"sub_jobs":[{"status":"SUCCESS","entities":{"server_id":"d89f8ca7-e54b-4d00-b539-d2621707f1a3"},"job_id":"4010b39b5404b277015404b72e8a0090","job_type":"createSingleServer","begin_time":"2016-04-11T09:46:34.505Z","end_time":"2016-04-11T09:50:16.819Z","error_code":null,"fail_reason":null}]},"job_id":"4010b39b5404b277015404b71f150084","job_type":"createServer","begin_time":"2016-04-11T09:46:30.547Z","end_time":"2016-04-11T09:50:34.756Z","error_code":null,"fail_reason":null}
type SubJob ¶
type SubJob struct { Status string `json:"status"` Entities Server `json:"entities"` JobId string `json:"job_id"` JobType string `json:"job_type"` BeginTime string `json:"begin_time"` EndTime string `json:"end_time"` ErrorCode string `json:"error_code"` FailReason string `json:"fail_reason"` Message string `json:"message"` Code string `json:"code"` }
Click to show internal directories.
Click to hide internal directories.