Node Build and Configuration Notebook - page 19 of 55

EditDeleteAnnotateNotarize
First PagePrevious PageNext PageLast PageTable of ContentsSearch

Date and Author(s)

Information Service API and sample XML messages V1

    
    
-------------------------------------   
Information Service Serviced Messages   
-------------------------------------   
Key:   
   
x. Messages the Information Service receives from any source   
   -> responses from the Information Service   
   <XML example>   
   
1. CreateTable (TableName, TableColumns, <column_attributes>, TablePrimaryKey)   
   
   <InfoServRequest>   
      <CreateTable TableName='hosts' >   
         <TableColumns>   
            <Column name='hostname' type='string' required='true' />   
            <Column name='ipaddress' type='string' required='true' />   
            <Column name='owner' type='string' />   
         </TableColumns>   
         <TablePrimaryKey>   
            <Column name='hostname' />   
         </TablePrimaryKey>   
      </CreateTable>   
   </InfoServRequest>   
   
2. ExpandTable (TableName, TableColumns, <column_attributes>)   
   
   <InfoServRequest>   
      <ExpandTable TableName='hosts' >   
         <TableColumns>   
            <Column name='hostup' type='boolean' />   
         </TableColumns>   
      </ExpandTable>   
   </InfoServRequest>   
   
3. ReduceTable (TableName, TableColumns)   
   
   <InfoServRequest>   
      <ReduceTable TableName='hosts' >   
         <TableColumns>   
            <Column name='hostup' />   
         </TableColumns>   
      </ReduceTable>   
   </InfoServRequest>   
   
4. DropTable   (TableName)   
   
   <InfoServRequest>   
      <DropTable TableName='hosts' />   
   </InfoServRequest>   
   
5. AddRow      (TableName, TableColumns, TableColumnValues)   
   
   <InfoServRequest>   
      <AddRow TableName='hosts' >   
         <Column name='hostname' value='ccn1' />   
         <Column name='ipaddress' value='140.221.1.1' />   
      </AddRow>   
   </InfoServRequest>   
   
6. SetRow      (TableName, TableColumns, TableColumnValues)   
   
   <InfoServRequest>   
      <SetRow TableName='hosts' >   
         <Column name='hostname' value='ccn1' />   
         <Column name='ipaddress' value='140.221.1.2' />   
      </SetRow>   
   </InfoServRequest>   
   
7. UpdateRows  (TableName, TableColumns, TableColumnValues,   
                           [SelectColumns, SelectValues])   
   
   <InfoServRequest>   
      <UpdateRows TableName='hosts' >   
         <Column name='ipaddress' value='140.221.1.2' />   
         <select>   
            <column name='hostname' value='ccn1' />   
         </select>   
      </UpdateRows>   
   </InfoServRequest>   
   
8. DeleteRows  (TableName, [SelectColumns, SelectValues])   
   
   <InfoServRequest>   
      <DeleteRows TableName='hosts' >   
         <select>   
            <Column name='hostname' value='ccn1' />   
         </select>   
      </DeleteRows>   
   </InfoServRequest>   
   
9. QueryRows   (TableName, TableColumns   
                           [SelectColumns, SelectValues])   
   
   <InfoServRequest>   
      <QueryRows TableName='hosts' >   
         <Column name='hostname' />   
         <Column name='ipaddress' />   
         <Column name='hostup' />   
         <select>   
            <Column name='hostname' value='ccn1' />   
         </select>   
      </QueryRows>   
   </InfoServRequest>   
   
   
Informaton Service response from CreateTable and similarly for   
ExpandTable, ReduceTable, DropTable, AddRow, and SetRow.   
   
   <InfoServResponses>   
     <CreateTable status='0' />   
        OR on failure  
     <CreateTable status='1' errortext='Invalid column type' />   
   </InfoServResponses>   
   
   
Response from UpdateRows and similarly for DeleteRows.   
   
   <InfoServResponses>   
      <UpdateRows status='0' count='10'/>   
         OR on failure  
      <UpdateRows status='1' errortext='Invalid column name' />   
   </InfoServResponses>   
   
   
Response from QueryRows.   
   
   <InfoServResponses>   
      <QueryRows status='0' count='2'/>   
         <row>   
            <Column value='ccn1' />   
            <Column value='140.221.1.1' />   
         </row>   
         <row>   
            <Column value='ccn2' />   
            <Column value='140.221.1.2' />   
         </row>   
      </QueryRows>   
   </InforServResponse>   
  
   OR is the following a reasonable alternative?  
  
   <InfoServResponses>   
      <QueryRows status='0' count='2'/>   
         <row col1='ccn1' col2='140.221.1.1' />   
         <row col1='ccn2' col2='140.221.1.2' />   
      </QueryRows>   
   </InforServResponse>   
   
   OR on failure  
   
   <InfoServResponses>   
      <QueryRows status='1' errortext='Invalid column name' />   
   </InfoServResponses>   
  
   
Metadata queries will use QueryRows on metadata tables.   
   
   To query tables in metadata:   
      TableQuery("InfoServTables", "Table_name");   
   
   To query table columns in metadata:   
      TableQuery("InfoServTableColumns", "TableColumnName"   
                     "TableName", "<some_table_name");   
   
   
--------------------------------------   
Information Service Initiated Messages   
--------------------------------------   
To Service Directory:   
   
1. DirectoryUpdate ("InfoServ", <location_information>)