From f3ba9ab3eb5bc578e6d5e736c84e4c3054eb3fcc Mon Sep 17 00:00:00 2001 From: daniceexi Date: Sun, 14 Dec 2014 08:40:21 -0500 Subject: [PATCH] fix the specific format in the doc of restapi which causes the getxcatdocs (pandoc) cannot generate doc for REST_API_Reference --- xCAT-server/xCAT-wsapi/genrestapidoc.pm | 10 ++++++++-- xCAT-server/xCAT-wsapi/xcatws.cgi | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/xCAT-server/xCAT-wsapi/genrestapidoc.pm b/xCAT-server/xCAT-wsapi/genrestapidoc.pm index 9dec9ba81..f0344818c 100755 --- a/xCAT-server/xCAT-wsapi/genrestapidoc.pm +++ b/xCAT-server/xCAT-wsapi/genrestapidoc.pm @@ -243,8 +243,13 @@ sub outwiki { } else { print "\n #curl -X $parts[2] -k \'https://127.0.0.1/xcatws$parts[3]$postfix\'\n"; } - $parts[4] =~ s/\n/\n /g; - print " $parts[4]\n\n---\n"; + + if ($parts[4]) { + $parts[4] =~ s/\n/\n /g; + print " $parts[4]\n\n---\n"; + } else { + print "\n---\n"; + } } else { push @errmsg, "Error format for:[".$def->{desc}."]\n"; } @@ -371,6 +376,7 @@ sub gendoc { } if ($format eq "wiki") { + print "![](http://sourceforge.net/p/xcat/wiki/XCAT_Documentation/attachment/Official-xcat-doc.png)\n\n"; print "\n[TOC]\n"; } diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index c3318bf7e..32f681834 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -807,7 +807,7 @@ my %URIdef = ( POST => { desc => "Create the osimage resources base on the parameters specified in the Data body.", #usage => "|$usagemsg{objchparam} DataBody: {iso:isoname\\file:filename\\node:noderange,params:[{attr1:value1,attr2:value2}]}|$usagemsg{non_getreturn}|", - usage => "|$usagemsg{objchparam} DataBody: {iso:isoname\\file:filename,params:[{attr1:value1,attr2:value2}]}|$usagemsg{non_getreturn}|", + usage => "|$usagemsg{objchparam} DataBody: {iso:isopath,file:filename,params:[{attr1:value1,attr2:value2}]}|$usagemsg{non_getreturn}|", example1 => "|Create osimage resources based on the ISO specified|POST|/osimages {\"iso\":\"/iso/RHEL6.4-20130130.0-Server-ppc64-DVD1.iso\"}||", example2 => "|Create osimage resources based on an xCAT image or configuration file|POST|/osimages {\"file\":\"/tmp/sles11.2-x86_64-install-compute.tgz\"}||", # TD: the imgcapture need to be moved to nodes/.*/osimages @@ -883,7 +883,7 @@ my %URIdef = ( matcher => '^\/osimages\/[^\/]*/instance$', POST => { desc => "Operate the instance of the osimage {imgname}.", - usage => "|$usagemsg{objchparam} DataBody: {action:gen\\pack\\export,params:[{attr1:value1,attr2:value2...}]}|$usagemsg{non_getreturn}|", + usage => "|$usagemsg{objchparam} DataBody: {action:gen OR pack OR export,params:[{attr1:value1,attr2:value2...}]}|$usagemsg{non_getreturn}|", example1 => "|Generates a stateless image based on the specified osimage|POST|/osimages/sles11.2-x86_64-install-compute/instance {\"action\":\"gen\"}||", example2 => "|Packs the stateless image from the chroot file system based on the specified osimage|POST|/osimages/sles11.2-x86_64-install-compute/instance {\"action\":\"pack\"}||", example3 => "|Exports an xCAT image based on the specified osimage|POST|/osimages/sles11.2-x86_64-install-compute/instance {\"action\":\"export\"}||",