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

     1  package replications
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  type Replication struct {
     8  	//Replication ID
     9  	Id string `json:"id"`
    10  	//Replication Name
    11  	Name string `json:"name"`
    12  	//Replication Description
    13  	Description string `json:"description"`
    14  	//Replication Model
    15  	ReplicaModel string `json:"replication_model"`
    16  	//Replication Status
    17  	Status string `json:"status"`
    18  	//Replication Attachment
    19  	Attachment []Attachment `json:"attachment"`
    20  	//Replication Group ID
    21  	GroupID string `json:"server_group_id"`
    22  	//Replication Volume IDs
    23  	VolumeIDs string `json:"volume_ids"`
    24  	//Replication Priority Station
    25  	PriorityStation string `json:"priority_station"`
    26  	//Replication Fault Level
    27  	FaultLevel string `json:"fault_level"`
    28  	//Replication Record Metadata
    29  	RecordMetadata RecordMetadata `json:"record_metadata"`
    30  }
    31  
    32  type Attachment struct {
    33  	//Device Name
    34  	Device string `json:"device"`
    35  	//Protected Instance ID
    36  	ProtectedInstance string `json:"protected_instance"`
    37  }
    38  
    39  type RecordMetadata struct {
    40  	//Whether Multiattach
    41  	Multiattach bool `json:"multiattach"`
    42  	//Whether Bootable
    43  	Bootable bool `json:"bootable"`
    44  	//Volume Size
    45  	VolumeSize int `json:"volume_size"`
    46  	//Volume Type
    47  	VolumeType string `json:"volume_type"`
    48  }
    49  
    50  type commonResult struct {
    51  	golangsdk.Result
    52  }
    53  
    54  // Extract is a function that accepts a result and extracts a replication.
    55  func (r commonResult) Extract() (*Replication, error) {
    56  	var response Replication
    57  	err := r.ExtractInto(&response)
    58  	return &response, err
    59  }
    60  
    61  func (r commonResult) ExtractInto(v interface{}) error {
    62  	return r.Result.ExtractIntoStructPtr(v, "replication")
    63  }
    64  
    65  // UpdateResult represents the result of a update operation. Call its Extract
    66  // method to interpret it as a Replication.
    67  type UpdateResult struct {
    68  	commonResult
    69  }
    70  
    71  // GetResult represents the result of a get operation. Call its Extract
    72  // method to interpret it as a Replication.
    73  type GetResult struct {
    74  	commonResult
    75  }