Querying the Service Lists

Function

This API is used to query the inference service lists.

URI

GET /v1/{project_id}/infer-services

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.

workspace_id

No

String

Workspace ID. The default value is 0.

Response

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Mandatory

Type

Description

is_success

Yes

Boolean

Whether the request is successful

services

Yes

List

List of the returned services. For details, see Table 3.

Table 3 services parameters

Parameter

Mandatory

Type

Description

service_id

Yes

String

Service ID

service_name

Yes

String

Service name

description

No

String

Service description

infer_type

Yes

String

Service type. The value real-time indicates the real-time service.

status

Yes

String

Service status. The value can be deploying, running, stopped, or concerning.

is_shared

Yes

Boolean

Whether a service is shared

invocation_times

Yes

String

Total service invoking times

failed_times

Yes

String

Total failed service invoking times

publish_time

Yes

Long

Time when a service is launched

update_time

Yes

Long

Time when a service is updated

Example

  • Example of a successful response
    {  
        "is_success": true,  
        "services": [
    {
       "service_id": "84746641-9af3-4fa6-b6ed-850e1f63416c",
       "service_name": "res-model-vpc2",
       "description": "test cusom image",
       "infer_type": "real-time",
       "status": "stopped",
       "is_shared": false,
       "invocation_times": "0",
       "failed_times": "0",
       "publish_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.