Querying the Details About a Service
Function
This API is used to query the details about a model service based on the service ID.
URI
GET /v1/{project_id}/services/{service_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
| service_id | Yes | String | Service ID |
Request Body
None
Response Body
| Parameter | Type | Description |
|---|---|---|
| service_id | String | Service ID |
| service_name | String | Service name |
| description | String | Service description |
| tenant | String | Tenant to which a service belongs |
| project | String | Project to which a service belongs |
| owner | String | User to which a service belongs |
| publish_at | Number | Latest service release time, in milliseconds calculated from 1970.1.1 0:0:0 UTC |
| infer_type | String | Inference mode. The value can be real-time, batch, or edge. |
| workspace_id | String | Workspace ID |
| cluster_id | String | ID of the dedicated cluster used by the real-time service. This parameter is returned only when the dedicated cluster is configured. |
| vpc_id | String | ID of the VPC to which the real-time service instance belongs. This parameter is returned when the network configuration is customized. |
| subnet_network_id | String | ID of the subnet where the real-time service instance resides. This parameter is returned when the network configuration is customized. |
| security_group_id | String | Security group to which the real-time service instance belongs. This parameter is returned when the network configuration is customized. |
| status | String | Service status. The value can be running, deploying, concerning, failed, stopped, or finished. |
| progress | Integer | Deployment progress. This parameter is returned when the status is deploying. |
| error_msg | String | Error message. When status is failed, an error message carrying the failure cause is returned. |
| config | config array corresponding to infer_type | Service configuration (If a service is shared, only model_id, model_name, and model_version are returned.) |
| access_address | String | Access address of an inference request. This parameter is returned when infer_type is set to real-time. |
| bind_access_address | String | Request address of the user-defined domain name. This parameter is returned after the domain name is bound. |
| invocation_times | Number | Total number of service calls |
| failed_times | Boolean | Number of failed service calls |
| is_shared | Number | Whether a service is subscribed |
| shared_count | Number | Number of subscribed services |
| schedule | schedule array | Service scheduling configuration. If this parameter is not set, no value is returned. For details, see Table 7. |
| update_time | Number | Time when the configuration used by a service is updated, in milliseconds calculated from 1970.1.1 0:0:0 UTC |
| debug_url | String | Online debugging address of a real-time service. This parameter exists only when the model supports online debugging and there is only one instance. |
| due_time | number | Time when a real-time service automatically stops, in milliseconds calculated from 1970.1.1 0:0:0 UTC. |
| operation_time | number | Operation time of a request |
| transition_at | number | Time when the service status changes |
| is_free | Boolean | Whether a service uses the free-of-charge flavor |
| additional_properties | Map<String, Object> | Additional service attribute |
| Parameter | Type | Description |
|---|---|---|
| model_id | String | Model ID |
| model_name | String | Model name |
| model_version | String | Model version |
| source_type | String | Model source. This parameter is returned when a model is created by an ExeML project. The value is auto. |
| status | String | Model status. Possible values are as follows:
|
| weight | Integer | Traffic weight allocated to a model |
| specification | String | Resource flavor. Available flavors: modelarts.vm.cpu.2u, modelarts.vm.gpu.p4, and modelarts.vm.ai1.a310 |
| envs | Map<String, String> | (Optional) Environment variable key-value pair required for running a model |
| instance_count | Integer | Number of instances deployed in a model |
| scaling | Boolean | Whether auto scaling is enabled |
| cluster_id | String | ID of the dedicated resource pool used by a service instance. This parameter is returned only when a dedicated resource pool is configured. |
| support_debug | Boolean | Whether a model supports online debugging |
| additional_properties | Map<String, Object> | Additional model deployment attribute |
| Parameter | Type | Description |
|---|---|---|
| model_id | String | Model ID |
| model_name | String | Model name |
| model_version | String | Model version |
| specification | String | Resource flavor. Available flavors: modelarts.vm.cpu.2u and modelarts.vm.gpu.p4 |
| envs | Map<String, String> | (Optional) Environment variable key-value pair required for running a model |
| instance_count | Integer | Number of instances deployed in a model |
| src_type | String | Data source type. This parameter is returned only when ManifestFile is specified. |
| src_path | String | OBS path of the input data of a batch job |
| dest_path | String | OBS path of the output data of a batch job |
| req_uri | String | Inference path of a batch job |
| mapping_type | String | Mapping type of the input data. The value can be file or csv. |
| mapping_rule | Map | Mapping between input parameters and CSV data. This parameter is mandatory only when mapping_type is set to csv. |
| start_time | Number | Task start time, in milliseconds calculated from 1970.1.1 0:0:0 UTC. This parameter is not returned until the task starts. |
| finished_time | Number | Task finished time, in milliseconds calculated from 1970.1.1 0:0:0 UTC. This parameter is not returned until the task ends. |
| Parameter | Type | Description |
|---|---|---|
| model_id | String | Model ID |
| model_name | String | Model name |
| model_version | String | Model version |
| specification | String | Resource flavor. Available flavors: modelarts.vm.cpu.2u and modelarts.vm.gpu.p4 |
| envs | Map<String, String> | Environment variable key-value pair required for running a model |
| nodes | node array | Node information |
| Parameter | Type | Description |
|---|---|---|
| id | String | Node ID |
| name | String | Node name |
| instance_status | String | Status of a model instance on a node. The value can be running, stopped, notReady, or failed. |
| predict_url | String | Inference URL of a node |
| node_label | String | Node label |
| description | String | Description |
| host_name | String | Host name of a node |
| os_name | String | OS name |
| os_type | String | OS type |
| os_version | String | OS version |
| arch | String | Node architecture |
| cpu | Integer | Number of CPUs |
| Memory size, in MBs | Integer | Memory size, in MBs |
| gpu_num | Integer | Number of GPUs |
| enable_gpu | String | Whether to enable the GPU |
| host_ips | String array | Host IP of a node |
| deployment_num | Integer | Number of application instances deployed on a node |
| state | String | Host status. Possible values are as follows:
|
| created_at | String | Creation time, in the format of YYYY-MM-DDThh:mm:ss (UTC) |
| updated_at | String | Update time, in the format of YYYY-MM-DDThh:mm:ss (UTC) |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | Yes | String | Scheduling type. Currently, only the value stop is supported. |
| time_unit | Yes | String | Scheduling time unit. Possible values are as follows:
|
| duration | Yes | Integer | Value that maps to the time unit. For example, if the task stops after two hours, set time_unit to HOURS and duration to 2. |
Samples
The following shows how to query the details about a real-time service based on the service ID.
- Sample request
GET https://endpoint/v1/{project_id}/services/{service_id}
- Sample response
{ "service_id": "f76f20ba-78f5-44e8-893a-37c8c600c02f", "service_name": "service-demo", "tenant": "xxxxx", "project": "xxxxx", "owner": "xxxxx", "publish_at": 1585809231902, "update_time": 1585809358259, "infer_type": "real-time", "status": "running", "progress": 100, "access_address": "https://xxxxx.apigw.cn-north-7.myhuaweicloud.com/v1/infers/088458d9-5755-4110-97d8-1d21065ea10b/f76f20ba-78f5-44e8-893a-37c8c600c02f", "cluster_id": "088458d9-5755-4110-97d8-1d21065ea10b", "workspace_id": "0", "additional_properties": {}, "is_shared": false, "invocation_times": 0, "failed_times": 0, "shared_count": 0, "operation_time": 1586249085447, "config": [{ "model_id": "044ebf3d-8bf4-48df-bf40-bad0e664c1e2", "model_name": "jar-model", "model_version": "1.0.1", "specification": "custom", "custom_spec": {}, "status": "notReady", "weight": 100, "instance_count": 1, "scaling": false, "envs": {}, "additional_properties": {}, "support_debug": false }], "transition_at": 1585809231902, "is_free": false }
Status Code
For details about the status code, see Table 1.
Last Article: Querying the List of Services
Next Article: Starting or Stopping a Service Instance on an Edge Node
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.