Class: IControl::System::Inet

Inherits:
Base
  • Object
show all
Defined in:
lib/icontrol/system/inet.rb,
lib/icontrol/system.rb

Overview

The Inet interface exposes the internal API functionality that you can use to manipulate the rc.conf and resolv.conf files. The ntp.conf file includes the functionality that you can use to set and get the following settings: host name, IP address (get only), router, NTP server and DNS server.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class IControl::Base

Instance Method Details

#dns_server_addressString

Gets the IP addresses that the device is using as its DNS servers.

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



18
19
20
# File 'lib/icontrol/system/inet.rb', line 18

def dns_server_address
  super
end

#hostnameString

Gets the host name of the device.

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



29
30
31
# File 'lib/icontrol/system/inet.rb', line 29

def hostname
  super
end

#hostname_to_ipString

Translate this hostname to IP addresses.

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



59
60
61
# File 'lib/icontrol/system/inet.rb', line 59

def hostname_to_ip
  super
end

#ip_to_hostname(opts) ⇒ String

Translate this IP addresses into hostname.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :ip_addresses (String)

    The list of IP addresses to translate into hostnames.

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



72
73
74
75
# File 'lib/icontrol/system/inet.rb', line 72

def ip_to_hostname(opts)
  check_params(opts,[:ip_addresses])
  super
end

#ntp_server_addressString

Gets the IP address/host name that that the device is using for its NTP service.

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



40
41
42
# File 'lib/icontrol/system/inet.rb', line 40

def ntp_server_address
  super
end

#service_name_to_service_number(opts) ⇒ long

Translate this service names to service numbers. If a service name can not be translated into an equivalent service number, a service number of 0 will be returned for that service name.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :service_names (String)

    The list of hostnames to translate into IP addresses

Returns:

  • (long)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



88
89
90
91
# File 'lib/icontrol/system/inet.rb', line 88

def service_name_to_service_number(opts)
  check_params(opts,[:service_names])
  super
end

#service_number_to_service_name(opts) ⇒ String

Translate this service numbers into service names. If an service number can not be translated into an equivalent service name, the string format of the service number will be returned.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :services (long)

    The list of service numbers to translate into service names.

Returns:

  • (String)

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



104
105
106
107
# File 'lib/icontrol/system/inet.rb', line 104

def service_number_to_service_name(opts)
  check_params(opts,[:services])
  super
end

#set_hostname(opts) ⇒ Object

Sets the host name of the device.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :hostname (String)

    The new hostname to set.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



117
118
119
120
# File 'lib/icontrol/system/inet.rb', line 117

def set_hostname(opts)
  check_params(opts,[:hostname])
  super
end

#set_ntp_server_address(opts) ⇒ Object

Configures the IP address/host name that the device uses for its NTP service.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :ntp_addresses (String)

    The IP addresses/host names of valid NTP servers.

Raises:

  • (IControl::IControl::Common::AccessDenied)

    raised if the client credentials are not valid.

  • (IControl::IControl::Common::InvalidArgument)

    raised if one of the arguments is invalid.

  • (IControl::IControl::Common::OperationFailed)

    raised if an operation error occurs.



130
131
132
133
# File 'lib/icontrol/system/inet.rb', line 130

def set_ntp_server_address(opts)
  check_params(opts,[:ntp_addresses])
  super
end

#versionString

Gets the version information for this interface.

Returns:

  • (String)


48
49
50
# File 'lib/icontrol/system/inet.rb', line 48

def version
  super
end