Creates a user-defined function (UDF) in DataStudio. The information about the UDF is described by using FlowSpec.
Operation description
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:* |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
integer |
Yes |
The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to query the ID. |
12345 |
| Spec |
string |
Yes |
The FlowSpec field information about the UDF. For more information, see FlowSpec. |
{ "version": "1.1.0", "kind": "Function", "spec": { "functions": [ { "name": "function name", "script": { "content": "{\"name\": \"function name\", \"datasource\": {\"type\": \"ODPS\", \"name\": \"ODPS_first\"}, \"runtimeResource\": {\"resourceGroup\": \"s_res_group_xx_xxxx\"}}", "path": "XXX/OpenAPI/function/function name", "runtime": { "command": "ODPS_FUNCTION" } }, "datasource": { "name": "ODPS_first", "type": "ODPS" }, "runtimeResource": { "resourceGroup": "S_res_group_XXXX_XXXX" } } ] } } |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. You can locate logs and troubleshoot issues based on the ID. |
AE49C88D-5BEE-5ADD-8B8C-C4BBC0D7**** |
| Id |
string |
The unique identifier of the UDF function. Note
Prior to SDK version 8.0.0, this field is of type Long. In SDK version 8.0.0 and later, it is of type String. This change does not affect the normal use of the SDK. The parameter is returned based on the type defined in the SDK. Compilation failures caused by the type change may occur only when you upgrade the SDK across version 8.0.0. In this case, you must manually update the data type. |
580667964888595XXXX |
Examples
Success response
JSON format
{
"RequestId": "AE49C88D-5BEE-5ADD-8B8C-C4BBC0D7****",
"Id": "580667964888595XXXX"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.