Documentation
¶
Index ¶
- func GetJobEntity(client *golangsdk.ServiceClient, jobId string, label string) (interface{}, error)
- func WaitForJobSuccess(client *golangsdk.ServiceClient, secs int, jobID string) error
- type Attachment
- type CreateOpts
- type CreateOptsBuilder
- type DeleteOpts
- type DeleteOptsBuilder
- type GetResult
- type Instance
- type JobEntity
- type JobResponse
- type JobResult
- type JobStatus
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJobEntity ¶
func WaitForJobSuccess ¶
Types ¶
type Attachment ¶
type CreateOpts ¶
type CreateOpts struct {
// Group ID
GroupID string `json:"server_group_id" required:"true"`
// Server ID
ServerID string `json:"server_id" required:"true"`
// Instance Name
Name string `json:"name" required:"true"`
// Instance Description
Description string `json:"description,omitempty"`
// Cluster ID
ClusterID string `json:"cluster_id,omitempty"`
// Subnet ID
SubnetID string `json:"primary_subnet_id,omitempty"`
// IP Address
IpAddress string `json:"primary_ip_address,omitempty"`
}
CreateOpts contains all the values needed to create a new instance.
func (CreateOpts) ToInstanceCreateMap ¶
func (opts CreateOpts) ToInstanceCreateMap() (map[string]interface{}, error)
ToInstanceCreateMap builds a create request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type DeleteOpts ¶
type DeleteOpts struct {
// Delete Target Server
DeleteTargetServer bool `json:"delete_target_server,omitempty"`
// Delete Target Eip
DeleteTargetEip bool `json:"delete_target_eip,omitempty"`
}
DeleteOpts contains all the values needed to delete an Instance.
func (DeleteOpts) ToInstanceDeleteMap ¶
func (opts DeleteOpts) ToInstanceDeleteMap() (map[string]interface{}, error)
ToInstanceDeleteMap builds a update request body from DeleteOpts.
type DeleteOptsBuilder ¶
DeleteOptsBuilder allows extensions to add additional parameters to the Delete request.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a Instance.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type Instance ¶
type Instance struct {
// Instance ID
Id string `json:"id"`
// Instance Name
Name string `json:"name"`
// Instance Description
Description string `json:"description"`
// Protection Group ID
GroupID string `json:"server_group_id"`
// Instance Status
Status string `json:"status"`
// Source Server
SourceServer string `json:"source_server"`
// Target Server
TargetServer string `json:"target_server"`
// Attachment
Attachment []Attachment `json:"attachment"`
}
type JobResponse ¶
type JobResponse struct {
JobID string `json:"job_id"`
}
type JobResult ¶
type JobResult struct {
golangsdk.Result
}
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (r JobResult)
Create will create a new Instance based on the values in CreateOpts.
func Delete ¶
func Delete(c *golangsdk.ServiceClient, id string, opts DeleteOptsBuilder) (r JobResult)
Delete will permanently delete a particular Instance based on its unique ID.
func (JobResult) ExtractJobResponse ¶
func (r JobResult) ExtractJobResponse() (*JobResponse, error)
func (JobResult) ExtractJobStatus ¶
type JobStatus ¶
type JobStatus struct {
Status string `json:"status"`
Entities JobEntity `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"`
}
type UpdateOpts ¶
type UpdateOpts struct {
// Instance name
Name string `json:"name" required:"true"`
}
UpdateOpts contains all the values needed to update an Instance.
func (UpdateOpts) ToInstanceUpdateMap ¶
func (opts UpdateOpts) ToInstanceUpdateMap() (map[string]interface{}, error)
ToInstanceUpdateMap builds a update request body from UpdateOpts.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of a update operation. Call its Extract method to interpret it as a Instance.
func Update ¶
func Update(c *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)
Update accepts a UpdateOpts struct and uses the values to update an Instance.The response code from api is 200
func (UpdateResult) ExtractInto ¶
func (r UpdateResult) ExtractInto(v interface{}) error