From: Dietmar Maurer Date: Fri, 24 Feb 2012 08:09:17 +0000 (+0100) Subject: add usage information X-Git-Url: https://git.proxmox.com/?p=pve2-api-doc.git;a=commitdiff_plain;h=308ec33a9a17124ef155451cd20664cde265b6ab add usage information --- diff --git a/data/PVEAPI.js b/data/PVEAPI.js index 5008085..ff3cd44 100644 --- a/data/PVEAPI.js +++ b/data/PVEAPI.js @@ -83,15 +83,32 @@ Ext.onReady(function() { var items = []; + var clicmdhash = { + GET: 'get', + POST: 'create', + PUT: 'set', + DELETE: 'delete' + }; + Ext.Array.each(['GET', 'POST', 'PUT', 'DELETE'], function(method) { var info = md[method]; if (info) { + var usage = ""; + + usage += ""; + usage += "
HTTP:   " + method + " /api2/json" + data.path + "
 
CLI:pvesh " + clicmdhash[method] + " " + data.path + "
"; + var sections = [ { title: 'Description', html: Ext.htmlEncode(info.description), bodyPadding: 10 + }, + { + title: 'Usage', + html: usage, + bodyPadding: 10 } ];