All Products
Search
Document Center

OpenSearch:ListFunctionInstances

Last Updated:Oct 16, 2024

Queries all algorithm instances of a user, which meet specified conditions.

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
  • FunctionInstance
    acs:opensearch:{#regionId}:{#accountId}:apps/{#AppGroupId}
    none
none

Request syntax

GET /v4/openapi/app-groups/{appGroupIdentity}/functions/{functionName}/instances HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
appGroupIdentitystringYes

The name of the application.

app_group_name
functionNamestringYes

The name of the feature.

ctr
modelTypestringNo

The type of the model.

tf_checkpoint
functionTypestringNo

The type of the feature.

"PAAS"
sourcestringNo

How the instance is created. Valid values:

  • builtin: The instance is created by system.
  • user: The instance is created by user. This is the default value.
  • all: all instances
user
pageNumberintegerNo

The number of the page to return. Default value: 1.

1
pageSizeintegerNo

The number of entries to return on each page. Default value: 10.

10
outputstringNo

The richness of the returned information. Valid values:

  • normal: displays information such as createParameters and cron. This is the default value.
  • simple: displays only the basic information.
  • detail: returns the details of the training task.
normal

Sample requests

GET /v4/openapi/app-groups/my-app/functions/ctr/instances?source=all&output=simple

Response parameters

ParameterTypeDescriptionExample
object

The response body.

Statusstring

The status of the request.

"OK"
HttpCodelong

The HTTP status code.

200
TotalCountlong

The total number of entries returned.

2
RequestIdstring

The ID of the request.

A4D487A9-A456-5AA5-A9C6-B7BF2889CF74
Messagestring

The error message. If no error occurs, the parameter is left empty.

instance not exist.
Codestring

The error code. If no error occurs, the parameter is left empty.

Instance.NotExist
Resultarray<object>

The information about the instances.

[]
Resultobject

The information about the instance.

Belongsobject

The information about the instance.

Categorystring

The category.

"general"
Domainstring

The industry.

"ecommerce"
Languagestring

The abbreviation of the language that applies.

"zh"
CreateParametersarray<object>

The parameters of the instance.

[]
CreateParametersobject

The parameter body.

Namestring

The name of the parameter.

"param1"
Valuestring

The value of the parameter.

"value1"
UsageParametersarray<object>

The parameters that are used.

UsageParametersobject

The parameter body.

Namestring

The name of the parameter.

use_param1
Valuestring

The value of the parameter.

value1
CreateTimelong

The time when the instance was created.

1234
Cronstring

The cron expression used to schedule training, in the format of (Minutes Hours DayofMonth Month DayofWeek). If the value is empty, it indicates that no periodic training is performed.

0 3 ? \* 0,1,3,5 (at 3 a.m. on Sunday, Monday, Wednesday, and Friday)
Descriptionstring

The description.

" "
ExtendInfostring

The extended information, which is a JSON string. It includes model evaluation information and error information.

"{\"dataReport\":{},\"errors\":{}}"
FunctionNamestring

The name of the feature.

"ctr"
FunctionTypestring

The type of the feature.

"PAAS"
InstanceNamestring

The name of the instance.

"ctr_test"
ModelTypestring

The type of the model.

"tf_checkpoint"
Sourcestring

How the instance is created. Valid values:

  • user: The instance is created by user.
  • builtin: The instance is created by system.
"user"
Statusstring

The state of the instance. Valid values:

  1. unavailable: No model is available. Models must be trained before you can use them.
  2. available: Models can be used.
available
VersionIdlong

The ID of the version.

123
Latencylong

The time consumed for the request, in milliseconds.

123

Sample success responses

{
    "status": "OK",
    "requestId": "A4D487A9-A456-5AA5-A9C6-B7BF2889CF74",
    "httpCode": 200,
    "code": "",
    "message": "",
    "latency": 123,
    "totalCount": 2,
    "result": [
        {
            "versionId": 100,
            "instanceName": "instance_1",
            "functionName": "hot",
            "functionType": "PAAS",
            "modelType": "offline_inference",
            "description": "",
            "status": "available",
            "belongs": {
                "domain": "ecommerce",
                "category": "general",
                "language": "zh"
            },
            "createTime": 100010,
            "source": "user"
        },
        {
            "versionId": 100,
            "instanceName": "instance_2",
            "functionName": "hot",
            "functionType": "PAAS",
            "modelType": "offline_inference",
            "description": "",
            "status": "available",
            "belongs": {
                "domain": "ecommerce",
                "category": "general",
                "language": "zh"
            },
            "createTime": 200020,
            "source": "user",
            "default": true
        }
    ]
}

Examples

Sample success responses

JSONformat

{
  "Status": "\"OK\"",
  "HttpCode": 200,
  "TotalCount": 2,
  "RequestId": "A4D487A9-A456-5AA5-A9C6-B7BF2889CF74",
  "Message": "instance not exist.",
  "Code": "Instance.NotExist",
  "Result": [
    {
      "Belongs": {
        "Category": "\"general\"",
        "Domain": "\"ecommerce\"",
        "Language": "\"zh\"\t"
      },
      "CreateParameters": [
        {
          "Name": "\"param1\"",
          "Value": "\"value1\""
        }
      ],
      "UsageParameters": [
        {
          "Name": "use_param1",
          "Value": "value1"
        }
      ],
      "CreateTime": 1234,
      "Cron": "0 3 ? \\* 0,1,3,5 (at 3 a.m. on Sunday, Monday, Wednesday, and Friday)\n",
      "Description": "\" \"",
      "ExtendInfo": "\"{\\\"dataReport\\\":{},\\\"errors\\\":{}}\"",
      "FunctionName": "\"ctr\"",
      "FunctionType": "\"PAAS\"",
      "InstanceName": "\"ctr_test\"",
      "ModelType": "\"tf_checkpoint\"",
      "Source": "\"user\"",
      "Status": "available",
      "VersionId": 123
    }
  ],
  "Latency": 123
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history