1- using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Text ;
5- using System . Threading . Tasks ;
6- using Newtonsoft . Json ;
1+ using Newtonsoft . Json ;
2+ using OpenStack . Serialization ;
3+
74namespace OpenStack . Networking . v2 . Layer3
85{
96 /// <summary>
107 ///
118 /// </summary>
9+ [ JsonConverterWithConstructor ( typeof ( RootWrapperConverter ) , "security_group_rule" ) ]
1210 public class SecurityGroupRule
1311 {
1412 /// <summary>
15- ///ngress or egress: the direction in which the security group rule is applied.
16- ///For a compute instance, an ingress security group rule is applied to incoming (ingress) traffic for that instance.
17- ///An egress rule is applied to traffic leaving the instance.
13+ /// ingress or egress: the direction in which the security group rule is applied.
14+ /// For a compute instance, an ingress security group rule is applied to incoming (ingress) traffic for that instance.
15+ /// An egress rule is applied to traffic leaving the instance.
1816 /// </summary>
1917 [ JsonProperty ( "direction" ) ]
20- public string Direction ;
18+ public TrafficDirection Direction ;
2119
2220 /// <summary>
23- ///Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules.
21+ /// The internet protocol version. Addresses represented in CIDR must match the ingress or egress rules.
2422 /// </summary>
2523 [ JsonProperty ( "ethertype" ) ]
26- public string Ethertype ;
24+ public IPVersion Ethertype ;
2725
2826 /// <summary>
2927 /// The UUID of the security group rule.
@@ -32,52 +30,46 @@ public class SecurityGroupRule
3230 public Identifier Id ;
3331
3432 /// <summary>
35- ///The maximum port number in the range that is matched by the security group rule.
36- ///The port_range_min attribute constrains the port_range_max attribute.
37- ///If the protocol is ICMP, this value must be an ICMP type.
33+ /// The minimum port number in the range that is matched by the security group rule.
34+ /// If the protocol is TCP or UDP, this value must be less than or equal to the port_range_max attribute value .
35+ /// If the protocol is ICMP, this value must be an ICMP type.
3836 /// </summary>
39- [ JsonProperty ( "port_range_max " ) ]
40- public int PortRangeMax ;
37+ [ JsonProperty ( "port_range_min " ) ]
38+ public int MinPort { get ; set ; }
4139
42- ///<summary>
43- ///The minimum port number in the range that is matched by the security group rule.
44- ///If the protocol is TCP or UDP, this value must be less than or equal to the port_range_max attribute value .
45- ///If the protocol is ICMP, this value must be an ICMP type.
40+ /// <summary>
41+ /// The maximum port number in the range that is matched by the security group rule.
42+ /// The port_range_min attribute constrains the port_range_max attribute.
43+ /// If the protocol is ICMP, this value must be an ICMP type.
4644 /// </summary>
47- [ JsonProperty ( "port_range_min " ) ]
48- public int PortRangeMin ;
45+ [ JsonProperty ( "port_range_max " ) ]
46+ public int MaxPort { get ; set ; }
4947
5048 /// <summary>
51- ///The protocol that is matched by the security group rule. Value is null, icmp, icmpv6, tcp, or udp.
49+ /// The protocol that is matched by the security group rule.
5250 /// </summary>
5351 [ JsonProperty ( "protocol" ) ]
54- public string Protocol ;
52+ public IPProtocol Protocol ;
5553
56- ///<summary>
57- ///The remote group UUID to associate with this security group rule.
58- ///You can specify either the remote_group_id or remote_ip_prefix attribute in the request body.
54+ /// <summary>
55+ /// The remote group UUID to associate with this security group rule.
56+ /// You can specify either the remote_group_id or remote_ip_prefix attribute in the request body.
5957 /// </summary>
6058 [ JsonProperty ( "remote_group_id" ) ]
61- public string RemoteGroupId ;
59+ public Identifier RemoteGroupId ;
6260
6361 /// <summary>
64- ///The remote IP prefix to associate with this security group rule.
65- ///You can specify either the remote_group_id or remote_ip_prefix attribute in the request body.
66- ///This attribute value matches the IP prefix as the source IP address of the IP packet.
62+ /// The remote IP prefix or CIDR to associate with this security group rule.
63+ /// You can specify either the remote_group_id or remote_ip_prefix attribute in the request body.
64+ /// This attribute value matches the IP prefix as the source IP address of the IP packet.
6765 /// </summary>
6866 [ JsonProperty ( "remote_ip_prefix" ) ]
69- public string RemoteIpPrefix ;
67+ public string RemoteCIDR ;
7068
7169 /// <summary>
72- ///The UUId of security group
70+ /// The UUId of security group
7371 /// </summary>
7472 [ JsonProperty ( "security_group_id" ) ]
75- public string SecurityGroupId ;
76-
77- /// <summary>
78- /// The UUID of the tenant who owns the security group rule. Only administrative users can specify a tenant UUID other than their own.
79- /// </summary>
80- [ JsonProperty ( "tenant_id" ) ]
81- public string TenantId ;
73+ public Identifier SecurityGroupId ;
8274 }
8375}
0 commit comments