获取当前功能新建实例时使用的版本信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
opensearch:DescribeFunction |
get |
*全部资源
|
无 | 无 |
请求语法
GET /v4/openapi/functions/{functionName}/current-version HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| functionName |
string |
是 |
功能名称,支持的模型有:
|
ctr |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| modelType |
string |
是 |
模型类型,不同功能对应的模型类型如下:
枚举值:
|
tf_checkpoint |
| functionType |
string |
否 |
功能类型:
|
PAAS |
| domain |
string |
否 |
行业,默认为空,表示通用版 枚举值:
|
ecommerce |
| category |
string |
否 |
垂类,默认为空 枚举值:
|
general |
示例
GET /v4/openapi/functions/ctr/current-version?modelType=_checkpoint&functionType=PAAS&domain=ecommerce&category=general
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
响应体 |
{ "status": "OK", "requestId": "", "httpCode": 200, "code": "", "message": "", "latency": 123, "result": { "versionName": "v1", "versionId": 101, "functionName": "ctr", "modelType": "tf_checkpoint", "functionType": "PAAS", "versionConfig": { "createParameters": [ { "name": "params1", "required": "true", "formItemProps": "{\"required\": true, \"pattern?\": \"/^[a-zA-Z][a-zA-Z0-9_]{0,29}$/\"}", "componentProps": "{\"component\": \"Input\", \"attributes\": {\"defaultValue\": \"value1\"}}" } ], "depends": [ { "dependency": "依赖项", "condition": "条件", "description": "" } ], "usageParameters": [] } } } |
|
| status |
string |
状态码 |
OK |
| httpCode |
integer |
HTTP 状态码。 |
200 |
| requestId |
string |
请求 id |
1638157479281 |
| message |
string |
错误信息 |
version not exist. |
| code |
string |
错误码 |
Version.NotExist |
| result |
object |
返回结果。 |
|
| functionName |
string |
功能名称 |
ctr |
| functionType |
string |
功能类型:
|
PAAS |
| modelType |
string |
模型类型 |
tf_checkpoint |
| versionConfig |
object |
配置信息 |
|
| createParameters |
array<object> |
创建实例时使用的参数列表 |
|
|
object |
参数体 |
||
|
string |
|||
| depends |
array<object> |
实例的依赖项列表 |
|
|
object |
参数体 |
||
|
string |
|||
| usageParameters |
array<object> |
实例在线使用过程中的参数列表 |
|
|
object |
参数体 |
||
|
string |
|||
| versionId |
integer |
版本 id |
101 |
| versionName |
string |
版本名称 |
v1 |
| latency |
integer |
请求耗时(单位 ms) |
123 |
正常返回示例(热词模型)
{
"status": "OK",
"requestId": "165890826219877085621759",
"latency": 0.049,
"httpCode": 200,
"code": "",
"message": "",
"result": {
"versionId": 37,
"versionName": "v2",
"description": "",
"status": "available",
"functionName": "hot",
"modelType": "offline_inference",
"functionType": "PAAS",
"versionConfig": {
"createParameters": [
{
"name": "filter",
"required": "false",
"validations": "[{\"preprocess\": {\"pattern\": \"(\\\\w+)\\\\s*(>=|<=|>|<|=|!=)\\\\s*(\\\\w+)\", \"type\": \"regex\", \"group\": 1}, \"params\": {\"data\": [\"user_id\", \"biz_type\"], \"type\": \"trival\"}, \"class\": \"EnumerateRule\"}]",
"value": "{\"component\":\"Input\",\"attributes\":{\"defaultValue\":\"\",\"dataSource\":\"\"}}",
"valueSplit": ","
}
],
"usageParameters": [
{
"name": "allow_dict_id",
"required": "false",
"validations": "[{\"params\": {\"restrictions\": \"type=hot_allowlist\", \"type\": \"passthrough\", \"dataSource\": \"dicts\"}, \"class\": \"EnumerateRule\"}]",
"value": "{\"component\":\"Select\",\"attributes\":{\"defaultValue\":\"\",\"dataSource\":\"\"}}"
},
{
"name": "deny_dict_id",
"required": "false",
"validations": "[{\"params\": {\"restrictions\": \"type=hot_denylist\", \"type\": \"passthrough\", \"dataSource\": \"dicts\"}, \"class\": \"EnumerateRule\"}]",
"value": "{\"component\":\"Select\",\"attributes\":{\"defaultValue\":\"\",\"dataSource\":\"\"}}"
}
],
"depends": [
{
"condition": "integrity_level >= 1",
"dependency": "integrity_level",
"description": "数据完整度至少为 L1 级"
}
],
"deployment": "",
"dagTemplate": "opensearch_hot_train"
}
}
}
示例
正常返回示例
JSON格式
{
"status": "OK",
"httpCode": 200,
"requestId": "1638157479281",
"message": "version not exist.",
"code": "Version.NotExist",
"result": {
"functionName": "ctr",
"functionType": "PAAS",
"modelType": "tf_checkpoint",
"versionConfig": {
"createParameters": [
{
"key": ""
}
],
"depends": [
{
"key": ""
}
],
"usageParameters": [
{
"key": ""
}
]
},
"versionId": 101,
"versionName": "v1"
},
"latency": 123
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。