GetFunctionCurrentVersion - 获取当前版本

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

调试

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

错误码

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

变更历史

更多信息,参考变更详情