Querying the Image Lists

Function

This API is used to query the image lists.

URI

GET /v1/{project_id}/image?type={type}

Table 1 describes the URI parameters.

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which is used for resource isolation. For details about how to obtain the project ID, see Obtaining a Project ID.

type

Yes

String

Image type. The options are infer, rank, and nlp.

Response

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Mandatory

Type

Description

is_success

Yes

Boolean

Whether the request is successful

images

Yes

List

Returned image list. For details, see Table 3.

Table 3 images parameters

Parameter

Mandatory

Type

Description

image_id

Yes

String

Image ID

model_name

Yes

String

Image name

model_version

Yes

String

Image version

type

Yes

String

Image type

build_time

Yes

Long

Time when an image is built

update_time

Yes

Long

Time when an image is updated

Example

  • Example of a successful response
    {  
        "is_success": true,  
        "images": [
    {
       "image_id": "xxxxxx",
       "model_name": "res-default",
       "model_version": "1.0.0",
       "type": "infer",
       "build_time": 1547866687137,
       "update_time": 1547866687137
    }
    ]
    }
  • Example of a failed response
    {  
        "is_success": false,  
        "error_code": "res.2301",  
        "error_msg": "Failed to resolve the token from the request."  
    }

Status Code

For details about status codes, see Status Codes.