Changes between Version 20 and Version 21 of Software/eAM/aInventory


Ignore:
Timestamp:
Jan 23, 2016, 10:30:52 PM (9 years ago)
Author:
seskar
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Software/eAM/aInventory

    v20 v21  
    6464{{{
    6565<services>
    66   <serviceGroup prefix="/inventory" name="inventory">
    67     <info></info>
     66  <serviceGroup name="inventory" prefix="/inventory">
     67    <info>Service to retrieve information about nodes or testbeds from the Inventory Database</info>
    6868    <service name="attribute_add"></service>
    6969    <service name="attribute_delete"></service>
    7070    <service name="attribute_list"></service>
    7171    <service name="attribute_listChildren"></service>
    72     <service name="attribute_modify">
     72    <service name="attribute_list_full"></service>
     73    <service name="attribute_modify"></service>
     74    <service name="attribute_swap"></service>
     75    <service name="domain_nodes"></service>
     76    <service name="parent_list"></service>
    7377    <service name="relation_add"></service>
    7478    <service name="resource_add"></service>
    7579    <service name="resource_delete"></service>
    7680    <service name="resource_list"></service>
     81    <service name="resource_rename"></service>
     82    <service name="resource_swap"></service>
    7783    <service name="topology_add"></service>
    7884    <service name="topology_delete"></service>
    7985    <service name="topology_list"></service>
     86    <service name="topology_nodes"></service>
    8087    <service name="topology_show"></service>
     88    <service name="update_cache"></service>
    8189  </serviceGroup>
    8290</services>
    8391}}}
    8492
    85 ''' resource_add - Add Resource '''
     93==== Attribute Services ====
     94
     95===== attribute_add - Add an attribute =====
     96
     97{{{
     98<service name="attribute_add">
     99  <info>Add attribute to resource</info>
     100  <args>
     101    <arg isRequired="true" name="name" value="name">
     102      <info>Resource name</info>
     103    </arg>
     104    <arg isRequired="true" name="attribute" value="attribute">
     105      <info>Name of attribute</info>
     106    </arg>
     107    <arg isRequired="true" name="value" value="value">
     108      <info>Value of attribute </info>
     109    </arg>
     110  </args>
     111</service>
     112}}}
     113
     114===== attribute_delete - Delete an attribute =====
     115
     116{{{
     117<service name="attribute_delete">
     118  <info>Delete all attributes matching attribute pattern for all nodes matching node name pattern (rn)</info>
     119  <args>
     120    <arg isRequired="true" name="name" value="name"
     121      <info>Resource name or resource name pattern</info>
     122    </arg>
     123    <arg isRequired="true" name="attribute" value="attribute">
     124      <info>Attribute pattern</info>
     125    </arg>
     126  </args>
     127</service>
     128}}}
     129
     130===== attribute_list - List attributes =====
     131
     132{{{
     133<service name="attribute_list">
     134  <info>Get resource with names matching name pattern with, attributes matching attribute name pattern and value matching attribute value pattern</info>
     135  <args>
     136    <arg isRequired="true" name="set" value="set">
     137      <info>Set of resource names or resource name pattern</info>
     138    </arg>
     139    <arg isRequired="false" name="attribute" value="[attribute]">
     140      <info>Attribute name pattern</info>
     141    </arg>
     142    <arg isRequired="false" name="value" value="[value]">
     143      <info>Attribute value pattern</info>
     144    </arg>
     145  </args>
     146</service>
     147}}}
     148
     149
     150===== attribute_listChildren - List attributes of children =====
     151
     152{{{
     153<service name="attribute_listChildren">
     154  <info>Get node with names matching name pattern with child (device) attributes matching attribute name pattern and value matching attribute value pattern</info>
     155  <args>
     156    <arg isRequired="true" name="set" value="set">
     157      <info>Set of resource names or resource name pattern</info>
     158    </arg>
     159    <arg isRequired="false" name="attribute" value="[attribute]">
     160      <info>Child attribute name pattern</info></arg>
     161    <arg isRequired="false" name="value" value="[value]">
     162      <info>Child attribute value pattern</info>
     163    </arg>
     164  </args>
     165</service>
     166}}}
     167
     168===== attribute_list_full - List node names with attributes =====
     169
     170{{{
     171<service name="attribute_list_full">
     172  <info>Get node with names matching name pattern with attributes matching attribute name pattern and value matching attribute value pattern</info>
     173  <args>
     174    <arg isRequired="true" name="set" value="set">
     175      <info>Set of resource names or resource name pattern</info>
     176    </arg>
     177    <arg isRequired="false" name="attribute" value="[attribute]">
     178      <info>Attribute name pattern</info>
     179    </arg>
     180    <arg isRequired="false" name="value" value="[value]">
     181      <info>Attribute value pattern</info>
     182    </arg>
     183  </args>
     184</service>
     185}}}
     186
     187===== attribute_modify - Modify an attribute value =====
     188
     189{{{
     190<service name="attribute_modify">
     191  <info>Modify attribute's value</info>
     192  <args>
     193    <arg isRequired="true" name="name" value="name">
     194      <info>Resource name</info>
     195    </arg>
     196    <arg isRequired="true" name="attribute" value="attribute">
     197      <info>Attribute name</info>
     198    </arg>
     199    <arg isRequired="true" name="value" value="value">
     200      <info>New value of attribute </info>
     201    </arg>
     202  </args>
     203</service>
     204}}}
     205
     206===== attribute_swap - Swap attribute values between two resources =====
     207
     208{{{
     209<service name="attribute_swap">
     210  <info>Swap attribute of two resources</info>
     211  <args>
     212    <arg isRequired="true" name="attribute" value="atribute">
     213      <info>Attribute to be swapped</info>
     214    </arg>
     215    <arg isRequired="true" name="resource1" value="resource1">
     216      <info>First Resource name</info>
     217    </arg><arg isRequired="true" name="resource2" value="resource2">
     218      <info>Second Resource name</info>
     219    </arg>
     220  </args>
     221</service>
     222}}}
     223
     224==== Resource Services ====
     225
     226Sub-group for resource management. Resources are: '''topology''','''node''','''domain''','''infrastructure'''
     227
     228===== domain_nodes - Show all nodes in a domain =====
     229
     230{{{
     231<service name="domain_nodes">
     232  <info>Get domain nodes</info>
     233  <args>
     234    <arg isRequired="true" name="domain" value="domain">
     235      <info>domain/testbed name</info>
     236    </arg>
     237  </args>
     238</service>
     239}}}
     240
     241===== parent_list - Show all parent resources =====
     242
     243{{{
     244<service name="parent_list">
     245   <info>Get all resources that given resourse belongs to</info>
     246   <args>
     247     <arg isRequired="false" name="name" value="[name]">
     248       <info>Fully qualified resource name</info>
     249     </arg>
     250   </args>
     251</service>
     252}}}
     253
     254===== relation_add - Add Relationship Between Resources =====
     255
     256{{{
     257<service name="relation_add">
     258  <info>Add relatin between two resources</info>
     259  <args>
     260    <arg isRequired="true" name="parent" value="rn">
     261      <info>parent resource name</info>
     262    </arg>
     263    <arg isRequired="true" name="child" value="rn">
     264      <info>child resource name</info>
     265    </arg>
     266  </args>
     267</service>
     268}}}
     269
     270===== resource_add - Add Resource =====
    86271
    87272{{{
     
    89274  <info>Add resource</info>
    90275  <args>
    91      <arg name="name" isRequired="true" value="name">
    92         <info>name of the resource or fully qualified resource name</info>
    93      </arg>
    94      <arg name="type" isRequired="true" value="type">
    95          <info>type of the resource</info>
    96      </arg>
    97      <arg name="xml" isRequired="false" value="[xml]">
    98         <info>xml-encoded hash of resource parameters</info>
    99      </arg>
    100   </args>
    101 </service>
    102 }}}
    103 
    104 ''' resource_delete - Delete Resource '''
    105 This method deletes all resource attributes, but does not delete children resources.
     276    <arg isRequired="true" name="name" value="name">
     277      <info>name of the resource or fully qualified resource name</info>
     278    </arg>
     279    <arg isRequired="true" name="type" value="type">
     280      <info>type of the resource</info>
     281    </arg>
     282    <arg isRequired="false" name="xml" value="[xml]">
     283      <info>xml-encoded hash of resource parameters</info>
     284    </arg>
     285  </args>
     286</service>
     287}}}
     288
     289===== resource_delete - Delete Resource =====
     290
    106291{{{
    107292<service name="resource_delete">
    108293  <info>Remove set of resources</info>
    109294  <args>
    110     <arg name="set" isRequired="true" value="set">
    111        <info>set of resource names</info>
    112     </arg>
    113   </args>
    114 </service>
    115 }}}
    116 
    117 ''' resource_list - List Resources '''
     295    <arg isRequired="true" name="set" value="set">
     296      <info>set of resource names</info>
     297    </arg>
     298  </args>
     299</service>
     300}}}
     301
     302
     303===== resource_list - List Resources =====
    118304
    119305{{{
     
    121307  <info>Get all available resources of given type that belongs to given parent resource with all attributes</info>
    122308  <args>
    123     <arg name="parent" isRequired="false" value="[parent]">
     309    <arg isRequired="false" name="parent" value="[parent]">
    124310      <info>Fully qualified resource name</info>
    125311    </arg>
    126     <arg name="type" isRequired="false" value="[type]">
     312    <arg isRequired="false" name="type" value="[type]">
    127313      <info>Type name, currently suported testbed, node and device</info>
    128314    </arg>
     
    131317}}}
    132318
    133 ''' relation_add - Add Relationship Between Resources '''
    134 
    135 {{{
    136 <service name="relation_add">
    137   <info>Add relation between two resources</info>
    138   <args>
    139     <arg name="parent" isRequired="true" value="rn">
    140       <info>parent resource name</info>
    141     </arg>
    142     <arg name="child" isRequired="true" value="rn">
    143       <info>child resource name</info>
    144     </arg>
    145   </args>
    146 </service>
    147 }}}
    148 
    149 ''' attribute_add - Add an attribute '''
    150 
    151 {{{
    152 <service name="attribute_add">
    153   <info>Add attribute to resource</info>
    154   <args>
    155     <arg name="name" value="name" isRequired="true">
    156       <info>Resource name</info>
    157     </arg>
    158     <arg name="attribute" value="attribute" isRequired="true">
    159       <info>Name of attribute</info>
    160     </arg>
    161     <arg name="value" value="value" isRequired="true">
    162       <info>Value of attribute </info>
    163     </arg>
    164   </args>
    165 </service>
    166 }}}
    167 
    168 ''' attribute_delete - Delete an attribute '''
    169 
    170 {{{
    171 <service name="attribute_delete">
    172   <info>Delete all attributes matching attribute pattern for all nodes matching node name pattern (rn)</info>
    173   <args>
    174     <arg name="name" value="[name]" isRequired="false">
    175       <info>Resource name or resource name pattern</info>
    176     </arg>
    177     <arg name="attribute" value="attribute" isRequired="true">
    178       <info>Attribute pattern</info>
    179     </arg>
    180   </args>
    181 </service>
    182 }}}
    183 
    184 ''' attribute_modify - Modify an attribute value '''
    185 
    186 {{{
    187 <service name="attribute_modify">
    188   <info>Modify attribute's value</info>
    189   <args>
    190     <arg name="name" value="name" isRequired="true">
    191       <info>Resource name</info>
    192     </arg>
    193     <arg name="attribute" value="attribute" isRequired="true">
    194       <info>Attribute name</info>
    195     </arg>
    196     <arg name="value" value="value" isRequired="true">
    197       <info>New value of attribute </info>
    198     </arg>
    199   </args>
    200 </service>
    201 }}}
    202 
    203 ''' attribute_list - List attributes '''
    204 
    205 {{{
    206 <service name="attribute_list">
    207   <info>Get node with names matching name pattern with attributes matching attribute name pattern and value matching attribute value pattern</info>
    208   <args>
    209     <arg name="set" value="[set]" isRequired="false">
    210       <info>Set of resource names or resource name pattern</info>
    211     </arg>
    212     <arg name="attribute" value="[attribute]" isRequired="false">
    213       <info>Attribute name pattern</info>
    214     </arg>
    215     <arg name="value" value="[value]" isRequired="false">
    216       <info>Attribute value pattern</info>
    217     </arg>
    218   </args>
    219 </service>
    220 }}}
    221 
    222 ''' attribute_listChildren - List attributes of children '''
    223 
    224 {{{
    225 <service name="attribute_listChildren">
    226   <info>Get node with names matching name pattern with child (device) attributes matching attribute name pattern and value matching attribute value pattern</info>
    227   <args>
    228     <arg name="set" value="[set]" isRequired="false">
    229        <info>Set of resource names or resource name pattern</info>
    230     </arg>
    231     <arg name="attribute" value="[attribute]" isRequired="false">
    232       <info>Child attribute name pattern</info>
    233     </arg>
    234     <arg name="value" value="[value]" isRequired="false">
    235       <info>Child attribute value pattern</info>
    236     </arg>
    237   </args>
    238 </service>
    239 }}}
    240 
     319===== resource_rename - Change resource name =====
     320
     321{{{
     322<service name="resource_rename">
     323  <info>Rename resource</info>
     324  <args>
     325    <arg isRequired="true" name="oldname" value="oldname">
     326      <info>Old resource name</info>
     327    </arg>
     328    <arg isRequired="true" name="newname" value="newname">
     329      <info>New resource name</info>
     330    </arg>
     331  </args>
     332</service>
     333}}}
     334
     335===== resource_swap - Swap two resources (names) =====
     336
     337{{{
     338<service name="resource_swap">
     339<info>Swap two resources</info><args>
     340<arg isRequired="true" name="resource1" value="resource1">
     341<info>First Resource name</info></arg><arg isRequired="true" name="resource2" value="resource2"><info>Second Resource name</info>
     342</arg>
     343</args>
     344</service>
     345}}}
     346
     347==== Topology Services ====
     348
     349Topologies are collections of resources that are grouped based on certain characteristics or attributes. Examples are: topology with the name: '''TOPO_CPU_grid.orbit-lab.org_2.10GHz''' that contains list of nodes in the '''grid''' with a '''CPU''' with'''2.1 GHz clock'''.
     350
     351===== topology_add - Service to create new topology =====
     352
     353{{{
     354<service name="topology_add">
     355  <info>Add topology</info>
     356  <args>
     357    <arg isRequired="true" name="name" value="name">
     358      <info>Toplogy name</info>
     359    </arg>
     360    <arg isRequired="true" name="set" value="set">
     361      <info>comma separeted node names</info>
     362    </arg>
     363  </args>
     364</service>
     365}}}
     366
     367===== topology_add - Service to delete existing topology =====
     368
     369{{{
     370<service name="topology_delete">
     371<info>Remove set of topologies</info>
     372<args>
     373<arg isRequired="true" name="set" value="set">
     374<info>Set of toplogy names</info>
     375</arg>
     376</args>
     377</service>
     378}}}
     379
     380
     381{{{
     382<service name="topology_list">
     383<info>Get all defined topologies</info>
     384</service>
     385}}}
     386
     387{{{
     388<service name="topology_nodes">
     389<info>Get topology nodes</info>
     390<args>
     391<arg isRequired="true" name="shortname" value="shortname">
     392<info>topology shortname</info>
     393</arg>
     394<arg isRequired="true" name="domain" value="domain">
     395<info>domain/testbed name</info>
     396</arg>
     397</args>
     398</service>
     399}}}
     400
     401{{{
     402<service name="topology_show">
     403<info>Show list of nodes that belong to given topology name</info
     404<args>
     405<arg isRequired="true" name="name" value="name">
     406<info>topology name</info
     407</arg>
     408</args>
     409</service>
     410}}}
     411
     412==== Maintenance Services ====
     413
     414===== update_cache - Service to update internal cache =====
     415
     416This service should be called after any changes to the inventory.
     417{{{
     418<service name="update_cache">
     419<info>Update cache</info>
     420</service>
     421}}}
    241422
    242423=== Usage Examples ===
     
    290471Instructions on how to add the Orbit software repository to your list of apt-sources can be found [wiki:Documentation/kPackages#UsingtheOribtPackageRepository ​here].
    291472
    292 Once installed the service is configured by TODO.
    293  
     473==== Configruation ====
     474
     475Te inventory service is configuraion is in /etc/omf-aggmgr-5.4/enabled/inventory.yaml YAML file. Mandatory configuration paramter is the '''database:''' which specifies inventory service database (actual database access is configured in [wiki:Software/eAM/ global OMF AM configuration file]). Otopnal ''':allowedIPs:''' parameter is used to restrict access to individual add/delete/modify services (in this case based on client IP addressa) with a default value set to 'localhost'.
     476
     477Example configuration file:
     478{{{
     479# NOTE: use only 'spaces' to indent !
     480# ('tab' indents are not supported by the ruby yaml parser used to read this file)
     481#
     482# This is the Config file for the Inventory GridService on the NICTA platform
     483#
     484---
     485inventory:
     486  :database:
     487    database: inventory54
     488  :allowedIPs:
     489        - 'localhost'
     490}}}