1
0
Fork 0
arangodb/js/apps/system/_admin/aardvark/APP/api-docs/aqlfunction.json

112 lines
8.4 KiB
JSON

{
"basePath": "/",
"swaggerVersion": "1.1",
"apiVersion": "0.1",
"apis": [
{
"operations": [
{
"errorResponses": [
{
"reason": "if success <em>HTTP 200</em> is returned. <br><br>",
"code": "200"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "namespace",
"description": "Returns all registered AQL user functions from namespace <em>namespace</em>. <br><br>"
}
],
"notes": "Returns all registered AQL user functions. <br><br> The call will return a JSON array with all user functions found. Each user function will at least have the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>name</em>: The fully qualified name of the user function <li><em>code</em>: A string representation of the function body",
"summary": " Return registered AQL user functions",
"httpMethod": "GET",
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl --data-binary @- --dump - http://localhost:8529/_api/aqlfunction\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n[ ]\n</code></pre><br><br><br>",
"nickname": "ReturnRegisteredAqlUserFunctions"
}
],
"path": "/_api/aqlfunction"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the function already existed and was replaced by the call, the server will respond with <em>HTTP 200</em>. <br><br>",
"code": "200"
},
{
"reason": "If the function can be registered by the server, the server will respond with <em>HTTP 201</em>. <br><br>",
"code": "201"
},
{
"reason": "If the JSON representation is malformed or mandatory data is missing from the request, the server will respond with <em>HTTP 400</em>. <br><br>",
"code": "400"
}
],
"parameters": [
{
"dataType": "Json",
"paramType": "body",
"required": true,
"name": "body",
"description": "the body with name and code of the aql user function. <br><br>"
}
],
"notes": "<br><br> The following data need to be passed in a JSON representation in the body of the POST request: <br><br> <ul class=\"swagger-list\"><li><em>name</em>: the fully qualified name of the user functions. <li><em>code</em>: a string representation of the function body. <li><em>isDeterministic</em>: an optional boolean value to indicate that the function results are fully deterministic (function return value solely depends on the input value and return value is the same for repeated calls with same input). The <em>isDeterministic</em> attribute is currently not used but may be used later for optimisations. </ul> In case of success, the returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code </ul> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message",
"summary": " Create AQL user function",
"httpMethod": "POST",
"examples": "<br><br><br><br><pre><code class=\"json\">shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/aqlfunction\n{\"name\":\"myfunctions::temperature::celsiustofahrenheit\",\"code\":\"function (celsius) { return celsius * 1.8 + 32; }\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"code\" : 201 \n}\n</code></pre><br><br><br>",
"nickname": "CreateAqlUserFunction"
}
],
"path": "/_api/aqlfunction"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the function can be removed by the server, the server will respond with <em>HTTP 200</em>. <br><br>",
"code": "200"
},
{
"reason": "If the user function name is malformed, the server will respond with <em>HTTP 400</em>. <br><br>",
"code": "400"
},
{
"reason": "If the specified user user function does not exist, the server will respond with <em>HTTP 404</em>. <br><br>",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": true,
"name": "name",
"description": "the name of the AQL user function. <br><br>"
},
{
"dataType": "String",
"paramType": "query",
"required": false,
"name": "group",
"description": "If set to <em>true</em>, then the function name provided in <em>name</em> is treated as a namespace prefix, and all functions in the specified namespace will be deleted. If set to <em>false</em>, the function name provided in <em>name</em> must be fully qualified, including any namespaces. <br><br>"
}
],
"notes": "<br><br> Removes an existing AQL user function, identified by <em>name</em>. <br><br> In case of success, the returned JSON object has the following properties: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>false</em> in this case) <li><em>code</em>: the HTTP status code </ul> The body of the response will contain a JSON object with additional error details. The object has the following attributes: <br><br> <ul class=\"swagger-list\"><li><em>error</em>: boolean flag to indicate that an error occurred (<em>true</em> in this case) <li><em>code</em>: the HTTP status code <li><em>errorNum</em>: the server error number <li><em>errorMessage</em>: a descriptive error message",
"summary": " Remove existing AQL user function",
"httpMethod": "DELETE",
"examples": "<br><br> deletes a function: <br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/aqlfunction/square::x::y\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : false, \n \"code\" : 200 \n}\n</code></pre><br><br><br> function not found: <br><br><br><br><pre><code class=\"json\">shell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/aqlfunction/myfunction::x::y\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1582, \n \"errorMessage\" : \"user function '%s()' not found\" \n}\n</code></pre><br><br><br>",
"nickname": "RemoveExistingAqlUserFunction"
}
],
"path": "/_api/aqlfunction/{name}"
}
]
}