diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index d0fa35d62..54e3ca8a9 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -217,6 +217,18 @@ my %URIdef = ( outhdler => \&noout, } }, + console => { + desc => "[URI:/nodes/{noderange}/console] - The console configuration for the node {noderange}", + matcher => '^/nodes/[^/]*/console$', + PUT => { + desc => "Update conserver configuration for the node {noderange}.", + usage => "|Json Formatted DataBody: {action:on/off}.|$usagemsg{non_getreturn}|", + example => "|Enable the console capability for node1|PUT|/nodes/node1/console {\"action\":\"on\"}||", + cmd => "makeconservercf", + fhandler => \&actionhdl, + outhdler => \&noout, + } + }, energy => { desc => "[URI:/nodes/{noderange}/energy] - The energy resource for the node {noderange}", matcher => '^/nodes/[^/]*/energy$', @@ -2119,6 +2131,14 @@ sub actionhdl { } } + } elsif ($params->{'resourcename'} eq "console") { + if ($paramhash->{'action'}) { + my $option = $paramhash->{'action'}; + my %op_hash = ('on' => '', 'off' => '-d'); + push @args, $op_hash{$paramhash->{'action'}}; + } else { + error("Missed Action.",$STATUS_NOT_FOUND); + } } push @{$request->{arg}}, @args;