Updated on 2026-07-24 GMT+08:00

Updating Service Configurations

Function

This API is applicable to scenarios where model service configurations need to be dynamically adjusted. It is used to update and upgrade model performance parameters, resource pool configurations, and service call configurations. By calling this API, you can upgrade an existing service to a new version. Before calling this API, ensure that the service status is stopped, failed, or running, and you have the permission to modify the service. After the update is successful, the new configuration takes effect immediately. If the update fails, the service retains the original configuration and returns an error message. Common exceptions include parameter verification errors, permission verification errors, and service status errors. If the service ID is invalid, the version number does not exist, or the user does not have the permission, "400 Bad Request" or "403 Forbidden" is returned. If the service status cannot be switched, "400 Bad Request" is returned.

Debugging

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

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    modelarts:service:update

    Write

    service *

    -

    -

    -

URI

PUT /v2/{project_id}/services/{service_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

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

Constraints

N/A

Range

Project ID.

Default Value

N/A

service_id

Yes

String

Definition

Service ID, which can be obtained from the response body during service creation or by obtaining services owned by the current user. The service_id field is the service ID.

Constraints

N/A

Range

Service ID.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. For details about how to obtain the token, see Obtaining a User Token Through Password Authentication.

Constraints

N/A

Range

N/A

Default Value

N/A

Content-Type

Yes

String

Definition

Message body type or format.

Constraints

N/A

Range

  • application/json

  • application/json;charset=utf-8

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

id

No

String

Definition

Service ID

Constraints

N/A

Range

N/A

name

No

String

Definition

Service name.

Constraints

N/A

Range

The value can contain 1 to 128 characters, including letters, digits, hyphens (-), and underscores (_).

Default Value

N/A

deploy_timeout_minutes

No

Integer

Definition

Service deployment timeout, which is an integer ranging from 1 to 300. (In version 8.6.0, this parameter is reserved for compatibility.)

Constraints

N/A

Range

[0, 300]

Default Value

N/A

version

No

String

Definition

This parameter is mandatory. If the version number already exists in the database, an error is reported (except when the description is modified).

Constraints

N/A

Range

N/A

Default Value

N/A

description

No

String

Definition

This parameter is optional. In the scenario where only the description is updated, the database field of the corresponding version is modified and the version number is not added.

Constraints

N/A

Range

N/A

Default Value

N/A

group_configs

No

Array of GroupConfig objects

Definition

This parameter is not required when the service is only modified. It is compatible with the version before the deployment separation.

Constraints

The maximum number of elements in group_configs is 1.

Range

N/A

Default Value

N/A

runtime_config

No

RuntimeConfig object

Definition

Service runtime settings.

Constraints

N/A

Range

N/A

Default Value

N/A

upgrade_config

No

UpgradeConfig object

Definition

Upgrade configuration

Constraints

N/A

Range

N/A

Default Value

N/A

lts_strategy

No

String

Definition

Log policy.

Constraints

N/A

Range

  • POOL: Use the log stream configured by the resource pool log plug-in.

  • AUTO_CREATE: Automatically create a log stream.

  • DEFAULT: The system determines the log policy.

Default Value

AUTO_CREATE: Automatically create a log stream.

log_configs

No

Array of LtsConfiguration objects

Definition

Log settings. When LTS is enabled, STDOUT is mandatory.

Constraints

When LTS is enabled, STDOUT is mandatory.

The maximum number is 2.

tags

No

String

Definition

Service tag. A maximum of 20 tags are supported.

Constraints

N/A

Range

N/A

Default Value

N/A

workspace_id

No

String

Definition

Workspace ID. The default value is 0.

Constraints

N/A

Range

N/A

Default Value

N/A

schedule

No

Array of ScheduleConfig objects

Definition

Scheduled stop configuration.

Constraints

This parameter takes effect only when the description parameter in the body is empty.

custom_metrics_path

No

String

Definition

Protocol, port number, and address separated by commas (,). The address length cannot exceed 255 characters and must be the same as the protocol, address, and port number specified by the image. Otherwise, metrics cannot be reported.

task_type

No

String

Definition

Model type.

Range

  • TEXT_GENERATION

  • IMAGE_UNDERSTANDING

  • VIDEO_GENERATION

  • IMAGE_GENERATION

  • RERANK

  • VECTOR_MODEL

  • EMBEDDING

Table 4 GroupConfig

Parameter

Mandatory

Type

Description

id

No

String

Definition

Deployment ID.

Constraints

N/A

Range

N/A

Default Value

N/A

name

Yes

String

Definition

Deployment name.

Constraints

N/A

Range

N/A

Default Value

N/A

pool_id

No

String

Definition

Resource pool ID. Services in a specified resource pool are queried. By default, no resource pool is filtered. You can obtain the value by querying the resource pool list.

Constraints

N/A

Range

N/A

Default Value

N/A

count

No

Integer

Definition

Number of service instances in the deployment scenario.

Constraints

N/A

Range

[1, 128]

Default Value

N/A

system_log_dump_enable

No

Boolean

Definition

Specifies whether to enable system log dump.

Constraints

This parameter is available only for NPU resource pools.

Range

N/A

Default Value

false

unit_configs

No

Array of UnitConfig objects

Definition

Inference unit configuration.

Constraints

For single-node inference, the number of instance units is 1. For distributed inference, the number of instances can be configured based on the framework.

weight

Yes

Integer

Definition

Weight percentage of the traffic allocated to the model. This parameter is mandatory only when the model is deployed as a real-time service.

Constraints

N/A

Range

[0,100]

Default Value

N/A

secret_type

No

String

Definition

Secret type. You can select the secret type (dew or agency) to be used here.

Constraints

  1. If the temporary agency credential is used, the following constraints must be met: CCE Container Storage (Everest) v2.4.204 or later has been installed in the cluster, the cluster version is v1.28 or later, and IAM5 has been enabled at the site.

  2. If the plugin version is insufficient or the cluster does not support temporary credentials, you need to mount the credentials through DEW.

Range

  • agency: temporary agency credential.

Default Value

N/A

secret_name

No

String

Definition

Secret name. When using a DEW secret, you can select the secret to be used here.

Constraints

N/A

priority

No

Integer

Definition

Service priority.

Constraints

  • If the service is in the Running state, the priority field is mandatory, and the value must be the same as the priority value of the original service.

  • If the service is in the Stopped state, the priority field is optional.

Range

[1, 3]

Default Value

N/A

high_avail_switch

No

Boolean

Definition

Specifies whether to enable HA. Once enabled, pods of different instances are evenly distributed to different nodes. (This parameter is about to be brought offline. Use the schedule_strategy field instead.)

Constraints

N/A

Range

  • true: HA is enabled.

  • false: HA is disabled.

Default Value

true

schedule_strategy

No

String

Definition

Scheduling policy.

Constraints

N/A

Range

  • HIGH_AVAILABILITY: HA scheduling

  • HIGH_UTILIZATION: compact scheduling

  • HIGH_PERFORMANCE: high-performance scheduling

Default Value

HIGH_AVAILABILITY

version

No

String

Definition

Service version, which consists of digits and periods (.), for example, 1.0.1.

Constraints

N/A

Range

The value ranges from 1.0.0 to 99.99.99 and can contain at most eight characters.

Default Value

N/A

version_id

No

String

Definition

Version ID, which can be obtained by querying the version list.

Constraints

N/A

Range

N/A

Default Value

N/A

description

No

String

Definition

Service description.

Constraints

N/A

Range

The value can contain a maximum of 512 characters and cannot contain greater-than signs (>) or less-than signs (<).

Default Value

This parameter is left blank by default.

framework

No

String

Definition

Service framework.

Constraints

Only the following enumerated values are supported: COMMON | VLLM | MINDIE.

Range

Only the following enumerated values are supported: COMMON | VLLM | MINDIE.

Default Value

COMMON.

running_count

No

Integer

Definition

Number of service running instances in the deployment scenario.

Constraints

N/A

Range

[1, 128]

Default Value

N/A

deploy_type

No

String

Definition

Deployment type.

Range

  • SINGLE: single-node single-PU

  • MULTI: multi-node multi-PU

mirror_traffic_enable

No

Boolean

Definition

Specifies whether to enable image traffic.

Range

N/A

mirror_traffic_weight

No

String

Definition

Image traffic weight.

Range

50

version_count

No

Integer

Definition

Number of service versions.

Range

N/A

update_at

No

Long

Definition

Update time, which is automatically generated.

Range

Millisecond-level timestamp, which is a 13-digit number.

model

No

ModelResource object

Definition

Model configuration shared by all inference units. You can select a model and weight file to use with the image. This configuration takes effect for all inference units.

Constraints

N/A

advanced_config

No

AdvancedConfig object

Definition

Advanced service deployment settings.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 5 UnitConfig

Parameter

Mandatory

Type

Description

id

No

String

Definition

Instance unit ID.

Constraints

N/A

Range

N/A

Default Value

N/A

name

No

String

Definition

Role name of the instance unit.

Constraints

The value can contain a maximum of 16 characters and must meet the regular expression ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$.

Default Value

N/A

role

No

String

Definition

Instance unit role.

Constraints

N/A

Range

  • COMMON: other roles

Default Value

N/A

custom_spec

No

CustomResourceSpec object

Definition

Custom resource specifications.

Constraints

N/A

Example

"custom_spec": {

"arch": "x86",

"cpu": 0.51,

"memory": 1024.0

},

flavor

No

String

Definition

Resource specifications. Select specifications based on service requirements. When specification is set to custom, the custom specifications are used. custom_spec specifies deployment specifications.

Constraints

N/A

Range

N/A

Default Value

N/A

flavor_display_name

No

String

Definition

Display name of a resource specification.

Constraints

N/A

Range

N/A

Default Value

N/A

image

Yes

ImageInfo object

Definition

Image configuration information, including the image path and image source.

Constraints

N/A

models

No

Array of ModelResource objects

Definition

This parameter is discarded. You are advised to use files to configure models.

Model configuration. You can select a model and weight file to use with the image.

Constraints

N/A

codes

No

Array of Code objects

Definition

This parameter is discarded. You are advised to use files to configure code.

Code configuration. You can select the OBS path where the code is stored.

Constraints

N/A

files

No

Array of FileInfo objects

Definition

Model and code configuration. You can select the model and weight file to work with the image and the OBS path where the code is stored.

Constraints

N/A

dumps

No

Array of Dump objects

Definition

Dump configuration. You can select the OBS bucket where the data is to be dumped.

Constraints

A maximum of 20 groups can be configured.

count

No

Integer

Definition

Number of configuration instances.

Constraints

N/A

Range

N/A

Default Value

N/A

cmd

No

String

Definition

Startup command.

Constraints

N/A

Range

N/A

Default Value

N/A

termination_grace

No

TerminationGrace object

Definition

Graceful shutdown configuration.

Constraints

N/A

envs

No

Map<String,String>

Definition

Environment variable.

Constraints

The length of a variable key cannot exceed 64 characters. The key can only contain letters, digits, underscores (_), hyphens (-), and periods (.), and cannot start with a digit. The value cannot contain HTML tags, including <^>.

readiness_health

No

Health object

Definition

Readiness health check.

Constraints

N/A

startup_health

No

Health object

Definition

Health checks are enabled.

Constraints

N/A

liveness_health

No

Health object

Definition

Liveness health check.

Range

N/A

port

No

Integer

Definition

Port.

Constraints

N/A

Range

[1, 65535]

Default Value

N/A

recovery

No

String

Definition

Auto-rebuild policy. When enabled, the platform will automatically rebuild pods according to the policy if they restart due to deployment configuration changes or hardware failures. If disabled, the platform will not intervene.

Constraints

N/A

Range

  • Instance: Deployment replica rebuilding. Restarts the entire deployment when a fault occurs.

  • Role: Unit rebuilding. Restarts all pods within a deployment unit if any pod in that unit fails.

  • Pod: Pod rebuilding. Restarts the faulty pod if it fails.

Default Value

N/A

npu_reset_enable

No

Boolean

Definition

Specifies whether to enable the recovery policy.

Constraints

N/A

Range

  • true: The recovery policy is enabled.

  • false: The recovery policy is disabled.

Default Value

N/A

group_count

No

Integer

Definition

Number of replicas in a unit. This parameter is invalid when deploy_type is set to SINGLE or workload_type is set to DEPLOYMENT.

Constraints

N/A

Range

[1, 100] or left empty.

Default Value

1

affinity

No

Affinity object

Definition

Node affinity scheduling.

Constraints

N/A

security_config

No

ServiceSecurityConfig object

Definition

Container user ID/user group ID.

Constraints

N/A

pool_resource_flavor

No

String

Definition

Node pool resource specifications.

Constraints

The value can contain only letters, digits, periods (.), hyphens (-), and underscores (_).

Range

The value can contain a maximum of 128 characters.

Default Value

N/A

Table 6 CustomResourceSpec

Parameter

Mandatory

Type

Description

gpu

No

Float

Definition

Number of GPUs.

Constraints

N/A

Range

The value can be a decimal. It cannot be smaller than 0, with the third decimal place is rounded off.

Default Value

N/A

memory

No

Integer

Definition

Memory size, in MB.

Constraints

N/A

Range

Only integers are supported.

Default Value

N/A

cpu

No

Float

Definition

CPU cores.

Constraints

N/A

Range

The value can be a decimal. It cannot be smaller than 0.01, with the third decimal place is rounded off.

Default Value

N/A

ascend

No

Integer

Definition

Number of Ascend chips.

Constraints

N/A

Range

N/A

Default Value

N/A

arch

No

String

Definition

Architecture type.

Constraints

N/A

Range

x86/arm64.

Default Value

N/A

Table 7 ImageInfo

Parameter

Mandatory

Type

Description

id

No

String

Definition

Image ID.

Constraints

N/A

Range

N/A

Default Value

N/A

source

Yes

String

Definition

Image type, which indicates the image source.

Constraints

N/A

Range

  • SWR: SoftWare Repository for Container (SWR)

  • [IMAGE: [general image].]

Default Value

N/A

swr_path

Yes

String

Definition

Image path. The address is different when the source value is different.

Constraints

N/A

Range

N/A

Default Value

N/A

category

No

String

Definition

Flavors supported by the image.

Constraints

N/A

Range

  • GPU: graphics processing unit.

  • CPU: central processing unit.

  • ASCEND: Ascend chip.

Default Value

CPU

Table 8 ModelResource

Parameter

Mandatory

Type

Description

source

Yes

String

Definition

Code source type.

Constraints

N/A

Range

The value is case-insensitive.

  • OBS: Object Storage Service

  • OBSFS: OBS file system API

  • EFS: Scalable File Service

  • LOCAL: local storage directory to which the host machine is mounted.

Default Value

N/A

address

No

String

Definition

Code source address, which complies with the format of different storage systems.

Constraints

N/A

Range

N/A

Default Value

N/A

mount_path

Yes

String

Definition

Path mounted to the container. The value must start with a slash (/) and can contain hyphens (-), backslashes (), underscores (), periods (.), letters, and digits. Constraints N/A Range The value must start and end with a slash (/) and can contain at most 255 characters. Only letters, digits, hyphens (-), and underscores () are allowed.

Default Value

N/A

host_cache

No

Boolean

Definition

Specifies whether the model can be cached locally. This function is disabled by default.

Constraints

N/A

Range

  • true: supported.

  • false: not supported.

Default Value

false

efs_sub_path

No

String

Definition

When the storage type is EFS, subdirectories can be configured.

Constraints

N/A

Range

N/A

Default Value

N/A

read_only

No

Boolean

Definition

Specifies whether the mount permission is read-only.

Constraints

N/A

Range

  • true: read only

  • false: non-read-only

Default Value

N/A

os_warm_up

No

Boolean

Definition

OS warmup.

Constraints

N/A

Range

  • true: Warmup enabled.

  • false: Warmup disabled.

Default Value

N/A

source_name

No

String

Definition

Warmup name.

Constraints

This parameter is mandatory when os_warm_up is set to true.

Range

The value can contain at most 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

asset_id

No

String

Definition

Preset asset ID.

Constraints

This parameter is mandatory when preset assets are used.

Range

The value can contain at most 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

Table 9 Code

Parameter

Mandatory

Type

Description

source

Yes

String

Definition

Code source type.

Constraints

N/A

Range

  • OBS: Object Storage Service

  • OBSFS: OBS file system API

  • EFS: Scalable File Service

Default Value

N/A

address

No

String

Definition

Code source address, which complies with the format of different storage systems.

Constraints

N/A

Range

N/A

Default Value

N/A

source_id

No

String

Definition

Code source ID. Either this parameter or address must be specified. The SFS Turbo ID can be passed only when source is set to EFS.

Constraints

N/A

Range

N/A

Default Value

N/A

mount_path

Yes

String

Definition

Path mounted to the container.

Constraints

N/A

Range

The value must start and end with a slash (/) and can contain at most 255 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

efs_sub_path

No

String

Definition

EFS subpath.

Constraints

N/A

Range

N/A

Default Value

N/A

read_only

No

Boolean

Definition

Specifies whether the mount permission is read-only.

Constraints

N/A

Range

  • true: read only

  • false: non-read-only

Default Value

N/A

Table 10 FileInfo

Parameter

Mandatory

Type

Description

source

Yes

String

Definition

Code source type.

Constraints

N/A

Range

The value is case-insensitive.

  • OBS: Object Storage Service

  • OBSFS: OBS file system API

  • EFS: Scalable File Service

  • LOCAL: local storage directory to which the host machine is mounted.

Default Value

N/A

address

No

String

Definition

Code source address, which complies with the format of different storage systems.

Constraints

N/A

Range

N/A

Default Value

N/A

mount_path

Yes

String

Definition

Path mounted to the container.

Constraints

N/A

Range

The value must start and end with a slash (/) and can contain at most 255 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

host_cache

No

Boolean

Definition

Specifies whether the model can be cached locally. This function is disabled by default.

Constraints

N/A

Range

  • true: supported.

  • false: not supported.

Default Value

false

efs_sub_path

No

String

Definition

When the storage type is EFS, subdirectories can be configured.

Constraints

N/A

Range

N/A

Default Value

N/A

read_only

No

Boolean

Definition

Specifies whether the mount permission is read-only.

Constraints

N/A

Range

  • true: read only

  • false: non-read-only

Default Value

N/A

os_warm_up

No

Boolean

Definition

OS warmup.

Constraints

N/A

Range

  • true: Warmup enabled.

  • false: Warmup disabled.

Default Value

N/A

source_name

No

String

Definition

Warmup name.

Constraints

This parameter is mandatory when os_warm_up is set to true.

Range

The value can contain at most 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

Table 11 Dump

Parameter

Mandatory

Type

Description

source

Yes

String

Definition

Source type of the dump mount directory.

Constraints

N/A

Range

  • OBS: Object Storage Service

  • OBSFS: OBS file system API

Default Value

N/A

address

No

String

Definition

Source address of the dump mount directory. The value can be an HTTPS or OBS address.

Constraints

N/A

Range

N/A

Default Value

N/A

mount_path

Yes

String

Definition

Path mounted to the container. The value must start with a slash (/) and can contain hyphens (-), backslashes (), underscores (_), periods (.), letters, and digits.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 12 TerminationGrace

Parameter

Mandatory

Type

Description

pre_stop_cmd

No

String

Definition: The shutdown command is triggered when the container receives a stop signal, but it must be completed within the grace period or the shutdown times out. If this happens, the container will be forcefully stopped. You can use this command to perform operations such as closing database connections, releasing file handles, and stopping child processes.

Constraints

The value can contain up to 255 characters.

Range

  • Protocol: http or https

  • Port: 1 to 65535

  • Address: Only letters, digits, periods (.), hyphens (-), underscores (_), and slashes (/) are allowed. The value cannot start with a slash (/).

Default Value

N/A

termination_grace_period_seconds

No

Integer

Definition

This parameter indicates the maximum length of time that can pass between when a Pod receives a stop signal to when it is forcefully stopped. It is used for the Pod to perform cleanup operations (such as closing connections, releasing resources, and saving states).

Constraints

The value can contain up to 255 characters.

Range

  • Protocol: http or https

  • Port: 1 to 65535

  • Address: Only letters, digits, periods (.), hyphens (-), underscores (_), and slashes (/) are allowed. The value cannot start with a slash (/).

Default Value

N/A

Table 13 Health

Parameter

Mandatory

Type

Description

check_method

No

String

Definition

Health check method, which can be HTTP or EXEC (commands).

Constraints

N/A

Range

  • HTTP: Hypertext Transfer Protocol

  • EXEC: commands

Default Value

During creation, if check_method is not specified, the default value is check_method.

During update, if check_method is not specified, an error will be reported.

cmd

No

String

Definition

Command line mandatory when the health check method is EXEC.

Constraints

The value can contain 0 to 1,024 characters and cannot contain the following characters: #~^$|%&*<>()'"[]{}

Range

N/A

Default Value

N/A

url

No

String

Definition

Request address mandatory when the health check mode is HTTP.

Constraints

The value can contain 0 to 1,024 characters. The first character must be a slash (/), and the subsequent characters can be letters, digits, hyphens (-), underscores (_), slashes (/), and colons (:).

Range

N/A

Default Value

N/A

protocol

No

String

Definition

Connection protocol. The default value is HTTP.

Constraints

N/A

Range

  • HTTPS: Hypertext Transfer Protocol Secure

  • HTTP: Hypertext Transfer Protocol

  • WSS: WebSocket Secure

  • WS: WebSocket

Default Value

N/A

initial_delay_seconds

Yes

Integer

Definition

Waiting time before the first detection. The default value is 30 and the minimum value is 1.

Constraints

N/A

Range

N/A

Default Value

30

timeout_seconds

Yes

Integer

Definition

Timeout interval of the detection. The default value is 30 seconds, and the minimum value is 1 second.

Constraints

N/A

Range

The minimum value is 1 second.

Default Value

30s

period_seconds

Yes

Integer

Definition

Interval at which the health check is performed. The default value is 10 seconds, and the minimum value is 1 second.

Constraints

N/A

Range

The minimum value is 1 second.

Default Value

10s

failure_threshold

Yes

Integer

Definition

The minimum number of consecutive detection failures required after a successful detection. Detection is considered failed only when this threshold is reached. The default value is 3. The minimum value is 1.

Constraints

N/A

Range

The minimum value is 1.

Default Value

3

Table 14 Affinity

Parameter

Mandatory

Type

Description

affinity_type

Yes

String

Definition

Node affinity type.

Constraints

N/A

Range

  • AFFINITY: affinity

  • ANTI_AFFINITY: anti-affinity

Default Value

N/A

required

Yes

Boolean

Definition

Specifies whether to set strong affinity.

Constraints

N/A

Range

  • true: Strong affinity is set.

  • false: Strong affinity is not set.

Default Value

N/A

selection_mode

Yes

String

Definition

Node selection mode.

Constraints

N/A

Range

IP

Default Value

N/A

targets

Yes

Map<String,String>

Definition

List selected using the preceding method, whose length cannot exceed 20.

Constraints

N/A

Table 15 ServiceSecurityConfig

Parameter

Mandatory

Type

Description

user_id

No

Long

Definition

user_id set during service container startup. This parameter can be left empty by default.

Range

[1, 60000]

group_id

No

Long

Definition

group_id set during service container startup. This parameter can be left empty by default.

Range

[1, 60000]

Table 16 AdvancedConfig

Parameter

Mandatory

Type

Description

deploy_timeout_minutes

No

String

Definition

Deployment timeout.

upgrade_config

Yes

UpgradeConfig object

Definition

Rolling upgrade configuration.

service_secret

No

ServiceSecret object

Definition

Service secret.

dynamic_routing_enable

No

Boolean

Definition

Intelligent routing switch.

strategy

No

String

Definition

Intelligent routing policy.

ems_enable

No

Boolean

Definition

EMS acceleration switch.

metric_api_scheme

No

String

Definition

Intelligent routing metric collection scheme.

metric_api_port

No

String

Definition

Intelligent routing metric collection port.

metric_api_path

No

String

Definition

Intelligent routing metric collection URL.

custom_metrics_path

No

String

Definition

Custom metric collection URL.

port

Yes

Integer

Definition

Container port.

protocol

Yes

String

Definition

Container request protocol. When WSS or WS is selected, the service API is upgraded to WebSocket. WebSocket cannot be enabled together with Traffic Limit.

Range

  • HTTP: HTTP protocol

  • HTTPS: HTTPS protocol

  • WSS: WebSocket Secure protocol

  • WS: WebSocket protocol

  • TCP: Transmission Control Protocol

  • NA: No protocol used

Table 17 RuntimeConfig

Parameter

Mandatory

Type

Description

service_invoke

Yes

ServiceInvoke object

Definition

Service call configuration.

Constraints

N/A

service_limit

Yes

ServiceLimit object

Definition

Service constraints.

Constraints

N/A

service_secret

No

ServiceSecret object

Definition

Service secret volume mounting.

Constraints

N/A

server_task_limit

No

ServerTaskLimit object

Definition

Service task restriction information.

Table 18 ServiceInvoke

Parameter

Mandatory

Type

Description

port

Yes

Integer

Definition

Service port number.

Constraints

N/A

Range

[1, 65535]

Default Value

N/A

protocol

Yes

String

Definition

Service request protocol. When WSS or WS is selected, the service API is upgraded to WebSocket. WebSocket cannot be enabled together with Traffic Limit.

Constraints

Asynchronous services support only HTTPS and HTTP.

Range

HTTP: HTTP protocol

HTTPS: HTTPS protocol

WSS: WebSocket Secure protocol

WS: WebSocket protocol

Default Value

N/A

auth_type

Yes

String

Definition

Authentication type.

Constraints

N/A

Range

  • TOKEN: IAM token authentication.

  • API_KEY: API key authentication.

  • NONE: No authentication.

Default Value

N/A

internet_access_enable

No

Boolean

Definition

External network access.

N/A

Constraints

N/A

Range

  • TRUE: External network access is enabled.

  • FALSE: Private network approval is not required.

Default Value

N/A

intranet_approval_enable

No

Boolean

Definition

Private network approval.

Constraints

N/A

Range

  • TRUE: Private network approval is required.

  • FALSE: Private network approval is not required.

Default Value

N/A

dynamic_routing_enable

No

Boolean

Definition

Dynamic route switch.

Constraints

N/A

Range

  • TRUE: Dynamic routing is enabled.

  • FALSE: Dynamic routing is disabled.

Default Value

N/A

strategy

No

String

Definition

Intelligent routing policy.

Constraints

N/A

Range

  • ROUND_ROBIN: round robin

  • ORIGIN_IP_HASH: source IP hash

  • MIN_CONN: minimum number of connections

  • MIN_FIRST_TOKEN_TIME: minimum time to first token

  • COMPOSITE: overall loads

  • SLO_BASED: SLO priority

Default Value

N/A

metric_api_scheme

No

String

Definition

Protocol of metric API service requests.

Constraints

N/A

Range

  • HTTP: HTTP protocol

  • HTTPS: HTTPS protocol

Default Value

N/A

metric_api_port

No

String

Definition

Metric API port number.

Constraints

N/A

Range

[1, 65535]

Default Value

N/A

metric_api_path

No

String

Definition

Metric API path.

Constraints

N/A

Range

N/A

Default Value

N/A

ems_enable

No

Boolean

Definition

Specifies whether to enable EMS acceleration.

Constraints

N/A

Range

  • TRUE: EMS acceleration is enabled.

  • FALSE: EMS acceleration is disabled.

Default Value

N/A

request_retry_enable

No

Boolean

Definition

Specifies whether the proxy supports request rescheduling.

Constraints

N/A

Range

  • true: The proxy supports request rescheduling.

  • false: The proxy does not support request rescheduling.

Default Value

false

request_retry_cnt_max

No

Integer

Definition

Maximum number of retries supported by the proxy for request rescheduling.

Constraints

N/A

Range

[1, 10]

Default Value

N/A

request_retry_interval_ms

No

Integer

Definition

Retry interval supported by the proxy for request rescheduling, in milliseconds.

Constraints

N/A

Range

[1, 10000]

Default Value

N/A

fuse_configs

No

FuseConfig object

Definition

Circuit breaker configuration.

Range

N/A

Table 19 FuseConfig

Parameter

Mandatory

Type

Description

error_rate_fuse_enable

No

Boolean

Definition

Error-rate circuit breaker switch.

Constraints

N/A

Range

true: Enable error-rate circuit breaker.

false: Disable error-rate circuit breaker.

Default Value

false: Disable error-rate circuit breaker.

error_rate_threshold

No

Float

Definition

Error-rate circuit breaker threshold.

Constraints

N/A

Range

(0, 1] (The value can contain a maximum of two decimal places. The third decimal place is rounded off.)

Default Value

N/A

Table 20 ServiceLimit

Parameter

Mandatory

Type

Description

rate_limit

Yes

RateLimit object

Definition

Metrics related to traffic control.

Constraints

N/A

request_size_limit

Yes

Integer

Definition

Request size limit.

Constraints

N/A

Range

1–50M

Default Value

N/A

request_timeout

Yes

Integer

Definition

Timeout interval.

Constraints

N/A

Range

1 to 7,200 seconds

Default Value

N/A

ip_white_list

No

Array of strings

Definition

IP address whitelist.

Constraints

N/A

ip_black_list

No

Array of strings

Definition

IP address blacklist.

Constraints

N/A

Table 21 RateLimit

Parameter

Mandatory

Type

Description

num

Yes

Integer

Definition

Maximum number of times a service can be accessed within a unit.

Constraints

N/A

Range

1 to 10000

Default Value

N/A

unit

Yes

String

Definition

Traffic limiting unit.

Constraints

N/A

Range

  • SECONDS (s)

  • MINUTES (min)

Default Value

N/A

Table 22 ServiceSecret

Parameter

Mandatory

Type

Description

secret_enable

No

Boolean

Definition

Specifies whether to enable the key.

Constraints

N/A

Range

  • true: The secret is enabled.

  • false: The secret is disabled.

Default Value

false

secret_type

No

String

Definition

Secret type.

Constraints

N/A

Range

  • custom: custom secret.

  • dew: DEW secret.

Default Value

N/A

secret_volumes

No

Array of SecretVolume objects

Definition

Secret volume mounting.

Constraints

Maximum: 30

group_enable

No

Boolean

Definition

Specifies whether to enable the image user group.

Constraints

N/A

Range

  • true: The user group of the image is enabled.

  • false: The user group of the image is not enabled.

Default Value

false

group_id

No

Long

Definition

User group ID of the image.

Constraints

N/A

Range

1000 to 4294967294

Default Value

N/A

Table 23 SecretVolume

Parameter

Mandatory

Type

Description

secret_name

No

String

Definition

Key name.

Constraints

N/A

Range

N/A

Default Value

N/A

secret_key

No

String

Definition

Secret key.

Constraints

A string of 1 to 63 characters is matched. Only letters, digits, dots (.), underscores (_), and hyphens (-) are allowed. The string cannot start with two consecutive dots (..).

Range

N/A

Default Value

N/A

secret_value

No

String

Definition

Secret value.

Constraints

The value is a Base64-encoded secret value and contains 1 to 32,768 characters.

Range

N/A

Default Value

N/A

mount_path

Yes

String

Definition

Mount path.

Constraints

N/A

Range

The value must start and end with a slash (/) and can contain at most 255 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

Table 24 ServerTaskLimit

Parameter

Mandatory

Type

Description

max_task

No

Integer

Definition

Maximum number of total tasks for a single service.

Range

[0, 10000]

Table 25 UpgradeConfig

Parameter

Mandatory

Type

Description

type

No

String

Definition

Upgrade type.

Constraints

N/A

Range

  • ROLLING: rolling upgrade (default value)

Default Value

N/A

rolling_update

No

RollingUpdate object

Definition

Rolling update configuration.

Constraints

N/A

Table 26 RollingUpdate

Parameter

Mandatory

Type

Description

max_surge

No

String

Definition

Maximum number of pods that can be started during rolling update.

Constraints

A percentage-type string.

Range

1/ %to 100%

Default Value

1%.

max_unavailable

No

String

Definition

Maximum number of pods that can be deleted during rolling update.

Constraints

A percentage-type string.

Range

1/ %to 100%

Default Value

1%.

Table 27 LtsConfiguration

Parameter

Mandatory

Type

Description

status

Yes

String

Definition

Log service status.

Range

  • ON: enabled

  • OFF: disabled

type

Yes

String

Definition

LTS log type.

Constraints

N/A

Range

  • STDOUT: standard log input and output

  • EVENT: Kubernetes event

Default Value

N/A

log_group_id

No

String

Definition

Log group ID. You can select an existing log group. If this parameter is left blank, a log group is automatically created.

Constraints

N/A

Range

N/A

Default Value

N/A

log_stream_id

No

String

Definition

Log stream ID. You can select an existing log group. If this parameter is left blank, the system automatically creates one.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 28 ScheduleConfig

Parameter

Mandatory

Type

Description

duration

No

Integer

Definition

Value mapping a time unit.

Constraints

The duration, together with the time_unit, defines a time range between 1 minute and 7 days.

Range

N/A

Default Value

N/A

time_unit

No

String

Definition

Time unit.

Constraints

The time_unit, together with the duration, defines a time range between 1 minute and 7 days.

Range

  • MINUTES (min)

  • HOURS (hour)

  • DAYS (day)

Default Value

N/A

type

No

String

Definition

Scheduling type. Only the value STOP is supported.

Constraints

N/A

Range

  • STOP

Default Value

N/A

Response Parameters

Status code: 200

Table 29 Response body parameters

Parameter

Type

Description

id

String

Definition

Service ID, which can be obtained from the response body during service creation or by obtaining services owned by the current user. The service_id field is the service ID.

Range

N/A

name

String

Definition

Service name, which is customized when you create a service.

Range

The value can contain at most 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

workspace_id

String

Definition

Workspace ID.

Range

  • 0: default workspace ID.

  • 32 characters consisting of digits and lowercase letters. For details about other space IDs, see Creating a Workspace.

type

String

Definition

Inference service type.

Range

  • REAL_TIME: real-time service

  • ASYNC_REAL_TIME: asynchronous service

deploy_type

String

Definition

Deployment mode.

Range

  • SINGLE: single-node single-PU

  • MULTI: multi-node multi-PU

status

String

Definition

Service status.

Range

  • DEPLOYING

  • FAILED

  • STOPPED

  • RUNNING

  • DELETING

  • STOPPING

  • CONCERNING: There is an alarm.

  • UPGRADING

  • ERROR: abnormal

  • INIT: to be deployed

failure_reason

String

Definition

Reason why the real-time service fails.

Range

N/A

version

ServiceVersionResponse object

Definition

Current service version.

predict_url

Array of PredictUrlResponse objects

Definition

Access address of the real-time service. No value is returned by the service creation API. The value is returned by the details API.

dispatcher_group_id

String

Definition

ID of the dispatcher group associated with the service. No value is returned by the service creation API. The value is returned by the details API.

Range

N/A

tags

Array of TagsResponse objects

Definition

TMS tags.

deploy_timeout_minutes

Integer

Definition

Deployment timeout.

schedule

Array of ScheduleConfigResponse objects

Definition

Scheduled stop configuration.

create_at

String

Definition

Creation time, which is automatically generated.

Range

Millisecond-level timestamp, which is a 13-digit number, for example, 1609459200000.

update_at

String

Definition

Update time, which is automatically generated.

Range

Millisecond-level timestamp, which is a 13-digit number, for example, 1609459200000.

task_type

String

Definition

Model type.

Range

  • TEXT_GENERATION

  • IMAGE_UNDERSTANDING

  • VIDEO_GENERATION

  • IMAGE_GENERATION

  • RERANK

  • VECTOR_MODEL

  • EMBEDDING

provider

String

Definition

Account ID of the service provider, which can be obtained by parsing the IAM token from the X-Auth-Token-Provider request header during service creation. If this parameter is not left blank, you need to add X-Auth-Token-Provider to the request header for all update operations on the service. In this case, the value is domain-level or project-level token of the account ID.

frozen_infos

Array of FrozenInfo objects

Definition

Freezing type returned when a service or deployment is frozen.

Table 30 ServiceVersionResponse

Parameter

Type

Description

id

String

Definition

Version ID.

Range

N/A

version

String

Definition

Version number.

Range

N/A

description

String

Definition

Description.

Range

N/A

predict_url

String

Definition

Inference request URL.

Range

N/A

runtime_config

RuntimeConfigResponse object

Definition

Service runtime settings.

upgrade_config

UpgradeConfigResponse object

Definition

Service upgrade settings.

instance_groups

Array of GroupConfigResponse objects

Definition

Service deployment information.

lts_strategy

String

Definition

Log policy.

Range

  • POOL: Use the log stream configured by the resource pool log plug-in.

  • AUTO_CREATE: Automatically create a log stream.

  • DEFAULT: The system determines the log policy.

lts_status

String

Definition

Status of the interconnection between the deployment and LTS.

Range

  • ON: enabled

  • OFF: disabled

lts_event_status

String

Definition

Status of the interconnection between the deployment and LTS Kubernetes events.

Range

  • ON: enabled

  • OFF: disabled

log_configs

Array of LogConfigResponse objects

Definition

Service log configuration information.

deploy_timeout_minutes

Integer

Definition

Deployment timeout.

Range

N/A

Table 31 RuntimeConfigResponse

Parameter

Type

Description

service_invoke

ServiceInvokeResponse object

Definition

Service call configuration.

service_limit

ServiceLimitResponse object

Definition

Service constraints.

Constraints

N/A

service_secret

ServiceSecretResponse object

Definition

Service secret volume mounting.

server_task_limit

ServerTaskLimit object

Definition

Service task restriction information.

Table 32 ServiceInvokeResponse

Parameter

Type

Description

port

Integer

Definition

Service port number.

Range

[1, 65535]

protocol

String

Definition

Service request protocol. When WSS or WS is selected, the service API is upgraded to WebSocket. WebSocket cannot be enabled together with Traffic Limit.

Range

  • HTTP: HTTP protocol

  • HTTPS: HTTPS protocol

  • WSS: WebSocket Secure protocol

  • WS: WebSocket protocol

auth_type

String

Definition

Authentication type.

Range

  • TOKEN: IAM token authentication.

  • API_KEY: API key authentication.

  • NONE: No authentication.

internet_access_enable

Boolean

Definition

External network access.

Range

  • TRUE: External network access is enabled.

  • FALSE: External network access is disabled.

intranet_approval_enable

Boolean

Definition

Private network approval.

Range

  • TRUE: Private network approval is required.

  • FALSE: Private network approval is disabled.

dynamic_routing_enable

Boolean

Definition

Dynamic route switch.

Range

  • TRUE: Dynamic routing is enabled.

  • FALSE: Dynamic routing is disabled.

strategy

String

Definition

Intelligent routing policy.

Range

  • ROUND_ROBIN: round robin

  • ORIGIN_IP_HASH: source IP hash

  • MIN_CONN: minimum number of connections

  • MIN_FIRST_TOKEN_TIME: minimum time to first token

  • COMPOSITE: overall loads

  • SLO_BASED: SLO priority

metric_api_scheme

String

Definition

Protocol of metric API service requests.

Range

  • HTTP: HTTP protocol

  • HTTPS: HTTPS protocol

metric_api_port

String

Definition

Metric API port number.

Range

[1, 65535]

metric_api_path

String

Definition

Metric API path.

Range

N/A

ems_enable

Boolean

Definition

Specifies whether to enable EMS acceleration.

Range

  • TRUE: EMS acceleration is enabled.

  • FALSE: EMS acceleration is disabled.

request_retry_enable

Boolean

Definition

Specifies whether the proxy supports request rescheduling.

Range

  • true: The proxy supports request rescheduling.

  • false: The proxy does not support request rescheduling.

request_retry_cnt_max

Integer

Definition

Maximum number of retries supported by the proxy for request rescheduling.

Range

[1, 10]

request_retry_interval_ms

Integer

Definition

Retry interval supported by the proxy for request rescheduling, in milliseconds.

Range

[1, 10000]

fuse_configs

FuseConfig object

Definition

Circuit breaker configuration.

Range

N/A

Table 33 FuseConfig

Parameter

Type

Description

error_rate_fuse_enable

Boolean

Definition

Error-rate circuit breaker switch.

Constraints

N/A

Range

true: Enable error-rate circuit breaker.

false: Disable error-rate circuit breaker.

Default Value

false: Disable error-rate circuit breaker.

error_rate_threshold

Float

Definition

Error-rate circuit breaker threshold.

Constraints

N/A

Range

(0, 1] (The value can contain a maximum of two decimal places. The third decimal place is rounded off.)

Default Value

N/A

Table 34 ServiceLimitResponse

Parameter

Type

Description

rate_limit

RateLimitResponse object

Definition

Metrics related to traffic control.

request_size_limit

Integer

Definition

Request size limit.

Range

1–50M

request_timeout

Integer

Definition

Timeout interval.

Range

1 to 7,200 seconds

ip_white_list

Array of strings

Definition

IP address whitelist.

ip_black_list

Array of strings

Definition

IP address blacklist.

Table 35 RateLimitResponse

Parameter

Type

Description

num

Integer

Definition

Maximum number of times a service can be accessed within a unit.

Range

1 to 10000

unit

String

Definition

Traffic limiting unit.

Range

  • NANOS (nanosecond)

  • MICROS (microsecond)

  • MILLIS (millisecond)

  • SECONDS (s)

  • MINUTES (min)

  • HOURS (hour)

  • DAYS (day)

Table 36 ServiceSecretResponse

Parameter

Type

Description

secret_enable

Boolean

Definition

Specifies whether to enable the key.

Range

  • true: The secret is enabled.

  • false: The secret is disabled.

secret_type

String

Definition

Secret type.

Range

  • custom: custom secret.

  • [dew: DEW secret.] (tag:hws,hws_hk,fcs)

secret_volumes

Array of SecretVolumeResponse objects

Definition

Secret volume mounting.

Constraints

Maximum: 30

group_enable

Boolean

Definition

Specifies whether to enable the image user group.

Range

  • true: The user group of the image is enabled.

  • false: The user group of the image is not enabled.

group_id

Long

Definition

User group ID of the image.

Range

1000 to 4294967294

Table 37 SecretVolumeResponse

Parameter

Type

Description

secret_name

String

Definition

Key name.

Range

N/A

secret_key

String

Definition

Secret key.

Range

The value contains up to 63 characters.

secret_value

String

Definition

Secret value.

Range

The value contains up to 32,768 characters.

mount_path

String

Definition

Mount path.

Range

N/A

Table 38 ServerTaskLimit

Parameter

Type

Description

max_task

Integer

Definition

Maximum number of total tasks for a single service.

Range

[0, 10000]

Table 39 UpgradeConfigResponse

Parameter

Type

Description

type

String

Definition

Upgrade type.

Range

  • ROLLING: rolling upgrade (default value)

rolling_update

RollingUpdateResponse object

Definition

Rolling update configuration.

Table 40 RollingUpdateResponse

Parameter

Type

Description

max_surge

String

Definition

Maximum number of pods that can be started during rolling update.

Range

N/A

max_unavailable

String

Definition

Maximum number of pods that can be deleted during rolling update.

Range

N/A

Table 41 GroupConfigResponse

Parameter

Type

Description

id

String

Definition

Deployment ID.

Range

N/A

name

String

Definition

Deployment name.

Range

N/A

pool_id

String

Definition

Resource pool ID. Services in a specified resource pool are queried. By default, no resource pool is filtered. You can obtain the value by querying the resource pool list.

Range

N/A

count

Integer

Definition

Number of service instances in the deployment scenario.

Constraints

N/A

Range

[1, 128]

Default Value

N/A

system_log_dump_enable

Boolean

Definition

Specifies whether to enable system log dump.

Constraints

This parameter is available only for NPU resource pools.

Range

N/A

Default Value

false

unit_configs

Array of UnitConfigResponse objects

Definition

Inference unit configuration.

weight

Integer

Definition

Weight percentage of the traffic allocated to the model. This parameter is mandatory only when the model is deployed as a real-time service.

Range

[0,100]

traffic_ratio

String

Definition

Traffic ratio, that is, the ratio of the expected user traffic to the total traffic of a single deployment instance. The value is calculated based on the traffic weight configuration and deployment status.

Range

0.00/ %to 100.00%

secret_type

String

Definition

Secret type. You can select the secret type (dew or agency) to be used here.

Constraints

N/A

Range

  • [dew: DEW secret.] (tag:hws,hws_hk,fcs)

  • agency: temporary agency credential.

Default Value

N/A

secret_name

String

Definition

Secret name. When using a DEW secret, you can select the secret to be used here.

Constraints

N/A

priority

Integer

Definition

Service priority.

Constraints

N/A

Range

[1, 3]

Default Value

N/A

high_avail_switch

Boolean

Definition

Specifies whether to enable HA. Once enabled, pods of different instances are evenly distributed to different nodes. (This parameter is about to be brought offline. Use the schedule_strategy field instead.)

Range

  • true: Enable HA.

  • false: Disable HA.

framework

String

Definition

Algorithm framework.

Range

  • COMMON: common real-time service.

version

String

Definition

Service version, which consists of digits and periods (.), for example, 1.0.1.

Constraints

N/A

Range

The value ranges from 1.0.0 to 99.99.99 and can contain at most eight characters.

Default Value

N/A

version_id

String

Definition

Version ID, which can be obtained by querying the version list.

Constraints

N/A

Range

N/A

Default Value

N/A

status

String

Definition

Service status.

Range

  • DEPLOYING

  • FAILED

  • STOPPED

  • RUNNING

  • DELETING

  • STOPPING

  • CONCERNING: There is an alarm.

  • DELETED

  • RESTARTING

  • UPGRADING

  • ERROR: abnormal

  • INTERRUPTING

running_count

Integer

Definition

Number of service running instances in the deployment scenario.

Constraints

N/A

Range

[1, 128]

Default Value

N/A

deploy_type

String

Definition

Deployment type.

Range

  • SINGLE: single-node single-PU

  • MULTI: multi-node multi-PU

mirror_traffic_enable

Boolean

Definition

Specifies whether to enable image traffic.

Range

N/A

mirror_traffic_weight

String

Definition

Image traffic weight.

Range

50.

version_count

Integer

Definition

Number of service versions.

Range

N/A

workload_type

String

Definition

Workload type.

Range

N/A

update_at

Long

Definition

Update time, which is automatically generated.

Range

Millisecond-level timestamp, which is a 13-digit number.

lts_state

String

Definition

Status of the interconnection between the deployment and LTS.

Range

  • ON: enabled

  • OFF: disabled

infer_name

String

Definition

Deployment ID.

model

InferModelResponse object

Definition

Model configuration. You can select a model and weight file to use with the image.

Constraints

N/A

advanced_config

AdvancedConfig object

Definition

Advanced deployment settings.

Constraints

N/A

description

String

Definition

Deployment description.

create_at

String

Definition

Creation time, which is automatically generated.

Range

Millisecond-level timestamp, which is a 13-digit number, for example, 1609459200000.

schedule_strategy

String

Definition

Scheduling policy.

Range

  • HIGH_AVAILABILITY: HA scheduling

  • HIGH_UTILIZATION: compact scheduling

  • HIGH_PERFORMANCE: high-performance scheduling

Table 42 UnitConfigResponse

Parameter

Type

Description

id

String

Definition

Instance unit ID.

Range

N/A

name

String

Definition

Instance unit name.

Range

N/A

role

String

Definition

Instance unit role.

Range

  • COMMON: other roles

custom_spec

CustomResourceSpec object

Definition

Custom resource specifications.

flavor

String

Definition

Resource specifications. Select specifications based on service requirements. When specification is set to custom, the custom specifications are used. custom_spec specifies deployment specifications.

Range

N/A

image

ImageInfoResponse object

Definition

Image configuration information, including the image path and image source.

models

Array of InferModelResponse objects

Definition

Model configuration. You can select a model and weight file to use with the image.

files

Array of FileResponse objects

Definition

Model and code configuration. You can select the model and weight file to work with the image and the OBS path where the code is stored.

codes

Array of CodeResponse objects

Definition

Code configuration. You can select the OBS path where the code is stored.

dumps

Array of DumpResponse objects

Definition

Dump configuration. You can select the OBS path where the data is to be dumped.

count

Integer

Definition

Number of configuration instances.

Range

N/A

group_count

Integer

Definition

Number of replicas in a unit. This parameter is invalid when deploy_type is set to SINGLE or workload_type is set to DEPLOYMENT.

Range

[1, 100] or left empty.

Default Value

1

cmd

String

Definition

Startup command.

Range

N/A

envs

Map<String,String>

Definition

Environment variable.

readiness_health

HealthResponse object

Definition

Readiness health check.

startup_health

HealthResponse object

Definition

Health checks are enabled.

liveness_health

HealthResponse object

Definition

Liveness health check.

port

Integer

Definition

Port.

Range

[1, 65535]

recovery

String

Definition

Auto-rebuild policy. When enabled, the platform will automatically rebuild pods according to the policy if they restart due to deployment configuration changes or hardware failures. If disabled, the platform will not intervene.

Range

  • Instance: Deployment replica rebuilding. Restarts the entire deployment when a fault occurs.

  • Role: Unit rebuilding. Restarts all pods within a deployment unit if any pod in that unit fails.

  • Pod: Pod rebuilding. Restarts the faulty pod if it fails.

npu_reset_enable

Boolean

Definition

Specifies whether to enable the recovery policy.

Range

  • true: The recovery policy is enabled.

  • false: The recovery policy is disabled.

affinity

AffinityResponse object

Definition

Node affinity scheduling.

flavor_display_name

String

Definition

Specification display name. This field is returned only for services deployed using the allocated specifications.

Range

N/A

termination_grace

TerminationGrace object

Definition

Once enabled, you can configure shutdown timeouts and commands. This prevents in-progress requests from being forcibly interrupted, thereby enhancing the availability and stability of the system.

Constraints

The value can contain up to 255 characters.

Range

  • Protocol: http or https

  • Port: 1 to 65535

  • Address: Only letters, digits, periods (.), hyphens (-), underscores (_), and slashes (/) are allowed. The value cannot start with a slash (/).

Default Value

N/A

security_config

ServiceSecurityConfig object

Definition

Settings for starting the service container.

Range

N/A

pool_resource_flavor

String

Definition

Node pool resource specifications.

Constraints

The value can contain only letters, digits, periods (.), hyphens (-), and underscores (_).

Range

The value can contain a maximum of 128 characters.

Default Value

N/A

Table 43 CustomResourceSpec

Parameter

Type

Description

gpu

Float

Definition

Number of GPUs.

Constraints

N/A

Range

The value can be a decimal. It cannot be smaller than 0, with the third decimal place is rounded off.

Default Value

N/A

memory

Integer

Definition

Memory size, in MB.

Constraints

N/A

Range

Only integers are supported.

Default Value

N/A

cpu

Float

Definition

CPU cores.

Constraints

N/A

Range

The value can be a decimal. It cannot be smaller than 0.01, with the third decimal place is rounded off.

Default Value

N/A

ascend

Integer

Definition

Number of Ascend chips.

Constraints

N/A

Range

N/A

Default Value

N/A

arch

String

Definition

Architecture type.

Constraints

N/A

Range

x86/arm64.

Default Value

N/A

Table 44 ImageInfoResponse

Parameter

Type

Description

id

String

Definition

Image ID.

Range

N/A

source

String

Definition

Image type, which indicates the image source.

Range

  • SWR: SoftWare Repository for Container (SWR)

swr_path

String

Definition

Image path. The address is different when the source value is different.

Range

N/A

category

String

Definition

Flavors supported by the image.

Range

  • GPU: graphics processing unit.

  • CPU: central processing unit.

  • ASCEND: Ascend chip.

Table 45 InferModelResponse

Parameter

Type

Description

source

String

Definition

Code source type.

Constraints

N/A

Range

The value is case-insensitive.

  • OBS: Object Storage Service

  • OBSFS: OBS file system API

  • EFS: Scalable File Service

  • LOCAL: local storage directory to which the host machine is mounted.

Default Value

N/A

address

String

Definition

Code source address, which complies with the format of different storage systems.

Constraints

N/A

Range

N/A

Default Value

N/A

source_id

String

Definition

Source ID.

Constraints

N/A

Range

N/A

Default Value

N/A

mount_path

String

Definition

Path mounted to the container. The value must start with a slash (/) and can contain hyphens (-), backslashes (), underscores (), periods (.), letters, and digits. Constraints N/A Range The value must start and end with a slash (/) and can contain at most 255 characters. Only letters, digits, hyphens (-), and underscores () are allowed.

Default Value

N/A

host_cache

Boolean

Definition

Specifies whether the model can be cached locally. This function is disabled by default.

Constraints

N/A

Range

  • true: supported.

  • false: not supported.

Default Value

false

efs_sub_path

String

Definition

When the storage type is EFS, subdirectories can be configured.

Constraints

N/A

Range

N/A

Default Value

N/A

read_only

Boolean

Definition

Specifies whether the mount permission is read-only.

Constraints

N/A

Range

  • true: read only

  • false: non-read-only

Default Value

N/A

os_warm_up

Boolean

Definition

OS warmup.

Constraints

N/A

Range

  • true: Warmup enabled.

  • false: Warmup disabled.

Default Value

N/A

source_name

String

Definition

Warmup name.

Constraints

This parameter is mandatory when os_warm_up is set to true.

Range

The value can contain at most 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

asset_id

String

Definition

Preset asset ID.

Constraints

This parameter is mandatory when preset assets are used.

Range

The value can contain at most 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

Table 46 FileResponse

Parameter

Type

Description

source

String

Definition

Code source type.

Range

  • OBS: Object Storage Service

  • OBSFS: OBS file system API

  • EFS: Scalable File Service

  • LOCAL: local storage directory to which the host machine is mounted.

address

String

Definition

Code source address, which complies with the format of different storage systems.

Range

N/A

mount_path

String

Definition

Path mounted to the container.

Constraints

N/A

Range

The value must start and end with a slash (/) and can contain at most 255 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

host_cache

Boolean

Definition

Specifies whether the model can be cached locally. This function is disabled by default.

Range

  • true: supported.

  • false: not supported.

efs_sub_path

String

Definition

When the storage type is EFS, subdirectories can be configured.

Range

N/A

read_only

Boolean

Definition

Specifies whether the mount permission is read-only.

Range

  • true: read only

  • false: non-read-only

os_warm_up

Boolean

Definition

OS warmup.

Range

  • true: Warmup enabled.

  • false: Warmup disabled.

source_name

String

Definition

Warmup name.

Constraints

This parameter is mandatory when os_warm_up is set to true.

Range

The value can contain at most 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

Table 47 CodeResponse

Parameter

Type

Description

source

String

Definition

Code source type.

Range

  • OBS: Object Storage Service

  • OBSFS: OBS file system API

  • EFS: Scalable File Service

address

String

Definition

Code source address, which complies with the format of different storage systems.

Range

N/A

source_id

String

Definition

Code source ID. Either this parameter or address must be specified. The SFS Turbo ID can be passed only when source is set to EFS.

Range

N/A

mount_path

String

Definition

Path mounted to the container.

Constraints

N/A

Range

The value must start and end with a slash (/) and can contain at most 255 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

efs_sub_path

String

Definition

EFS subpath.

Range

N/A

read_only

Boolean

Definition

Specifies whether the mount permission is read-only.

Range

  • true: read only

  • false: non-read-only

Table 48 DumpResponse

Parameter

Type

Description

source

String

Definition

Dump source type.

Range

  • OBS: Object Storage Service

  • OBSFS: OBS file system API

address

String

Definition

Dump source address, which complies with the format of different storage systems.

Range

N/A

mount_path

String

Definition

Path mounted to the container. The value must start with a slash (/) and can contain hyphens (-), backslashes (), underscores (_), periods (.), letters, and digits.

Range

N/A

type

String

Definition

Transfer type.

Range

  • DUMP: user-defined dump

  • DUMP_SYS: system dump

Table 49 HealthResponse

Parameter

Type

Description

check_method

String

Definition

Health check method, which can be HTTP or EXEC (commands).

Constraints

N/A

Range

  • HTTP: Hypertext Transfer Protocol

  • EXEC: commands

Default Value

N/A

cmd

String

Definition

Command line when the health check method is EXEC.

Constraints

The value can contain 0 to 1,024 characters and cannot contain the following characters: #~^$|%&*<>()'"[]{}

Range

N/A

Default Value

N/A

url

String

Definition

Request address when the health check mode is HTTP.

Constraints

The value can contain 0 to 1,024 characters. The first character must be a slash (/), and the subsequent characters can be letters, digits, hyphens (-), underscores (_), slashes (/), and colons (:).

Range

N/A

Default Value

N/A

protocol

String

Definition

Connection protocol. The default value is HTTP.

Constraints

N/A

Range

  • HTTPS: Hypertext Transfer Protocol Secure

  • HTTP: Hypertext Transfer Protocol

  • WSS: WebSocket Secure

  • WS: WebSocket

Default Value

N/A

initial_delay_seconds

Integer

Definition

Waiting time before the first detection. The default value is 30 and the minimum value is 1.

Constraints

N/A

Range

N/A

Default Value

30

timeout_seconds

Integer

Definition

Timeout interval of the detection. The default value is 30 seconds, and the minimum value is 1 second.

Constraints

N/A

Range

The minimum value is 1 second.

Default Value

30s

period_seconds

Integer

Definition

Interval at which the health check is performed. The default value is 10 seconds, and the minimum value is 1 second.

Constraints

N/A

Range

The minimum value is 1 second.

Default Value

10s

failure_threshold

Integer

Definition

The minimum number of consecutive detection failures required after a successful detection. Detection is considered failed only when this threshold is reached. The default value is 3. The minimum value is 1.

Constraints

N/A

Range

The minimum value is 1.

Default Value

3

Table 50 AffinityResponse

Parameter

Type

Description

affinity_type

String

Definition

Node affinity type.

Range

  • AFFINITY: affinity

  • ANTI_AFFINITY: anti-affinity

required

Boolean

Definition

Specifies whether to set strong affinity.

Range

  • true: Strong affinity is set.

  • false: Strong affinity is not set.

selection_mode

String

Definition

Node selection mode.

Range

IP.

targets

Map<String,String>

Definition

List selected using the preceding method, whose length cannot exceed 20.

Table 51 TerminationGrace

Parameter

Type

Description

pre_stop_cmd

String

Definition: The shutdown command is triggered when the container receives a stop signal, but it must be completed within the grace period or the shutdown times out. If this happens, the container will be forcefully stopped. You can use this command to perform operations such as closing database connections, releasing file handles, and stopping child processes.

Constraints

The value can contain up to 255 characters.

Range

  • Protocol: http or https

  • Port: 1 to 65535

  • Address: Only letters, digits, periods (.), hyphens (-), underscores (_), and slashes (/) are allowed. The value cannot start with a slash (/).

Default Value

N/A

termination_grace_period_seconds

Integer

Definition

This parameter indicates the maximum length of time that can pass between when a Pod receives a stop signal to when it is forcefully stopped. It is used for the Pod to perform cleanup operations (such as closing connections, releasing resources, and saving states).

Constraints

The value can contain up to 255 characters.

Range

  • Protocol: http or https

  • Port: 1 to 65535

  • Address: Only letters, digits, periods (.), hyphens (-), underscores (_), and slashes (/) are allowed. The value cannot start with a slash (/).

Default Value

N/A

Table 52 ServiceSecurityConfig

Parameter

Type

Description

user_id

Long

Definition

user_id set during service container startup. This parameter can be left empty by default.

Range

[1, 60000]

group_id

Long

Definition

group_id set during service container startup. This parameter can be left empty by default.

Range

[1, 60000]

Table 53 AdvancedConfig

Parameter

Type

Description

deploy_timeout_minutes

String

Definition

Deployment timeout.

upgrade_config

UpgradeConfig object

Definition

Rolling upgrade configuration.

service_secret

ServiceSecret object

Definition

Service secret.

dynamic_routing_enable

Boolean

Definition

Intelligent routing switch.

strategy

String

Definition

Intelligent routing policy.

ems_enable

Boolean

Definition

EMS acceleration switch.

metric_api_scheme

String

Definition

Intelligent routing metric collection scheme.

metric_api_port

String

Definition

Intelligent routing metric collection port.

metric_api_path

String

Definition

Intelligent routing metric collection URL.

custom_metrics_path

String

Definition

Custom metric collection URL.

port

Integer

Definition

Container port.

protocol

String

Definition

Container request protocol. When WSS or WS is selected, the service API is upgraded to WebSocket. WebSocket cannot be enabled together with Traffic Limit.

Range

  • HTTP: HTTP protocol

  • HTTPS: HTTPS protocol

  • WSS: WebSocket Secure protocol

  • WS: WebSocket protocol

  • TCP: Transmission Control Protocol

  • NA: No protocol used

Table 54 UpgradeConfig

Parameter

Type

Description

type

String

Definition

Upgrade type.

Constraints

N/A

Range

  • ROLLING: rolling upgrade (default value)

Default Value

N/A

rolling_update

RollingUpdate object

Definition

Rolling update configuration.

Constraints

N/A

Table 55 RollingUpdate

Parameter

Type

Description

max_surge

String

Definition

Maximum number of pods that can be started during rolling update.

Constraints

A percentage-type string.

Range

1/ %to 100%

Default Value

1%.

max_unavailable

String

Definition

Maximum number of pods that can be deleted during rolling update.

Constraints

A percentage-type string.

Range

1/ %to 100%

Default Value

1%.

Table 56 ServiceSecret

Parameter

Type

Description

secret_enable

Boolean

Definition

Specifies whether to enable the key.

Constraints

N/A

Range

  • true: The secret is enabled.

  • false: The secret is disabled.

Default Value

false

secret_type

String

Definition

Secret type.

Constraints

N/A

Range

  • custom: custom secret.

  • dew: DEW secret.

Default Value

N/A

secret_volumes

Array of SecretVolume objects

Definition

Secret volume mounting.

Constraints

Maximum: 30

group_enable

Boolean

Definition

Specifies whether to enable the image user group.

Constraints

N/A

Range

  • true: The user group of the image is enabled.

  • false: The user group of the image is not enabled.

Default Value

false

group_id

Long

Definition

User group ID of the image.

Constraints

N/A

Range

1000 to 4294967294

Default Value

N/A

Table 57 SecretVolume

Parameter

Type

Description

secret_name

String

Definition

Key name.

Constraints

N/A

Range

N/A

Default Value

N/A

secret_key

String

Definition

Secret key.

Constraints

A string of 1 to 63 characters is matched. Only letters, digits, dots (.), underscores (_), and hyphens (-) are allowed. The string cannot start with two consecutive dots (..).

Range

N/A

Default Value

N/A

secret_value

String

Definition

Secret value.

Constraints

The value is a Base64-encoded secret value and contains 1 to 32,768 characters.

Range

N/A

Default Value

N/A

mount_path

String

Definition

Mount path.

Constraints

N/A

Range

The value must start and end with a slash (/) and can contain at most 255 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

Table 58 LogConfigResponse

Parameter

Type

Description

type

String

Definition

Log output type.

Range

  • STDOUT: Logs are output to the console or terminal.

  • EVENT: Kubernetes event.

status

String

Definition

Log service status.

Range

  • ON: enabled

  • OFF: disabled

log_group_id

String

Definition

Log group ID. You can select an existing log group. If this parameter is left blank, a log group is automatically created.

Constraints

N/A

Range

N/A

Default Value

N/A

log_stream_id

String

Definition

Log stream ID. You can select an existing log group. If this parameter is left blank, the system automatically creates one.

Constraints

N/A

Range

N/A

Default Value

N/A

deployment_id

String

Definition

ID of the deployment corresponding to the log stream. This parameter has a value when the log policy is default or pool.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 59 PredictUrlResponse

Parameter

Type

Description

type

String

Definition

Access mode.

Range

  • CONSOLE: Access through the console.

  • PUBLIC: Access through the public network.

  • INTERNAL: Access through the private network.

urls

Array of strings

Definition

Access address of an inference request. This parameter is only valid when type is set to REAL_TIME and the service is deployed.

Table 60 TagsResponse

Parameter

Type

Description

key

String

Definition

Tag key field.

Constraints

N/A

Range

The value can contain 1 to 128 characters. Only letters, digits, spaces, and special characters (_.:=+-@) are allowed. However, the value cannot start or end with a space or start with sys.

Default Value

N/A

value

String

Definition

Tag value field.

Range

The value can contain 255 characters. Only letters, digits, underscores (_), periods (.), slashes (/), equal signs (=), plus signs (+), minus signs (-), and at signs (@) are allowed.

Table 61 ScheduleConfigResponse

Parameter

Type

Description

due_time

Long

Definition

Trigger time. The value is a 13-digit timestamp, UTC time, in milliseconds.

Range

N/A

duration

Integer

Definition

Value mapping a time unit.

Range

N/A

time_unit

String

Definition

Scheduling time unit.

Range

  • MINUTES (min)

  • HOURS (hour)

  • DAYS (day)

type

String

Definition

Scheduling type. Only the value STOP is supported.

Range

  • STOP

processed

Boolean

Definition

Indicates whether the processing is complete.

Range

  • true: The scheduled task has been executed.

  • false: The scheduled task has not been executed.

Table 62 FrozenInfo

Parameter

Type

Description

scene

String

Freezing scenario. Options:

  • ARREAR: Frozen due to arrears

  • POLICE: frozen due to public security issues

  • ILLEGAL: Frozen due to abuse

effect

Integer

Impacts of freezing. Options:

  • 1: can be released after being frozen

  • 2: cannot be released after being frozen

Example Requests

Modify service configurations.

PUT https://{endpoint}/v2/{project_id}/services/{service_id}

{
  "schedule" : [ {
    "time_unit" : "HOURS",
    "type" : "STOP",
    "duration" : 10
  } ],
  "id" : "123e4567-e89b-12d3-a456-426655440000",
  "name" : "service-example",
  "version" : "0.0.1",
  "deploy_timeout_minutes" : 60,
  "description" : "",
  "workspace_id" : "0",
  "group_configs" : [ {
    "framework" : "COMMON",
    "name" : "instance-example",
    "pool_id" : "pool-example",
    "weight" : 100,
    "count" : 1,
    "unit_configs" : [ {
      "image" : {
        "source" : "SWR",
        "swr_path" : "swr.cn-north-7.myhuaweicloud.com/example/helloworld-example:0.0.1"
      },
      "flavor" : "flavor-example",
      "cmd" : "/bin/bash -c start.sh",
      "count" : 1
    } ]
  } ],
  "tags" : [ ],
  "runtime_config" : {
    "service_invoke" : {
      "port" : 123,
      "protocol" : "HTTPS",
      "auth_type" : "NONE",
      "dynamic_routing_enable" : false
    },
    "service_limit" : {
      "request_size_limit" : 20,
      "request_timeout" : 30,
      "ip_white_list" : [ ],
      "ip_black_list" : [ ],
      "rate_limit" : {
        "num" : 200,
        "unit" : "SECONDS"
      }
    }
  },
  "upgrade_config" : {
    "type" : "ROLLING",
    "rolling_update" : {
      "max_surge" : "20%",
      "max_unavailable" : "20%"
    }
  }
}

Example Responses

Status code: 200

Service configuration modified.

{
  "create_at" : 1733470423880,
  "failure_reason" : "",
  "id" : "123e4567-e89b-12d3-a456-426655440000",
  "name" : "infer-10",
  "schedule" : [ {
    "due_time" : 0,
    "duration" : 1,
    "processed" : false,
    "time_unit" : "HOURS",
    "type" : "STOP"
  } ],
  "status" : "DEPLOYING",
  "deploy_timeout_minutes" : 60,
  "type" : "REAL_TIME",
  "update_at" : 1733482797586,
  "version" : {
    "description" : "0.1.0 version update",
    "id" : "0ed64919-729c-4ecc-bbdf-87381013322b",
    "instance_groups" : [ {
      "count" : 1,
      "framework" : "COMMON",
      "id" : "f702f711-1cc1-4b5b-921e-87381013322b",
      "name" : "xxxxx1",
      "pool_id" : "pool-infer-xxxx",
      "unit_configs" : [ {
        "cmd" : "",
        "codes" : [ {
          "address" : "https://example.obs.example1.com",
          "mount_path" : "/codes/",
          "source" : "EFS",
          "source_id" : "98b57430-a738-4bce-9dea-2c70eb5f1005"
        } ],
        "envs" : {
          "additionalProp1" : "string1",
          "additionalProp3" : "string2",
          "additionalProp2" : "string3"
        },
        "flavor" : "CPU: 2 vCPUs 8GB",
        "id" : "8a0e84c0939b9c2101939ba30846004d",
        "image" : {
          "category" : "CPU",
          "source" : "SWR",
          "swr_path" : "swr.huaweicloud.com/atelier/pytorch_1_4:pytorch_1.4-cuda_10.1-py37-ubuntu_18.04-x86_64-041ba2e"
        },
        "models" : [ {
          "mount_path" : "/models/",
          "source" : "EFS",
          "source_id" : "98b57430-a738-4bce-9dea-2c70eb5f1005"
        } ],
        "role" : "COMMON"
      } ],
      "weight" : 100
    } ],
    "runtime_config" : {
      "service_invoke" : {
        "auth_type" : "TOKEN",
        "port" : 65534,
        "protocol" : "HTTPS",
        "dynamic_routing_enable" : false
      },
      "service_limit" : {
        "rate_limit" : {
          "num" : 1999,
          "unit" : "NANOS"
        },
        "request_size_limit" : 49,
        "request_timeout" : 1799
      }
    },
    "version" : "0.1.0"
  },
  "workspace_id" : "0"
}

Status Codes

Status Code

Description

200

Service configuration modified.

Error Codes

See Error Codes.