全部產品
Search
文件中心

OpenSearch:GetFunctionCurrentVersion - 擷取目前的版本

更新時間:Nov 24, 2025

擷取當前功能建立執行個體時使用的版本資訊。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

opensearch:DescribeFunction

get

*全部資源

*

請求文法

GET /v4/openapi/functions/{functionName}/current-version HTTP/1.1

路徑參數

名稱

類型

必填

描述

樣本值

functionName

string

功能名稱,支援的模型有:

  • CTR 模型:ctr

  • 人氣模型:pop

  • 類目模型:category

  • 熱詞模型:hot

  • 底紋模型:hint

  • 下拉提示模型:suggest

  • 分詞模型:analyzer

  • 詞權重模型:termweight

ctr

請求參數

名稱

類型

必填

描述

樣本值

modelType

string

模型類型,不同功能對應的模型類型如下:

  • CTR 模型:tf_checkpoint

  • 人氣模型:pop

  • 類目模型:offline_inference

  • 熱詞模型:offline_inference

  • 底紋模型:offline_inference

  • 下拉提示模型:offline_inference

  • 分詞模型:text

  • 詞權重模型:tf_checkpoint

枚舉值:

  • pop :

    人氣模型

  • offline_inference :

    熱詞底紋\類目預測

  • tf_checkpoint :

    ctr\定製詞權重等

  • text :

    定製分詞

tf_checkpoint

functionType

string

功能類型:

  • PAAS (預設)

  • SAAS

PAAS

domain

string

行業,預設為空白,表示通用版

枚舉值:

  • education :

    教育行業

  • ecommerce :

    電商行業

  • community :

    內容社區

ecommerce

category

string

垂類,預設為空白

枚舉值:

  • general :

    通用

  • question :

    教育搜題

  • it :

    IT 內容

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

  • SAAS

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
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情