All Products
Search
Document Center

OpenSearch:GetFunctionCurrentVersion

Last Updated:Oct 16, 2024

Queries the version information about the current feature when you create an instance.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
opensearch:DescribeFunctionget
  • All Resources
    *
    none
none

Request syntax

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

Request parameters

ParameterTypeRequiredDescriptionExample
functionNamestringYes

The name of the feature. Valid values:

  • ctr: click-through rate (CTR) model
  • pop: popularity model
  • category: category model
  • hot: hotword model
  • hint: shading model
  • suggest: drop-down suggestion model
  • analyzer: word segmentation model
  • termweight: word weight model
ctr
modelTypestringYes

The type of the model. The following features correspond to different model types:

  • CTR model: tf_checkpoint
  • Popularity model: pop
  • Category model: offline_inference
  • Hotword model: offline_inference
  • Shading model: offline_inference
  • Drop-down suggestion model: offline_inference
  • Word segmentation model: text
  • Word weight model: tf_checkpoint
tf_checkpoint
functionTypestringNo

The type of the feature. Valid values:

  • PAAS. This is the default value.
  • SAAS.
PAAS
domainstringNo

The industry. By default, this parameter is left empty, which indicates General-purpose Edition.

ecommerce
categorystringNo

The category. By default, this parameter is left empty.

general

Sample requests

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

Response parameters

ParameterTypeDescriptionExample
object

The response body.

Statusstring

The status of the request.

OK
HttpCodelong

The HTTP status code.

200
RequestIdstring

The ID of the request.

1638157479281
Messagestring

The error message.

version not exist.
Codestring

The error code.

Version.NotExist
Resultobject

The result of the request.

FunctionNamestring

The name of the feature.

ctr
FunctionTypestring

The type of the feature. Valid values:

  • PAAS
  • SAAS
PAAS
ModelTypestring

The type of the model.

tf_checkpoint
VersionConfigobject

The configuration information about the instance.

CreateParametersarray<object>

The parameters that are used to create the instance.

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

The parameter body.

Namestring

The name of the parameter.

params1
Requiredstring

Indicates whether the parameter is required.

true
Dependsarray<object>

The dependencies of the instance.

Dependsobject

The parameter body.

Conditionstring

The condition.

""
Dependencystring

The dependency.

""
Descriptionstring

The description.

""
UsageParametersarray<object>

The parameters that are used to use the instance online.

[]
UsageParametersobject

The parameter body.

Namestring

The name of the parameter.

""
Requiredstring

Indicates whether the parameter is required.

""
VersionIdlong

The ID of the version.

101
VersionNamestring

The name of the version.

v1
Latencylong

The time consumed for the request, in milliseconds.

123

Sample success responses (In this example, hotword model is used.)

{
    "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": "The level of the data integrity must be equal to or greater than 1."
                }
            ],
            "deployment": "",
            "dagTemplate": "opensearch_hot_train"
        }
    }
}

Examples

Sample success responses

JSONformat

{
  "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
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history