:original_name: modelarts_03_0088.html
.. _modelarts_03_0088:
Querying Service Update Logs
============================
Function
--------
This API is used to query the update logs of a real-time service.
URI
---
GET /v1/{project_id}/services/{service_id}/logs
:ref:`Table 1 ` describes the required parameters.
.. _modelarts_03_0088__en-us_topic_0130234308_table10624434011:
.. table:: **Table 1** Parameters
+-------------+-----------+--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Parameter | Mandatory | Type | Description |
+=============+===========+========+===============================================================================================================================================================+
| project_id | Yes | String | Project ID. For details about how to obtain the project ID, see :ref:`Obtaining a Project ID `. |
+-------------+-----------+--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| service_id | Yes | String | Service ID |
+-------------+-----------+--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| update_time | No | Number | Update time for filtering. This parameter can be used to obtain the update logs of a real-time service. By default, the filtering by update time is disabled. |
+-------------+-----------+--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
Request Body
------------
None
Response Body
-------------
:ref:`Table 2 ` describes the response parameters.
.. _modelarts_03_0088__en-us_topic_0130234308_table1869020408516:
.. table:: **Table 2** Parameters
+--------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| Parameter | Type | Description |
+==============+===============+======================================================================================================================+
| service_id | String | Service ID |
+--------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| service_name | String | Service name |
+--------------+---------------+----------------------------------------------------------------------------------------------------------------------+
| logs | **log** array | Service update logs. For details, see :ref:`Table 3 `. |
+--------------+---------------+----------------------------------------------------------------------------------------------------------------------+
.. _modelarts_03_0088__en-us_topic_0130234308_table0745828125216:
.. table:: **Table 3** **log** parameters
+---------------+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Parameter | Type | Description |
+===============+==================+============================================================================================================================================================================================+
| update_time | Number | Time when a service is updated, in milliseconds calculated from 1970.1.1 0:0:0 UTC |
+---------------+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| result | String | Update result. The value can be **SUCCESS**, **FAIL**, or **RUNNING**. |
+---------------+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| config | **config** array | Updated service configurations. For details, see :ref:`Table 4 `. |
+---------------+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| success_num | Number | Number of nodes that are successfully operated. This parameter is returned when **infer_type** is set to **edge**. |
+---------------+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| failed_num | Number | Number of nodes that fail to be operated. This parameter is returned when **infer_type** is set to **edge**. |
+---------------+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| result_detail | **result** array | Operation result details. This parameter is returned when **infer_type** is set to **edge**. For details, see :ref:`Table 5 `. |
+---------------+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| cluster_id | String | ID of a dedicated resource pool |
+---------------+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| extend_config | List | Personalized configuration |
+---------------+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. _modelarts_03_0088__en-us_topic_0130234308_table1355535185314:
.. table:: **Table 4** **config** parameters
+-----------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+
| Parameter | Type | Description |
+=======================+=======================+=======================================================================================================================+
| model_id | String | Model ID |
+-----------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+
| model_name | String | Model name |
+-----------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+
| model_version | String | Model version |
+-----------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+
| weight | Integer | Traffic weight allocated to a model. This parameter is returned when **infer_type** is set to **real-time**. |
+-----------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+
| specification | String | Resource flavor. |
+-----------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+
| custom_spec | Object | Custom specifications. For details, see :ref:`Table 6 `. |
+-----------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+
| instance_count | Integer | Number of instances deployed in a model. |
+-----------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+
| envs | Map | Environment variable key-value pair required for running a model |
| | | |
| | | To ensure data security, do not enter sensitive information, such as plaintext passwords, in environment variables. |
+-----------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+
| cluster_id | String | ID of a dedicated resource pool |
+-----------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------+
.. _modelarts_03_0088__en-us_topic_0130234308_table44853072416:
.. table:: **Table 5** **result** parameters
+-----------+---------+----------------------------------------------------------------------------------------------------+
| Parameter | Type | Description |
+===========+=========+====================================================================================================+
| node_id | String | Node ID |
+-----------+---------+----------------------------------------------------------------------------------------------------+
| node_name | String | Node name |
+-----------+---------+----------------------------------------------------------------------------------------------------+
| operation | String | Operation type. The value can be **deploy** or **delete**. |
+-----------+---------+----------------------------------------------------------------------------------------------------+
| result | Boolean | Operation result. **true** indicates operation success, and **false** indicates operation failure. |
+-----------+---------+----------------------------------------------------------------------------------------------------+
.. _modelarts_03_0088__en-us_topic_0130234308_table134334512416:
.. table:: **Table 6** **custom_spec** parameters
========= ======= =====================
Parameter Type Description
========= ======= =====================
cpu Float Number of CPUs
memory Integer Memory capacity in MB
gpu_p4 Float Number of GPUs
========= ======= =====================
Samples
-------
The following shows how to query the update logs of the real-time service whose ID is **xxxxxx** and name is **mnist**.
- Sample request
.. code-block:: text
GET https://endpoint/v1/{project_id}/services/xxxxxx/logs
- Sample response
.. code-block::
{
"service_id": "e2122bbd-f7c8-4bf8-bacc-59616276194b",
"service_name": "service-demo",
"logs": [{
"config": [{
"model_id": "f565ac47-6239-4e8c-b2dc-0665dc52e302",
"model_name": "model-demo",
"model_version": "0.0.1",
"specification": "modelarts.vm.cpu.2u",
"custom_spec": {},
"weight": 100,
"instance_count": 1,
"scaling": false,
"envs": {},
"cluster_id": "2c9080f86d37da64016d381fe5940002"
}],
"extend_config": [],
"update_time": 1586250930708,
"result": "RUNNING",
"cluster_id": "2c9080f86d37da64016d381fe5940002"
}]
}
Status Code
-----------
For details about the status code, see :ref:`Table 1 `.
Error Codes
-----------
See :ref:`Error Codes `.