The URI list which can be used to create tokens for account .
Returns:
Example:
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"}' { "token":{ "id":"a6e89b59-2b23-429a-b3fe-d16807dd19eb", "expire":"2014-3-8 14:55:0" } }
The URI list which can be used to create, query, change and manage node objects.
This resource can be used to display all the nodes which have been defined in the xCAT database.
The attributes details for the node will not be displayed.
Refer to the man page:lsdef.
Returns:
Example:
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' [ "node1", "node2", "node3", ]
The keyword ALLRESOURCES can be used as {noderange} which means to get node attributes for all the nodes.
Refer to the man page:lsdef.
Returns:
Example:
Get all the attibutes for node 'node1'.
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1?userName=root&userPW=cluster&pretty=1' { "node1":{ "profile":"compute", "netboot":"xnba", "arch":"x86_64", "mgt":"ipmi", "groups":"all", ... } }
Refer to the man page:chdef.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:mkdef.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:rmdef.
Returns:
Example:
Delete the node node1
#curl -X DELETE -k 'https://127.0.0.1/xcatws/nodes/node1?userName=root&userPW=cluster&pretty=1'
The keyword ALLRESOURCES can be used as {noderange} which means to get node attributes for all the nodes.
Refer to the man page:lsdef.
Returns:
Example:
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' { "node1":{ "netboot":"xnba", "mgt":"ipmi", "groups":"all" } }
Refer to the man page:makehosts.
Returns:
Example:
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'
The prerequisite of the POST operation is the mapping of ip and noderange for the node has been added in the /etc/hosts.
Refer to the man page:makedns.
Returns:
Example:
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'
Refer to the man page:makedns.
Returns:
Example:
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'
Refer to the man page:makedhcp.
Returns:
Example:
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'
Refer to the man page:makedhcp.
Returns:
Example:
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'
Refer to the man page:nodestat.
Returns:
Example:
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' { "node1":{ "nodestat":"noping" } }
Refer to the man page:rscan.
Returns:
Example:
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' { "cmm01node09":{ "mpa":"ngpcmm01", "parent":"ngpcmm01", "serial":"1035CDB", "mtm":"789523X", "cons":"fsp", "hwtype":"blade", "objtype":"node", "groups":"blade,all,p260", "mgt":"fsp", "nodetype":"ppc,osi", "slotid":"9", "hcp":"10.1.9.9", "id":"1" }, ... }
Refer to the man page:rpower.
Returns:
Example:
Get the power status.
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/power?userName=root&userPW=cluster&pretty=1' { "node1":{ "power":"on" } }
Refer to the man page:rpower.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:renergy.
Returns:
Example:
Get all the energy attributes.
#curl -X GET -k 'https://127.0.0.1/xcatws/nodes/node1/energy?userName=root&userPW=cluster&pretty=1' { "node1":{ "cappingmin":"272.3 W", "cappingmax":"354.0 W" ... } }
Refer to the man page:renergy.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:renergy.
Returns:
Example:
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' { "node1":{ "cappingmin":"272.3 W", "cappingmax":"354.0 W" } }
Refer to the man page:rspconfig.
Returns:
Example:
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' { "node1":{ "SP SNMP Community":"public" } }
Refer to the man page:rspconfig.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:rsetboot.
Returns:
Example:
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' { "node1":{ "nextboot":"Network" } }
Refer to the man page:rsetboot.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:nodeset.
Returns:
Example:
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' { "node1":{ "bootstat":"boot" } }
Refer to the man page:nodeset.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:rvitals.
Returns:
Example:
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' { "node1":{ "SysBrd Fault":"0", "CPUs":"0", "Fan 4A Tach":"3330 RPM", "Drive 15":"0", "SysBrd Vol Fault":"0", "nvDIMM Flash":"0", "Progress":"0" ... } }
Refer to the man page:rvitals.
Returns:
Example:
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' { "node1":{ "Fan 1A Tach":"3219 RPM", "Fan 4B Tach":"2688 RPM", "Fan 3B Tach":"2560 RPM", "Fan 4A Tach":"3330 RPM", "Fan 2A Tach":"3293 RPM", "Fan 1B Tach":"2592 RPM", "Fan 3A Tach":"3182 RPM", "Fan 2B Tach":"2592 RPM" } }
Refer to the man page:rinv.
Returns:
Example:
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' { "node1":{ "DIMM 21 ":"8GB PC3-12800 (1600 MT/s) ECC RDIMM", "DIMM 1 Manufacturer":"Hyundai Electronics", "Power Supply 2 Board FRU Number":"94Y8105", "DIMM 9 Model":"HMT31GR7EFR4C-PB", "DIMM 8 Manufacture Location":"01", "DIMM 13 Manufacturer":"Hyundai Electronics", "DASD Backplane 4":"Not Present", ... } }
Refer to the man page:rinv.
Returns:
Example:
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' { "node1":{ "System Description":"System x3650 M4", "System Model/MTM":"7915C2A" } }
Refer to the man page:reventlog.
Returns:
Example:
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' { "node1":{ "eventlog":[ "03/19/2014 15:17:58 Event Logging Disabled, Log Area Reset/Cleared (SEL Fullness)" ] } }
Refer to the man page:reventlog.
Returns:
Example:
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' [ { "eventlog":[ "SEL cleared" ], "name":"node1" } ]
Refer to the man page:rbeacon.
Parameters:
Returns:
Example:
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"}' [ { "name":"node1", "beacon":"on" } ]
Refer to the man page:updatenode.
Returns:
Example:
Initiate an updatenode process.
#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. ", "node2: Wed Mar 20 15:01:43 CST 2013 Running postscript: ospkgs", "node2: Running of postscripts has completed." ]
Refer to the man page:updatenode.
Returns:
Example:
Initiate an file syncing process.
#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." ]
Refer to the man page:updatenode.
Returns:
Example:
Initiate an software maintenance process.
#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", " Unable to read consumer identity", " Postscript: ospkgs exited with code 0", " Wed Apr 3 09:05:44 CST 2013 Running postscript: otherpkgs", " ./otherpkgs: no extra rpms to install", " Postscript: otherpkgs exited with code 0", " Running of Software Maintenance has completed." ] }
Refer to the man page:updatenode.
Parameters:
Returns:
Example:
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"]}' { "node2":[ " Wed Apr 3 09:01:33 CST 2013 Running postscript: syslog", " Shutting down system logger: [ OK ]", " Starting system logger: [ OK ]", " Postscript: syslog exited with code 0", " Wed Apr 3 09:01:33 CST 2013 Running postscript: remoteshell", " Stopping sshd: [ OK ]", " Starting sshd: [ OK ]", " Postscript: remoteshell exited with code 0", " Running of postscripts has completed." ] }
Refer to the man page:xdsh.
Parameters:
Returns:
Example:
Run the 'data' 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"]}' { "node2":[ " Wed Apr 3 08:30:26 CST 2013", " testline1", " testline2" ] }
Refer to the man page:xdcp.
Parameters:
Returns:
Example:
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"}' no output for succeeded copy.
The node should be a virtual machine of type kvm, esxi ...
Refer to the man page:chvm.
Parameters:
Returns:
Example1:
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"}'
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"}'
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"}'
Refer to the man page:mkvm.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:rmvm.
Parameters:
Returns:
Example:
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"}'
The node should be a virtual machine of kvm, esxi ...
Refer to the man page:clonevm.
Parameters:
Returns:
Example1:
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"}' { "node1":{ "vmclone":"Cloning of node1.hda.qcow2 complete (clone uses 9633.19921875 for a disk size of 30720MB)" } }
Example2:
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"}'
The node should be a virtual machine of kvm, esxi ...
Refer to the man page:rmigrate.
Parameters:
Example:
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"}'
URI list which can be used to query, create osimage resources.
Refer to the man page:lsdef.
Returns:
Example:
Get all the osimage names.
#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", "sles11.2-x86_64-install-iscsiibft", "sles11.2-x86_64-install-service" ]
Refer to the man page:copycds.
Parameters:
Returns:
Example1:
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"}'
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"}'
The keyword ALLRESOURCES can be used as {imgname} which means to get image attributes for all the osimages.
Refer to the man page:lsdef.
Returns:
Example:
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' { "sles11.2-x86_64-install-compute":{ "provmethod":"install", "profile":"compute", "template":"/opt/xcat/share/xcat/install/sles/compute.sles11.tmpl", "pkglist":"/opt/xcat/share/xcat/install/sles/compute.sles11.pkglist", "osvers":"sles11.2", "osarch":"x86_64", "osname":"Linux", "imagetype":"linux", "otherpkgdir":"/install/post/otherpkgs/sles11.2/x86_64", "osdistroname":"sles11.2-x86_64", "pkgdir":"/install/sles11.2/x86_64" } }
Refer to the man page:chdef.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:mkdef.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:rmdef.
Returns:
Example:
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'
The keyword ALLRESOURCES can be used as {imgname} which means to get image attributes for all the osimages.
Refer to the man page:lsdef.
Returns:
Example:
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' { "sles11.2-ppc64-install-compute":{ "provmethod":"install", "osname":"Linux", "osarch":"ppc64", "imagetype":"linux" } }
Refer to the man page of command.
Parameters:
Returns:
Example1:
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"}'
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"}'
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"}'
Refer to the man page:rmimage.
Returns:
Example:
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'
The URI list which can be used to create, query, change and manage network objects.
This resource can be used to display all the networks which have been defined in the xCAT database.
The attributes details for the networks will not be displayed.
Refer to the man page:lsdef.
Returns:
Example:
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' [ "network1", "network2", "network3", ]
Refer to the man page:makenetworks.
Parameters:
Returns:
Example:
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'
The keyword ALLRESOURCES can be used as {netname} which means to get network attributes for all the networks.
Refer to the man page:lsdef.
Returns:
Example:
Get all the attibutes for network 'network1'.
#curl -X GET -k 'https://127.0.0.1/xcatws/networks/network1?userName=root&userPW=cluster&pretty=1' { "network1":{ "gateway":"<xcatmaster>", "mask":"255.255.255.0", "mgtifname":"eth2", "net":"10.0.0.0", "tftpserver":"10.0.0.119", ... } }
Refer to the man page:chdef.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:mkdef.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:rmdef.
Returns:
Example:
Delete the network network1
#curl -X DELETE -k 'https://127.0.0.1/xcatws/networks/network1?userName=root&userPW=cluster&pretty=1'
The keyword ALLRESOURCES can be used as {netname} which means to get network attributes for all the networks.
Refer to the man page:lsdef.
Returns:
Example:
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' { "network1":{ "gateway":"9.114.34.254", "mask":"255.255.255.0", } }
The URI list which can be used to create, query, change and manage policy entries.
It will dislplay all the policy resource.
Refer to the man page:lsdef.
Returns:
Example:
Get all the policy objects.
#curl -X GET -k 'https://127.0.0.1/xcatws/policy?userName=root&userPW=cluster&pretty=1' [ "1", "1.2", "2", "4.8" ]
It will display all the policy attributes for one policy resource.
The keyword ALLRESOURCES can be used as {policy_priority} which means to get policy attributes for all the policies.
Refer to the man page:lsdef.
Returns:
Example:
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' { "1":{ "name":"root", "rule":"allow" } }
It will change one or more attributes for a policy.
Refer to the man page:chdef.
Parameters:
Returns:
Example:
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"}'
It will creat a new policy resource.
Refer to the man page:chdef.
Parameters:
Returns:
Example:
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"}'
Remove one or more policy resource.
Refer to the man page:rmdef.
Returns:
Example:
Delete the policy 10.
#curl -X DELETE -k 'https://127.0.0.1/xcatws/policy/10?userName=root&userPW=cluster&pretty=1'
It will get one or more attributes of a policy.
The keyword ALLRESOURCES can be used as {policy_priority} which means to get policy attributes for all the policies.
Refer to the man page:lsdef.
Returns:
Example:
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' { "1":{ "name":"root", "rule":"allow" } }
The URI list which can be used to create, query, change and manage group objects.
This resource can be used to display all the groups which have been defined in the xCAT database.
The attributes details for the group will not be displayed.
Refer to the man page:lsdef.
Returns:
Example:
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' [ "__mgmtnode", "all", "compute", "ipmi", "kvm", ]
Refer to the man page:lsdef.
Returns:
Example:
Get all the attibutes for group 'all'.
#curl -X GET -k 'https://127.0.0.1/xcatws/groups/all?userName=root&userPW=cluster&pretty=1' { "all":{ "members":"zxnode2,nodexxx,node1,node4" } }
Refer to the man page:chdef.
Parameters:
Returns:
Example:
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"}'
Refer to the man page:lsdef.
Returns:
Example:
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' { "all":{ "netboot":"yaboot", "mgt":"dfm" } }
The URI list which can be used to create, query, change global configuration.
This resource can be used to display all the global configuration which have been defined in the xCAT database.
It will display all the global attributes.
Refer to the man page:lsdef.
Returns:
Example:
Get all the global configuration
#curl -X GET -k 'https://127.0.0.1/xcatws/globalconf?userName=root&userPW=cluster&pretty=1' { "clustersite":{ "xcatconfdir":"/etc/xcat", "tftpdir":"/tftpboot", ... } }
It will display one or more global attributes.
Refer to the man page:lsdef.
Returns:
Example:
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' { "clustersite":{ "domain":"cluster.com", "master":"192.168.1.15" } }
It can be used for changing/adding global attributes.
Refer to the man page:chdef.
Parameters:
Returns:
Example:
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"}'
Used for femove one or more global attributes.
Refer to the man page:chdef.
Returns:
Example:
Remove the domain configure.
#curl -X DELETE -k 'https://127.0.0.1/xcatws/globalconf/attrs/domain?userName=root&userPW=cluster&pretty=1'
The URI list which can be used to manage the host, dns and dhcp services on xCAT MN.
Refer to the man page:makedns.
Returns:
Example:
Initialize the dns service.
#curl -X POST -k 'https://127.0.0.1/xcatws/services/dns?userName=root&userPW=cluster&pretty=1'
Refer to the man page:makedhcp.
Returns:
Example:
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'
Refer to the man page:makehosts.
Returns:
Example:
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'
Refer to the man page:lsslp.
Returns:
Example:
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' { "ngpcmm01":{ "mpa":"ngpcmm01", "otherinterfaces":"10.1.9.101", "serial":"100037A", "mtm":"789392X", "hwtype":"cmm", "side":"2", "objtype":"node", "nodetype":"mp", "groups":"cmm,all,cmm-zet", "mgt":"blade", "hidden":"0", "mac":"5c:f3:fc:25:da:99" }, ... }
Refer to the man page:lsslp.
Returns:
Example:
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' { "ngpcmm01":{ "mpa":"ngpcmm01", "otherinterfaces":"10.1.9.101", "serial":"100037A", "mtm":"789392X", "hwtype":"cmm", "side":"2", "objtype":"node", "nodetype":"mp", "groups":"cmm,all,cmm-zet", "mgt":"blade", "hidden":"0", "mac":"5c:f3:fc:25:da:99" }, "Server--SNY014BG27A01K":{ "mpa":"Server--SNY014BG27A01K", "otherinterfaces":"10.1.9.106", "serial":"100CF0A", "mtm":"789392X", "hwtype":"cmm", "side":"1", "objtype":"node", "nodetype":"mp", "groups":"cmm,all,cmm-zet", "mgt":"blade", "hidden":"0", "mac":"34:40:b5:df:0a:be" } }
URI list which can be used to create, query, change table entries.
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.
Returns:
Example1:
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' { "nodetype":[ { "provmethod":"rhels6.4-x86_64-install-compute", "profile":"compute", "arch":"x86_64", "name":"node1", "os":"rhels6.4" }, { "provmethod":"rhels6.3-x86_64-install-compute", "profile":"compute", "arch":"x86_64", "name":"node2", "os":"rhels6.3" } ] }
Example2:
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' { "noderes":[ { "installnic":"mac", "netboot":"xnba", "name":"node1", "nfsserver":"192.168.1.15" }, { "installnic":"mac", "netboot":"pxe", "name":"node2", "proxydhcp":"no" } ], "nodetype":[ { "provmethod":"rhels6.4-x86_64-install-compute", "profile":"compute", "arch":"x86_64", "name":"node1", "os":"rhels6.4" }, { "provmethod":"rhels6.3-x86_64-install-compute", "profile":"compute", "arch":"x86_64", "name":"node2", "os":"rhels6.3" } ] }
Parameters:
Returns:
Example:
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"}}'
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.
Returns:
Example:
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' { "nodetype":[ { "arch":"x86_64", "name":"node1", "os":"rhels6.4" }, { "arch":"x86_64", "name":"node2", "os":"rhels6.3" } ] }
Use this for tables that don't have node name as the key of the table, for example: passwd, site, networks, polciy, etc.
Returns:
Example:
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' { "networks":[ { "netname":"192_168_13_0-255_255_255_0", "gateway":"192.168.13.254", "staticrangeincrement":"1", "net":"192.168.13.0", "mask":"255.255.255.0" }, { "netname":"192_168_12_0-255_255_255_0", "gateway":"192.168.12.254", "staticrangeincrement":"1", "net":"192.168.12.0", "mask":"255.255.255.0" }, ] }
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.
Returns:
Example:
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' { "networks":[ { "mgtifname":"eth0", "netname":"192_168_1_0-255_255_255_0", "tftpserver":"192.168.1.15", "gateway":"192.168.1.100", "staticrangeincrement":"1", "net":"192.168.1.0", "mask":"255.255.255.0" } ] }
Parameters:
Returns:
Example:
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"}'
Returns:
Example:
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'
Use this for tables that don't have node name as the key of the table, for example: passwd, site, networks, polciy, etc.
Returns:
Example:
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' { "networks":[ { "mgtifname":"eth0", "tftpserver":"192.168.1.15" } ] }
Wiki: Editing_and_Downloading_xCAT_Documentation
Wiki: WS_API
Wiki: XCAT_Documentation