All Products
Search
Document Center

DataWorks:CreateFunction

Last Updated:Dec 05, 2024

Creates a user-defined function (UDF) in DataStudio. The information about the UDF is described by using FlowSpec.

Operation description

Note You cannot use this API operation to create multiple UDFs at a time. If you specify multiple UDFs by using FlowSpec, the system creates only the first specified UDF.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectIdstringYes

The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to query the ID.

12345
SpecstringYes

The FlowSpec field information about the UDF. For more information, see FlowSpec .

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

AE49C88D-5BEE-5ADD-8B8C-C4BBC0D7XXXX
Idstring

The ID of the UDF.

580667964888595XXXX

Examples

Sample success responses

JSONformat

{
  "RequestId": "AE49C88D-5BEE-5ADD-8B8C-C4BBC0D7XXXX",
  "Id": "580667964888595XXXX"
}

Error codes

For a list of error codes, visit the Service error codes.