GetFunctionCurrentVersion - 获取当前版本

更新时间:
复制 MD 格式

获取当前功能新建实例时使用的版本信息。

调试

您可以在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

返回结果。

functionName

string

功能名称

ctr

functionType

string

功能类型:

  • PAAS

  • SAAS

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
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。