github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/sdrs/v1/protectiongroups/results.go (about) 1 package protectiongroups 2 3 import ( 4 "github.com/huaweicloud/golangsdk" 5 ) 6 7 type Group struct { 8 //Group ID 9 Id string `json:"id"` 10 //Group Name 11 Name string `json:"name"` 12 //Group Description 13 Description string `json:"description"` 14 //The source AZ of a protection group 15 SourceAZ string `json:"source_availability_zone"` 16 //The target AZ of a protection group 17 TargetAZ string `json:"target_availability_zone"` 18 //An active-active domain 19 DomainID string `json:"domain_id"` 20 //ID of the source VPC 21 SourceVpcID string `json:"source_vpc_id"` 22 //Deployment model 23 DrType string `json:"dr_type"` 24 } 25 26 type commonResult struct { 27 golangsdk.Result 28 } 29 30 // Extract is a function that accepts a result and extracts a group. 31 func (r commonResult) Extract() (*Group, error) { 32 var response Group 33 err := r.ExtractInto(&response) 34 return &response, err 35 } 36 37 func (r commonResult) ExtractInto(v interface{}) error { 38 return r.Result.ExtractIntoStructPtr(v, "server_group") 39 } 40 41 // UpdateResult represents the result of a update operation. Call its Extract 42 // method to interpret it as a Group. 43 type UpdateResult struct { 44 commonResult 45 } 46 47 // GetResult represents the result of a get operation. Call its Extract 48 // method to interpret it as a Group. 49 type GetResult struct { 50 commonResult 51 }