Creates a UDF function in Data Studio. The UDF function information is described in FlowSpec format.
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 ID of the DataWorks workspace. You can log on to the DataWorks console and go to the workspace management page to view the ID. |
12345 |
| Spec |
string |
Yes |
The FlowSpec information that describes the UDF function. For more information about the specifications, 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. Used for locating logs and troubleshooting issues. |
AE49C88D-5BEE-5ADD-8B8C-C4BBC0D7**** |
| Id |
string |
The unique identifier of the UDF function. Important This field was of the Long type in SDK versions earlier than 8.0.0 and is of the String type in SDK 8.0.0 and later. This change does not affect normal SDK usage, and the parameter is still returned in the type defined in the SDK. Only when you upgrade across SDK version 8.0.0, the type change may cause project compilation failures, and you need to manually correct 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.