github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/sdrs/v1/drill/results.go (about)

     1  package drill
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  type Drill struct {
     8  	// DR-Drill ID
     9  	Id string `json:"id"`
    10  	// DR-Drill Name
    11  	Name string `json:"name"`
    12  	// DR-Drill Status
    13  	Status string `json:"status"`
    14  	// DR-Drill VPC ID
    15  	DrillVpcID string `json:"drill_vpc_id"`
    16  	// DR-Drill Group ID
    17  	GroupID string `json:"server_group_id"`
    18  	// DR-Drill Volume IDs
    19  	Servers []Servers `json:"drill_servers"`
    20  }
    21  
    22  type Servers struct {
    23  	// Protected Instance ID
    24  	ProtectedInstance string `json:"protected_instance"`
    25  	// Drill server ID
    26  	ServerID string `json:"drill_server_id"`
    27  }
    28  
    29  type commonResult struct {
    30  	golangsdk.Result
    31  }
    32  
    33  // Extract is a function that accepts a result and extracts a dr-drill.
    34  func (r commonResult) Extract() (*Drill, error) {
    35  	var response Drill
    36  	err := r.ExtractInto(&response)
    37  	return &response, err
    38  }
    39  
    40  func (r commonResult) ExtractInto(v interface{}) error {
    41  	return r.Result.ExtractIntoStructPtr(v, "disaster_recovery_drill")
    42  }
    43  
    44  // UpdateResult represents the result of a update operation. Call its Extract
    45  // method to interpret it as a dr-drill.
    46  type UpdateResult struct {
    47  	commonResult
    48  }
    49  
    50  // GetResult represents the result of a get operation. Call its Extract
    51  // method to interpret it as a dr-drill.
    52  type GetResult struct {
    53  	commonResult
    54  }