Class: Azure::ARM::Network::Models::SecurityRulePropertiesFormat

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_network/models/security_rule_properties_format.rb

Overview

Model object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accessSecurityRuleAccess

or denied. Possible values are ‘Allow’ and ‘Deny’. Possible values include: ‘Allow’, ‘Deny’

Returns:



49
50
51
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 49

def access
  @access
end

#descriptionString

to 140 chars.

Returns:

  • (String)

    Gets or sets a description for this rule. Restricted



17
18
19
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 17

def description
  @description
end

#destination_address_prefixString

source IP range. Asterix ‘*’ can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used.

Returns:

  • (String)

    Gets or sets destination address prefix. CIDR or



44
45
46
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 44

def destination_address_prefix
  @destination_address_prefix
end

#destination_port_rangeString

range between 0 and 65535. Asterix ‘*’ can also be used to match all ports.

Returns:

  • (String)

    Gets or sets Destination Port or Range. Integer or



31
32
33
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 31

def destination_port_range
  @destination_port_range
end

#directionSecurityRuleDirection

rule.InBound or Outbound. The direction specifies if rule will be evaluated on incoming or outcoming traffic. Possible values include: ‘Inbound’, ‘Outbound’

Returns:



61
62
63
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 61

def direction
  @direction
end

#priorityInteger

be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.

Returns:

  • (Integer)

    Gets or sets the priority of the rule. The value can



55
56
57
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 55

def priority
  @priority
end

#protocolSecurityRuleProtocol

applies to. Can be Tcp, Udp or All(*). Possible values include: ‘Tcp’, ‘Udp’, ‘*’

Returns:



22
23
24
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 22

def protocol
  @protocol
end

#provisioning_stateString

resource Updating/Deleting/Failed

Returns:

  • (String)

    Gets or sets Provisioning state of the PublicIP



65
66
67
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 65

def provisioning_state
  @provisioning_state
end

#source_address_prefixString

range. Asterix ‘*’ can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress rule, specifies where network traffic originates from.

Returns:

  • (String)

    Gets or sets source address prefix. CIDR or source IP



38
39
40
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 38

def source_address_prefix
  @source_address_prefix
end

#source_port_rangeString

between 0 and 65535. Asterix ‘*’ can also be used to match all ports.

Returns:

  • (String)

    Gets or sets Source Port or Range. Integer or range



26
27
28
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 26

def source_port_range
  @source_port_range
end

Class Method Details

.deserialize_object(object) ⇒ SecurityRulePropertiesFormat

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 125

def self.deserialize_object(object)
  return if object.nil?
  output_object = SecurityRulePropertiesFormat.new

  deserialized_property = object['protocol']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = SecurityRuleProtocol.constants.any? { |e| SecurityRuleProtocol.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum SecurityRuleProtocol does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.protocol = deserialized_property

  deserialized_property = object['sourceAddressPrefix']
  output_object.source_address_prefix = deserialized_property

  deserialized_property = object['destinationAddressPrefix']
  output_object.destination_address_prefix = deserialized_property

  deserialized_property = object['access']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = SecurityRuleAccess.constants.any? { |e| SecurityRuleAccess.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum SecurityRuleAccess does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.access = deserialized_property

  deserialized_property = object['direction']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = SecurityRuleDirection.constants.any? { |e| SecurityRuleDirection.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum SecurityRuleDirection does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.direction = deserialized_property

  deserialized_property = object['description']
  output_object.description = deserialized_property

  deserialized_property = object['sourcePortRange']
  output_object.source_port_range = deserialized_property

  deserialized_property = object['destinationPortRange']
  output_object.destination_port_range = deserialized_property

  deserialized_property = object['priority']
  deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty?
  output_object.priority = deserialized_property

  deserialized_property = object['provisioningState']
  output_object.provisioning_state = deserialized_property

  output_object
end

.serialize_object(object) ⇒ Hash

Serializes given Model object into Ruby Hash.

Parameters:

  • object

    Model object to serialize.

Returns:

  • (Hash)

    Serialized object in form of Ruby Hash.



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
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 83

def self.serialize_object(object)
  object.validate
  output_object = {}

  serialized_property = object.protocol
  output_object['protocol'] = serialized_property unless serialized_property.nil?

  serialized_property = object.source_address_prefix
  output_object['sourceAddressPrefix'] = serialized_property unless serialized_property.nil?

  serialized_property = object.destination_address_prefix
  output_object['destinationAddressPrefix'] = serialized_property unless serialized_property.nil?

  serialized_property = object.access
  output_object['access'] = serialized_property unless serialized_property.nil?

  serialized_property = object.direction
  output_object['direction'] = serialized_property unless serialized_property.nil?

  serialized_property = object.description
  output_object['description'] = serialized_property unless serialized_property.nil?

  serialized_property = object.source_port_range
  output_object['sourcePortRange'] = serialized_property unless serialized_property.nil?

  serialized_property = object.destination_port_range
  output_object['destinationPortRange'] = serialized_property unless serialized_property.nil?

  serialized_property = object.priority
  output_object['priority'] = serialized_property unless serialized_property.nil?

  serialized_property = object.provisioning_state
  output_object['provisioningState'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



70
71
72
73
74
75
76
# File 'lib/azure_mgmt_network/models/security_rule_properties_format.rb', line 70

def validate
  fail MsRest::ValidationError, 'property protocol is nil' if @protocol.nil?
  fail MsRest::ValidationError, 'property source_address_prefix is nil' if @source_address_prefix.nil?
  fail MsRest::ValidationError, 'property destination_address_prefix is nil' if @destination_address_prefix.nil?
  fail MsRest::ValidationError, 'property access is nil' if @access.nil?
  fail MsRest::ValidationError, 'property direction is nil' if @direction.nil?
end