From ef3f29352fe91fda5738119058b79a59c0cc7d3a Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 4 Jun 2014 06:18:07 -0400 Subject: [PATCH] update the doc part in xcatws.cgi for GET action against nodes/networks/osimages/policy to use keyword ALLRESOURCES --- xCAT-server/xCAT-wsapi/xcatws.cgi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index 17cd8faa2..1ef36af5d 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -67,6 +67,7 @@ my %URIdef = ( matcher => '^/nodes/[^/]*$', GET => { desc => "Get all the attibutes 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}|", cmd => "lsdef", @@ -103,6 +104,7 @@ my %URIdef = ( matcher => '^/nodes/[^/]*/attrs/\S+$', GET => { desc => "Get the specific 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 the attributes {groups,mgt,netboot} for node node1|GET|/nodes/node1/attrs/groups,mgt,netboot|{\n \"node1\":{\n \"netboot\":\"xnba\",\n \"mgt\":\"ipmi\",\n \"groups\":\"all\"\n }\n}|", cmd => "lsdef", @@ -123,7 +125,7 @@ my %URIdef = ( matcher => '^/nodes/[^/]*/nodestat$', GET => { desc => "Get the running status for the node {noderange}.", - usage => "||$usagemsg{objreturn}|", + usage => "||An object which includes multiple entries like: : { nodestat : }|", example => "|Get the running status for node node1|GET|/nodes/node1/nodestat|{\n \"node1\":{\n \"nodestat\":\"noping\"\n }\n}|", cmd => "nodestat", fhandler => \&actionhdl, @@ -188,7 +190,7 @@ my %URIdef = ( matcher => '^/nodes/[^/]*/power$', GET => { desc => "Get the power status for the node {noderange}.", - usage => "||$usagemsg{objreturn}|", + usage => "||An object which includes multiple entries like: : { power : }|", example => "|Get the power status.|GET|/nodes/node1/power|{\n \"node1\":{\n \"power\":\"on\"\n }\n}|", cmd => "rpower", fhandler => \&actionhdl, @@ -688,6 +690,7 @@ my %URIdef = ( matcher => '^\/networks\/[^\/]*$', GET => { desc => "Get all the attibutes 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\":\"\",\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", @@ -724,6 +727,7 @@ my %URIdef = ( matcher => '^\/networks\/[^\/]*/attrs/\S+$', GET => { desc => "Get the specific 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 the attributes {groups,mgt,netboot} for network network1|GET|/networks/network1/attrs/gateway,mask,mgtifname,net,tftpserver|{\n \"network1\":{\n \"gateway\":\"9.114.34.254\",\n \"mask\":\"255.255.255.0\",\n }\n}|", cmd => "lsdef", @@ -773,6 +777,7 @@ my %URIdef = ( matcher => '^\/osimages\/[^\/]*$', GET => { desc => "Get all the attibutes 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}|", cmd => "lsdef", @@ -810,6 +815,7 @@ my %URIdef = ( matcher => '^\/osimages\/[^\/]*/attrs/\S+$', GET => { desc => "Get the specific 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 => "||Json format: An array of attr:value pairs for the specified osimage.|", example => "|Get the specified attributes.|GET|/osimages/sles11.2-ppc64-install-compute/attrs/imagetype,osarch,osname,provmethod|{\n \"sles11.2-ppc64-install-compute\":{\n \"provmethod\":\"install\",\n \"osname\":\"Linux\",\n \"osarch\":\"ppc64\",\n \"imagetype\":\"linux\"\n }\n}|", cmd => "lsdef", @@ -872,6 +878,7 @@ my %URIdef = ( GET => { desc => "Get all the attibutes 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}|", example => "|Get all the attribute for policy 1.|GET|/policy/1|{\n \"1\":{\n \"name\":\"root\",\n \"rule\":\"allow\"\n }\n}|", cmd => "lsdef", @@ -912,6 +919,7 @@ my %URIdef = ( GET => { desc => "Get the specific attributes for the policy {policy_priority}.", desc1 => "It will get one or more attributes of a policy.", + desc2 => "The keyword ALLRESOURCES can be used as {policy_priority} which means to get policy attributes for all the policies.", usage => "||$usagemsg{objreturn}|", example => "|Get the name and rule attributes for policy 1.|GET|/policy/1/attrs/name,rule|{\n \"1\":{\n \"name\":\"root\",\n \"rule\":\"allow\"\n }\n}|", cmd => "lsdef",