Updated on 2025-10-24 GMT+08:00

Allowing Users to Access Alarm Data

Function

This API is used for tenants to integrate their self-developed monitoring systems into COC based on standards. After the integration, alarms are reported to the COC alarm center in the standard format.

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, no identity policy-based permission required for calling this API.

URI

POST /v1/event/huawei/custom/{integration_key}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

integration_key

Yes

String

Integration ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

alarmId

Yes

String

Alarm ID.

alarmName

Yes

String

Alarm name.

alarmLevel

Yes

String

Alarm severity. The value can be:

  • Critical

  • Major

  • Minor

  • Info (suggestion)

time

Yes

Long

Alarm occurrence time.

nameSpace

Yes

String

Service namespace.

regionId

No

String

ID of the region where the alarm is generated.

applicationId

Yes

String

Application ID.

resourceName

No

String

Resource name.

resourceId

No

String

Resource ID.

alarmDesc

Yes

String

Alarm description.

URL

No

String

Raw alarm URL.

alarmStatus

No

String

Alarm status. The value can be:

  • alarm (alarming)

  • ok (cleared)

alarmSource

Yes

String

Alarm source.

additional

No

Object

Additional information about an alarm.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

provider_code

String

Service ID.

error_code

String

Request response code. The value ranges from 0000 to 9999. The value is 0 in normal cases.

error_msg

String

Response description for a request.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

provider_code

String

Service ID.

error_code

String

Request response code. The value ranges from 0000 to 9999. The value is 0 in normal cases.

error_msg

String

Response description for a request.

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

provider_code

String

Service ID.

error_code

String

Request response code. The value ranges from 0000 to 9999. The value is 0 in normal cases.

error_msg

String

Response description for a request.

Example Requests

Example of the request body for accessing a custom message

https://{Endpoint}/v1/event/huawei/custom/{integration_key}

{
  "alarmId" : "18cfxxxxxxxxxx0f8",
  "alarmName" : "Alarm for CPU usage exceeding the threshold",
  "alarmLevel" : "Critical",
  "time" : 1709118444540,
  "nameSpace" : "shanghai",
  "regionId" : "***",
  "applicationId" : "18cfa0a5ef8d",
  "resourceName" : "machine-1",
  "resourceId" : "18cxxxxxxxxxxxxff68625",
  "alarmDesc" : "string",
  "URL" : "https://xxx.com",
  "alarmStatus" : "alarm",
  "alarmSource" : "coc",
  "additional" : { }
}

Example Responses

Status code: 200

Request result is returned.

{
  "error_code" : "COC.00000000",
  "error_msg" : "success",
  "data" : null,
  "provider_code" : "049"
}

Status code: 400

Incorrect request body is returned.

{
  "error_code" : "COC.00000001",
  "error_msg" : "alarmName must not be null | alarmId must not be null",
  "data" : null,
  "provider_code" : "049"
}

Status code: 401

Incorrect authentication is returned.

{
  "error_code" : "common.01010001",
  "error_msg" : "Token missing or invalid.",
  "data" : null,
  "provider_code" : "049"
}

Status Codes

Status Code

Description

200

Request result is returned.

400

Incorrect request body is returned.

401

Incorrect authentication is returned.

Error Codes

See Error Codes.