This endpoint is in preview and may be modified or removed at any time.
To use this endpoint, add preview=true to the request query parameters.
Replaces the function for the model.
Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:models-write.
objectstringstringoptionalThe unique Resource Identifier (RID) of the Ontology. To look up your Ontology RID, please use the
List ontologies endpoint or check the Ontology Manager.
booleanobjectThe replaced ModelFunction
stringstringstringstringbooleanstringoptionalThe unique Resource Identifier (RID) of the Ontology. To look up your Ontology RID, please use the
List ontologies endpoint or check the Ontology Manager.
1
2
3
4
5
curl -X PUT \
\t-H "Content-type: application/json" \
\t-H "Authorization: Bearer $TOKEN" \
"https://$HOSTNAME/api/v2/models/ri.models.main.model.f351c142-0e4c-4b12-adc2-6e1539737ae9/function?preview=true" \
-d '{"apiName":"myModelFunction","ontologyBinding":"ri.ontology.main.ontology.a1b2c3d4-e5f6-7890-abcd-ef1234567890","isRowWise":false}'1
2
3
4
5
6
7
8
{
"apiName": "myModelFunction",
"ontologyBinding": "ri.ontology.main.ontology.a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"isRowWise": false,
"functionVersion": "0.0.1",
"displayName": "Core.DisplayName",
"functionRid": "ri.function-registry.main.function.a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}| Error Name | ||
|---|---|---|
Model | Error Code | INVALID_ARGUMENT |
| Status Code | 400 | |
| Description | The model API contains a data type that is not supported for Ontology function creation. | |
| Parameters | fieldName, unsupportedType | |
Invalid | Error Code | INVALID_ARGUMENT |
| Status Code | 400 | |
| Description | The provided API name for the function is invalid. | |
| Parameters | apiName | |
Ontology | Error Code | INVALID_ARGUMENT |
| Status Code | 400 | |
| Description | An ontologyBinding is required when creating or replacing a model function. | |
| Parameters | | |
Ontology | Error Code | NOT_FOUND |
| Status Code | 404 | |
| Description | The specified ontology was not found. | |
| Parameters | ontologyRid | |
Replace | Error Code | PERMISSION_DENIED |
| Status Code | 403 | |
| Description | Could not replace the ModelFunction. | |
| Parameters | modelRid | |
Model | Error Code | NOT_FOUND |
| Status Code | 404 | |
| Description | The given Model could not be found. | |
| Parameters | modelRid | |
Model | Error Code | NOT_FOUND |
| Status Code | 404 | |
| Description | The given ModelFunction could not be found. | |
| Parameters | modelRid | |
See Errors for a general overview of errors in the platform.