From 71da0126266701e91903e8fe59066d4a008a2cfa Mon Sep 17 00:00:00 2001 From: hallgren Date: Mon, 18 Jun 2012 13:08:32 +0000 Subject: [PATCH] cloud service: add preliminary cloud service API documentation --- gf.cabal | 2 +- src/www/gf-cloud-api.html | 116 ++++++++++++++++++++++++++++++++++++++ src/www/index.html | 1 + 3 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 src/www/gf-cloud-api.html diff --git a/gf.cabal b/gf.cabal index 6f8b06ea3..4cbc24a96 100644 --- a/gf.cabal +++ b/gf.cabal @@ -13,7 +13,7 @@ bug-reports: http://code.google.com/p/grammatical-framework/issues/list tested-with: GHC==6.12.3, GHC==7.0.4 data-dir: src -data-files: www/index.html +data-files: www/*.html www/P/*.png www/gfse/*.html www/gfse/*.css diff --git a/src/www/gf-cloud-api.html b/src/www/gf-cloud-api.html new file mode 100644 index 000000000..5549764d1 --- /dev/null +++ b/src/www/gf-cloud-api.html @@ -0,0 +1,116 @@ + + +GF Cloud Service API (preliminary) + + + + + + + +

GF Cloud Service API (preliminary)

+ +The GF cloud service API provides the following functionality: + + +

+The service is available from +http://cloud.grammaticalframework.org. + +Users that have GF installed on their own computer can also +run the service locally by starting GF with the command gf -server. + +

+ +This is preliminary and subject to change! + +

PGF Service

+ +The GF Cloud Service supports the same set of PGF service requests as the +already available PGF web service. For example, a request like + +
+http://cloud.grammaticalframework.org/grammars/Foods.pgf?command=random +
+ +might return a result like + +
+[{"tree":"Pred (That Pizza) (Very Boring)"}] +
+ +

+For more info, see: +

+ +

GF Shell Service

+This service lets you execute arbitrary GF shell commands. Before you can do +this, you need to use the /new command to obtain a +working directory (which also servces as a session identifier) on the server, +see below. + +
+
/gfshell&dir=...&command=i+Foods.pgf +
  +
/gfshell&dir=...&command=gr +
Pred (That Pizza) (Very Boring) +
+ +For documentation of GF shell commands, see: + + +

Additional cloud service

+ +
+
/new +
This generates a new working directory on the server, e.g. + /tmp/gfse.123456. + Most of the clouds service commands require that a working directory + is specified in the dir parameter. + The working directory is persistent, so clients are expected + to remember and reuse it. Access to previously + uploaded files requires that the same working directory is used. +
/parse?path=source +
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 + GFSE (the cloud-based GF grammar editor). +
/cloud?&dir=...&command=upload&path1=source1&path2=source2&... +
Upload files to be stored in the cloud. +
/cloud?&dir=...&command=make&path1=source1&path2=source2&... +
Upload grammar files and compile them into a PGF file. +
/cloud?&dir=...&command=download&file=path +
Download the specified file. +
/cloud?&dir=...&command=ls&ext=.pgf +
["Foods.pgf","Letter.pgf"] (list files with the specified extension) + +
/cloud?&dir=...&command=rm&file=path +
Remove the specified file. +
/cloud?&dir=...&command=link_directories&newdir=... +
Combine server directores. This is used by GFSE to share grammars + between multiple devices. +
+ +
+
+
+ Last modified: Mon Jun 18 15:03:02 CEST 2012 +
+
+TH + +
+ + diff --git a/src/www/index.html b/src/www/index.html index abc06780c..d5a18b51c 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -27,6 +27,7 @@
  • About the simple translation tool
  • PGF web service API examples
  • PGF web service API documentation +
  • GF Cloud Service API