Updated on 2026-02-26 GMT+08:00

Obtaining Region Information

Description

This API is used to obtain the region information of ModelArts real-time services. When source is set to custom_from_modelarts_v2 during the creation of a custom endpoint, the region parameter in the request is obtained.

Constraints

This function is only supported in CN-Hong Kong.

URI

GET /v1/{project_id}/maas/services/custom-endpoint/regions

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project-id

Yes

String

Definition: Project ID. For details about how to obtain the project ID, see Obtaining a Project ID and Name.

Constraints: N/A.

Range: The value can contain 32 characters. Only lowercase letters and digits are allowed.

Default Value: N/A.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition: User token. The token 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 value, see Authentication.

Constraints: N/A.

Range: N/A.

Default Value: N/A.

Content-Type

Yes

String

Definition: Type of the message body. The value is fixed to application/json.

Constraints: N/A.

Range: N/A.

Default Value: N/A.

Response Parameters

Table 3 Response body parameters

Parameter

Type

Description

region_items

Array[RegionInfo]

Definition: All region information of ModelArts real-time services.

Range: N/A.

Table 4 RegionInfo

Parameter

Type

Description

region_id

String

Definition: Region of ModelArts real-time services.

Range: N/A.

locales

LocalInfo

Definition: Endpoint name.

Range: N/A.

Table 5 LocalInfo

Parameter

Type

Description

en_us

String

Definition: English name.

Range: N/A.

Table 6 Error response parameters

Parameter

Type

Description

error_msg

String

Definition: Error description.

Range: N/A.

error_code

String

Definition: Error code, indicating the error type.

Range: N/A.

Request Example

GET
/v1/{project_id}/maas/services/custom-endpoint/regions

Response Example

  • Success response. Status code: 200.
    {
        "region_items": [
            {
                "region_id": "cn-southwest-2",
                "locales": {
                    "en_us": "cn-southwest-2",
                }
            },
            {
                "region_id": "cn-north-12",
                "locales": {
                    "en_us": "cn-north-12",
                }
            },
            {
                "region_id": "cn-east-4",
                "locales": {
                    "en_us": "cn-east-4",
                }
            },
            {
                "region_id": "cn-north-9",
                "locales": {
                    "en_us": "cn-north-9",
                }
            }
        ]
    }
  • Error response. Status code: 400.
    {
    "error_msg": "Invalid token.",
    "error_code": "ModelArts.0104"
    }

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.