取得目前功能新建執行個體時使用的版本資訊。
調試
您可以在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
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。