Help Center> ModelArts> API Reference> Service Management> Updating a Single Property of a Model Service
Updated on 2024-05-30 GMT+08:00

Updating a Single Property of a Model Service

Function

This API is used to update a single property of a model service. Currently, only instance_count (number of instances of the model service) is supported. This operation can be performed only for real-time services in the running, alarm, or abnormal state.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

PUT /v1/{project_id}/services/{service_id}/property

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.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

changed_property

Yes

String

Property name. Currently, only instance_count (number of instances of the model service) is supported.

configs

No

Array of UpdateServiceConfig objects

Service configurations.

Table 4 UpdateServiceConfig

Parameter

Mandatory

Type

Description

changed_value

Yes

String

Property value. The value must be an integer. If changed_property is set to instance_count, this parameter value must be greater than or less than the number of current instances.

model_id

Yes

String

Model ID.

Response Parameters

Status code: 200

Table 5 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Tracing ID.

Table 6 Response body parameters

Parameter

Type

Description

update_time

String

Update time. This parameter is returned only when the service configuration upgrade is triggered. For example, if the config parameter is modified, the update result can be filtered from the service update records based on this time. This parameter is not returned when the description is modified or the service is started or stopped.

resource_ids

String

Updated resource IDs.

Status code: 401

Table 7 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Tracing ID.

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Internal service error code.

error_msg

String

Error message.

Example Requests

Update a single property of a model service.

PUT https://{endpoint}/v1/{project_id}/services/{service_id}/property

{
  "changed_property" : "instance_count",
  "configs" : [ {
    "model_id" : "98240f41-6c69-437c-b894-9c488b1d9c43",
    "changed_value" : 2
  } ]
}

Example Responses

Status code: 200

OK

{
  "update_time" : 1712026426703
}

Status code: 401

Unauthorized

{
  "error_code" : "ModelArts.0203",
  "error_msg" : "Invalid token."
}

Status Codes

Status Code

Description

200

OK

401

Unauthorized

Error Codes

See Error Codes.