Skip to main content

incus_client/models/
instance_state_network_counters.rs

1/*
2 * Incus external REST API
3 *
4 * This is the REST API used by all Incus clients. Internal endpoints aren't included in this documentation.  The Incus API is available over both a local unix+http and remote https API. Authentication for local users relies on group membership and access to the unix socket. For remote users, the default authentication method is TLS client certificates.
5 *
6 * The version of the OpenAPI document: 1.0
7 * Contact: lxc-devel@lists.linuxcontainers.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// InstanceStateNetworkCounters : InstanceStateNetworkCounters represents packet counters as part of the network section of an instance's state.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct InstanceStateNetworkCounters {
17    /// Number of bytes received
18    #[serde(rename = "bytes_received", skip_serializing_if = "Option::is_none")]
19    pub bytes_received: Option<i64>,
20    /// Number of bytes sent
21    #[serde(rename = "bytes_sent", skip_serializing_if = "Option::is_none")]
22    pub bytes_sent: Option<i64>,
23    /// Number of errors received
24    #[serde(rename = "errors_received", skip_serializing_if = "Option::is_none")]
25    pub errors_received: Option<i64>,
26    /// Number of errors sent
27    #[serde(rename = "errors_sent", skip_serializing_if = "Option::is_none")]
28    pub errors_sent: Option<i64>,
29    /// Number of inbound packets dropped
30    #[serde(rename = "packets_dropped_inbound", skip_serializing_if = "Option::is_none")]
31    pub packets_dropped_inbound: Option<i64>,
32    /// Number of outbound packets dropped
33    #[serde(rename = "packets_dropped_outbound", skip_serializing_if = "Option::is_none")]
34    pub packets_dropped_outbound: Option<i64>,
35    /// Number of packets received
36    #[serde(rename = "packets_received", skip_serializing_if = "Option::is_none")]
37    pub packets_received: Option<i64>,
38    /// Number of packets sent
39    #[serde(rename = "packets_sent", skip_serializing_if = "Option::is_none")]
40    pub packets_sent: Option<i64>,
41}
42
43impl InstanceStateNetworkCounters {
44    /// InstanceStateNetworkCounters represents packet counters as part of the network section of an instance's state.
45    pub fn new() -> InstanceStateNetworkCounters {
46        InstanceStateNetworkCounters {
47            bytes_received: None,
48            bytes_sent: None,
49            errors_received: None,
50            errors_sent: None,
51            packets_dropped_inbound: None,
52            packets_dropped_outbound: None,
53            packets_received: None,
54            packets_sent: None,
55        }
56    }
57}
58