ListModels

更新时间:
复制 MD 格式

Queries a list of models that meet specified conditions by instance ID.

Operation description

Operation description

This API operation retrieves a list of models from a specified instance. You can filter results by model name, type, and pagination parameters. Provide the instance ID as a path parameter. Other filter conditions are optional query parameters.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

searchengine:ListModels

list

*Instance

acs:searchengine:{#regionId}:{#accountId}:instance/{#InstanceId}

None None

Request syntax

GET /openapi/ha3/instances/{instanceId}/models HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The instance ID.

ha-cn-test

Request parameters

Parameter

Type

Required

Description

Example

name

string

No

The model name.

test1

type

string

No

The model type.

text_embedding

pageNumber

integer

No

The page number. Default value: 1.

1

pageSize

integer

No

The number of entries per page. Default value: 10.

10

Response elements

Element

Type

Description

Example

object

The response includes the request ID and a model list. Each element in the model list contains detailed model information such as name, type, URL, and status.

requestId

string

The request ID.

38b079f1-7846-4226-8c90-3e2644b5c52b

totalCount

integer

The total number of entries.

14

result

array<object>

The model list. For more information, see Model.

array<object>

The model information.

name

string

The model name.

test

type

string

The model type.

  • a. Text embedding: text_embedding

  • b. Text sparse embedding: text_sparse_embedding

  • c. Image embedding: image_embedding

  • d. Image content analysis: image_analyze.

text_embedding

url

string

The access URL of the model service.

http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001

status

string

The model status. Valid values:

  • ok: The model is available.

  • forbidden: The model is unavailable.

ok

dimension

integer

The dimension of the model.

128

content

object

The content information of the model.

modelName

string

The model name.

test

modelType

string

The model type.

  • Text embedding: text_embedding

  • Text sparse embedding: text_sparse_embedding

  • Image embedding: image_embedding

  • Image content parsing: image_analyze

text_embedding

url

string

The endpoint of the model service.

http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001

method

string

The HTTP method to access the model service. Supported methods are PUT and POST.

POST

request

object

The request configuration.

header

object

The HTTP header to access the model service.

Authorization

string

The authentication information. Format: Bearer access_token

Bearer OS-v0********6vvs

Content-Type

string

The HTTP request content type.

application/json

urlParams

object

The parameters in the URL. Some model services require that parameters are passed in the URL.

build

object

The parameters passed during index building.

key: value

search

object

The parameters passed during a query.

key: value

requestBody

string

The template string for the request body.

{\"input\": [\"%{input}\"], \"input_type\": \"%{input_type}\"}

parameters

object

If body parameters must differ between the build and search phases, define them in this object.

build

object

The parameters for the index building phase.

input_type

string

The input type.

query

search

object

The parameters for the query phase.

input_type

string

The input type.

document

response

object

The JSONPath expression used to parse the result.

embeddings

string

The JSONPath expression used to parse the result.

$.result.embeddings[*].embedding

createTime

string

The creation time.

2024-05-21 16:05:26

updateTime

string

The last modification time.

2024-05-21 16:05:26

Examples

Success response

JSON format

{
  "requestId": "38b079f1-7846-4226-8c90-3e2644b5c52b",
  "totalCount": 14,
  "result": [
    {
      "name": "test",
      "type": "text_embedding",
      "url": "http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001",
      "status": "ok",
      "dimension": 128,
      "content": {
        "modelName": "test",
        "modelType": "text_embedding",
        "url": "http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001",
        "method": "POST",
        "request": {
          "header": {
            "Authorization": "Bearer OS-v0********6vvs\n",
            "Content-Type": "application/json\n"
          },
          "urlParams": {
            "build": {
              "test": "test",
              "test2": 1
            },
            "search": {
              "test": "test",
              "test2": 1
            }
          },
          "requestBody": "{\\\"input\\\": [\\\"%{input}\\\"], \\\"input_type\\\": \\\"%{input_type}\\\"}",
          "parameters": {
            "build": {
              "input_type": "query\n"
            },
            "search": {
              "input_type": "document\n"
            }
          }
        },
        "response": {
          "embeddings": "$.result.embeddings[*].embedding\n"
        }
      },
      "createTime": "2024-05-21 16:05:26",
      "updateTime": "2024-05-21 16:05:26"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.