All Products
Search
Document Center

OpenSearch:GetFunctionInstance

Last Updated:Oct 16, 2024

Queries the details of an algorithm instance by instance name.

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/{instanceName} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
appGroupIdentitystringYes

The name of the application.

150057101
functionNamestringYes

The name of the feature.

ctr
instanceNamestringYes

The name of the instance.

ctr_test
outputstringNo

Specifies the richness of returned information. Valid values:

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

Sample requests

GET /v4/openapi/app-groups/my-app/functions/ctr/instances/ctr_test?output=detail

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.

68ED4E1B-92B8-5821-A886-9C90686139EB
Messagestring

The error message.

instance not exist.
Codestring

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

Instance.NotExist
Resultobject

The details of 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 that are used to create 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 task was created. Unit: milliseconds.

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 of the instance.

instance descriptions
ExtendInfostring

The extended information, which is a JSON string.

{\"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 the system.
user
Statusstring

The status 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
Taskobject

The information about the training task. This parameter is not displayed if no task is available.

DagStatusstring

The status of the task. Valid values:

  • success: succeeded
  • failed: failed
  • untrained: to be trained
  • pending: being scheduled
  • running: being trained
success
LastRunTimelong

The time consumed for the most recent run, in milliseconds.

1234
VersionIdlong

The ID of the version.

101
Latencylong

The time consumed for the request, in milliseconds.

123

Sample success responses

{
    "status": "OK",
    "requestId": "",
    "httpCode": 200,
    "code": "",
    "message": "",
    "latency": 123,
    "result": {
        "versionId": 100,
        "instanceName": "ctr_test",
        "functionName": "ctr",
        "functionType": "PAAS",
        "modelType": "tf_checkpoint",
        "Description": "test",
        "status": "available",
        "belongs": {
            "domain": "ecommerce",
            "category": "general",
            "language": "zh"
        },
        "createTime": 100010,
        "createParameters": [
            {
                "name": "param1",
                "value": "val1"
            }
        ],
        "usageParameters": [
            {
                "name": "use_param1",
                "value": "val1"
            }
        ],
        "extendInfo": "{\"error\":{},\"dataReport\":{}}",
        "cron": "",
        "task": {
            "dagStatus": "running",
            "progress": 30,
            "lastRunTime": 200020
        }
    }
}

Examples

Sample success responses

JSONformat

{
  "Status": "OK",
  "HttpCode": 200,
  "RequestId": "68ED4E1B-92B8-5821-A886-9C90686139EB",
  "Message": "instance not exist.",
  "Code": "Instance.NotExist",
  "Result": {
    "Belongs": {
      "Category": "general",
      "Domain": "ecommerce",
      "Language": "zh\n"
    },
    "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": "instance descriptions",
    "ExtendInfo": "{\\\"dataReport\\\":{},\\\"errors\\\":{}}",
    "FunctionName": "ctr",
    "FunctionType": "PAAS",
    "InstanceName": "ctr_test",
    "ModelType": "tf_checkpoint",
    "Source": "user",
    "Status": "available",
    "Task": {
      "DagStatus": "success",
      "LastRunTime": 1234
    },
    "VersionId": 101
  },
  "Latency": 123
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history