Create a Function

POST {{baseUrl}}/api/v2/databases/:database/schemas/:schema/functions?createMode=errorIfExists

Create a function.

Request Params

KeyDatatypeRequiredDescription
createModestringQuery parameter allowing support for different modes of resource creation. Possible values include:
  • errorIfExists: Throws an error if you try to create a resource that already exists.
  • orReplace: Automatically replaces the existing resource with the current one.
  • ifNotExists: Creates a new resource when an alter is requested for a non-existent resource. |

Request Body

{"name"=>"<string>", "arguments"=>[{"name"=>"<string>", "datatype"=>"TEXT", "value"=>{"description"=>"Argument's value"}}, {"name"=>"<string>", "datatype"=>"TEXT", "value"=>{"description"=>"Argument's value"}}], "function_type"=>"service-function", "returns"=>"TEXT", "max_batch_rows"=>"<integer>", "created_on"=>"<dateTime>", "signature"=>"<string>", "language"=>"<string>", "body"=>"<string>"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;status&quot;:&quot;\u003cstring\u003e&quot;}