mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-15 10:50:28 +00:00
add xmlapi test cases, they do not need to ship with rpm
This commit is contained in:
55
xCAT-test/xmlapi/README
Normal file
55
xCAT-test/xmlapi/README
Normal file
@ -0,0 +1,55 @@
|
||||
xCAT has an XML input interface to the xCAT tables. The routines are in tabutils.pm and map to the
|
||||
Table.pm routines by the same name. These routines were written for PCM but are also used in the restapi. They are not a documented api.
|
||||
For the restapi, check the following for how and which routines are used.
|
||||
xCAT-server/xCAT-wsapi/xcatws.cgi at all the functions between tablenodehdl() and tablerowdelhdl().
|
||||
|
||||
getAllEntries => "tabutils",
|
||||
getNodesAttribs => "tabutils",
|
||||
getTablesAllNodeAttribs => "tabutils",
|
||||
getTablesNodesAttribs => "tabutils",
|
||||
getTablesAllRowAttribs => "tabutils",
|
||||
setNodesAttribs => "tabutils",
|
||||
delEntries => "tabutils",
|
||||
getAttribs => "tabutils",
|
||||
setAttribs => "tabutils",
|
||||
NodeRange => "tabutils",
|
||||
|
||||
If you vi /opt/xcat/lib/perl/xCAT_plugin/tabutils.pm, and search for example "sub getAllEntries", you will see documented in the routines comments to input XML format requried and the output XML sent.
|
||||
|
||||
To test these routines, I put together a driver program pcmdriver, that generates the test XML and sends it and displays the returned output.
|
||||
|
||||
|
||||
For example:
|
||||
vi xmldriver in this directory
|
||||
|
||||
You will see
|
||||
|
||||
$ENV{'XCATXMLTRACE'}=1;
|
||||
my $XML=`cat /.../xmlapi/getTablesAllRowAttribsreq`;
|
||||
my $data=$XML;
|
||||
|
||||
$ENV{'XCATSHOWXML'}=1;
|
||||
|
||||
xCAT::Client::submit_request($data, \&xCAT::Client::handle_response);
|
||||
exit $xCAT::Client::EXITCODE;
|
||||
|
||||
If you vi getTablesAllRowAttribsreq, you will see the following. This is an XML request to get the all rows from the passwd table the attributes username and rack. These is one of these XML request files for all
|
||||
possible input to the routines in the directory.
|
||||
|
||||
XCATXMLTRACE is exported to show the XML that is being sent to xcatd. XCATSHOWXML is exported to display the XML returned to the client.
|
||||
|
||||
To get the XML request you must not be running in XCATBYPASS mode, you can get the reponse in XCATBYPASS mode.
|
||||
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getTablesAllRowAttribs</command>
|
||||
<table>
|
||||
<tablename>passwd</tablename>
|
||||
<attr>username</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>rack</tablename>
|
||||
<attr>rackname</attr>
|
||||
</table>
|
||||
</xcatrequest>
|
||||
|
13
xCAT-test/xmlapi/Table.pm.routines
Normal file
13
xCAT-test/xmlapi/Table.pm.routines
Normal file
@ -0,0 +1,13 @@
|
||||
sub setNodeAttribs
|
||||
sub addNodeAttribs
|
||||
sub setAttribs
|
||||
sub setAttribsWhere
|
||||
sub setNodesAttribs
|
||||
sub getNodesAttribs
|
||||
sub getNodeAttribs
|
||||
sub getAllEntries
|
||||
sub getAllAttribsWhere
|
||||
sub getAllNodeAttribs
|
||||
sub getAllAttribs
|
||||
sub delEntries
|
||||
sub getAttribs
|
11
xCAT-test/xmlapi/delEntriesreq
Normal file
11
xCAT-test/xmlapi/delEntriesreq
Normal file
@ -0,0 +1,11 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>delEntries</command>
|
||||
<table>
|
||||
<name>nodelist</name>
|
||||
<attr>
|
||||
<groups>compute1,lissa</groups>
|
||||
<status>down</status>
|
||||
</attr>
|
||||
</table>
|
||||
</xcatrequest>
|
17
xCAT-test/xmlapi/delEntriesreq2
Normal file
17
xCAT-test/xmlapi/delEntriesreq2
Normal file
@ -0,0 +1,17 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>delEntries</command>
|
||||
<table>
|
||||
<name>nodelist</name>
|
||||
<attrs>
|
||||
<groups>compute1,lissa</groups>
|
||||
<status>down</status>
|
||||
</attrs>
|
||||
</table>
|
||||
<table>
|
||||
<name>nodelist</name>
|
||||
<attrs>
|
||||
<groups>compute2</groups>
|
||||
</attrs>
|
||||
</table>
|
||||
</xcatrequest>
|
7
xCAT-test/xmlapi/delEntriesreq3
Normal file
7
xCAT-test/xmlapi/delEntriesreq3
Normal file
@ -0,0 +1,7 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>delEntries</command>
|
||||
<table>
|
||||
<name>nodelist</name>
|
||||
</table>
|
||||
</xcatrequest>
|
35
xCAT-test/xmlapi/deltblreq
Normal file
35
xCAT-test/xmlapi/deltblreq
Normal file
@ -0,0 +1,35 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>deltbl</command>
|
||||
<table>tablename</table>
|
||||
<key>key1</key>
|
||||
<value>value1</value>
|
||||
<node>noderange2</node>
|
||||
.
|
||||
.
|
||||
.
|
||||
or <node>ALL</node>
|
||||
<attr>attribute1</attr>
|
||||
<attr>attribute2</attr>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
</xcatrequest>
|
||||
<xcatresponse>
|
||||
<rows>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</rows>
|
||||
<xcatresponse>
|
||||
<serverdone></serverdone>
|
||||
</xcatresponse>
|
||||
|
37
xCAT-test/xmlapi/getAllEntries
Normal file
37
xCAT-test/xmlapi/getAllEntries
Normal file
@ -0,0 +1,37 @@
|
||||
# Reads all entries from the input Table
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getAllEntries</command>
|
||||
<table>tablename</table>
|
||||
</xcatrequest>
|
||||
<xcatresponse>
|
||||
<row>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</row>
|
||||
.
|
||||
.
|
||||
.
|
||||
<row>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</row>
|
||||
</xcatresponse>
|
||||
<xcatresponse>
|
||||
<serverdone></serverdone>
|
||||
</xcatresponse>
|
37
xCAT-test/xmlapi/getAllEntries.save1
Normal file
37
xCAT-test/xmlapi/getAllEntries.save1
Normal file
@ -0,0 +1,37 @@
|
||||
# Reads all entries from the input Table
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getAllEntries</command>
|
||||
<table>tablename</table>
|
||||
</xcatrequest>
|
||||
<xcatresponse>
|
||||
<row>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</row>
|
||||
.
|
||||
.
|
||||
.
|
||||
<row>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</row>
|
||||
</xcatresponse>
|
||||
<xcatresponse>
|
||||
<serverdone></serverdone>
|
||||
</xcatresponse>
|
5
xCAT-test/xmlapi/getAllEntriesreq
Normal file
5
xCAT-test/xmlapi/getAllEntriesreq
Normal file
@ -0,0 +1,5 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getAllEntries</command>
|
||||
<table>switch</table>
|
||||
</xcatrequest>
|
5
xCAT-test/xmlapi/getAllEntriesreq.save
Normal file
5
xCAT-test/xmlapi/getAllEntriesreq.save
Normal file
@ -0,0 +1,5 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getAllEntries</command>
|
||||
<table>nodelist</table>
|
||||
</xcatrequest>
|
5
xCAT-test/xmlapi/getAllEntriesreq.save1
Normal file
5
xCAT-test/xmlapi/getAllEntriesreq.save1
Normal file
@ -0,0 +1,5 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getAllEntries</command>
|
||||
<table>nodelist</table>
|
||||
</xcatrequest>
|
10
xCAT-test/xmlapi/getAttribsreq
Normal file
10
xCAT-test/xmlapi/getAttribsreq
Normal file
@ -0,0 +1,10 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getAttribs</command>
|
||||
<table>site</table>
|
||||
<keys>
|
||||
<key>domain</key>
|
||||
</keys>
|
||||
<attrs>value</attrs>
|
||||
<attrs>comments</attrs>
|
||||
</xcatrequest>
|
8
xCAT-test/xmlapi/getAttribsreq.old
Normal file
8
xCAT-test/xmlapi/getAttribsreq.old
Normal file
@ -0,0 +1,8 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getAttribs</command>
|
||||
<table>site</table>
|
||||
<key>domain</key>
|
||||
<attr>value</attr>
|
||||
<attr>comments</attr>
|
||||
</xcatrequest>
|
11
xCAT-test/xmlapi/getAttribsreq2
Normal file
11
xCAT-test/xmlapi/getAttribsreq2
Normal file
@ -0,0 +1,11 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getAttribs</command>
|
||||
<table>networks</table>
|
||||
<keys>
|
||||
<net>11.35.0.0</net>
|
||||
<mask>255.255.0.0</mask>
|
||||
</keys>
|
||||
<attr>netname</attr>
|
||||
<attr>dhcpserver</attr>
|
||||
</xcatrequest>
|
50
xCAT-test/xmlapi/getNodeAttribs
Normal file
50
xCAT-test/xmlapi/getNodeAttribs
Normal file
@ -0,0 +1,50 @@
|
||||
# Reads the table input for the noderange and returns list of attributes
|
||||
# requested
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getNodeAttribs</command>
|
||||
<table>tablename</table>
|
||||
<node>noderange</node>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</xcatrequest>
|
||||
<xcatresponse>
|
||||
<node>nodename1</node>
|
||||
<row>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</row>
|
||||
.
|
||||
.
|
||||
.
|
||||
<node>nodenameN</node>
|
||||
<row>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</row>
|
||||
</xcatresponse>
|
||||
<xcatresponse>
|
||||
<serverdone></serverdone>
|
||||
</xcatresponse>
|
||||
|
50
xCAT-test/xmlapi/getNodeAttribs1
Normal file
50
xCAT-test/xmlapi/getNodeAttribs1
Normal file
@ -0,0 +1,50 @@
|
||||
# Reads the table input for the noderange and returns list of attributes
|
||||
# requested
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getNodeAttribs</command>
|
||||
<table>tablename</table>
|
||||
<node>noderange</node>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</xcatrequest>
|
||||
<xcatresponse>
|
||||
<node>nodename1</node>
|
||||
<row>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</row>
|
||||
.
|
||||
.
|
||||
.
|
||||
<node>nodenameN</node>
|
||||
<row>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</row>
|
||||
</xcatresponse>
|
||||
<xcatresponse>
|
||||
<serverdone></serverdone>
|
||||
</xcatresponse>
|
||||
|
8
xCAT-test/xmlapi/getNodesAttribsreq
Normal file
8
xCAT-test/xmlapi/getNodesAttribsreq
Normal file
@ -0,0 +1,8 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getNodesAttribs</command>
|
||||
<table>nodelist</table>
|
||||
<noderange>blade01-blade02</noderange>
|
||||
<attr>groups</attr>
|
||||
<attr>status</attr>
|
||||
</xcatrequest>
|
7
xCAT-test/xmlapi/getNodesAttribsreq1
Normal file
7
xCAT-test/xmlapi/getNodesAttribsreq1
Normal file
@ -0,0 +1,7 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getNodesAttribs</command>
|
||||
<table>nodelist</table>
|
||||
<noderange>blade01-blade02</noderange>
|
||||
<attr>ALL</attr>
|
||||
</xcatrequest>
|
7
xCAT-test/xmlapi/getNodesAttribsreq2
Normal file
7
xCAT-test/xmlapi/getNodesAttribsreq2
Normal file
@ -0,0 +1,7 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getNodesAttribs</command>
|
||||
<table>nodelist</table>
|
||||
<noderange>blade01-blade02</noderange>
|
||||
<attr>ALL</attr>
|
||||
</xcatrequest>
|
9
xCAT-test/xmlapi/getTablesAllNodeAttribsreq
Normal file
9
xCAT-test/xmlapi/getTablesAllNodeAttribsreq
Normal file
@ -0,0 +1,9 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getTablesAllNodeAttribs</command>
|
||||
<table>
|
||||
<tablename>nodelist</tablename>
|
||||
<attr>groups</attr>
|
||||
<attr>comments</attr>
|
||||
</table>
|
||||
</xcatrequest>
|
14
xCAT-test/xmlapi/getTablesAllNodeAttribsreq1
Normal file
14
xCAT-test/xmlapi/getTablesAllNodeAttribsreq1
Normal file
@ -0,0 +1,14 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getTablesAllNodeAttribs</command>
|
||||
<table>
|
||||
<tablename>nodetype</tablename>
|
||||
<attr>os</attr>
|
||||
<attr>nodetype</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>nodelist</tablename>
|
||||
<attr>groups</attr>
|
||||
<attr>status</attr>
|
||||
</table>
|
||||
</xcatrequest>
|
13
xCAT-test/xmlapi/getTablesAllNodeAttribsreq2
Normal file
13
xCAT-test/xmlapi/getTablesAllNodeAttribsreq2
Normal file
@ -0,0 +1,13 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getTablesAllNodeAttribs</command>
|
||||
<table>
|
||||
<tablename>nodetype</tablename>
|
||||
<attr>os</attr>
|
||||
<attr>nodetype</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>nodelist</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
</xcatrequest>
|
36
xCAT-test/xmlapi/getTablesAllNodeAttribsreq3
Normal file
36
xCAT-test/xmlapi/getTablesAllNodeAttribsreq3
Normal file
@ -0,0 +1,36 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getTablesAllNodeAttribs</command>
|
||||
<table>
|
||||
<tablename>nodetype</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>nodelist</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>noderes</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>postscripts</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>mac</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>mp</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>nodehm</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>mpa</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
</xcatrequest>
|
12
xCAT-test/xmlapi/getTablesAllRowAttribsreq
Normal file
12
xCAT-test/xmlapi/getTablesAllRowAttribsreq
Normal file
@ -0,0 +1,12 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getTablesAllRowAttribs</command>
|
||||
<table>
|
||||
<tablename>passwd</tablename>
|
||||
<attr>username</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>rack</tablename>
|
||||
<attr>rackname</attr>
|
||||
</table>
|
||||
</xcatrequest>
|
9
xCAT-test/xmlapi/getTablesNodesAttribsreq
Normal file
9
xCAT-test/xmlapi/getTablesNodesAttribsreq
Normal file
@ -0,0 +1,9 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getTablesNodesAttribs</command>
|
||||
<noderange>test</noderange>
|
||||
<table>
|
||||
<tablename>nodelist</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
</xcatrequest>
|
13
xCAT-test/xmlapi/getTablesNodesAttribsreq1
Normal file
13
xCAT-test/xmlapi/getTablesNodesAttribsreq1
Normal file
@ -0,0 +1,13 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getTablesNodesAttribs</command>
|
||||
<noderange>test</noderange>
|
||||
<table>
|
||||
<tablename>nodelist</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
<table>
|
||||
<tablename>nodetype</tablename>
|
||||
<attr>nodetype</attr>
|
||||
</table>
|
||||
</xcatrequest>
|
9
xCAT-test/xmlapi/getTablesNodesAttribsreq2
Normal file
9
xCAT-test/xmlapi/getTablesNodesAttribsreq2
Normal file
@ -0,0 +1,9 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>getTablesNodesAttribs</command>
|
||||
<noderange>test</noderange>
|
||||
<table>
|
||||
<tablename>noderes</tablename>
|
||||
<attr>ALL</attr>
|
||||
</table>
|
||||
</xcatrequest>
|
14
xCAT-test/xmlapi/noderange
Normal file
14
xCAT-test/xmlapi/noderange
Normal file
@ -0,0 +1,14 @@
|
||||
# Reads the table input for the noderange and returns list of attributes
|
||||
# requested
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>NodeRange</command>
|
||||
<node>compute1-compute2</node>
|
||||
</xcatrequest>
|
||||
<xcatresponse>
|
||||
<node>node1</node>
|
||||
.
|
||||
.
|
||||
.
|
||||
<node>noden</node>
|
||||
</xcatresponse>
|
5
xCAT-test/xmlapi/noderangereq
Normal file
5
xCAT-test/xmlapi/noderangereq
Normal file
@ -0,0 +1,5 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>NodeRange</command>
|
||||
<noderange>compute1-compute2</noderange>
|
||||
</xcatrequest>
|
5
xCAT-test/xmlapi/noderangereq.save
Normal file
5
xCAT-test/xmlapi/noderangereq.save
Normal file
@ -0,0 +1,5 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>NodeRange</command>
|
||||
<noderange>compute1-compute2</noderange>
|
||||
</xcatrequest>
|
5
xCAT-test/xmlapi/noderangereq.save1
Normal file
5
xCAT-test/xmlapi/noderangereq.save1
Normal file
@ -0,0 +1,5 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>NodeRange</command>
|
||||
<noderange>compute1-compute2</noderange>
|
||||
</xcatrequest>
|
34
xCAT-test/xmlapi/readtblreq
Normal file
34
xCAT-test/xmlapi/readtblreq
Normal file
@ -0,0 +1,34 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>readtbl</command>
|
||||
<table>tablename</table>
|
||||
<node>noderange1</node>
|
||||
<node>noderange2</node>
|
||||
.
|
||||
.
|
||||
.
|
||||
or <node>ALL</node>
|
||||
<attr>attribute1</attr>
|
||||
<attr>attribute2</attr>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
</xcatrequest>
|
||||
<xcatresponse>
|
||||
<rows>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</rows>
|
||||
<xcatresponse>
|
||||
<serverdone></serverdone>
|
||||
</xcatresponse>
|
||||
|
34
xCAT-test/xmlapi/readtblreq.node
Normal file
34
xCAT-test/xmlapi/readtblreq.node
Normal file
@ -0,0 +1,34 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>readtbl</command>
|
||||
<table>tablename</table>
|
||||
<node>noderange1</node>
|
||||
<node>noderange2</node>
|
||||
.
|
||||
.
|
||||
.
|
||||
or <node>ALL</node>
|
||||
<attr>attribute1</attr>
|
||||
<attr>attribute2</attr>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
</xcatrequest>
|
||||
<xcatresponse>
|
||||
<rows>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</rows>
|
||||
<xcatresponse>
|
||||
<serverdone></serverdone>
|
||||
</xcatresponse>
|
||||
|
17
xCAT-test/xmlapi/setAttribs
Normal file
17
xCAT-test/xmlapi/setAttribs
Normal file
@ -0,0 +1,17 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>setAttribs</command>
|
||||
<table>tablename</table>
|
||||
<keys>
|
||||
<keyname1>value1</keyname1>
|
||||
<keyname2>value2</keyname2> For multiple key tables
|
||||
</keys>
|
||||
<attr>
|
||||
<attrname1>value1</attrname1>
|
||||
<attrname2>value2</attrname2>
|
||||
</attr>
|
||||
</xcatrequest>
|
||||
<xcatresponse>
|
||||
<serverdone></serverdone>
|
||||
</xcatresponse>
|
||||
|
12
xCAT-test/xmlapi/setAttribsreq
Normal file
12
xCAT-test/xmlapi/setAttribsreq
Normal file
@ -0,0 +1,12 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>setAttribs</command>
|
||||
<table>site</table>
|
||||
<keys>
|
||||
<key>domain</key>
|
||||
</keys>
|
||||
<attr>
|
||||
<value>pok.com</value>
|
||||
<comments>This is a test</comments>
|
||||
</attr>
|
||||
</xcatrequest>
|
13
xCAT-test/xmlapi/setAttribsreq1
Normal file
13
xCAT-test/xmlapi/setAttribsreq1
Normal file
@ -0,0 +1,13 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>setAttribs</command>
|
||||
<table>networks</table>
|
||||
<keys>
|
||||
<net>10.0.1.0</key>
|
||||
<mask>255.255.255.0</mask>
|
||||
</keys>
|
||||
<attr>
|
||||
<gateway>10.0.1.254</gateway>
|
||||
</attr>
|
||||
</xcatrequest>
|
||||
|
13
xCAT-test/xmlapi/setAttribsreq2
Normal file
13
xCAT-test/xmlapi/setAttribsreq2
Normal file
@ -0,0 +1,13 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>setAttribs</command>
|
||||
<table>networks</table>
|
||||
<keys>
|
||||
<net>10.0.1.0</net>
|
||||
<mask>255.255.255.0</mask>
|
||||
</keys>
|
||||
<attr>
|
||||
<netname>mynet</netname>
|
||||
<gateway>10.0.1.254</gateway>
|
||||
</attr>
|
||||
</xcatrequest>
|
19
xCAT-test/xmlapi/setNodeAttribs
Normal file
19
xCAT-test/xmlapi/setNodeAttribs
Normal file
@ -0,0 +1,19 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>setNodeAttribs</command>
|
||||
<table>tablename</table>
|
||||
<node>noderange</node>
|
||||
<attr>attribute1</attr>
|
||||
<value>value1</value>
|
||||
<attr>attribute2</attr>
|
||||
<value>value2</value>
|
||||
.
|
||||
.
|
||||
.
|
||||
<attr>attributeN</attr>
|
||||
<value>valueN</value>
|
||||
</xcatrequest>
|
||||
<xcatresponse>
|
||||
<serverdone></serverdone>
|
||||
</xcatresponse>
|
||||
|
14
xCAT-test/xmlapi/setNodesAttribsreq
Normal file
14
xCAT-test/xmlapi/setNodesAttribsreq
Normal file
@ -0,0 +1,14 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>setNodesAttribs</command>
|
||||
<noderange>blade01-blade02</noderange>
|
||||
<arg>
|
||||
<table>
|
||||
<name>nodelist</name>
|
||||
<attr>
|
||||
<groups>all,compute,lissa</groups>
|
||||
<comments> This is a another test</comments>
|
||||
</attr>
|
||||
</table>
|
||||
</arg>
|
||||
</xcatrequest>
|
14
xCAT-test/xmlapi/setNodesAttribsreq1
Normal file
14
xCAT-test/xmlapi/setNodesAttribsreq1
Normal file
@ -0,0 +1,14 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>setNodesAttribs1</command>
|
||||
<noderange>blade01-blade02</noderange>
|
||||
<arg>
|
||||
<table>
|
||||
<name>nodelist</name>
|
||||
<attr>
|
||||
<groups>all,compute,lissa,newtest</groups>
|
||||
<comments> This is a another testtest</comments>
|
||||
</attr>
|
||||
</table>
|
||||
</arg>
|
||||
</xcatrequest>
|
21
xCAT-test/xmlapi/setNodesAttribsreq1.1
Normal file
21
xCAT-test/xmlapi/setNodesAttribsreq1.1
Normal file
@ -0,0 +1,21 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>setNodesAttribs</command>
|
||||
<noderange>blade01-blade02</noderange>
|
||||
<arg>
|
||||
<table>
|
||||
<name>nodelist</name>
|
||||
<attr>
|
||||
<groups>lissa</groups>
|
||||
<comments> This is a another testx</comments>
|
||||
</attr>
|
||||
</table>
|
||||
<table>
|
||||
<name>nodetype</name>
|
||||
<attr>
|
||||
<os>Redhat2</os>
|
||||
<comments> This is a another testy</comments>
|
||||
</attr>
|
||||
</table>
|
||||
</arg>
|
||||
</xcatrequest>
|
14
xCAT-test/xmlapi/setNodesAttribsreq1.new
Normal file
14
xCAT-test/xmlapi/setNodesAttribsreq1.new
Normal file
@ -0,0 +1,14 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>setNodesAttribs1</command>
|
||||
<noderange>blade01-blade02</noderange>
|
||||
<arg>
|
||||
<table>
|
||||
<name>nodelist</name>
|
||||
<attr>
|
||||
<groups>all,compute</groups>
|
||||
<comments> This is a test</comments>
|
||||
</attr>
|
||||
</table>
|
||||
</arg>
|
||||
</xcatrequest>
|
17
xCAT-test/xmlapi/setNodesAttribsreq2
Normal file
17
xCAT-test/xmlapi/setNodesAttribsreq2
Normal file
@ -0,0 +1,17 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>setNodesAttribs</command>
|
||||
<arg>
|
||||
<table>ppc</table>
|
||||
<nodes>
|
||||
<n1>
|
||||
<hcp>fsp1</hcp>
|
||||
<id>1</id>
|
||||
</n1>
|
||||
<n2>
|
||||
<parent>cec1</parent>
|
||||
</n1>
|
||||
</nodes>
|
||||
</arg>
|
||||
</xcatrequest>
|
||||
|
19
xCAT-test/xmlapi/setNodesAttribsreq3
Normal file
19
xCAT-test/xmlapi/setNodesAttribsreq3
Normal file
@ -0,0 +1,19 @@
|
||||
<xcatrequest>
|
||||
<clienttype>PCM</clienttype>
|
||||
<command>setNodesAttribs</command>
|
||||
<noderange>compute2</noderange>
|
||||
<arg>
|
||||
<table>
|
||||
<name>nodelist</name>
|
||||
<attr>
|
||||
<groups>allxxx</groups>
|
||||
</attr>
|
||||
</table>
|
||||
<table>
|
||||
<name>nodetype</name>
|
||||
<attr>
|
||||
<os>Redhat20</os>
|
||||
</attr>
|
||||
</table>
|
||||
</arg>
|
||||
</xcatrequest>
|
40
xCAT-test/xmlapi/xmldriver
Executable file
40
xCAT-test/xmlapi/xmldriver
Executable file
@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT =
|
||||
$ENV{'XCATROOT'} ? $ENV{'XCATROOT'}
|
||||
: -d '/opt/xcat' ? '/opt/xcat'
|
||||
: '/usr';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use strict;
|
||||
use File::Basename;
|
||||
use Cwd;
|
||||
use Socket;
|
||||
use XML::Simple;
|
||||
require xCAT::MsgUtils;
|
||||
use xCAT::Utils;
|
||||
require xCAT::Client;
|
||||
my $bname = basename($0);
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head1 pcmdriver - test XMLapi to Table.pm ( via tabutils.pm)
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Main
|
||||
|
||||
$ENV{'XCATXMLTRACE'}=1;
|
||||
my $XML=`cat /root/lissa/xmlapi/getTablesAllRowAttribsreq`;
|
||||
|
||||
my $data=$XML;
|
||||
|
||||
$ENV{'XCATSHOWXML'}=1;
|
||||
|
||||
xCAT::Client::submit_request($data, \&xCAT::Client::handle_response);
|
||||
exit $xCAT::Client::EXITCODE;
|
||||
|
60
xCAT-test/xmlapi/xmldriver.old
Executable file
60
xCAT-test/xmlapi/xmldriver.old
Executable file
@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT =
|
||||
$ENV{'XCATROOT'} ? $ENV{'XCATROOT'}
|
||||
: -d '/opt/xcat' ? '/opt/xcat'
|
||||
: '/usr';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use strict;
|
||||
use File::Basename;
|
||||
use Cwd;
|
||||
use Socket;
|
||||
use XML::Simple;
|
||||
require xCAT::MsgUtils;
|
||||
use xCAT::Utils;
|
||||
require xCAT::Client;
|
||||
my $bname = basename($0);
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head1 pcmdriver - test XMLapi for PCM
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Main
|
||||
|
||||
$ENV{'XCATXMLTRACE'}=1;
|
||||
my $XML=`cat /root/lissa/PCM/api/getTablesAllRowAttribsreq`;
|
||||
#my $XML=`cat /root/lissa/PCM/api/getAllEntriesreq `;
|
||||
#my $XML=`cat /root/lissa/PCM/api/setNodesAttribsreq `;
|
||||
#y $XML=`cat /root/lissa/PCM/api/getTablesAllNodeAttribsreq `;
|
||||
#my $XML=`cat /root/lissa/PCM/api/getTablesAllNodeAttribsreq1`;
|
||||
#my $XML=`cat /root/lissa/PCM/api/getTablesAllNodeAttribsreq2`;
|
||||
#my $XML=`cat /root/lissa/PCM/api/getTablesAllNodeAttribsreq3`;
|
||||
#my $XML=`cat /root/lissa/PCM/api/getTablesNodesAttribsreq`;
|
||||
#my $XML=`cat /root/lissa/PCM/api/getTablesNodesAttribsreq2`;
|
||||
#my $XML=`cat /root/lissa/PCM/api/getTablesNodesAttribsreq1`;
|
||||
#my $XML=`cat /root/lissa/PCM/api/setNodesAttribsreq1.1 `;
|
||||
#my $XML=`cat /root/lissa/PCM/api/getNodesAttribsreq1 `;
|
||||
#y $XML=`cat /root/lissa/PCM/api/getNodesAttribsreq `;
|
||||
#my $XML=`cat /root/lissa/PCM/api/getNodesAttribsreq2 `;
|
||||
#my $XML=`cat /root/lissa/PCM/api/setNodesAttribsreq3 `;
|
||||
#my $XML=`cat /root/lissa/PCM/api/delEntriesreq `;
|
||||
#my $XML=`cat /root/lissa/PCM/api/delEntriesreq3 `;
|
||||
#my $XML=`cat /root/lissa/PCM/api/getAttribsreq `;
|
||||
#my $XML=`cat /root/lissa/PCM/api/getAttribsreq2 `;
|
||||
#my $XML=`cat /root/lissa/PCM/api/setAttribsreq `;
|
||||
#my $XML=`cat /root/lissa/PCM/api/noderangereq `;
|
||||
|
||||
my $data=$XML;
|
||||
|
||||
$ENV{'XCATSHOWXML'}=1;
|
||||
|
||||
xCAT::Client::submit_request($data, \&xCAT::Client::handle_response);
|
||||
exit $xCAT::Client::EXITCODE;
|
||||
|
43
xCAT-test/xmlapi/xmldriver.org
Normal file
43
xCAT-test/xmlapi/xmldriver.org
Normal file
@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT =
|
||||
$ENV{'XCATROOT'} ? $ENV{'XCATROOT'}
|
||||
: -d '/opt/xcat' ? '/opt/xcat'
|
||||
: '/usr';
|
||||
}
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use strict;
|
||||
use File::Basename;
|
||||
use Cwd;
|
||||
use Socket;
|
||||
|
||||
#use Data::Dumper;
|
||||
use Getopt::Long;
|
||||
require xCAT::MsgUtils;
|
||||
require xCAT::DSHCLI;
|
||||
use xCAT::Utils;
|
||||
use xCAT::RemoteShellExp;
|
||||
require xCAT::PCMClient;
|
||||
my $bname = basename($0);
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head1 pcmdriver - test XMLapi for PCM
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Main
|
||||
|
||||
|
||||
my $XML=`cat /root/lissa/PCM/api/getAllEntriesreq `;
|
||||
my $data=$XML;
|
||||
|
||||
|
||||
|
||||
xCAT::PCMClient::submit_request($data, \&xCAT::Client::handle_response);
|
||||
exit $xCAT::Client::EXITCODE;
|
||||
|
6
xCAT-test/xmlapi/xmlrequest.org
Normal file
6
xCAT-test/xmlapi/xmlrequest.org
Normal file
@ -0,0 +1,6 @@
|
||||
<xcatrequest>
|
||||
<clienttype>cli</clienttype>
|
||||
<command>nodels</command>
|
||||
<cwd>/svn/xcat-core/2.6/perl-xCAT/xCAT</cwd>
|
||||
<noderange>service</noderange>
|
||||
</xcatrequest>
|
9
xCAT-test/xmlapi/xmlresponse
Normal file
9
xCAT-test/xmlapi/xmlresponse
Normal file
@ -0,0 +1,9 @@
|
||||
<xcatresponse>
|
||||
<node>
|
||||
<name>rhsn</name>
|
||||
</node>
|
||||
</xcatresponse>
|
||||
rhsn
|
||||
<xcatresponse>
|
||||
<serverdone></serverdone>
|
||||
</xcatresponse>
|
Reference in New Issue
Block a user