Changes between Version 1 and Version 2 of Software/eAM/aInventory


Ignore:
Timestamp:
Dec 21, 2012, 5:34:34 AM (12 years ago)
Author:
seskar
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Software/eAM/aInventory

    v1 v2  
    66Inventory AM consist of a database with a [http://mytestbed.net/projects/omf/wiki/NewInventoryDesign database schema] that can hold information for arbitrary type of resource and a set of services that are used to manage it
    77
    8 ==== Resources and Relationships ====
     8=== Resources and Relationships ===
    99
    1010Resources are physical entities in a testbed that are assumed to be named with fully qualified domain name (fqdn) (for resources that can have one) or with arbitrary string (for resources that are not IP addressable)and can have any number of attributes. Resource can be in relation with any other resource with, so far, 2 types of relationships:
     
    5353}}}
    5454
    55 ==== Resource Services ====
     55==== resource_add - Add Resource ====
    5656
    5757{{{
     
    7272}}}
    7373
     74==== resource_delete - Delete Resource ====
     75
    7476{{{
    7577<service name="resource_delete">
     
    8284</service>
    8385}}}
     86
     87==== resource_list - List Resources ====
     88
    8489{{{
    8590<service name="resource_list">
     
    96101}}}
    97102
     103==== relation_add - Add Relationship Between Resources ====
     104
    98105{{{
    99106<service name="relation_add">
    100   <info>Add relatin between two resources</info>
     107  <info>Add relation between two resources</info>
    101108  <args>
    102109    <arg name="parent" isRequired="true" value="rn">
     
    109116</service>
    110117}}}
    111 === Usage Example ===
     118
     119==== attribute_add - Add an attribute ====
     120
     121{{{
     122<service name="attribute_add">
     123  <info>Add attribute to resource</info>
     124  <args>
     125    <arg name="name" value="name" isRequired="true">
     126      <info>Resource name</info>
     127    </arg>
     128    <arg name="attribute" value="attribute" isRequired="true">
     129      <info>Name of attribute</info>
     130    </arg>
     131    <arg name="value" value="value" isRequired="true">
     132      <info>Value of attribute </info>
     133    </arg>
     134  </args>
     135</service>
     136}}}
     137
     138==== attribute_delete - Delete an attribute ====
     139
     140{{{
     141<service name="attribute_delete">
     142  <info>Delete all attributes matching attribute pattern for all nodes matching node name pattern (rn)</info>
     143  <args>
     144    <arg name="name" value="[name]" isRequired="false">
     145      <info>Resource name or resource name pattern</info>
     146    </arg>
     147    <arg name="attribute" value="attribute" isRequired="true">
     148      <info>Attribute pattern</info>
     149    </arg>
     150  </args>
     151</service>
     152}}}
     153
     154==== attribute_modify - Modify an attribute value ====
     155
     156{{{
     157<service name="attribute_modify">
     158  <info>Modify attribute's value</info>
     159  <args>
     160    <arg name="name" value="name" isRequired="true">
     161      <info>Resource name</info>
     162    </arg>
     163    <arg name="attribute" value="attribute" isRequired="true">
     164      <info>Attribute name</info>
     165    </arg>
     166    <arg name="value" value="value" isRequired="true">
     167      <info>New value of attribute </info>
     168    </arg>
     169  </args>
     170</service>
     171}}}
     172
     173==== attribute_list - List attributes ====
     174
     175{{{
     176<service name="attribute_list">
     177  <info>Get node with names matching name pattern with attributes matching attribute name pattern and value matching attribute value pattern</info>
     178  <args>
     179    <arg name="set" value="[set]" isRequired="false">
     180      <info>Set of resource names or resource name pattern</info>
     181    </arg>
     182    <arg name="attribute" value="[attribute]" isRequired="false">
     183      <info>Attribute name pattern</info>
     184    </arg>
     185    <arg name="value" value="[value]" isRequired="false">
     186      <info>Attribute value pattern</info>
     187    </arg>
     188  </args>
     189</service>
     190}}}
     191
     192==== attribute_listChildren - List attributes of children ====
     193
     194{{{
     195<service name="attribute_listChildren">
     196  <info>Get node with names matching name pattern with child (device) attributes matching attribute name pattern and value matching attribute value pattern</info>
     197  <args>
     198    <arg name="set" value="[set]" isRequired="false">
     199       <info>Set of resource names or resource name pattern</info>
     200    </arg>
     201    <arg name="attribute" value="[attribute]" isRequired="false">
     202      <info>Child attribute name pattern</info>
     203    </arg>
     204    <arg name="value" value="[value]" isRequired="false">
     205      <info>Child attribute value pattern</info>
     206    </arg>
     207  </args>
     208</service>
     209}}}
     210
     211=== Usage Examples ===
    112212
    113213Create tesbed, add node to it and add basic attributes
    114214
    115215{{{
    116  
     216# Define the testbed
     217  wget -qO- 'http://new.orbit-lab.org:5054/inventory/resource_add?name=sb10.orbit-lab.org&type=testbed'
     218# Add a node
     219  wget -qO- 'http://new.orbit-lab.org:5054/inventory/resource_add?name=node1-1.sb10.orbit-lab.org&type=node'
     220# Create the parent/child relationship between the testbed and the node
     221  wget -qO- 'http://new.orbit-lab.org:5054/inventory/relation_add?parent=sb10.orbit-lab.org&child=node1-1.sb10.orbit-lab.org'
     222# Add basic attributes
     223# CM is CM3 (mandatory)
     224  wget -qO- 'http://new.orbit-lab.org:5054/inventory/attribute_add?name=node1-1.sb10.orbit-lab.org&attribute=CM_type&value=3'
     225# IP Address for this CM (mandatory)
     226  wget -qO- 'http://new.orbit-lab.org:5054/inventory/attribute_add?name=node1-1.sb10.orbit-lab.org&attribute=CM_ip&value=10.22.1.1'
     227# IP Port for this CM (mandatory)
     228  wget -qO- 'http://new.orbit-lab.org:5054/inventory/attribute_add?name=node1-1.sb10.orbit-lab.org&attribute=CM_port&value=1'
     229# Disk from the node boots (for imaging)
     230  wget -qO- 'http://new.orbit-lab.org:5054/inventory/attribute_add?name=node1-1.sb10.orbit-lab.org&attribute=INF_default_disk&value=/dev/sda'
     231  ...
     232}}}
     233
     234
     235Replace inventory information
     236
     237{{{
     238# Delete all attributes colected by the inventory process running on the node
     239  wget -qO- 'http://new.orbit-lab.org:5054/inventory/attribute_delete?name=node1-1.sb10.orbit-lab.org&attribute=INV_*'
     240XXXXX Delete all devices for the node??? XXXXX
     241# Add first device (and add it to the node)
     242  wget -qO- 'http://new.orbit-lab.org:5054/inventory/resource_add?name=ethernet0&type=device'
     243  wget -qO- 'http://new.orbit-lab.org:5054/inventory/relation_add?parent=node1-1.sb10.orbit-lab.org&child=ethernet0'
     244# Add attributes for the new device
     245  wget -qO- 'http://new.orbit-lab.org:5054/inventory/attribute_add?name=ethernet0&attribute=INV_MAC_0&value=00:01:02:03:04:05'
    117246}}}
    118247