Queries for models in an instance that meet specified criteria.
Operation description
Request description
This API retrieves a list of models from a specified instance. The instance ID is a required path parameter. You can filter the results using optional query parameters, such as model name, type, and paging parameters.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
searchengine:ListModels |
list |
*Instance
|
None | None |
Request syntax
GET /openapi/ha3/instances/{instanceId}/models HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| instanceId |
string |
Yes |
The instance ID. |
ha-cn-test |
| name |
string |
No |
The model name. |
test1 |
| type |
string |
No |
The model type. |
text_embedding |
| pageNumber |
integer |
No |
The page number. The default value is 1. |
1 |
| pageSize |
integer |
No |
The number of entries per page. The default value is 10. |
10 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response includes the request ID and a list of models. Each element in the list contains details about a model, such as its 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> |
A list of models. For more information, see Model. |
|
|
object |
The model information. |
||
| name |
string |
The model name. |
test |
| type |
string |
The model type.
|
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 |
| status |
string |
The model status.
|
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 |
| 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 time when the model was created. |
2024-05-21 16:05:26 |
| updateTime |
string |
The time when the model was last modified. |
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.