文档

GetFunctionCurrentVersion - 获取当前版本

更新时间:

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

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
opensearch:DescribeFunctionRead
  • FunctionInstance
    acs:opensearch:{#regionId}:{#accountId}:functions/*

请求语法

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

请求参数

名称类型必填描述示例值
functionNamestring

功能名称,支持的模型有:

  • CTR 模型:ctr
  • 人气模型:pop
  • 类目模型:category
  • 热词模型:hot
  • 底纹模型:hint
  • 下拉提示模型:suggest
  • 分词模型:analyzer
  • 词权重模型:termweight
ctr
modelTypestring

模型类型,不同功能对应的模型类型如下:

  • CTR 模型:tf_checkpoint
  • 人气模型:pop
  • 类目模型:offline_inference
  • 热词模型:offline_inference
  • 底纹模型:offline_inference
  • 下拉提示模型:offline_inference
  • 分词模型:text
  • 词权重模型:tf_checkpoint
tf_checkpoint
functionTypestring

功能类型:

  • PAAS (默认)
  • SAAS
PAAS
domainstring

行业,默认为空,表示通用版

枚举值:
  • education教育行业
  • ecommerce电商行业
  • community内容社区
ecommerce
categorystring

垂类,默认为空

枚举值:
  • general通用
  • question教育搜题
  • itIT内容
general

示例

GET /v4/openapi/functions/ctr/current-version?modelType=_checkpoint&functionType=PAAS&domain=ecommerce&category=general

返回参数

名称类型描述示例值
object

响应体

Statusstring

状态码

OK
HttpCodelong

HTTP 状态码。

200
RequestIdstring

请求 id

1638157479281
Messagestring

错误信息

version not exist.
Codestring

错误码

Version.NotExist
Resultobject

返回结果。

FunctionNamestring

功能名称

ctr
FunctionTypestring

功能类型:

  • PAAS
  • SAAS
PAAS
ModelTypestring

模型类型

tf_checkpoint
VersionConfigobject

配置信息

CreateParametersobject []

创建实例时使用的参数列表

[ { "name": "params1", "required": "true", "formItemProps": "{\"required\": true, \"pattern?\": \"/^[a-zA-Z][a-zA-Z0-9_]{0,29}$/\"}", "componentProps": "{\"component\": \"Input\", \"attributes\": {\"defaultValue\": \"value1\"}}" } ]
Namestring

name

params1
Requiredstring

required

true
Dependsobject []

实例的依赖项列表

[ { "dependency": "依赖项", "condition": "条件", "description": "" } ]
Conditionstring

条件

""
Dependencystring

依赖项

""
Descriptionstring

描述

""
UsageParametersobject []

实例在线使用过程中的参数列表

[]
Namestring

name

""
Requiredstring

required

""
VersionIdlong

版本 id

101
VersionNamestring

版本名称

v1
Latencylong

请求耗时(单位 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
}

错误码

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

变更历史

变更时间变更内容概要操作
暂无变更历史
  • 本页导读 (0)
文档反馈