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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
* Proxmox Virtual Environment API
*
* Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
*
* The version of the OpenAPI document: 9.x
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClusterFirewallGetRulesResponseDataInner {
/// Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name
#[serde(rename = "action")]
pub action: String,
/// Descriptive comment
#[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
/// Restrict packet destination address
#[serde(rename = "dest", skip_serializing_if = "Option::is_none")]
pub dest: Option<String>,
/// Restrict TCP/UDP destination port
#[serde(rename = "dport", skip_serializing_if = "Option::is_none")]
pub dport: Option<String>,
/// Flag to enable/disable a rule
#[serde(rename = "enable", skip_serializing_if = "Option::is_none")]
pub enable: Option<i64>,
/// Specify icmp-type. Only valid if proto equals 'icmp' or 'icmpv6'/'ipv6-icmp'
#[serde(rename = "icmp-type", skip_serializing_if = "Option::is_none")]
pub icmp_type: Option<String>,
/// Network interface name. You have to use network configuration key names for VMs and containers
#[serde(rename = "iface", skip_serializing_if = "Option::is_none")]
pub iface: Option<String>,
/// IP version (4 or 6) - automatically determined from source/dest addresses
#[serde(rename = "ipversion", skip_serializing_if = "Option::is_none")]
pub ipversion: Option<i64>,
/// Log level for firewall rule
#[serde(rename = "log", skip_serializing_if = "Option::is_none")]
pub log: Option<models::PveLogEnum>,
/// Use predefined standard macro
#[serde(rename = "macro", skip_serializing_if = "Option::is_none")]
pub r#macro: Option<String>,
/// Rule position in the ruleset
#[serde(rename = "pos")]
pub pos: i64,
/// IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'
#[serde(rename = "proto", skip_serializing_if = "Option::is_none")]
pub proto: Option<String>,
/// Restrict packet source address
#[serde(rename = "source", skip_serializing_if = "Option::is_none")]
pub source: Option<String>,
/// Restrict TCP/UDP source port
#[serde(rename = "sport", skip_serializing_if = "Option::is_none")]
pub sport: Option<String>,
/// Rule type
#[serde(rename = "type")]
pub r#type: String,
}
impl ClusterFirewallGetRulesResponseDataInner {
pub fn new(action: String, pos: i64, r#type: String) -> ClusterFirewallGetRulesResponseDataInner {
ClusterFirewallGetRulesResponseDataInner {
action,
comment: None,
dest: None,
dport: None,
enable: None,
icmp_type: None,
iface: None,
ipversion: None,
log: None,
r#macro: None,
pos,
proto: None,
source: None,
sport: None,
r#type,
}
}
}