gf-cloud-api.html: document the new command=remake

Also improve the documentation of the responses to the upload and make
commands.
This commit is contained in:
hallgren
2012-10-23 21:16:31 +00:00
parent b810b5000c
commit f7cb80008b

View File

@@ -8,6 +8,7 @@
dl.api>dt, .request { background-color: #cef; } dl.api>dt, .request { background-color: #cef; }
.response { background-color: #ffc; } .response { background-color: #ffc; }
dd { margin-top: 0.5ex; margin-bottom: 0.5ex; } dd { margin-top: 0.5ex; margin-bottom: 0.5ex; }
em { color: #36f; }
</style> </style>
</head> </head>
@@ -107,22 +108,39 @@ For documentation of GF shell commands, see:
The working directory is persistent, so clients are expected The working directory is persistent, so clients are expected
to remember and reuse it. Access to previously to remember and reuse it. Access to previously
uploaded files requires that the same working directory is used. uploaded files requires that the same working directory is used.
<dt><code>/parse?</code><var>path</var><code>=</code><var>source</var> <dt><code>/parse?</code><var>path</var><code>=</code><var>source</var>
<dd>This command can be used to check GF source code for syntax errors. <dd>This command can be used to check GF source code for syntax errors.
It also converts GF source code to the JSON representation used in It also converts GF source code to the JSON representation used in
GFSE (the cloud-based GF grammar editor). GFSE (the cloud-based GF grammar editor).
<dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>upload</strong>&amp;</code><var>path<sub>1</sub></var><code>=</code><var>source<sub>1</sub></var><code>&amp;</code><var>path<sub>2</sub></var><code>=</code><var>source<sub>2</sub></var><code>&amp;</code>... <dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>upload</strong>&amp;</code><var>path<sub>1</sub></var><code>=</code><var>source<sub>1</sub></var><code>&amp;</code><var>path<sub>2</sub></var><code>=</code><var>source<sub>2</sub></var><code>&amp;</code>...
<dd>Upload files to be stored in the cloud. <dd>Upload files to be stored in the cloud.
<dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>make</strong>&amp;</code><var>path<sub>1</sub></var><code>=</code><var>source<sub>1</sub></var><code>&amp;</code><var>path<sub>2</sub></var><code>=</code><var>source<sub>2</sub></var><code>&amp;</code>...
<dd>Upload grammar files and compile them into a PGF file.
The response code is 204 if the upload was successful. The response code is 204 if the upload was successful.
<dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>make</strong>&amp;</code><var>path<sub>1</sub></var><code>=</code><var>source<sub>1</sub></var><code>&amp;</code><var>path<sub>2</sub></var><code>=</code><var>source<sub>2</sub></var><code>&amp;</code>...
<dd>Upload grammar files and compile them into a PGF file. Example response:
<blockquote class=response><code>
{ "errorcode":"OK", <em>// "OK" or "Error"</em>
<br>  "command":"gf -s -make FoodsEng.gf FoodsSwe.gf FoodsChi.gf",
<br>  "output":"\n\n" <em>// Warnings and errors from GF</em>
<br>}</code></blockquote>
<dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>remake</strong>&amp;</code><var>path<sub>1</sub></var><code>=</code><var>source<sub>1</sub></var><code>&amp;</code><var>path<sub>2</sub></var><code>=</code><var>source<sub>2</sub></var><code>&amp;</code>...
<dd>Like <code>command=<strong>remake</strong></code>, except you can leave
the <var>source<sub>i</sub></var> parts empty to reuse previously uploaded
files.
<dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>download</strong>&amp;file=</code><var>path</var> <dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>download</strong>&amp;file=</code><var>path</var>
<dd>Download the specified file. <dd>Download the specified file.
<dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>ls</strong>&amp;ext=.pgf</code> <dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>ls</strong>&amp;ext=.pgf</code>
<dd>List files with the specified extension, e.g. <dd>List files with the specified extension, e.g.
<code class=response>["Foods.pgf","Letter.pgf"]</code>. <code class=response>["Foods.pgf","Letter.pgf"]</code>.
<dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>rm</strong>&amp;file=</code><var>path</var> <dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>rm</strong>&amp;file=</code><var>path</var>
<dd>Remove the specified file. <dd>Remove the specified file.
<dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>link_directories</strong>&newdir=</code>... <dt><code>/cloud?dir=</code>...<code>&amp;command=<strong>link_directories</strong>&newdir=</code>...
<dd>Combine server directores. This is used by GFSE to share grammars <dd>Combine server directores. This is used by GFSE to share grammars
between multiple devices. between multiple devices.
@@ -131,7 +149,7 @@ For documentation of GF shell commands, see:
<hr> <hr>
<address></address> <address></address>
<div class=modtime><small> <div class=modtime><small>
<!-- hhmts start -->Last modified: Tue Oct 2 17:26:02 CEST 2012 <!-- hhmts end --> <!-- hhmts start -->Last modified: Tue Oct 23 23:16:26 CEST 2012 <!-- hhmts end -->
</small></div> </small></div>
<address> <address>
<a href="http://www.cse.chalmers.se/~hallgren/">TH</a> <a href="http://www.cse.chalmers.se/~hallgren/">TH</a>