Class: IControl::LTConfig::Field

Inherits:
Base
  • Object
show all
Defined in:
lib/icontrol/lt_config/field.rb,
lib/icontrol/lt_config.rb

Overview

The Field interface enables you to manage fields and field instances in the Loosely-Typed Configuration system.

Defined Under Namespace

Classes: EnabledStateSequenceSequence

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

#application_data(opts) ⇒ String[]

Gets application data for one or more loosely-typed configuration fields for this classes. This is the "back-end application hook“.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :field_names (String[])

    A list of (list of) fields for which to get type information, with one list for each class specified, each with one entry for each field requested.

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.



19
20
21
22
# File 'lib/icontrol/lt_config/field.rb', line 19

def application_data(opts)
  opts = check_params(opts,[:field_names])
  super(opts)
end

#clustered_state(opts) ⇒ EnabledState[]

Gets the clustered state for one or more specified loosely-typed configuration fields for this classes. If the field is clustered, that means don’t use the default.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :field_names (String[])

    A list of (list of) fields for which to get clustered states, with one list for each class specified, each with one entry for each field requested.

Returns:

  • (EnabledState[])

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.



34
35
36
37
# File 'lib/icontrol/lt_config/field.rb', line 34

def clustered_state(opts)
  opts = check_params(opts,[:field_names])
  super(opts)
end

#configsyncd_state(opts) ⇒ EnabledState[]

Gets the configsyncd state for one or more specified loosely-typed configuration fields for this classes. If the field is configsyncd, that means don’t use the default.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :field_names (String[])

    A list of (list of) fields for which to get configsyncd states, with one list for each class specified, each with one entry for each field requested.

Returns:

  • (EnabledState[])

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.



49
50
51
52
# File 'lib/icontrol/lt_config/field.rb', line 49

def configsyncd_state(opts)
  opts = check_params(opts,[:field_names])
  super(opts)
end

#db_variable_mirror_information(opts) ⇒ String[]

Gets db variable mirror information for one or more loosely-typed configuration fields for this classes. This, if non-empty, indicates which db variable should have its value mirrored with this field.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :field_names (String[])

    A list of (list of) fields for which to get type information, with one list for each class specified, each with one entry for each field requested.

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.



65
66
67
68
# File 'lib/icontrol/lt_config/field.rb', line 65

def db_variable_mirror_information(opts)
  opts = check_params(opts,[:field_names])
  super(opts)
end

#default(opts) ⇒ String[]

Gets default value information for one or more loosely-typed configuration fields for this classes.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :field_names (String[])

    A list of (list of) fields for which to get type information, with one list for each class specified, each with one entry for each field requested.

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.



80
81
82
83
# File 'lib/icontrol/lt_config/field.rb', line 80

def default(opts)
  opts = check_params(opts,[:field_names])
  super(opts)
end

#display_name(opts) ⇒ String[]

Gets display name information for one or more loosely-typed configuration fields for this classes.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :field_names (String[])

    A list of (list of) fields for which to get type information, with one list for each class specified, each with one entry for each field requested.

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.



95
96
97
98
# File 'lib/icontrol/lt_config/field.rb', line 95

def display_name(opts)
  opts = check_params(opts,[:field_names])
  super(opts)
end

#listString[]

Gets a list of loosely-typed configuration fields for this classes.

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.



107
108
109
# File 'lib/icontrol/lt_config/field.rb', line 107

def list
  super
end

#required_state(opts) ⇒ EnabledState[]

Gets the required state for one or more specified loosely-typed configuration fields for this classes. If the field is required, that means don’t use the default.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :field_names (String[])

    A list of (list of) fields for which to get required states, with one list for each class specified, each with one entry for each field requested.

Returns:

  • (EnabledState[])

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.



121
122
123
124
# File 'lib/icontrol/lt_config/field.rb', line 121

def required_state(opts)
  opts = check_params(opts,[:field_names])
  super(opts)
end

#set_value(opts) ⇒ Object

