mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-12 06:20:14 +00:00
Merge pull request #5050 from bybai/nodels
add xCAT REST API for nodels
This commit is contained in:
@@ -15,10 +15,10 @@ POST - Create a token.
|
||||
|
||||
**Example:**
|
||||
|
||||
Acquire a token for user 'root'. ::
|
||||
Aquire a token for user 'root'. ::
|
||||
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/tokens?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"userName":"root","userPW":"cluster"}'
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/tokens?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"userName":"root","userPW":"cluster"}'
|
||||
{
|
||||
"token":{
|
||||
"id":"a6e89b59-2b23-429a-b3fe-d16807dd19eb",
|
||||
@@ -52,7 +52,7 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
Get all the node names from xCAT database. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes?userName=root&userPW=cluster&pretty=1'
|
||||
[
|
||||
"node1",
|
||||
"node2",
|
||||
@@ -78,7 +78,7 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
Get all the attributes for node 'node1'. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"profile":"compute",
|
||||
@@ -108,9 +108,7 @@ Refer to the man page: :doc:`chdef </guides/admin-guides/references/man1/chdef.1
|
||||
Change the attributes mgt=dfm and netboot=yaboot. ::
|
||||
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"mgt":"dfm","netboot":"yaboot"}'
|
||||
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"mgt":"dfm","netboot":"yaboot"}'
|
||||
POST - Create the node {noderange}.
|
||||
```````````````````````````````````
|
||||
|
||||
@@ -118,7 +116,7 @@ Refer to the man page: :doc:`mkdef </guides/admin-guides/references/man1/mkdef.1
|
||||
|
||||
**Parameters:**
|
||||
|
||||
* Json format: An object which includes multiple 'att:value' pairs. DataBody: {attr1:v1,att2:v2,...}.
|
||||
* Json format: An object which includes multiple 'att:value' pairs. DataBody: {options:{opt1:v1,opt2:v2},attr1:v1,att2:v2,...}.
|
||||
|
||||
**Returns:**
|
||||
|
||||
@@ -129,8 +127,7 @@ Refer to the man page: :doc:`mkdef </guides/admin-guides/references/man1/mkdef.1
|
||||
Create a node with attributes groups=all, mgt=dfm and netboot=yaboot ::
|
||||
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"groups":"all","mgt":"dfm","netboot":"yaboot"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"options":{"--template":"x86_64kvmguest-template"},'
|
||||
DELETE - Remove the node {noderange}.
|
||||
`````````````````````````````````````
|
||||
|
||||
@@ -144,8 +141,8 @@ Refer to the man page: :doc:`rmdef </guides/admin-guides/references/man1/rmdef.1
|
||||
|
||||
Delete the node node1 ::
|
||||
|
||||
#curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/nodes/{noderange}/attrs/{attr1,attr2,attr3 ...}] - The attributes resource for the node {noderange}
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -165,7 +162,7 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
Get the attributes {groups,mgt,netboot} for node node1 ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/attrs/groups,mgt,netboot?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/attrs/groups,mgt,netboot?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"netboot":"xnba",
|
||||
@@ -190,8 +187,8 @@ Refer to the man page: :doc:`makehosts </guides/admin-guides/references/man8/mak
|
||||
|
||||
Create the mapping of ip and hostname record for node 'node1'. ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/host?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/host?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/nodes/{noderange}/dns] - The dns record resource for the node {noderange}
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -210,8 +207,8 @@ Refer to the man page: :doc:`makedns </guides/admin-guides/references/man8/maked
|
||||
|
||||
Create the dns record for node 'node1'. ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/dns?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/dns?userName=root&userPW=cluster&pretty=1'
|
||||
DELETE - Remove the dns record for the node {noderange}.
|
||||
````````````````````````````````````````````````````````
|
||||
|
||||
@@ -225,8 +222,8 @@ Refer to the man page: :doc:`makedns </guides/admin-guides/references/man8/maked
|
||||
|
||||
Delete the dns record for node node1 ::
|
||||
|
||||
#curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1/dns?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1/dns?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/nodes/{noderange}/dhcp] - The dhcp record resource for the node {noderange}
|
||||
---------------------------------------------------------------------------------
|
||||
|
||||
@@ -243,8 +240,8 @@ Refer to the man page: :doc:`makedhcp </guides/admin-guides/references/man8/make
|
||||
|
||||
Create the dhcp record for node 'node1'. ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/dhcp?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/dhcp?userName=root&userPW=cluster&pretty=1'
|
||||
DELETE - Remove the dhcp record for the node {noderange}.
|
||||
`````````````````````````````````````````````````````````
|
||||
|
||||
@@ -258,8 +255,8 @@ Refer to the man page: :doc:`makedhcp </guides/admin-guides/references/man8/make
|
||||
|
||||
Delete the dhcp record for node node1 ::
|
||||
|
||||
#curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1/dhcp?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1/dhcp?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/nodes/{noderange}/nodestat}] - The attributes resource for the node {noderange}
|
||||
-------------------------------------------------------------------------------------
|
||||
|
||||
@@ -277,13 +274,37 @@ Refer to the man page: :doc:`nodestat </guides/admin-guides/references/man1/node
|
||||
Get the running status for node node1 ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/nodestat?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/nodestat?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"nodestat":"noping"
|
||||
}
|
||||
}
|
||||
|
||||
[URI:/nodes/{noderange}/nodels}] - Lists the nodes, noderange cannot start with /
|
||||
---------------------------------------------------------------------------------
|
||||
|
||||
GET - Lists the nodes.
|
||||
``````````````````````
|
||||
|
||||
Refer to the man page: :doc:`nodels </guides/admin-guides/references/man1/nodels.1>`
|
||||
|
||||
**Returns:**
|
||||
|
||||
* Json format: An array of node names.
|
||||
|
||||
**Example:**
|
||||
|
||||
Get the node names from xCAT database. ::
|
||||
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node[1-3]/nodels?userName=root&userPW=cluster&pretty=1'
|
||||
[
|
||||
"node1",
|
||||
"node2",
|
||||
"node3",
|
||||
]
|
||||
|
||||
[URI:/nodes/{noderange}/subnodes] - The sub-nodes resources for the node {noderange}
|
||||
------------------------------------------------------------------------------------
|
||||
|
||||
@@ -301,7 +322,7 @@ Refer to the man page: :doc:`rscan </guides/admin-guides/references/man1/rscan.1
|
||||
Get all the children nodes for node 'node1'. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/subnodes?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/subnodes?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"cmm01node09":{
|
||||
"mpa":"ngpcmm01",
|
||||
@@ -338,7 +359,7 @@ Refer to the man page: :doc:`rpower </guides/admin-guides/references/man1/rpower
|
||||
Get the power status. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/power?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/power?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"power":"on"
|
||||
@@ -362,8 +383,8 @@ Refer to the man page: :doc:`rpower </guides/admin-guides/references/man1/rpower
|
||||
|
||||
Change the power status to on ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/power?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"on"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/power?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"on"}'
|
||||
[URI:/nodes/{noderange}/energy] - The energy resource for the node {noderange}
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
@@ -380,8 +401,8 @@ Refer to the man page: :doc:`renergy </guides/admin-guides/references/man1/rener
|
||||
|
||||
Get all the energy attributes. ::
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/energy?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/energy?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"cappingmin":"272.3 W",
|
||||
@@ -407,8 +428,8 @@ Refer to the man page: :doc:`renergy </guides/admin-guides/references/man1/rener
|
||||
|
||||
Turn on the cappingstatus to [on] ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/energy?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"cappingstatus":"on"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/energy?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"cappingstatus":"on"}'
|
||||
[URI:/nodes/{noderange}/energy/{cappingmaxmin,cappingstatus,cappingvalue ...}] - The specific energy attributes resource for the node {noderange}
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -426,7 +447,7 @@ Refer to the man page: :doc:`renergy </guides/admin-guides/references/man1/rener
|
||||
Get the energy attributes which are specified in the URI. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/energy/cappingmaxmin,cappingstatus?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/energy/cappingmaxmin,cappingstatus?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"cappingmin":"272.3 W",
|
||||
@@ -451,7 +472,7 @@ Refer to the man page: :doc:`rspconfig </guides/admin-guides/references/man1/rsp
|
||||
Get the snmp community for the service processor of node1. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/sp/community?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/sp/community?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"SP SNMP Community":"public"
|
||||
@@ -475,8 +496,8 @@ Refer to the man page: :doc:`rspconfig </guides/admin-guides/references/man1/rsp
|
||||
|
||||
Set the snmp community to [mycommunity]. ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/sp/community?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"value":"mycommunity"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/sp/community?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"value":"mycommunity"}'
|
||||
[URI:/nodes/{noderange}/nextboot] - The temporary bootorder resource in next boot for the node {noderange}
|
||||
----------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -494,7 +515,7 @@ Refer to the man page: :doc:`rsetboot </guides/admin-guides/references/man1/rset
|
||||
Get the bootorder for the next boot. (It's only valid after setting.) ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/nextboot?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/nextboot?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"nextboot":"Network"
|
||||
@@ -518,8 +539,8 @@ Refer to the man page: :doc:`rsetboot </guides/admin-guides/references/man1/rset
|
||||
|
||||
Set the bootorder for the next boot. ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/nextboot?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"order":"net"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/nextboot?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"order":"net"}'
|
||||
[URI:/nodes/{noderange}/bootstate] - The boot state resource for node {noderange}.
|
||||
----------------------------------------------------------------------------------
|
||||
|
||||
@@ -537,7 +558,7 @@ Refer to the man page: :doc:`nodeset </guides/admin-guides/references/man1/nimno
|
||||
Get the next boot state for the node1. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/bootstate?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/bootstate?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"bootstat":"boot"
|
||||
@@ -561,8 +582,8 @@ Refer to the man page: :doc:`nodeset </guides/admin-guides/references/man1/nimno
|
||||
|
||||
Set the next boot state for the node1. ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/bootstate?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"osimage":"rhels6.4-x86_64-install-compute"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/bootstate?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"osimage":"rhels6.4-x86_64-install-compute"}'
|
||||
[URI:/nodes/{noderange}/vitals] - The vitals resources for the node {noderange}
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -580,7 +601,7 @@ Refer to the man page: :doc:`rvitals </guides/admin-guides/references/man1/rvita
|
||||
Get all the vitails attributes for the node1. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/vitals?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/vitals?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"SysBrd Fault":"0",
|
||||
@@ -611,7 +632,7 @@ Refer to the man page: :doc:`rvitals </guides/admin-guides/references/man1/rvita
|
||||
Get the 'fanspeed' vitals attribute. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/vitals/fanspeed?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/vitals/fanspeed?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"Fan 1A Tach":"3219 RPM",
|
||||
@@ -642,7 +663,7 @@ Refer to the man page: :doc:`rinv </guides/admin-guides/references/man1/rinv.1>`
|
||||
Get all the inventory attributes for node1. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/inventory?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/inventory?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"DIMM 21 ":"8GB PC3-12800 (1600 MT/s) ECC RDIMM",
|
||||
@@ -673,7 +694,7 @@ Refer to the man page: :doc:`rinv </guides/admin-guides/references/man1/rinv.1>`
|
||||
Get the 'model' inventory attribute for node1. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/inventory/model?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/inventory/model?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"System Description":"System x3650 M4",
|
||||
@@ -698,7 +719,7 @@ Refer to the man page: :doc:`reventlog </guides/admin-guides/references/man1/rev
|
||||
Get all the eventlog for node1. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/eventlog?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/eventlog?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node1":{
|
||||
"eventlog":[
|
||||
@@ -721,7 +742,7 @@ Refer to the man page: :doc:`reventlog </guides/admin-guides/references/man1/rev
|
||||
Delete all the event log for node1. ::
|
||||
|
||||
|
||||
#curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1/eventlog?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1/eventlog?userName=root&userPW=cluster&pretty=1'
|
||||
[
|
||||
{
|
||||
"eventlog":[
|
||||
@@ -752,7 +773,7 @@ Refer to the man page: :doc:`rbeacon </guides/admin-guides/references/man1/rbeac
|
||||
Turn on the beacon. ::
|
||||
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/beacon?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"on"}'
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/beacon?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"on"}'
|
||||
[
|
||||
{
|
||||
"name":"node1",
|
||||
@@ -777,7 +798,7 @@ Refer to the man page: :doc:`updatenode </guides/admin-guides/references/man1/up
|
||||
Initiate an updatenode process. ::
|
||||
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/updating?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/updating?userName=root&userPW=cluster&pretty=1'
|
||||
[
|
||||
"There were no syncfiles defined to process. File synchronization has completed.",
|
||||
"Performing software maintenance operations. This could take a while, if there are packages to install.
|
||||
@@ -803,7 +824,7 @@ Refer to the man page: :doc:`updatenode </guides/admin-guides/references/man1/up
|
||||
Initiate an file syncing process. ::
|
||||
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/filesyncing?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/filesyncing?userName=root&userPW=cluster&pretty=1'
|
||||
[
|
||||
"There were no syncfiles defined to process. File synchronization has completed."
|
||||
]
|
||||
@@ -825,7 +846,7 @@ Refer to the man page: :doc:`updatenode </guides/admin-guides/references/man1/up
|
||||
Initiate an software maintenance process. ::
|
||||
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/sw?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/sw?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"node2":[
|
||||
" Wed Apr 3 09:05:42 CST 2013 Running postscript: ospkgs",
|
||||
@@ -859,7 +880,7 @@ Refer to the man page: :doc:`updatenode </guides/admin-guides/references/man1/up
|
||||
Initiate an updatenode process. ::
|
||||
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/postscript?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"scripts":["syslog","remoteshell"]}'
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/postscript?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"scripts":["syslog","remoteshell"]}'
|
||||
{
|
||||
"node2":[
|
||||
" Wed Apr 3 09:01:33 CST 2013 Running postscript: syslog",
|
||||
@@ -895,7 +916,7 @@ Refer to the man page: :doc:`xdsh </guides/admin-guides/references/man1/xdsh.1>`
|
||||
Run the 'date' command on the node2. ::
|
||||
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/nodeshell?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"command":["date","ls"]}'
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/nodeshell?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"command":["date","ls"]}'
|
||||
{
|
||||
"node2":[
|
||||
" Wed Apr 3 08:30:26 CST 2013",
|
||||
@@ -925,7 +946,7 @@ Refer to the man page: :doc:`xdcp </guides/admin-guides/references/man1/xdcp.1>`
|
||||
Copy files /tmp/f1 and /tmp/f2 from xCAT MN to the node2:/tmp. ::
|
||||
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/nodecopy?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"src":["/tmp/f1","/tmp/f2"],"target":"/tmp"}'
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node2/nodecopy?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"src":["/tmp/f1","/tmp/f2"],"target":"/tmp"}'
|
||||
no output for succeeded copy.
|
||||
|
||||
[URI:/nodes/{noderange}/vm] - The virtualization node {noderange}.
|
||||
@@ -953,20 +974,20 @@ Refer to the man page: :doc:`chvm </guides/admin-guides/references/man1/chvm.1>`
|
||||
|
||||
Set memory to 3000MB. ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"memorysize":"3000"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"memorysize":"3000"}'
|
||||
**Example2:**
|
||||
|
||||
Add a new 20G disk. ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"adddisk":"20G"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"adddisk":"20G"}'
|
||||
**Example3:**
|
||||
|
||||
Purge the disk 'hdb'. ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"purgedisk":"hdb"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"purgedisk":"hdb"}'
|
||||
POST - Create the vm node {noderange}.
|
||||
``````````````````````````````````````
|
||||
|
||||
@@ -988,8 +1009,8 @@ Refer to the man page: :doc:`mkvm </guides/admin-guides/references/man1/mkvm.1>`
|
||||
|
||||
Create the vm node1 with a 30G disk, 2048M memory and 2 cpus. ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"disksize":"30G","memorysize":"2048","cpucount":"2"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"disksize":"30G","memorysize":"2048","cpucount":"2"}'
|
||||
DELETE - Remove the vm node {noderange}.
|
||||
````````````````````````````````````````
|
||||
|
||||
@@ -1009,8 +1030,8 @@ Refer to the man page: :doc:`rmvm </guides/admin-guides/references/man1/rmvm.1>`
|
||||
|
||||
Remove the vm node1 by force and purge the disk. ::
|
||||
|
||||
#curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"force":"yes","purge":"yes"}'
|
||||
|
||||
curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1/vm?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"force":"yes","purge":"yes"}'
|
||||
[URI:/nodes/{noderange}/vmclone] - The clone resource for the virtual node {noderange}.
|
||||
---------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1038,7 +1059,7 @@ Refer to the man page: :doc:`clonevm </guides/admin-guides/references/man1/clone
|
||||
Create a clone master named "vmmaster" from the node1. ::
|
||||
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/vmclone?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"tomaster":"vmmaster","detach":"yes"}'
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/vmclone?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"tomaster":"vmmaster","detach":"yes"}'
|
||||
{
|
||||
"node1":{
|
||||
"vmclone":"Cloning of node1.hda.qcow2 complete (clone uses 9633.19921875 for a disk size of 30720MB)"
|
||||
@@ -1049,8 +1070,8 @@ Create a clone master named "vmmaster" from the node1. ::
|
||||
|
||||
Clone the node1 from the clone master named "vmmaster". ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/vmclone?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"frommaster":"vmmaster"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/vmclone?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"frommaster":"vmmaster"}'
|
||||
[URI:/nodes/{noderange}/vmmigrate] - The virtualization resource for migration.
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -1069,8 +1090,8 @@ Refer to the man page: :doc:`rmigrate </guides/admin-guides/references/man1/rmig
|
||||
|
||||
Migrate node1 to target host host2. ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/vmmigrate?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"target":"host2"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/nodes/node1/vmmigrate?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"target":"host2"}'
|
||||
Osimage resources
|
||||
=================
|
||||
|
||||
@@ -1093,7 +1114,7 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
Get all the osimage names. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/osimages?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/osimages?userName=root&userPW=cluster&pretty=1'
|
||||
[
|
||||
"sles11.2-x86_64-install-compute",
|
||||
"sles11.2-x86_64-install-iscsi",
|
||||
@@ -1118,14 +1139,14 @@ Refer to the man page: :doc:`copycds </guides/admin-guides/references/man8/copyc
|
||||
|
||||
Create osimage resources based on the ISO specified ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/osimages?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"iso":"/iso/RHEL6.4-20130130.0-Server-ppc64-DVD1.iso"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/osimages?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"iso":"/iso/RHEL6.4-20130130.0-Server-ppc64-DVD1.iso"}'
|
||||
**Example2:**
|
||||
|
||||
Create osimage resources based on an xCAT image or configuration file ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/osimages?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"file":"/tmp/sles11.2-x86_64-install-compute.tgz"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/osimages?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"file":"/tmp/sles11.2-x86_64-install-compute.tgz"}'
|
||||
[URI:/osimages/{imgname}] - The osimage resource
|
||||
------------------------------------------------
|
||||
|
||||
@@ -1145,7 +1166,7 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
Get the attributes for the specified osimage. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"sles11.2-x86_64-install-compute":{
|
||||
"provmethod":"install",
|
||||
@@ -1179,8 +1200,8 @@ Refer to the man page: :doc:`chdef </guides/admin-guides/references/man1/chdef.1
|
||||
|
||||
Change the 'osvers' and 'osarch' attributes for the osiamge. ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/osimages/sles11.2-ppc64-install-compute/?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"osvers":"sles11.3","osarch":"x86_64"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/osimages/sles11.2-ppc64-install-compute/?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"osvers":"sles11.3","osarch":"x86_64"}'
|
||||
POST - Create the osimage {imgname}.
|
||||
````````````````````````````````````
|
||||
|
||||
@@ -1198,8 +1219,8 @@ Refer to the man page: :doc:`mkdef </guides/admin-guides/references/man1/mkdef.1
|
||||
|
||||
Create a osimage obj with the specified parameters. ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.3-ppc64-install-compute?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"osvers":"sles11.3","osarch":"ppc64","osname":"Linux","provmethod":"install","profile":"compute"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.3-ppc64-install-compute?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"osvers":"sles11.3","osarch":"ppc64","osname":"Linux","provmethod":"install","profile":"compute"}'
|
||||
DELETE - Remove the osimage {imgname}.
|
||||
``````````````````````````````````````
|
||||
|
||||
@@ -1213,8 +1234,8 @@ Refer to the man page: :doc:`rmdef </guides/admin-guides/references/man1/rmdef.1
|
||||
|
||||
Delete the specified osimage. ::
|
||||
|
||||
#curl -X DELETE -k 'https://127.0.0.1/xcatws/osimages/sles11.3-ppc64-install-compute?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X DELETE -k 'https://127.0.0.1/xcatws/osimages/sles11.3-ppc64-install-compute?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/osimages/{imgname}/attrs/attr1,attr2,attr3 ...] - The attributes resource for the osimage {imgname}
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1233,7 +1254,8 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
|
||||
Get the specified attributes. ::
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/osimages/sles11.2-ppc64-install-compute/attrs/imagetype,osarch,osname,provmethod?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/osimages/sles11.2-ppc64-install-compute/attrs/imagetype,osarch,osname,provmethod?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"sles11.2-ppc64-install-compute":{
|
||||
"provmethod":"install",
|
||||
@@ -1263,20 +1285,20 @@ Refer to the man page: :doc:` </guides/admin-guides/references/>`
|
||||
|
||||
Generates a stateless image based on the specified osimage ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"gen"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"gen"}'
|
||||
**Example2:**
|
||||
|
||||
Packs the stateless image from the chroot file system based on the specified osimage ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"pack"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"pack"}'
|
||||
**Example3:**
|
||||
|
||||
Exports an xCAT image based on the specified osimage ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"export"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"action":"export"}'
|
||||
DELETE - Delete the stateless or statelite image instance for the osimage {imgname} from the file system
|
||||
````````````````````````````````````````````````````````````````````````````````````````````````````````
|
||||
|
||||
@@ -1290,8 +1312,8 @@ Refer to the man page: :doc:`rmimage </guides/admin-guides/references/man1/rmima
|
||||
|
||||
Delete the stateless image for the specified osimage ::
|
||||
|
||||
#curl -X DELETE -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X DELETE -k 'https://127.0.0.1/xcatws/osimages/sles11.2-x86_64-install-compute/instance?userName=root&userPW=cluster&pretty=1'
|
||||
Network Resources
|
||||
=================
|
||||
|
||||
@@ -1318,7 +1340,7 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
Get all the networks names from xCAT database. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/networks?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/networks?userName=root&userPW=cluster&pretty=1'
|
||||
[
|
||||
"network1",
|
||||
"network2",
|
||||
@@ -1342,8 +1364,8 @@ Refer to the man page: :doc:`makenetworks </guides/admin-guides/references/man8/
|
||||
|
||||
Create the networks resources base on the network configuration on xCAT MN. ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/networks?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/networks?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/networks/{netname}] - The network resource
|
||||
------------------------------------------------
|
||||
|
||||
@@ -1362,7 +1384,8 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
|
||||
Get all the attributes for network 'network1'. ::
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/networks/network1?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/networks/network1?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"network1":{
|
||||
"gateway":"<xcatmaster>",
|
||||
@@ -1391,8 +1414,8 @@ Refer to the man page: :doc:`chdef </guides/admin-guides/references/man1/chdef.1
|
||||
|
||||
Change the attributes mgtifname=eth0 and net=10.1.0.0. ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/networks/network1?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"mgtifname":"eth0","net":"10.1.0.0"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/networks/network1?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"mgtifname":"eth0","net":"10.1.0.0"}'
|
||||
POST - Create the network {netname}. DataBody: {attr1:v1,att2:v2...}.
|
||||
`````````````````````````````````````````````````````````````````````
|
||||
|
||||
@@ -1410,8 +1433,8 @@ Refer to the man page: :doc:`mkdef </guides/admin-guides/references/man1/mkdef.1
|
||||
|
||||
Create a network with attributes gateway=10.1.0.1, mask=255.255.0.0 ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/networks/network1?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"gateway":"10.1.0.1","mask":"255.255.0.0"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/networks/network1?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"gateway":"10.1.0.1","mask":"255.255.0.0"}'
|
||||
DELETE - Remove the network {netname}.
|
||||
``````````````````````````````````````
|
||||
|
||||
@@ -1425,8 +1448,8 @@ Refer to the man page: :doc:`rmdef </guides/admin-guides/references/man1/rmdef.1
|
||||
|
||||
Delete the network network1 ::
|
||||
|
||||
#curl -X DELETE -k 'https://127.0.0.1/xcatws/networks/network1?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X DELETE -k 'https://127.0.0.1/xcatws/networks/network1?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/networks/{netname}/attrs/attr1,attr2,...] - The attributes resource for the network {netname}
|
||||
---------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1445,7 +1468,8 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
|
||||
Get the attributes {groups,mgt,netboot} for network network1 ::
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/networks/network1/attrs/gateway,mask,mgtifname,net,tftpserver?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/networks/network1/attrs/gateway,mask,mgtifname,net,tftpserver?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"network1":{
|
||||
"gateway":"9.114.34.254",
|
||||
@@ -1476,7 +1500,8 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
|
||||
Get all the policy objects. ::
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/policy?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/policy?userName=root&userPW=cluster&pretty=1'
|
||||
[
|
||||
"1",
|
||||
"1.2",
|
||||
@@ -1504,7 +1529,8 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
|
||||
Get all the attribute for policy 1. ::
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/policy/1?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/policy/1?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"1":{
|
||||
"name":"root",
|
||||
@@ -1532,8 +1558,7 @@ Refer to the man page: :doc:`chdef </guides/admin-guides/references/man1/chdef.1
|
||||
Set the name attribute for policy 3. ::
|
||||
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/policy/3?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"name":"root"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/policy/3?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"name":"root"}'
|
||||
POST - Create the policy {policyname}. DataBody: {attr1:v1,att2:v2...}.
|
||||
```````````````````````````````````````````````````````````````````````
|
||||
|
||||
@@ -1553,8 +1578,8 @@ Refer to the man page: :doc:`chdef </guides/admin-guides/references/man1/chdef.1
|
||||
|
||||
Create a new policy 10. ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/policy/10?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"name":"root","commands":"rpower"}'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/policy/10?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"name":"root","commands":"rpower"}'
|
||||
DELETE - Remove the policy {policy_priority}.
|
||||
`````````````````````````````````````````````
|
||||
|
||||
@@ -1570,8 +1595,8 @@ Refer to the man page: :doc:`rmdef </guides/admin-guides/references/man1/rmdef.1
|
||||
|
||||
Delete the policy 10. ::
|
||||
|
||||
#curl -X DELETE -k 'https://127.0.0.1/xcatws/policy/10?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X DELETE -k 'https://127.0.0.1/xcatws/policy/10?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/policy/{policyname}/attrs/{attr1,attr2,attr3,...}] - The attributes resource for the policy {policy_priority}
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1592,7 +1617,8 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
|
||||
Get the name and rule attributes for policy 1. ::
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/policy/1/attrs/name,rule?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/policy/1/attrs/name,rule?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"1":{
|
||||
"name":"root",
|
||||
@@ -1625,7 +1651,8 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
|
||||
Get all the group names from xCAT database. ::
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/groups?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/groups?userName=root&userPW=cluster&pretty=1'
|
||||
[
|
||||
"__mgmtnode",
|
||||
"all",
|
||||
@@ -1650,7 +1677,8 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
|
||||
Get all the attributes for group 'all'. ::
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/groups/all?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/groups/all?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"all":{
|
||||
"members":"zxnode2,nodexxx,node1,node4"
|
||||
@@ -1675,8 +1703,7 @@ Refer to the man page: :doc:`chdef </guides/admin-guides/references/man1/chdef.1
|
||||
Change the attributes mgt=dfm and netboot=yaboot. ::
|
||||
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/groups/all?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"mgt":"dfm","netboot":"yaboot"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/groups/all?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"mgt":"dfm","netboot":"yaboot"}'
|
||||
[URI:/groups/{groupname}/attrs/{attr1,attr2,attr3 ...}] - The attributes resource for the group {groupname}
|
||||
-----------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1694,7 +1721,7 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
Get the attributes {mgt,netboot} for group all ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/groups/all/attrs/mgt,netboot?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/groups/all/attrs/mgt,netboot?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"all":{
|
||||
"netboot":"yaboot",
|
||||
@@ -1728,7 +1755,7 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
Get all the global configuration ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/globalconf?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/globalconf?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"clustersite":{
|
||||
"xcatconfdir":"/etc/xcat",
|
||||
@@ -1755,7 +1782,8 @@ Refer to the man page: :doc:`lsdef </guides/admin-guides/references/man1/lsdef.1
|
||||
|
||||
Get the 'master' and 'domain' configuration. ::
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/globalconf/attrs/master,domain?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/globalconf/attrs/master,domain?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"clustersite":{
|
||||
"domain":"cluster.com",
|
||||
@@ -1782,8 +1810,8 @@ Refer to the man page: :doc:`chdef </guides/admin-guides/references/man1/chdef.1
|
||||
|
||||
Change/Add the domain attribute. ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/globalconf/attrs/domain?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"domain":"cluster.com"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/globalconf/attrs/domain?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"domain":"cluster.com"}'
|
||||
DELETE - Remove the site attributes.
|
||||
````````````````````````````````````
|
||||
|
||||
@@ -1799,8 +1827,8 @@ Refer to the man page: :doc:`chdef </guides/admin-guides/references/man1/chdef.1
|
||||
|
||||
Remove the domain configure. ::
|
||||
|
||||
#curl -X DELETE -k 'https://127.0.0.1/xcatws/globalconf/attrs/domain?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X DELETE -k 'https://127.0.0.1/xcatws/globalconf/attrs/domain?userName=root&userPW=cluster&pretty=1'
|
||||
Service Resources
|
||||
=================
|
||||
|
||||
@@ -1822,8 +1850,8 @@ Refer to the man page: :doc:`makedns </guides/admin-guides/references/man8/maked
|
||||
|
||||
Initialize the dns service. ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/services/dns?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/services/dns?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/services/dhcp] - The dhcp service resource.
|
||||
-------------------------------------------------
|
||||
|
||||
@@ -1840,8 +1868,8 @@ Refer to the man page: :doc:`makedhcp </guides/admin-guides/references/man8/make
|
||||
|
||||
Create the dhcpd.conf and restart the dhcpd. ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/services/dhcp?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/services/dhcp?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/services/host] - The hostname resource.
|
||||
---------------------------------------------
|
||||
|
||||
@@ -1858,8 +1886,8 @@ Refer to the man page: :doc:`makehosts </guides/admin-guides/references/man8/mak
|
||||
|
||||
Create the ip/hostname records for all the nodes to /etc/hosts. ::
|
||||
|
||||
#curl -X POST -k 'https://127.0.0.1/xcatws/services/host?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X POST -k 'https://127.0.0.1/xcatws/services/host?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/services/slpnodes] - The nodes which support SLP in the xCAT cluster
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
@@ -1876,7 +1904,8 @@ Refer to the man page: :doc:`lsslp </guides/admin-guides/references/man1/lsslp.1
|
||||
|
||||
Get all the nodes which support slp in the network. ::
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/services/slpnodes?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/services/slpnodes?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"ngpcmm01":{
|
||||
"mpa":"ngpcmm01",
|
||||
@@ -1912,7 +1941,7 @@ Refer to the man page: :doc:`lsslp </guides/admin-guides/references/man1/lsslp.1
|
||||
Get all the CMM nodes which support slp in the network. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/services/slpnodes/CMM?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/services/slpnodes/CMM?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"ngpcmm01":{
|
||||
"mpa":"ngpcmm01",
|
||||
@@ -1966,7 +1995,7 @@ GET - Get attributes of tables for a noderange.
|
||||
Get all the columns from table nodetype for node1 and node2. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/tables/nodetype/nodes/node1,node2?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/tables/nodetype/nodes/node1,node2?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"nodetype":[
|
||||
{
|
||||
@@ -1991,7 +2020,7 @@ Get all the columns from table nodetype for node1 and node2. ::
|
||||
Get all the columns from tables nodetype and noderes for node1 and node2. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/tables/nodetype,noderes/nodes/node1,node2?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/tables/nodetype,noderes/nodes/node1,node2?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"noderes":[
|
||||
{
|
||||
@@ -2040,8 +2069,8 @@ PUT - Change the node table attributes for {noderange}.
|
||||
|
||||
Change the nodetype.arch and noderes.netboot attributes for nodes node1,node2. ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/tables/nodetype,noderes/nodes/node1,node2?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"nodetype":{"arch":"x86_64"},"noderes":{"netboot":"xnba"}}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/tables/nodetype,noderes/nodes/node1,node2?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"nodetype":{"arch":"x86_64"},"noderes":{"netboot":"xnba"}}'
|
||||
[URI:/tables/{tablelist}/nodes/nodes/{noderange}/{attrlist}] - The node table attributes resource
|
||||
-------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -2059,7 +2088,7 @@ GET - Get table attributes for a noderange.
|
||||
Get OS and ARCH attributes from nodetype table for node1 and node2. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/tables/nodetype/nodes/node1,node2/os,arch?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/tables/nodetype/nodes/node1,node2/os,arch?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"nodetype":[
|
||||
{
|
||||
@@ -2078,7 +2107,7 @@ Get OS and ARCH attributes from nodetype table for node1 and node2. ::
|
||||
[URI:/tables/{tablelist}/rows] - The non-node table resource
|
||||
------------------------------------------------------------
|
||||
|
||||
Use this for tables that don't have node name as the key of the table, for example: passwd, site, networks, policy, etc.
|
||||
Use this for tables that don't have node name as the key of the table, for example: passwd, site, networks, polciy, etc.
|
||||
|
||||
GET - Get all rows from non-node tables.
|
||||
````````````````````````````````````````
|
||||
@@ -2092,7 +2121,7 @@ GET - Get all rows from non-node tables.
|
||||
Get all rows from networks table. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/tables/networks/rows?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/tables/networks/rows?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"networks":[
|
||||
{
|
||||
@@ -2115,7 +2144,7 @@ Get all rows from networks table. ::
|
||||
[URI:/tables/{tablelist}/rows/{keys}] - The non-node table rows resource
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Use this for tables that don't have node name as the key of the table, for example: passwd, site, networks, policy, etc.
|
||||
Use this for tables that don't have node name as the key of the table, for example: passwd, site, networks, polciy, etc.
|
||||
|
||||
{keys} should be the name=value pairs which are used to search table. e.g. {keys} should be [net=192.168.1.0,mask=255.255.255.0] for networks table query since the net and mask are the keys of networks table.
|
||||
|
||||
@@ -2131,7 +2160,7 @@ GET - Get attributes for rows from non-node tables.
|
||||
Get row which net=192.168.1.0,mask=255.255.255.0 from networks table. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/tables/networks/rows/net=192.168.1.0,mask=255.255.255.0?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/tables/networks/rows/net=192.168.1.0,mask=255.255.255.0?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"networks":[
|
||||
{
|
||||
@@ -2161,8 +2190,8 @@ PUT - Change the non-node table attributes for the row that matches the {keys}.
|
||||
|
||||
Create a route row in the routes table. ::
|
||||
|
||||
#curl -X PUT -k 'https://127.0.0.1/xcatws/tables/routes/rows/routename=privnet?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"net":"10.0.1.0","mask":"255.255.255.0","gateway":"10.0.1.254","ifname":"eth1"}'
|
||||
|
||||
curl -X PUT -k 'https://127.0.0.1/xcatws/tables/routes/rows/routename=privnet?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"net":"10.0.1.0","mask":"255.255.255.0","gateway":"10.0.1.254","ifname":"eth1"}'
|
||||
DELETE - Delete rows from a non-node table that have the attribute values specified in {keys}.
|
||||
``````````````````````````````````````````````````````````````````````````````````````````````
|
||||
|
||||
@@ -2174,12 +2203,12 @@ DELETE - Delete rows from a non-node table that have the attribute values specif
|
||||
|
||||
Delete a route row which routename=privnet in the routes table. ::
|
||||
|
||||
#curl -X DELETE -k 'https://127.0.0.1/xcatws/tables/routes/rows/routename=privnet?userName=root&userPW=cluster&pretty=1'
|
||||
|
||||
curl -X DELETE -k 'https://127.0.0.1/xcatws/tables/routes/rows/routename=privnet?userName=root&userPW=cluster&pretty=1'
|
||||
[URI:/tables/{tablelist}/rows/{keys}/{attrlist}] - The non-node table attributes resource
|
||||
-----------------------------------------------------------------------------------------
|
||||
|
||||
Use this for tables that don't have node name as the key of the table, for example: passwd, site, networks, policy, etc.
|
||||
Use this for tables that don't have node name as the key of the table, for example: passwd, site, networks, polciy, etc.
|
||||
|
||||
GET - Get specific attributes for rows from non-node tables.
|
||||
````````````````````````````````````````````````````````````
|
||||
@@ -2193,7 +2222,7 @@ GET - Get specific attributes for rows from non-node tables.
|
||||
Get attributes mgtifname and tftpserver which net=192.168.1.0,mask=255.255.255.0 from networks table. ::
|
||||
|
||||
|
||||
#curl -X GET -k 'https://127.0.0.1/xcatws/tables/networks/rows/net=192.168.1.0,mask=255.255.255.0/mgtifname,tftpserver?userName=root&userPW=cluster&pretty=1'
|
||||
curl -X GET -k 'https://127.0.0.1/xcatws/tables/networks/rows/net=192.168.1.0,mask=255.255.255.0/mgtifname,tftpserver?userName=root&userPW=cluster&pretty=1'
|
||||
{
|
||||
"networks":[
|
||||
{
|
||||
|
@@ -13,7 +13,7 @@ my @apigroups = (
|
||||
groupname => 'nodes',
|
||||
header => "Node Resources",
|
||||
desc => "The URI list which can be used to create, query, change and manage node objects.",
|
||||
resources => [ 'allnode', 'nodeallattr', 'nodeattr', 'nodehost', 'nodedns', 'nodedhcp', 'nodestat', 'subnodes',
|
||||
resources => [ 'allnode', 'nodeallattr', 'nodeattr', 'nodehost', 'nodedns', 'nodedhcp', 'nodestat', 'nodels', 'subnodes',
|
||||
'power', 'energy', 'energyattr', 'serviceprocessor', 'nextboot', 'bootstate',
|
||||
'vitals', 'vitalsattr', 'inventory', 'inventoryattr', 'eventlog', 'beacon',
|
||||
'updating', 'filesyncing', 'software_maintenance', 'postscript', 'nodeshell', 'nodecopy',
|
||||
@@ -181,9 +181,9 @@ sub make_rst_format {
|
||||
my ($uri, $data);
|
||||
if ($parts[3] =~ /\s+/) {
|
||||
($uri, $data) = split(/ /, $parts[3]);
|
||||
print "\n #curl -X $parts[2] -k \'https://127.0.0.1/xcatws$uri$postfix\' -H Content-Type:application/json --data \'$data\'\n";
|
||||
print "\n curl -X $parts[2] -k \'https://127.0.0.1/xcatws$uri$postfix\' -H Content-Type:application/json --data \'$data\'\n";
|
||||
} else {
|
||||
print "\n #curl -X $parts[2] -k \'https://127.0.0.1/xcatws$parts[3]$postfix\'\n";
|
||||
print "\n curl -X $parts[2] -k \'https://127.0.0.1/xcatws$parts[3]$postfix\'\n";
|
||||
}
|
||||
|
||||
if ($parts[4]) {
|
||||
|
@@ -42,7 +42,7 @@ use IO::Socket::SSL;
|
||||
my %usagemsg = (
|
||||
objreturn => "Json format: An object which includes multiple \'<name> : {att:value, attr:value ...}\' pairs.",
|
||||
objchparam => "Json format: An object which includes multiple \'att:value\' pairs.",
|
||||
non_getreturn => "No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}."
|
||||
non_getreturn => "No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}."
|
||||
);
|
||||
|
||||
# ver(1.0): Use array type instread of string split by '|' or ','
|
||||
@@ -72,16 +72,16 @@ my %URIdef = (
|
||||
desc => "[URI:/nodes/{noderange}] - The node resource",
|
||||
matcher => '^/nodes/[^/]*$',
|
||||
GET => {
|
||||
desc => "Get all the attibutes for the node {noderange}.",
|
||||
desc => "Get all the attributes for the node {noderange}.",
|
||||
desc1 => "The keyword ALLRESOURCES can be used as {noderange} which means to get node attributes for all the nodes.",
|
||||
usage => "||$usagemsg{objreturn}|",
|
||||
example => "|Get all the attibutes for node \'node1\'.|GET|/nodes/node1|{\n \"node1\":{\n \"profile\":\"compute\",\n \"netboot\":\"xnba\",\n \"arch\":\"x86_64\",\n \"mgt\":\"ipmi\",\n \"groups\":\"all\",\n ...\n }\n}|",
|
||||
example => "|Get all the attributes for node \'node1\'.|GET|/nodes/node1|{\n \"node1\":{\n \"profile\":\"compute\",\n \"netboot\":\"xnba\",\n \"arch\":\"x86_64\",\n \"mgt\":\"ipmi\",\n \"groups\":\"all\",\n ...\n }\n}|",
|
||||
cmd => "lsdef",
|
||||
fhandler => \&defhdl,
|
||||
outhdler => \&defout,
|
||||
},
|
||||
PUT => {
|
||||
desc => "Change the attibutes for the node {noderange}.",
|
||||
desc => "Change the attributes for the node {noderange}.",
|
||||
usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
|
||||
example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/nodes/node1 {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||",
|
||||
cmd => "chdef",
|
||||
@@ -138,6 +138,18 @@ my %URIdef = (
|
||||
outhdler => \&actionout,
|
||||
},
|
||||
},
|
||||
nodels => {
|
||||
desc => "[URI:/nodes/{noderange}/nodels}] - Lists the nodes, noderange cannot start with /",
|
||||
matcher => '^/nodes/[^/]*/nodels$',
|
||||
GET => {
|
||||
desc => "Lists the nodes.",
|
||||
usage => "||Json format: An array of node names.|",
|
||||
example => "|Get the node names from xCAT database.|GET|/nodes/node[1-3]/nodels|[\n \"node1\",\n \"node2\",\n \"node3\",\n]|",
|
||||
cmd => "nodels",
|
||||
fhandler => \&actionhdl,
|
||||
outhdler => \&nodelsout,
|
||||
},
|
||||
},
|
||||
nodehost => {
|
||||
desc => "[URI:/nodes/{noderange}/host] - The mapping of ip and hostname for the node {noderange}",
|
||||
matcher => '^/nodes/[^/]*/host$',
|
||||
@@ -351,7 +363,7 @@ my %URIdef = (
|
||||
desc => "[URI:/nodes/{noderange}/vitals] - The vitals resources for the node {noderange}",
|
||||
matcher => '^/nodes/[^/]*/vitals$',
|
||||
GET => {
|
||||
desc => "Get all the vitals attibutes.",
|
||||
desc => "Get all the vitals attributes.",
|
||||
usage => "||$usagemsg{objreturn}|",
|
||||
example => "|Get all the vitails attributes for the node1.|GET|/nodes/node1/vitals|{\n \"node1\":{\n \"SysBrd Fault\":\"0\",\n \"CPUs\":\"0\",\n \"Fan 4A Tach\":\"3330 RPM\",\n \"Drive 15\":\"0\",\n \"SysBrd Vol Fault\":\"0\",\n \"nvDIMM Flash\":\"0\",\n \"Progress\":\"0\"\n ...\n }\n}|",
|
||||
cmd => "rvitals",
|
||||
@@ -364,7 +376,7 @@ my %URIdef = (
|
||||
desc => "[URI:/nodes/{noderange}/vitals/{temp|voltage|wattage|fanspeed|power|leds...}] - The specific vital attributes for the node {noderange}",
|
||||
matcher => '^/nodes/[^/]*/vitals/\S+$',
|
||||
GET => {
|
||||
desc => "Get the specific vitals attibutes.",
|
||||
desc => "Get the specific vitals attributes.",
|
||||
usage => "||$usagemsg{objreturn}|",
|
||||
example => "|Get the \'fanspeed\' vitals attribute.|GET|/nodes/node1/vitals/fanspeed|{\n \"node1\":{\n \"Fan 1A Tach\":\"3219 RPM\",\n \"Fan 4B Tach\":\"2688 RPM\",\n \"Fan 3B Tach\":\"2560 RPM\",\n \"Fan 4A Tach\":\"3330 RPM\",\n \"Fan 2A Tach\":\"3293 RPM\",\n \"Fan 1B Tach\":\"2592 RPM\",\n \"Fan 3A Tach\":\"3182 RPM\",\n \"Fan 2B Tach\":\"2592 RPM\"\n }\n}|",
|
||||
cmd => "rvitals",
|
||||
@@ -376,7 +388,7 @@ my %URIdef = (
|
||||
desc => "[URI:/nodes/{noderange}/inventory] - The inventory attributes for the node {noderange}",
|
||||
matcher => '^/nodes/[^/]*/inventory$',
|
||||
GET => {
|
||||
desc => "Get all the inventory attibutes.",
|
||||
desc => "Get all the inventory attributes.",
|
||||
usage => "||$usagemsg{objreturn}|",
|
||||
example => "|Get all the inventory attributes for node1.|GET|/nodes/node1/inventory|{\n \"node1\":{\n \"DIMM 21 \":\"8GB PC3-12800 (1600 MT/s) ECC RDIMM\",\n \"DIMM 1 Manufacturer\":\"Hyundai Electronics\",\n \"Power Supply 2 Board FRU Number\":\"94Y8105\",\n \"DIMM 9 Model\":\"HMT31GR7EFR4C-PB\",\n \"DIMM 8 Manufacture Location\":\"01\",\n \"DIMM 13 Manufacturer\":\"Hyundai Electronics\",\n \"DASD Backplane 4\":\"Not Present\",\n ...\n }\n}|",
|
||||
cmd => "rinv",
|
||||
@@ -388,7 +400,7 @@ my %URIdef = (
|
||||
desc => "[URI:/nodes/{noderange}/inventory/{pci|model...}] - The specific inventory attributes for the node {noderange}",
|
||||
matcher => '^/nodes/[^/]*/inventory/\S+$',
|
||||
GET => {
|
||||
desc => "Get the specific inventory attibutes.",
|
||||
desc => "Get the specific inventory attributes.",
|
||||
usage => "||$usagemsg{objreturn}|",
|
||||
example => "|Get the \'model\' inventory attribute for node1.|GET|/nodes/node1/inventory/model|{\n \"node1\":{\n \"System Description\":\"System x3650 M4\",\n \"System Model/MTM\":\"7915C2A\"\n }\n}|",
|
||||
cmd => "rinv",
|
||||
@@ -632,15 +644,15 @@ my %URIdef = (
|
||||
desc => "[URI:/groups/{groupname}] - The group resource",
|
||||
matcher => '^/groups/[^/]*$',
|
||||
GET => {
|
||||
desc => "Get all the attibutes for the group {groupname}.",
|
||||
desc => "Get all the attributes for the group {groupname}.",
|
||||
usage => "||$usagemsg{objreturn}|",
|
||||
example => "|Get all the attibutes for group \'all\'.|GET|/groups/all|{\n \"all\":{\n \"members\":\"zxnode2,nodexxx,node1,node4\"\n }\n}|",
|
||||
example => "|Get all the attributes for group \'all\'.|GET|/groups/all|{\n \"all\":{\n \"members\":\"zxnode2,nodexxx,node1,node4\"\n }\n}|",
|
||||
cmd => "lsdef",
|
||||
fhandler => \&defhdl,
|
||||
outhdler => \&defout,
|
||||
},
|
||||
PUT => {
|
||||
desc => "Change the attibutes for the group {groupname}.",
|
||||
desc => "Change the attributes for the group {groupname}.",
|
||||
usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
|
||||
example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/groups/all {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||",
|
||||
cmd => "chdef",
|
||||
@@ -830,16 +842,16 @@ my %URIdef = (
|
||||
desc => "[URI:/networks/{netname}] - The network resource",
|
||||
matcher => '^\/networks\/[^\/]*$',
|
||||
GET => {
|
||||
desc => "Get all the attibutes for the network {netname}.",
|
||||
desc => "Get all the attributes for the network {netname}.",
|
||||
desc1 => "The keyword ALLRESOURCES can be used as {netname} which means to get network attributes for all the networks.",
|
||||
usage => "||$usagemsg{objreturn}|",
|
||||
example => "|Get all the attibutes for network \'network1\'.|GET|/networks/network1|{\n \"network1\":{\n \"gateway\":\"<xcatmaster>\",\n \"mask\":\"255.255.255.0\",\n \"mgtifname\":\"eth2\",\n \"net\":\"10.0.0.0\",\n \"tftpserver\":\"10.0.0.119\",\n ...\n }\n}|",
|
||||
example => "|Get all the attributes for network \'network1\'.|GET|/networks/network1|{\n \"network1\":{\n \"gateway\":\"<xcatmaster>\",\n \"mask\":\"255.255.255.0\",\n \"mgtifname\":\"eth2\",\n \"net\":\"10.0.0.0\",\n \"tftpserver\":\"10.0.0.119\",\n ...\n }\n}|",
|
||||
cmd => "lsdef",
|
||||
fhandler => \&defhdl,
|
||||
outhdler => \&defout,
|
||||
},
|
||||
PUT => {
|
||||
desc => "Change the attibutes for the network {netname}.",
|
||||
desc => "Change the attributes for the network {netname}.",
|
||||
usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
|
||||
example => "|Change the attributes mgtifname=eth0 and net=10.1.0.0.|PUT|/networks/network1 {\"mgtifname\":\"eth0\",\"net\":\"10.1.0.0\"}||",
|
||||
cmd => "chdef",
|
||||
@@ -919,7 +931,7 @@ my %URIdef = (
|
||||
desc => "[URI:/osimages/{imgname}] - The osimage resource",
|
||||
matcher => '^\/osimages\/[^\/]*$',
|
||||
GET => {
|
||||
desc => "Get all the attibutes for the osimage {imgname}.",
|
||||
desc => "Get all the attributes for the osimage {imgname}.",
|
||||
desc1 => "The keyword ALLRESOURCES can be used as {imgname} which means to get image attributes for all the osimages.",
|
||||
usage => "||$usagemsg{objreturn}|",
|
||||
example => "|Get the attributes for the specified osimage.|GET|/osimages/sles11.2-x86_64-install-compute|{\n \"sles11.2-x86_64-install-compute\":{\n \"provmethod\":\"install\",\n \"profile\":\"compute\",\n \"template\":\"/opt/xcat/share/xcat/install/sles/compute.sles11.tmpl\",\n \"pkglist\":\"/opt/xcat/share/xcat/install/sles/compute.sles11.pkglist\",\n \"osvers\":\"sles11.2\",\n \"osarch\":\"x86_64\",\n \"osname\":\"Linux\",\n \"imagetype\":\"linux\",\n \"otherpkgdir\":\"/install/post/otherpkgs/sles11.2/x86_64\",\n \"osdistroname\":\"sles11.2-x86_64\",\n \"pkgdir\":\"/install/sles11.2/x86_64\"\n }\n}|",
|
||||
@@ -937,7 +949,7 @@ my %URIdef = (
|
||||
outhdler => \&noout,
|
||||
},
|
||||
PUT => {
|
||||
desc => "Change the attibutes for the osimage {imgname}.",
|
||||
desc => "Change the attributes for the osimage {imgname}.",
|
||||
usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,attr2:v2...}|$usagemsg{non_getreturn}|",
|
||||
example => "|Change the 'osvers' and 'osarch' attributes for the osiamge.|PUT|/osimages/sles11.2-ppc64-install-compute/ {\"osvers\":\"sles11.3\",\"osarch\":\"x86_64\"}||",
|
||||
cmd => "chdef",
|
||||
@@ -968,7 +980,7 @@ my %URIdef = (
|
||||
|
||||
# TD, the implementation may need to be change.
|
||||
PUT_backup => {
|
||||
desc => "Change the attibutes for the osimage {imgname}.",
|
||||
desc => "Change the attributes for the osimage {imgname}.",
|
||||
usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,attr2:v2...}|$usagemsg{non_getreturn}|",
|
||||
example => "|Change the 'osvers' and 'osarch' attributes for the osiamge.|PUT|/osimages/sles11.2-ppc64-install-compute/attrs/osvers;osarch {\"osvers\":\"sles11.3\",\"osarch\":\"x86_64\"}||",
|
||||
cmd => "chdef",
|
||||
@@ -1020,7 +1032,7 @@ my %URIdef = (
|
||||
desc => "[URI:/policy/{policy_priority}] - The policy resource",
|
||||
matcher => '^\/policy\/[^\/]*$',
|
||||
GET => {
|
||||
desc => "Get all the attibutes for a policy {policy_priority}.",
|
||||
desc => "Get all the attributes for a policy {policy_priority}.",
|
||||
desc1 => "It will display all the policy attributes for one policy resource.",
|
||||
desc2 => "The keyword ALLRESOURCES can be used as {policy_priority} which means to get policy attributes for all the policies.",
|
||||
usage => "||$usagemsg{objreturn}|",
|
||||
@@ -1030,7 +1042,7 @@ my %URIdef = (
|
||||
outhdler => \&defout,
|
||||
},
|
||||
PUT => {
|
||||
desc => "Change the attibutes for the policy {policy_priority}.",
|
||||
desc => "Change the attributes for the policy {policy_priority}.",
|
||||
desc1 => "It will change one or more attributes for a policy.",
|
||||
usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
|
||||
example => "|Set the name attribute for policy 3.|PUT|/policy/3 {\"name\":\"root\"}||",
|
||||
@@ -1144,7 +1156,7 @@ my %URIdef = (
|
||||
desc1 => "For a large number of nodes, this API call can be faster than using the corresponding nodes resource. The disadvantage is that you need to know the table names the attributes are stored in.",
|
||||
matcher => '^/tables/[^/]+/nodes/[^/]+$',
|
||||
GET => {
|
||||
desc => "Get attibutes of tables for a noderange.",
|
||||
desc => "Get attributes of tables for a noderange.",
|
||||
usage => "||An object containing each table. Within each table object is an array of node objects containing the attributes.|",
|
||||
example1 => qq(|Get all the columns from table nodetype for node1 and node2.|GET|/tables/nodetype/nodes/node1,node2|{\n \"nodetype\":[\n {\n \"provmethod\":\"rhels6.4-x86_64-install-compute\",\n \"profile\":\"compute\",\n \"arch\":\"x86_64\",\n \"name\":\"node1\",\n \"os\":\"rhels6.4\"\n },\n {\n \"provmethod\":\"rhels6.3-x86_64-install-compute\",\n \"profile\":\"compute\",\n \"arch\":\"x86_64\",\n \"name\":\"node2\",\n \"os\":\"rhels6.3\"\n }\n ]\n}|),
|
||||
example2 => qq(|Get all the columns from tables nodetype and noderes for node1 and node2.|GET|/tables/nodetype,noderes/nodes/node1,node2|{\n \"noderes\":[\n {\n \"installnic\":\"mac\",\n \"netboot\":\"xnba\",\n \"name\":\"node1\",\n \"nfsserver\":\"192.168.1.15\"\n },\n {\n \"installnic\":\"mac\",\n \"netboot\":\"pxe\",\n \"name\":\"node2\",\n \"proxydhcp\":\"no\"\n }\n ],\n \"nodetype\":[\n {\n \"provmethod\":\"rhels6.4-x86_64-install-compute\",\n \"profile\":\"compute\",\n \"arch\":\"x86_64\",\n \"name\":\"node1\",\n \"os\":\"rhels6.4\"\n },\n {\n \"provmethod\":\"rhels6.3-x86_64-install-compute\",\n \"profile\":\"compute\",\n \"arch\":\"x86_64\",\n \"name\":\"node2\",\n \"os\":\"rhels6.3\"\n }\n ]\n}|),
|
||||
@@ -1152,7 +1164,7 @@ my %URIdef = (
|
||||
outhdler => \&tableout,
|
||||
},
|
||||
PUT => {
|
||||
desc => "Change the node table attibutes for {noderange}.",
|
||||
desc => "Change the node table attributes for {noderange}.",
|
||||
usage => "|A hash of table names and attribute objects. DataBody: {table1:{attr1:v1,att2:v2,...}}.|$usagemsg{non_getreturn}|",
|
||||
example => '|Change the nodetype.arch and noderes.netboot attributes for nodes node1,node2.|PUT|/tables/nodetype,noderes/nodes/node1,node2 {"nodetype":{"arch":"x86_64"},"noderes":{"netboot":"xnba"}}||',
|
||||
fhandler => \&tablenodeputhdl,
|
||||
@@ -1164,14 +1176,14 @@ my %URIdef = (
|
||||
desc1 => "For a large number of nodes, this API call can be faster than using the corresponding nodes resource. The disadvantage is that you need to know the table names the attributes are stored in.",
|
||||
matcher => '^/tables/[^/]+/nodes/[^/]+/[^/]+$',
|
||||
GET => {
|
||||
desc => "Get table attibutes for a noderange.",
|
||||
desc => "Get table attributes for a noderange.",
|
||||
usage => "||An object containing each table. Within each table object is an array of node objects containing the attributes.|",
|
||||
example => qq(|Get OS and ARCH attributes from nodetype table for node1 and node2.|GET|/tables/nodetype/nodes/node1,node2/os,arch|{\n \"nodetype\":[\n {\n \"arch\":\"x86_64\",\n \"name\":\"node1\",\n \"os\":\"rhels6.4\"\n },\n {\n \"arch\":\"x86_64\",\n \"name\":\"node2\",\n \"os\":\"rhels6.3\"\n }\n ]\n}|),
|
||||
fhandler => \&tablenodehdl,
|
||||
outhdler => \&tableout,
|
||||
},
|
||||
PUT_backup => {
|
||||
desc => "[URI:/tables/nodes/{noderange}] - Change the node table attibutes for the {noderange}.",
|
||||
desc => "[URI:/tables/nodes/{noderange}] - Change the node table attributes for the {noderange}.",
|
||||
usage => "|A hash of table names and attribute objects. DataBody: {table1:{attr1:v1,att2:v2,...}}.|$usagemsg{non_getreturn}|",
|
||||
example => '|Change the nodehm.mgmt and noderes.netboot attributes for nodes node1-node5.|PUT|/tables/nodes/node1-node5 {"nodehm":{"mgmt":"ipmi"},"noderes":{"netboot":"xnba"}}||',
|
||||
fhandler => \&tablenodeputhdl,
|
||||
@@ -1196,14 +1208,14 @@ my %URIdef = (
|
||||
desc2 => "{keys} should be the name=value pairs which are used to search table. e.g. {keys} should be [net=192.168.1.0,mask=255.255.255.0] for networks table query since the net and mask are the keys of networks table.",
|
||||
matcher => '^/tables/[^/]+/rows/[^/]+$',
|
||||
GET => {
|
||||
desc => "Get attibutes for rows from non-node tables.",
|
||||
desc => "Get attributes for rows from non-node tables.",
|
||||
usage => "||An object containing each table. Within each table object is an array of row objects containing the attributes.|",
|
||||
example => qq(|Get row which net=192.168.1.0,mask=255.255.255.0 from networks table.|GET|/tables/networks/rows/net=192.168.1.0,mask=255.255.255.0|{\n \"networks\":[\n {\n \"mgtifname\":\"eth0\",\n \"netname\":\"192_168_1_0-255_255_255_0\",\n \"tftpserver\":\"192.168.1.15\",\n \"gateway\":\"192.168.1.100\",\n \"staticrangeincrement\":\"1\",\n \"net\":\"192.168.1.0\",\n \"mask\":\"255.255.255.0\"\n }\n ]\n}|),
|
||||
fhandler => \&tablerowhdl,
|
||||
outhdler => \&tableout,
|
||||
},
|
||||
PUT => {
|
||||
desc => "Change the non-node table attibutes for the row that matches the {keys}.",
|
||||
desc => "Change the non-node table attributes for the row that matches the {keys}.",
|
||||
usage => "|A hash of attribute names and values. DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
|
||||
example => '|Create a route row in the routes table.|PUT|/tables/routes/rows/routename=privnet {"net":"10.0.1.0","mask":"255.255.255.0","gateway":"10.0.1.254","ifname":"eth1"}||',
|
||||
fhandler => \&tablerowputhdl,
|
||||
@@ -1222,7 +1234,7 @@ my %URIdef = (
|
||||
desc1 => "Use this for tables that don't have node name as the key of the table, for example: passwd, site, networks, polciy, etc.",
|
||||
matcher => '^/tables/[^/]+/rows/[^/]+/[^/]+$',
|
||||
GET => {
|
||||
desc => "Get specific attibutes for rows from non-node tables.",
|
||||
desc => "Get specific attributes for rows from non-node tables.",
|
||||
usage => "||An object containing each table. Within each table object is an array of row objects containing the attributes.|",
|
||||
example => qq(|Get attributes mgtifname and tftpserver which net=192.168.1.0,mask=255.255.255.0 from networks table.|GET|/tables/networks/rows/net=192.168.1.0,mask=255.255.255.0/mgtifname,tftpserver|{\n \"networks\":[\n {\n \"mgtifname\":\"eth0\",\n \"tftpserver\":\"192.168.1.15\"\n }\n ]\n}|),
|
||||
fhandler => \&tablerowhdl,
|
||||
@@ -1279,7 +1291,7 @@ my %URIdef = (
|
||||
GET => {
|
||||
desc => "Show attributes of a node template.",
|
||||
usage => "||$usagemsg{objreturn}|",
|
||||
example => "|GET all the attibutes of node template \'x86_64kvmguest-template\'.|GET|/templates/node {\"options\":{\"--template\":\"x86_64kvmguest-template\"}} |{\n \"arch\":{\n \"x86_64\":\"compute\",\n \"bmc\":\"MANDATORY:The hostname or ip address of the BMC adapater\",\n \bmcpassword\":\"MANDATORY:the password of the BMC\",\n \"mgt\":\"ipmi\",\n \"groups\":\"all\",\n ...\n }\n}",
|
||||
example => "|GET all the attributes of node template \'x86_64kvmguest-template\'.|GET|/templates/node {\"options\":{\"--template\":\"x86_64kvmguest-template\"}} |{\n \"arch\":{\n \"x86_64\":\"compute\",\n \"bmc\":\"MANDATORY:The hostname or ip address of the BMC adapater\",\n \bmcpassword\":\"MANDATORY:the password of the BMC\",\n \"mgt\":\"ipmi\",\n \"groups\":\"all\",\n ...\n }\n}",
|
||||
cmd => "lsdef",
|
||||
fhandler => \&defhdl,
|
||||
outhdler => \&defout,
|
||||
@@ -1755,6 +1767,56 @@ sub defout_remove_appended_info {
|
||||
}
|
||||
}
|
||||
|
||||
#handle output of nodels command
|
||||
#input data like:
|
||||
#$VAR1 = [
|
||||
# {
|
||||
# 'xcatdsource' => [
|
||||
# 'bybc0602'
|
||||
# ],
|
||||
# 'node' => [
|
||||
# {
|
||||
# 'name' => [
|
||||
# 'node1'
|
||||
# ]
|
||||
# },
|
||||
# {
|
||||
# 'name' => [
|
||||
# 'node2'
|
||||
# ]
|
||||
# },
|
||||
# {
|
||||
# 'name' => [
|
||||
# 'node3'
|
||||
# ]
|
||||
# }
|
||||
# ]
|
||||
# }
|
||||
# ];
|
||||
|
||||
#TO:
|
||||
#------------
|
||||
# [
|
||||
# 'node1',
|
||||
# 'node2',
|
||||
# 'node3'
|
||||
# ];
|
||||
sub nodelsout {
|
||||
my $data = shift;
|
||||
my $json;
|
||||
foreach my $d (@$data) {
|
||||
my $jsonnode;
|
||||
my $lines = $d->{node};
|
||||
foreach my $l (@$lines) {
|
||||
|
||||
push(@{$json}, $l->{name}[0]);
|
||||
|
||||
}
|
||||
}
|
||||
if ($json) {
|
||||
addPageContent($JSON->encode($json), 1);
|
||||
}
|
||||
}
|
||||
|
||||
sub localresout {
|
||||
my $data = shift;
|
||||
@@ -2060,6 +2122,10 @@ sub actionhdl {
|
||||
} else {
|
||||
error("Missed Action.", $STATUS_NOT_FOUND);
|
||||
}
|
||||
} elsif ($params->{'resourcename'} eq "nodels") {
|
||||
if (isGET()) {
|
||||
|
||||
}
|
||||
} elsif ($params->{'resourcename'} =~ /(energy|energyattr)/) {
|
||||
if (isGET()) {
|
||||
if ($params->{'resourcename'} eq "energy") {
|
||||
@@ -2828,7 +2894,7 @@ sub tablenodeputhdl {
|
||||
my $params = shift;
|
||||
|
||||
# from the %URIdef:
|
||||
# desc => "[URI:/tables/nodes/{noderange}] - Change the table attibutes for the {noderange}.",
|
||||
# desc => "[URI:/tables/nodes/{noderange}] - Change the table attributes for the {noderange}.",
|
||||
# usage => "|An array of table objects. Each table object contains the table name and an object of attribute values. DataBody: {table1:{attr1:v1,att2:v2,...}}.|$usagemsg{non_getreturn}|",
|
||||
# example => '|Change the nodehm.mgmt and noderes.netboot attributes for nodes node1-node5.|PUT|/tables/nodes/node1-node5 {"nodehm":{"mgmt":"ipmi"},"noderes":{"netboot":"xnba"}}||',
|
||||
|
||||
@@ -2895,7 +2961,7 @@ sub tablerowputhdl {
|
||||
my $params = shift;
|
||||
|
||||
# from %URIdef:
|
||||
# desc => "[URI:/tables/{table}/rows/{keys}] - Change the non-node table attibutes for the row that matches the {keys}.",
|
||||
# desc => "[URI:/tables/{table}/rows/{keys}] - Change the non-node table attributes for the row that matches the {keys}.",
|
||||
# usage => "|A hash of attribute names and values. DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|",
|
||||
# example => '|Creat a route row in the routes table.|PUT|/tables/routes/rows/routename=privnet {"net":"10.0.1.0","mask":"255.255.255.0","gateway":"10.0.1.254","ifname":"eth1"}||',
|
||||
|
||||
|
Reference in New Issue
Block a user