Module: DhcpsApi::OptionValue
- Included in:
- Server
- Defined in:
- lib/dhcpsapi/option_value.rb
Instance Method Summary collapse
-
#get_multicast_option_value(option_id, multicast_scope_name, vendor_name = nil) ⇒ Hash
Retrieves an option value for a multicast scope.
-
#get_option_value(option_id, vendor_name = nil) ⇒ Hash
Retrieves an option value for a default scope.
-
#get_reserved_option_value(option_id, reserved_ip_address, subnet_ip_address, vendor_name = nil) ⇒ Hash
Retrieves an option value for a reservation.
-
#get_subnet_option_value(option_id, subnet_ip_address, vendor_name = nil) ⇒ Hash
Retrieves an option value for a subnet.
-
#list_multicast_option_values(multicast_scope_name, vendor_name = nil) ⇒ Array<Hash>
List option values for a multicast scope.
-
#list_reserved_option_values(reserved_ip_address, subnet_ip_address, vendor_name = nil) ⇒ Array<Hash>
List option values for a reservation.
-
#list_subnet_option_values(subnet_ip_address, vendor_name = nil) ⇒ Array<Hash>
List option values for a subnet.
-
#list_values(vendor_name = nil) ⇒ Array<Hash>
List option values for a default scope.
-
#remove_multicast_option_value(option_id, multicast_scope_name, vendor_name = nil) ⇒ void
Removes an option value for a multicast scope.
-
#remove_option_value(option_id, vendor_name = nil) ⇒ void
Removes a default scope option value.
-
#remove_reserved_option_value(option_id, reserved_ip_address, subnet_ip_address, vendor_name = nil) ⇒ void
Removes an option value for a reservation.
-
#remove_subnet_option_value(option_id, subnet_ip_address, vendor_name = nil) ⇒ void
Removes an option value for a subnet.
-
#set_multicast_option_value(option_id, multicast_scope_name, option_type, values, vendor_name = nil) ⇒ void
Sets an option value for a multicast scope.
-
#set_option_value(option_id, option_type, values, vendor_name = nil) ⇒ void
Sets an option value for a default scope.
-
#set_reserved_option_value(option_id, reserved_ip_address, subnet_ip_address, option_type, values, vendor_name = nil) ⇒ void
Sets an option value for a reservation.
-
#set_subnet_option_value(option_id, subnet_ip_address, option_type, values, vendor_name = nil) ⇒ void
Sets an option value for a subnet.
Instance Method Details
#get_multicast_option_value(option_id, multicast_scope_name, vendor_name = nil) ⇒ Hash
Retrieves an option value for a multicast scope.
api.get_multicast_option_value(3, ‘224.0.0.0’)
167 168 169 170 171 172 173 |
# File 'lib/dhcpsapi/option_value.rb', line 167 def get_multicast_option_value(option_id, multicast_scope_name, vendor_name = nil) dhcp_get_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_multicast_scope(multicast_scope_name) ) end |
#get_option_value(option_id, vendor_name = nil) ⇒ Hash
Retrieves an option value for a default scope.
api.get_option_value(3)
188 189 190 191 192 193 194 |
# File 'lib/dhcpsapi/option_value.rb', line 188 def get_option_value(option_id, vendor_name = nil) dhcp_get_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_default_scope ) end |
#get_reserved_option_value(option_id, reserved_ip_address, subnet_ip_address, vendor_name = nil) ⇒ Hash
Retrieves an option value for a reservation.
api.get_reserved_option_value(3, ‘192.168.42.100’, 192.168.42.0’)
144 145 146 147 148 149 150 |
# File 'lib/dhcpsapi/option_value.rb', line 144 def get_reserved_option_value(option_id, reserved_ip_address, subnet_ip_address, vendor_name = nil) dhcp_get_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_reserved_scope(reserved_ip_address, subnet_ip_address) ) end |
#get_subnet_option_value(option_id, subnet_ip_address, vendor_name = nil) ⇒ Hash
Retrieves an option value for a subnet.
api.get_subnet_option_value(3, ‘192.168.42.0’)
121 122 123 124 125 126 127 |
# File 'lib/dhcpsapi/option_value.rb', line 121 def get_subnet_option_value(option_id, subnet_ip_address, vendor_name = nil) dhcp_get_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_subnet_scope(subnet_ip_address) ) end |
#list_multicast_option_values(multicast_scope_name, vendor_name = nil) ⇒ Array<Hash>
List option values for a multicast scope.
api.list_multicast_option_values(‘224.0.0.0’)
332 333 334 335 336 337 338 |
# File 'lib/dhcpsapi/option_value.rb', line 332 def list_multicast_option_values(multicast_scope_name, vendor_name = nil) items, _ = retrieve_items(:dhcp_enum_option_values_v5, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_multicast_scope(multicast_scope_name), 1024, 0) items end |
#list_reserved_option_values(reserved_ip_address, subnet_ip_address, vendor_name = nil) ⇒ Array<Hash>
List option values for a reservation.
api.list_reserved_option_values(‘192.168.42.100’, ‘192.168.42.0’)
311 312 313 314 315 316 317 |
# File 'lib/dhcpsapi/option_value.rb', line 311 def list_reserved_option_values(reserved_ip_address, subnet_ip_address, vendor_name = nil) items, _ = retrieve_items(:dhcp_enum_option_values_v5, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_reserved_scope(reserved_ip_address, subnet_ip_address), 1024, 0) items end |
#list_subnet_option_values(subnet_ip_address, vendor_name = nil) ⇒ Array<Hash>
List option values for a subnet.
api.list_subnet_option_values(‘192.168.42.0’)
289 290 291 292 293 294 295 |
# File 'lib/dhcpsapi/option_value.rb', line 289 def list_subnet_option_values(subnet_ip_address, vendor_name = nil) items, _ = retrieve_items(:dhcp_enum_option_values_v5, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_subnet_scope(subnet_ip_address), 1024, 0) items end |
#list_values(vendor_name = nil) ⇒ Array<Hash>
List option values for a default scope.
api.list_multicast_option_values
352 353 354 355 356 357 358 |
# File 'lib/dhcpsapi/option_value.rb', line 352 def list_values(vendor_name = nil) items, _ = retrieve_items(:dhcp_enum_option_values_v5, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_default_scope, 1024, 0) items end |
#remove_multicast_option_value(option_id, multicast_scope_name, vendor_name = nil) ⇒ void
This method returns an undefined value.
Removes an option value for a multicast scope.
api.remove_multicast_option_value(3, ‘224.0.0.0’)
249 250 251 252 253 254 255 |
# File 'lib/dhcpsapi/option_value.rb', line 249 def remove_multicast_option_value(option_id, multicast_scope_name, vendor_name = nil) dhcp_remove_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_multicast_scope(multicast_scope_name) ) end |
#remove_option_value(option_id, vendor_name = nil) ⇒ void
This method returns an undefined value.
Removes a default scope option value.
api.remove_option_value(3)
268 269 270 271 272 273 274 |
# File 'lib/dhcpsapi/option_value.rb', line 268 def remove_option_value(option_id, vendor_name = nil) dhcp_remove_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_default_scope ) end |
#remove_reserved_option_value(option_id, reserved_ip_address, subnet_ip_address, vendor_name = nil) ⇒ void
This method returns an undefined value.
Removes an option value for a reservation.
api.remove_reserved_option_value(3, ‘192.168.42.100’, 192.168.42.0’)
229 230 231 232 233 234 235 |
# File 'lib/dhcpsapi/option_value.rb', line 229 def remove_reserved_option_value(option_id, reserved_ip_address, subnet_ip_address, vendor_name = nil) dhcp_remove_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_reserved_scope(reserved_ip_address, subnet_ip_address) ) end |
#remove_subnet_option_value(option_id, subnet_ip_address, vendor_name = nil) ⇒ void
This method returns an undefined value.
Removes an option value for a subnet.
api.remove_subnet_option_value(3, ‘192.168.42.0’)
208 209 210 211 212 213 214 |
# File 'lib/dhcpsapi/option_value.rb', line 208 def remove_subnet_option_value(option_id, subnet_ip_address, vendor_name = nil) dhcp_remove_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_subnet_scope(subnet_ip_address) ) end |
#set_multicast_option_value(option_id, multicast_scope_name, option_type, values, vendor_name = nil) ⇒ void
This method returns an undefined value.
Sets an option value for a multicast scope.
api.set_multicast_option_value(26, ‘224.0.0.0’, DhcpsApi::DHCP_OPTION_DATA_TYPE::DhcpWordOption, [1500])
72 73 74 75 76 77 78 79 80 |
# File 'lib/dhcpsapi/option_value.rb', line 72 def set_multicast_option_value(option_id, multicast_scope_name, option_type, values, vendor_name = nil) dhcp_set_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_multicast_scope(multicast_scope_name), option_type, values.is_a?(Array) ? values : [values] ) end |
#set_option_value(option_id, option_type, values, vendor_name = nil) ⇒ void
This method returns an undefined value.
Sets an option value for a default scope.
api.set_option_value(26, DhcpsApi::DHCP_OPTION_DATA_TYPE::DhcpWordOption, [1500])
97 98 99 100 101 102 103 104 105 |
# File 'lib/dhcpsapi/option_value.rb', line 97 def set_option_value(option_id, option_type, values, vendor_name = nil) dhcp_set_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_default_scope, option_type, values.is_a?(Array) ? values : [values] ) end |
#set_reserved_option_value(option_id, reserved_ip_address, subnet_ip_address, option_type, values, vendor_name = nil) ⇒ void
This method returns an undefined value.
Sets an option value for a reservation.
api.set_reservationt_option_value(3, ‘192.168.42.100’, ‘192.168.42.0’, DhcpsApi::DHCP_OPTION_DATA_TYPE::DhcpIpAddressOption, [‘192.168.42.1’, ‘192.168.42.2’])
46 47 48 49 50 51 52 53 54 |
# File 'lib/dhcpsapi/option_value.rb', line 46 def set_reserved_option_value(option_id, reserved_ip_address, subnet_ip_address, option_type, values, vendor_name = nil) dhcp_set_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_reserved_scope(reserved_ip_address, subnet_ip_address), option_type, values.is_a?(Array) ? values : [values] ) end |
#set_subnet_option_value(option_id, subnet_ip_address, option_type, values, vendor_name = nil) ⇒ void
This method returns an undefined value.
Sets an option value for a subnet.
api.set_subnet_option_value(3, ‘192.168.42.0’, DhcpsApi::DHCP_OPTION_DATA_TYPE::DhcpIpAddressOption, [‘192.168.42.1’, ‘192.168.42.2’])
19 20 21 22 23 24 25 26 27 |
# File 'lib/dhcpsapi/option_value.rb', line 19 def set_subnet_option_value(option_id, subnet_ip_address, option_type, values, vendor_name = nil) dhcp_set_option_value_v5( option_id, vendor_name, DhcpsApi::DHCP_OPTION_SCOPE_INFO.build_for_subnet_scope(subnet_ip_address), option_type, values.is_a?(Array) ? values : [values] ) end |