Sets the value for one loosely-typed configuration field instance for this class instance. This is for convenience, when you want to set just one value in just one class instance. Use set_values instead for greater efficiency when setting multiple field values.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :create_instances_if_needed (boolean)

    Whether to create the class instances if needed.

  • :class_instance_key (IControl::LTConfig::ClassInstanceKey)

    The class instance containing the field of interest.

  • :field_instance_name (String)

    A field instance for which to set value.

  • :value (String)

    A field instance value. The value is given as a string when using this method.

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.



199
200
201
202
# File 'lib/icontrol/lt_config/field.rb', line 199

def set_value(opts)
  opts = check_params(opts,[:create_instances_if_needed,:class_instance_key,:field_instance_name,:value])
  super(opts)
end

#set_values(opts) ⇒ Object

Sets values for one or more loosely-typed configuration field instances for this class instances.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :create_instances_if_needed (boolean)

    Whether to create the class instances if needed.

  • :class_instance_keys (IControl::LTConfig::ClassInstanceKey)

    The class instances containing the fields of interest.

  • :field_instance_names (String[])

    A list of (list of) field instances for which to set values, with one list for each class instance specified, each with one entry for each field to set. As a convenience, if the fields are the same for each class instance, you may pass just 1 list of fields to be used for all class instances. In any case, the class instance must have the fields requested on pain of exception.

  • :values (String[])

    A list of (list of) field instance values, with one list for each class specified, each with one entry for each field specified. Values are given as strings when using this method. As a convenience, if the values are the same for each class instance, you may pass just 1 list of values to be used for all class instances. In any case, the number of fields must match the number of values for a given class instance (and must make sense for each class instance) on pain of exception.

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.



216
217
218
219
# File 'lib/icontrol/lt_config/field.rb', line 216

def set_values(opts)
  opts = check_params(opts,[:create_instances_if_needed,:class_instance_keys,:field_instance_names,:values])
  super(opts)
end

#type_information(opts) ⇒ String[]

Gets type information for one or more loosely-typed configuration fields for this classes. (This is not to be confused with type; type information gives information relevant to the processing of a basic type, for example, type int might have type information specifying min and max value).

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :field_names (String[])

    A list of (list of) fields for which to get type information, with one list for each class specified, each with one entry for each field requested.

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.



138
139
140
141
# File 'lib/icontrol/lt_config/field.rb', line 138

def type_information(opts)
  opts = check_params(opts,[:field_names])
  super(opts)
end

#value(opts) ⇒ String

Gets the value for one loosely-typed configuration field instance for this class instance. This is for convenience, when you want to get just one value in just one class instance. Use get_values instead for greater efficiency when getting multiple field values.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :class_instance_key (IControl::LTConfig::ClassInstanceKey)

    The class instance containing the field of interest.

  • :field_instance_name (String)

    A field instance for which to get value.

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.



156
157
158
159
# File 'lib/icontrol/lt_config/field.rb', line 156

def value(opts)
  opts = check_params(opts,[:class_instance_key,:field_instance_name])
  super(opts)
end

#values(opts) ⇒ String[]

Gets values for one or more loosely-typed configuration field instances for this class instances.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :class_instance_keys (IControl::LTConfig::ClassInstanceKey)

    The class instances containing the fields of interest.

  • :field_instance_names (String[])

    A list of (list of) field instances for which to get values, with one list for each class instance specified, each with one entry for each field requested. As a convenience, if the fields are the same for each class instance, you may pass just 1 list of fields to be used for all class instances. In any case, the class instance must have the fields requested on pain of exception.

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.



172
173
174
175
# File 'lib/icontrol/lt_config/field.rb', line 172

def values(opts)
  opts = check_params(opts,[:class_instance_keys,:field_instance_names])
  super(opts)
end

#versionString

Gets the version information for this interface.

Returns:

  • (String)


181
182
183
# File 'lib/icontrol/lt_config/field.rb', line 181

def version
  super
end