github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/vpn/v5/connection_monitors/results.go (about) 1 package connection_monitors 2 3 import ( 4 "github.com/chnsz/golangsdk" 5 ) 6 7 type CommonResult struct { 8 golangsdk.Result 9 } 10 11 type ConnectionMonitor struct { 12 ID string `json:"id"` 13 Status string `json:"status"` 14 VpnConnectionId string `json:"vpn_connection_id"` 15 Type string `json:"type"` 16 SourceIp string `json:"source_ip"` 17 DestinationIp string `json:"destination_ip"` 18 ProtoType string `json:"proto_type"` 19 } 20 21 type ListResp struct { 22 ConnectionMonitors []ConnectionMonitor `json:"connection_monitors"` 23 RequestId string `json:"request_id"` 24 } 25 26 func (r CommonResult) Extract() ([]ConnectionMonitor, error) { 27 var s *ListResp 28 err := r.ExtractInto(&s) 29 return s.ConnectionMonitors, err 30 }