EMI.CONF.KEYS

September 18th, 2009 Leave a comment Go to comments

When called this method returns information about the EMI.CONF key(s) that have been indicated by the key parameter.

EMI.CONF Key Types

EMI.CONF keys have several types. Types are defined in the EMI.CONF modules for each EMI.CONF keys and can be used for validation and EMI-RPC Client application development purposes.

Key Type Description
value The key has value
list The key is a list item
group The key is a group container
unique The key has unique value within the list

EMI.CONF Key Value Types

EMI.CONF keys have several value types. Types are defined in the EMI.CONF modules for each EMI.CONF keys and can be used for validation and EMI-RPC Client application development purposes.

Value Type Description
boolean Values: true or false, for example false
int[x,y] Integer range from x to y
frac[x,y,z] Fractional integer range from x to y with fractional part having maximum of z digits after period. E.g. frac[-3,7,3] can contain value 6.092 or -2.001.
hex[x,y] Hexadecimal range with values from x to y. For example hex[0,FFFF] can have values from 0 to FFFF.
mac MAC address. Values: hex[0,FFFFFFFFFFFF]
ip IP address (ip4 or ip6)
ip4[addr] IPv4 address. Values: 32 bits, presented in dotted quad notation, e.g. 192.168.0.1
ip4[cidr] IPv4 address with netmask. Values: CIDR notation, e.g. 192.168.0.1/24
ip4[netmask] IPv4 netmask in dotted quad notation, e.g. 255.255.0.0
ip6[addr] IPv6 Address. Values: 128 bits, presented in IPv6 notation
ip6[cidr] IPv6 Address. Values: IPv6 in CIDR notation e.g. fec0::80/64
ascii_char[n] Values: ASCII string containing n characters
ascii_text Values: ASCII string of any length
if[phy] Values: Any physical network interface name
if[virtual] Values: Any virtual network interface name
if[any] Values: Any network interface name
enum[str1|str2|str3|...] Values: Defined set of ASCII strings, e.g. enum["yes"|"no"]
bin[n] n bits in binary format, e.g. bin[4] can contain value 0010
object Node contains more nodes underneath
dyn_enum[x,y] Dynamically enumerated strings which can be accessed with “x” key in EMI Stat. Use type definition “y” if stat not available.

Request Parameters

Name Type Mandatory Description
session JSON String yes Session ID
key JSON String or JSON Array of Strings yes Specify EMI.CONF key which info is to be retrieved
rec JSON Boolean no Specify if the keys are traversed recursively. If set to “TRUE”, response shall contain also info on all sub keys of the specified key. Default: “FALSE”.

Response

Name Type Description
data JSON Array Result array

Result Array is JSON Array which contains JSON Objects. The contained JSON Object(s) Structure:

{
  data:
  [
    {
      "key": _JSON String_,
      "type": _JSON String_,
      "value_type": _JSON String_,
      "value_default": _JSON String_,
      "value_name": _JSON String_,
      "description": _JSON String_,
      "required": _JSON Boolean_,
      "priority": _JSON String_
    }, ...
  ]
}

Error Codes

Reference Description
EOK No errors (contains warnings)
EBADPARAM Error in parameters
ENOTFOUND The specified EMI.CONF key not found
EGENERAL Some other error
ESESSION Session with the given ID is not found

Examples

Request to EMI-RPC Server:

{
     "EMI-RPC": "1.0",
     "id": 2,
     "method": "emi.conf.keys",
     "params":
     {
          "session":"",
          "key":"bridge.*.name",
          "rec":FALSE
     }
}

Response from EMI-RPC Server:

{
     "EMI-RPC": "1.0",
     "id": 2,
     "result":
     {
          "data" :
          [
               {
                    "key":"bridge.*.name",
                    "type":"unique",
                    "value_type":"ascii_char[32]",
                    "value_default":"bridge1",
                    "value_name":"Bridge Interface Name",
                    "description":"some description",
                    "required":FALSE,
                    "priority": 100
               }
          ]
     }
}
  1. No comments yet.
  1. No trackbacks yet.