Help Center/ ModelArts/ API Reference/ Service Management/ Obtaining Service Update Logs
Updated on 2024-06-13 GMT+08:00

Obtaining Service Update Logs

Function

This API is used to obtain the update logs of a real-time service.

URI

GET /v1/{project_id}/services/{service_id}/logs

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

service_id

Yes

String

Service ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

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, update logs are not filtered.

Request Parameters

Table 3 Request header 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

Table 4 Response body parameters

Parameter

Type

Description

service_name

String

Service name

service_id

String

Service ID

logs

Array of Log objects

Service update records

Table 5 Log

Parameter

Type

Description

update_time

Number

Update time, in milliseconds calculated from 1970.1.1 0:0:0 UTC.

result

String

Update result. Options:

  • SUCCESS

  • FAIL

  • RUNNING

config

Array of config objects

Model running configurations

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

Array of UpdateResult objects

Operation result details. This parameter is returned when infer_type is set to edge.

cluster_id

String

ID of a dedicated resource pool

extend_config

Array of strings

Personalized configuration

Table 6 config

Parameter

Type

Description

model_id

String

Common parameters Model ID You can obtain the value by calling the API for querying the AI application list.

model_name

String

Model name

model_version

String

Model version

weight

Integer

Weight of traffic allocated to a model. This parameter is mandatory only when infer_type is set to real-time. The sum of all weights must be equal to 100. If multiple model versions are configured with different traffic weights in a real-time service, ModelArts will continuously access the prediction API of the service and forward prediction requests to the model instances of the corresponding versions based on the weights.

specification

String

Resource flavor. This parameter is returned when infer_type is set to real-time.

custom_spec

CustomSpec object

Custom resource specifications

envs

Map<String,String>

Environment variable key-value pair required for running a model

cluster_id

String

ID of a dedicated resource pool

instance_count

Integer

Number of instances where a model is deployed. This parameter is returned when infer_type is set to real-time.

Table 7 CustomSpec

Parameter

Type

Description

gpu_p4

Float

Number of GPUs, which can be a decimal. The value cannot be smaller than 0, with the third decimal place is rounded off. This parameter is optional and is not used by default.

memory

Integer

Memory in MB, which must be an integer

cpu

Float

Number of CPU cores, which can be a decimal. The value cannot be smaller than 0.01, with the third decimal place is rounded off.

ascend_a310

Integer

Number of Ascend chips. This parameter is optional and is not used by default. Either this parameter or gpu_p4 is configured.

Table 8 UpdateResult

Parameter

Type

Description

result

Boolean

Operation result. true indicates that the operation is successful, and false indicates that the operation failed.

node_name

String

Name of an edge node

operation

String

Operation. Options:

  • deploy

  • delete

node_id

String

Edge node ID You can obtain the value after creating an edge node on IEF.

Example Requests

GET https://{endpoint}/v1/{project_id}/services/{service_id}/logs

Example Responses

Status code: 200

Service update logs

{
  "service_name" : "mnist",
  "service_id" : "195c1f2d-136d-40af-a0f3-db5717d2634a",
  "logs" : [ {
    "result" : "SUCCESS",
    "update_time" : 1574770228888,
    "config" : [ {
      "model_version" : "0.0.1",
      "specification" : "modelarts.vm.cpu.2u",
      "model_name" : "minst",
      "weight" : 100,
      "model_id" : "0e07b41b-173e-42db-8c16-8e1b44cc0d44",
      "instance_count" : 1
    } ]
  } ]
}

Status Codes

Status Code

Description

200

Service update logs

Error Codes

See Error Codes.