获取当前功能新建实例时使用的版本信息。
调试
您可以在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 |
返回结果。 |
{ "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": [] } } |
| FunctionName |
string |
功能名称 |
ctr |
| FunctionType |
string |
功能类型:
|
PAAS |
| ModelType |
string |
模型类型 |
tf_checkpoint |
| VersionConfig |
object |
配置信息 |
{ "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": [] } |
| CreateParameters |
array<object> |
创建实例时使用的参数列表 |
[ { "name": "params1", "required": "true", "formItemProps": "{\"required\": true, \"pattern?\": \"/^[a-zA-Z][a-zA-Z0-9_]{0,29}$/\"}", "componentProps": "{\"component\": \"Input\", \"attributes\": {\"defaultValue\": \"value1\"}}" } ] |
|
object |
参数体 |
{ "name": "params1", "required": "true", "formItemProps": "{\"required\": true, \"pattern?\": \"/^[a-zA-Z][a-zA-Z0-9_]{0,29}$/\"}", "componentProps": "{\"component\": \"Input\", \"attributes\": {\"defaultValue\": \"value1\"}}" } |
|
| Name |
string |
name |
params1 |
| Required |
string |
required |
true |
| Depends |
array<object> |
实例的依赖项列表 |
[ { "dependency": "依赖项", "condition": "条件", "description": "" } ] |
|
object |
参数体 |
{ "dependency": "依赖项", "condition": "条件", "description": "" } |
|
| Condition |
string |
条件 |
"" |
| Dependency |
string |
依赖项 |
"" |
| Description |
string |
描述 |
"" |
| UsageParameters |
array<object> |
实例在线使用过程中的参数列表 |
[] |
|
object |
参数体 |
{} |
|
| Name |
string |
name |
"" |
| Required |
string |
required |
"" |
| 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": [
{
"Name": "params1",
"Required": "true"
}
],
"Depends": [
{
"Condition": "\"\"",
"Dependency": "\"\"",
"Description": "\"\""
}
],
"UsageParameters": [
{
"Name": "\"\"",
"Required": "\"\""
}
]
},
"VersionId": 101,
"VersionName": "v1"
},
"Latency": 123
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。