Help Center/ ModelArts/ API Reference/ Model Inference/ HRA Policy/ Obtaining the Ratio Detection Information of an Inference Unit
Updated on 2026-07-24 GMT+08:00

Obtaining the Ratio Detection Information of an Inference Unit

Function

This API is used to view the ratio detection information of inference units on a deployed service. Before calling this API, ensure that the service has been deployed and a valid service ID has been obtained. After the query, the policy information of the service is returned, including the rule ID, rule name, policy status, and HRA result status. If the provided service ID is invalid, the parameter settings are incorrect, or the system resources are insufficient, an error message is displayed, prompting you to check the validity of the input data or contact technical support.

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:getHra

    Read

    service *

    -

    -

    -

URI

GET /v2/{project_id}/services/{service_id}/deployments/{deployment_id}/hra

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 querying the service list. The service_id field indicates the service ID.

Constraints

N/A

Range

Service ID.

Default Value

N/A

deployment_id

Yes

String

Definition

Deployment ID, which you can obtain from the response body when adding the deployment or by obtaining service deployments. The deployment_id field indicates the deployment ID.

Constraints

N/A

Range

Deployment 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

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

id

String

Definition

HRA policy ID.

Range

N/A

workspace_id

String

Definition

Workspace ID. If no workspace is created, the default value is 0. If a workspace is created and used, use the actual value.

Range

N/A

hra_rules

Array of HraRuleResponse objects

Definition

HRA rule list.

disable

Boolean

Definition

User-controlled enable/disable switch.

Range

true indicates disabled and false indicates enabled.

Constraints

N/A

Default Value

N/A

policy_status

String

Definition

Policy status.

Range

  • CREATING

  • ACTIVE: available

  • INACTIVE: unavailable

  • DELETED

Constraints

N/A

Default Value

N/A

min_replicas

Integer

Definition

Minimum number of replicas. This parameter is invalid because the current version does not support actual scaling.

Range

1 to 128

max_replicas

Integer

Definition

Maximum number of replicas. This parameter is invalid because the current version does not support actual scaling.

Range

1 to 128

scale_window

Integer

Definition

Scaling time window. This parameter is invalid because the current version does not support actual scaling.

Range

N/A

Table 4 HraRuleResponse

Parameter

Type

Description

id

String

Definition

Rule ID, which can be obtained from the response body during HRA policy creation. You can also query the ratio detection information of the inference unit to obtain the HRA policy of the current user. The id field indicates the rule ID.

Constraints

N/A

Range

Rule ID.

Default Value

N/A

name

String

Definition

Rule name.

Range

N/A

disable

Boolean

Definition

Specifies whether to disable the rule.

Range

  • true: disabled

  • false: enabled

Constraints

N/A

Default Value

N/A

scaler_type

String

Definition

Scaling type.

Range

  • SIMULATOR_ALGO: simulator algorithm scaling type.

Constraints

N/A

Default Value

N/A

rule_status

String

Definition

HRA rule status.

Range

  • CREATING

  • CONFIG_SUCCESS

  • EXECUTE_SUCCESS

  • DELETED

  • FAILED

Constraints

N/A

Default Value

N/A

slo_info

Array of SloInfo objects

Definition

SLO configuration parameters.

Range

N/A

metrics

Array of Metrics objects

Definition

Metric information.

Range

N/A

role_replica

Array of RoleReplica objects

Definition

Role scaling policy (This parameter is invalid because actual scaling is not supported.)

Table 5 SloInfo

Parameter

Type

Description

slo_objectives

Array of SloObjectives objects

Definition

Expected simulation metric.

Range

N/A

predict_window_seconds

Integer

Definition

Prediction time window.

Constraints

60 to 600

Range

N/A

Default Value

60

Table 6 SloObjectives

Parameter

Type

Description

metric_ttft

Integer

Definition

Time to first token (TTFT), in milliseconds.

Range

0 to 10000

Constraints

N/A

Default Value

100

metric_tpot

Integer

Definition

Time per output token (TPOT), in milliseconds.

Range

0 to 1000

Constraints

N/A

Default Value

50

percental

Integer

Definition

SLO satisfaction percentage.

Range

0 to 100

Table 7 Metrics

Parameter

Type

Description

endpoint

String

Definition

Metric collection address. The value can be an IP address, a domain name, or localhost.

Range

N/A

path

String

Definition

Metric collection path.

Range

N/A

port

String

Definition

Metric collection port.

Range

1 to 65535

scheme

String

Definition

Metric collection protocol.

Range

  • HTTP

  • HTTPS

metrics_source

String

Definition

Metric source type.

Range

  • CONTAINER: within a container

  • OTHERS: other external addresses

Constraints

N/A

Default Value

CONTAINER

Table 8 RoleReplica

Parameter

Type

Description

name

String

Definition

Role name.

Range

N/A

max_replicas

Integer

Definition

Maximum number of replicas.

Range

1 to 128

min_replicas

Integer

Definition

Minimum number of replicas.

Range

1 to 128

Example Requests

None

Example Responses

Status code: 200

The HRA configuration and status of the specified deployment are obtained.

{
  "disable" : false,
  "hra_rules" : [ {
    "disable" : false,
    "id" : "d4b07447-69e1-42e5-ab8f-e22f848972d6",
    "metrics" : [ {
      "endpoint" : "localhost",
      "metrics_source" : "CONTAINER",
      "path" : "/metrics",
      "port" : "9800",
      "scheme" : "http"
    } ],
    "name" : "rule-nhqd",
    "role_replica" : [ {
      "max_replicas" : 3,
      "min_replicas" : 1,
      "name" : "prefill"
    }, {
      "max_replicas" : 3,
      "min_replicas" : 1,
      "name" : "decode"
    } ],
    "rule_status" : "CREATING",
    "scaler_type" : "SIMULATOR_ALGO",
    "slo_info" : [ {
      "predict_window_seconds" : 60,
      "slo_objectives" : [ {
        "metric_tpot" : 50,
        "metric_ttft" : 100,
        "percental" : 90
      } ]
    } ]
  } ],
  "id" : "c5a82cef-57e2-4661-a75c-644a5e7a6ef2",
  "max_replicas" : 128,
  "min_replicas" : 1,
  "policy_status" : "INACTIVE",
  "scale_window" : 0,
  "workspace_id" : "0"
}

Status Codes

Status Code

Description

200

The HRA configuration and status of the specified deployment are obtained.

Error Codes

See Error Codes.