drill

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJobEntity

func GetJobEntity(client *golangsdk.ServiceClient, jobId string, label string) (interface{}, error)

func WaitForJobSuccess

func WaitForJobSuccess(client *golangsdk.ServiceClient, secs int, jobID string) error

Types

type CreateOpts

type CreateOpts struct {
	// Protection Group ID
	GroupID string `json:"server_group_id" required:"true"`
	// Drill vpc id
	DrillVpcID string `json:"drill_vpc_id" required:"true"`
	// DR-Drill Name
	Name string `json:"name" required:"true"`
}

CreateOpts contains all the values needed to create a new dr-drill.

func (CreateOpts) ToDrillCreateMap

func (opts CreateOpts) ToDrillCreateMap() (map[string]interface{}, error)

ToDrillCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToDrillCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type Drill

type Drill struct {
	// DR-Drill ID
	Id string `json:"id"`
	// DR-Drill Name
	Name string `json:"name"`
	// DR-Drill Status
	Status string `json:"status"`
	// DR-Drill VPC ID
	DrillVpcID string `json:"drill_vpc_id"`
	// DR-Drill Group ID
	GroupID string `json:"server_group_id"`
	// DR-Drill Volume IDs
	Servers []Servers `json:"drill_servers"`
}

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 dr-drill.

func Get

func Get(c *golangsdk.ServiceClient, id string) (r GetResult)

Get retrieves a particular dr-drill based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Drill, error)

Extract is a function that accepts a result and extracts a dr-drill.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

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 DR-Drill based on the values in CreateOpts.

func Delete

func Delete(c *golangsdk.ServiceClient, id string) (r JobResult)

Delete will permanently delete a particular dr-drill based on its unique ID.

func (JobResult) ExtractJobResponse

func (r JobResult) ExtractJobResponse() (*JobResponse, error)

func (JobResult) ExtractJobStatus

func (r JobResult) ExtractJobStatus() (*JobStatus, error)

type JobStatus

type JobStatus struct {
	Status     string                 `json:"status"`
	Entities   map[string]interface{} `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 Servers

type Servers struct {
	// Protected Instance ID
	ProtectedInstance string `json:"protected_instance"`
	// Drill server ID
	ServerID string `json:"drill_server_id"`
}

type UpdateOpts

type UpdateOpts struct {
	// DR-Drill name
	Name string `json:"name" required:"true"`
}

UpdateOpts contains all the values needed to update a dr-drill.

func (UpdateOpts) ToDrillUpdateMap

func (opts UpdateOpts) ToDrillUpdateMap() (map[string]interface{}, error)

ToDrillUpdateMap builds a update request body from UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToDrillUpdateMap() (map[string]interface{}, error)
}

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 dr-drill.

func Update

func Update(c *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

Update accepts a UpdateOpts struct and uses the values to update a dr-drill. The response code from api is 200

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Drill, error)

Extract is a function that accepts a result and extracts a dr-drill.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL