Creates an algorithm instance of a feature.
Operation description
You can call the GetFunctionCurrentVersion operation to query the latest version of a feature. The response of the operation includes the createParameters parameter that is used to create an algorithm instance, the usageParameters parameter, and the requirements for setting these parameters.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
opensearch:WriteFunction | create |
|
| none |
Request syntax
POST /v4/openapi/app-groups/{appGroupIdentity}/functions/{functionName}/instances HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Body | object | Yes | The request body. | |
instanceName | string | Yes | The instance name. The name must be 1 to 30 characters in length and can contain letters, digits, and underscores (_). The name is case-sensitive and must start with a letter. | ctr_test |
modelType | string | Yes | The model type. The value varies based on the model.
| tf_checkpoint |
functionType | string | No | The feature type.
| PAAS |
description | string | No | The description. | test instance |
createParameters | array<object> | No | The parameters used to create the instance. | [ { "name": "param1", "value": "val1" } ] |
object | No | The parameter body. | ||
name | string | No | The parameter name. | title_field |
value | string | No | The parameter value. | title |
usageParameters | array<object> | No | The parameters used to use the instance. | |
object | No | The parameters that are used online, such as the blacklist and whitelist. | ||
name | string | No | The parameter name. | allow_dict_id |
value | string | No | The parameter value. | 123 |
cron | string | No | The CRON expression used to schedule periodic training, in the format of Minutes Hours DayofMonth Month DayofWeek. The default value is empty, which specifies that no periodic training is performed. A value of 0 for DayofWeek specifies Sunday. | 0 0 ? * 0,1,2,3,4,5,6 |
appGroupIdentity | string | Yes | The name of the application. | my_app_group_name |
functionName | string | Yes | The feature name. Valid values:
| ctr |
Sample requests (In this example, the functionName parameter is set to ctr.)
POST /v4/openapi/app-groups/my-app/functions/ctr/instances
{
"instanceName": "my_ctr",
"modelType": "tf_checkpoint",
"functionType": "PAAS",
"cron": "0 0 ? * 0,1,3,5",
"description": "",
"createParameters": [
{
"name": "id_field",
"value": "id"
},
{
"name": "title_field",
"value": "title"
}
],
"usageParameters": []
}
Sample requests (In this example, the functionName parameter is set to hot.)
POST /v4/openapi/app-groups/my-app/functions/hot/instances
{
"instanceName":"my_hot",
"modelType":"offline_inference",
"functionType":"PAAS",
"createParameters":[
{
"name":"filter",
"value":"biz_type != 1"
}
],
"usageParameters": [
{
"name":"allow_dict_id",
"value":"123"
},
{
"name":"deny_dict_id",
"value":"456"
}
],
"cron":"12 4 ? * 1,2,3,4,5,6,0"
}
Response parameters
Examples
Sample success responses
JSON
format
{
"Status": "OK",
"HttpCode": 200,
"RequestId": "98724351-D6B2-5D8A-B089-7FFD1821A7E9",
"Message": "version not exist.",
"Code": "Version.NotExist",
"Latency": 123
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-03-30 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-03-28 | The internal configuration of the API is changed, but the call is not affected | View Change Details |