forked from pulse-vadc/go-vtm
/
statistics_traffic_ips_ip_gateway.go
39 lines (35 loc) · 1.34 KB
/
statistics_traffic_ips_ip_gateway.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (C) 2018, Pulse Secure, LLC.
// Licensed under the terms of the MPL 2.0. See LICENSE file for details.
// Go library for Pulse Virtual Traffic Manager REST version 4.0.
package vtm
import (
"encoding/json"
)
type TrafficIpsIpGatewayStatistics struct {
Statistics struct {
ArpMessage *int `json:"arp_message"`
GatewayPingRequests *int `json:"gateway_ping_requests"`
GatewayPingResponses *int `json:"gateway_ping_responses"`
NodePingRequests *int `json:"node_ping_requests"`
NodePingResponses *int `json:"node_ping_responses"`
Number *int `json:"number"`
NumberInet46 *int `json:"number_inet46"`
NumberRaised *int `json:"number_raised"`
NumberRaisedInet46 *int `json:"number_raised_inet46"`
PingResponseErrors *int `json:"ping_response_errors"`
} `json:"statistics"`
}
func (vtm VirtualTrafficManager) GetTrafficIpsIpGatewayStatistics() (*TrafficIpsIpGatewayStatistics, *vtmErrorResponse) {
conn := vtm.connector.getChildConnector("/tm/4.0/status/local_tm/statistics/traffic_ips/ip_gateway")
data, ok := conn.get()
if ok != true {
object := new(vtmErrorResponse)
json.NewDecoder(data).Decode(object)
return nil, object
}
object := new(TrafficIpsIpGatewayStatistics)
if err := json.NewDecoder(data).Decode(object); err != nil {
panic(err)
}
return object, nil
}