Obtaining Services
Function
This API is used to obtain model services.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET /v1/{project_id}/services
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID and Name. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
service_id |
No |
String |
Service ID. You can obtain the service ID from the response body when creating a service or obtain the services owned by the current user by calling the API for querying the service list. The service_id field indicates the service ID. By default, service IDs are not filtered. |
service_name |
No |
String |
Service name, which is specified by the user during creation. By default, the service name is not filtered. |
model_id |
No |
String |
Model ID, which can be obtained from the response body when an AI application is created. You can also obtain the AI applications owned by the current user by calling the API for querying the AI application list. The model_id field indicates the model ID. By default, model IDs are not filtered. |
workspace_id |
No |
String |
Workspace ID For details about how to obtain the value, see Querying the Workspace List. If no workspace is created, the default value is 0. If a workspace is created and used, the actual value prevails. |
infer_type |
No |
String |
Inference mode. By default, the inference mode is not filtered. Options:
|
status |
No |
String |
Service status. By default, the service status is not filtered. The options are as follows:
|
offset |
No |
Integer |
Start page for pagination display. The default value is 0. |
limit |
No |
Integer |
Maximum number of records returned on each page. Default value: 1000 |
sort_by |
No |
String |
Sorting field. Enums:
|
order |
No |
String |
Sorting order. Enums:
|
tags |
No |
String |
Tag. By default, tags are not filtered. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API that is used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total_count |
Integer |
Total number of services that meet the search criteria when no paging is performed |
count |
Integer |
Number of services in the query result. If offset and limit are not configured, the values of count and total are the same. |
services |
Array of ListServices objects |
Collection of obtained services |
Parameter |
Type |
Description |
---|---|---|
failed_times |
Long |
Number of failed service calls |
owner |
String |
User to which a service belongs |
due_time |
Number |
Time when an online service automatically stops, in milliseconds calculated from 1970.1.1 0:0:0 UTC. This parameter is not returned if automatic stop is not configured. |
finished_time |
Number |
Batch service completion time, in milliseconds calculated from 1970.1.1 0:0:0 UTC. This parameter is returned only when the service is a batch service. |
infer_type |
String |
Inference mode. Options:
|
service_name |
String |
Service name |
description |
String |
Service description. |
project |
String |
Project to which a service belongs |
invocation_times |
Long |
Total number of service calls |
publish_at |
Long |
Latest service release time, in milliseconds calculated from 1970.1.1 0:0:0 UTC. |
workspace_id |
String |
Workspace ID |
schedule |
Array of Schedule objects |
Service scheduling configuration. If this parameter is not configured, no value will be returned. |
start_time |
Number |
Batch service start time, in milliseconds calculated from 1970.1.1 0:0:0 UTC. This parameter is returned only when the service is a batch service. |
operation_time |
Number |
Operation time of a request |
is_shared |
Boolean |
Whether a service is subscribed True indicates that the service is a subscription service. |
service_id |
String |
Service ID |
progress |
Integer |
Deployment progress. This parameter is available when the status is deploying. |
shared_count |
Number |
Number of subscribed services |
tenant |
String |
Tenant to which a service belongs |
status |
String |
Service status. The options are as follows:
|
is_opened_sample_collection |
String |
Whether to enable data collection, which defaults to false |
transition_at |
Number |
Time when the service status changes |
is_free |
Boolean |
Whether a free-of-charge flavor is used |
additional_properties |
Map<String,String> |
Additional service attribute. If this parameter is not configured, no value will be returned. |
Parameter |
Type |
Description |
---|---|---|
duration |
Integer |
Value mapping a time unit. For example, if the task stops after two hours, set time_unit to HOURS and duration to 2. |
time_unit |
String |
Scheduling time unit. Possible values are DAYS, HOURS, and MINUTES. |
type |
String |
Scheduling type. Currently, the value can only be stop, indicating that the task automatically stops after a specified period of time. |
Example Requests
GET https://{endpoint}/v1/{project_id}/services
Example Responses
Status code: 200
Service list
{ "total_count" : 1, "count" : 1, "services" : [ { "failed_times" : 1, "owner" : "b575785bcece44beb23597770fb819f9", "infer_type" : "real-time", "service_name" : "mnist", "description" : "", "project" : "b575785bcece44beb23597770fb819f9", "invocation_times" : 50, "publish_at" : 1243143243, "workspace_id" : 0, "is_shared" : false, "service_id" : "195c1f2d-136d-40af-a0f3-db5717d2634a", "shared_count" : 0, "tenant" : "b575785bcece44beb23597770fb819f9", "status" : "running" } ] }
Status Codes
Status Code |
Description |
---|---|
200 |
Service list |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot