No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

eSight V300R010C00SPC200, 300, and 500 Self-Service Integration Guide 10

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Cloud OS Physical Device Alarm Messages

Cloud OS Physical Device Alarm Messages

Message Subscription Interface

Function

This interface is used to obtain the host ID of the Cloud OS that generates an alarm. You can use the host ID to query the VM affected by the alarm on the Cloud OS. Currently, only the E9000 server is supported.

If you only want to obtain physical device alarms, you can subscribe to alarm change messages, as described in Alarm Change Message.

URI

/rest/openapi/notification/server/hwalarm/risk

Access Method

PUT

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request header parameter list

String

Indicates the session ID, which is used for Open API authentication.

NOTE:

A third-party system invokes the login interface of the security management module to obtain the value of this parameter.

systemID

Mandatory

Request entity parameter list

String

Indicates the third-party system ID.

NOTE:

The value can be an IP address of 1 to 64 characters, including digits (0-9), lowercase letters (a-z), uppercase letters (A-Z), and the following special characters: @ _ - ( ) , . ^ $ ~ ` !

openID

Mandatory

Request entity parameter list

String

Indicates the credential used by eSight to proactively connect to a third-party system, which is assigned by the third-party system.

NOTE:

The value consists of 1 to 1024 characters, including digits (0-9), lowercase letters (a-z), uppercase letters (A-Z), and the following special characters: @ _ - ( ) , . ^ $ ~ ` !

url

Mandatory

Request entity parameter list

String

Indicates the URL to which eSight sends a notification in POST mode.

NOTE:

For example, the URL can be http://10.10.10.10:8080/device. The URL correctness must be ensured by the notification subscriber. The IP address is specified in the Open API whitelist. The value consists of 1 to 1024 characters complying with the HTTP URL encoding specification.

dataType

Optional

Request entity parameter list

String

Indicates the value type of the data field in the notification.

NOTE:

Currently, only the JSON value type is supported. The default value is JSON.

desc

Optional

Request entity parameter list

String

Indicates the third-party system description.

NOTE:

The default value is null, indicating that the parameter is not specified. The value consists of 0 to 1024 characters. The character set is not restricted.

Result

Field

Value Type

Description

code

int

Indicates the operation return code. The options are as follows:

  • 0: successful
  • Others: failed. Value 1001 indicates that the license is invalid, 1002 indicates that the license cannot invoke the Open API, 1204 indicates that the authentication fails, 1501 indicates that no systemID is provided, 1502 indicates that the systemID is invalid, 1503 indicates that third-party system openID for authentication is not provided, 1504 indicates that third-party system openID for authentication is invalid, 1505 indicates that the dataType is not supported, 1506 indicates that the URL for receiving third-party messages is not provided, 1507 indicates that the URL for receiving third-party messages is invalid, 1508 indicates that the URL for receiving third-party messages is not in the Open API whitelist, 1509 indicates that the description provided is invalid, 1510 indicates that the requested resourceURI does not exist (that is, the resource corresponding to the entire request URL does not exist), and 1511 indicates that the subscription is invalid because the request URL is invalid.

data

String

The field is displayed as null.

description

String

Indicates the description of the interface invoking result.

Precautions

None

Example

Data Segment

Value

Request URL

PUT https://eSightIP: port/rest/openapi/notification/server/hwalarm/risk HTTP/1.1

Request header

openid: 775c47f9-9a1b-43f9-a24b-2c3db1a55622;

Request entity

systemID=example%40system&openID=1b7a6992-5d5f-4091-a49f-ec2e09640a05&url=https%3A%2F%2FdemoIP%3AdemoPort%2Fnotification&dataType=JSON&desc=eSight+DesignIn+Demo

Response entity

{"code":0,"data":null,"description":"Operation success."}

Message Unsubscription Interface

Function

This interface is used to unsubscribe from physical alarm messages from the Cloud OS.

URI

/rest/openapi/notification/server/hwalarm/risk

Access Method

DELETE

Parameter Description

Table 3-4 Parameter description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Message header parameter list

String

Indicates the session ID, which is used for Open API authentication.

NOTE:

A third-party system invokes the login interface of the security management module to obtain the value of this parameter.

systemID

Mandatory

URL parameter list

String

Indicates the third-party system ID.

NOTE:

The value can be an IP address of 1 to 64 characters, including digits (0-9), lowercase letters (a-z), uppercase letters (A-Z), and the following special characters: @ _ - ( ) , . ^ $ ~ ` !

desc

Optional

URL parameter list

String

Indicates the third-party system description.

NOTE:

The default value is null, indicating that the parameter is not specified. The value consists of 0 to 1024 characters. The character set is not restricted.

Result

Field

Value Type

Description

code

int

Indicates the operation return code. The options are as follows:

  • 0: successful
  • Others: failed. Value 1001 indicates that the license is invalid, 1002 indicates that the license cannot invoke the Open API, 1204 indicates that the authentication fails, 1501 indicates that no systemID is provided, 1502 indicates that the systemID is invalid, and 1512 indicates that the unsubscription is invalid because the request URL is invalid.

data

String

The field is displayed as null.

description

String

Indicates the description of the interface invoking result.

Precautions

In the requests whose MIME type is application/x-www-form-urlencoded, space characters are encoded as plus signs and the plus signs are encoded as %2B.

Example

Data Segment

Value

Request URL

DELETE https://eSightIP:port/rest/openapi/notification/server/hwalarm/risk?systemID=example%40system&desc=eSight+DesignIn+Demo+Unsubscription. HTTP/1.1

Request header

openid: 775c47f9-9a1b-43f9-a24b-2c3db1a55622;

Request entity

N/A

Response entity

{"code":0,"data":null,"description":"Operation success."}

Message Sending Interface

Message Data

Field

Value Type

Description

resourceURI

String

Indicates the resource type URI, which is the same as the URI of the message subscription interface. For an alarm change message notification, the URI is /rest/openapi/notification/server/hwalarm/risk.

msgType

int

Indicates the message type. The options are as follows:

  • 0: A risk occurs.
  • 1: A risk is eliminated.

data

list

Indicates the data object that is described in JSON array. The alarm-related data structure is defined as follows:

Note

If the message receiving address uses HTTP, the value of data is an encrypted string. The third-party system must decrypt the value using the values of KEY and IV in the configuration file and then parse the data object.

extendedData

String

Indicates the JSON extended data object represented by a character string. The value here is the null object {}.

description

String

Indicates the notification description.

timestamp

String

Indicates the timestamp when a notification is sent. The eSight server determines the value format.

The data object includes the following fields:

Field

Value Type

Description

rackDn

String

Indicates the rack DN.

rackIP

String

Indicates the BMC IP address of the rack.

deviceDn

String

Indicates the blade DN.

deviceIndex

String

Indicates the blade slot ID.

deviceBMCIP

String

Indicates the BMC management address of the blade.

hostIP

String

Indicates the management address of the host in the OpenStack resource pool.

hostId

String

Indicates the host ID.

hostName

String

Indicates the host name.

virtualType

int

Indicates the host virtualization type.

  • 1: KVM
  • 2: Ironic
  • 3: FusionCompute
  • 4: vCenter

platformDn

String

Indicates the DN of the cloud platform.

platformDomain

String

Indicates the domain name of the cloud platform. (Set this parameter to a domain name for the FusionSphere platform and to an IP address for other platforms.)

platformType

int

Indicates the cloud platform type.

  • 1: ESXi
  • 3: FusionCompute
  • 4: vCenter
  • 5: FusionSphere

alarmGroupID

String

Indicates the alarm group ID.

alarmCode

String

Indicates the alarm code ID.

alarmName

String

Indicates the alarm name.

alarmLevel

String

Indicates the alarm severity. The options are as follows:

  • 0: unknown
  • 1: critical
  • 2: major
  • 3: minor
  • 4: suggestion
  • 5: cleared

eventTime

String

Indicates the time when the alarm occurs for the first time.

isClear

int

Indicates the alarm clearance type.

  • 0: uncleared
  • 1: cleared

alarmLocation

String

Indicates the alarm location.

Example

The notification is sent in POST mode, and all notification data is saved in the body of the HTTP packet. Assume that the third-party system WebService provides the implementation request instance of javax.servlet.http.HttpServletRequest. The following message data can be obtained:

Invoking Method

Obtained Value

request.getParameter("resourceURI")

"/rest/openapi/notification/server/hwalarm/risk"

request.getParameter("msgType")

1

request.getParameter("data")

"[{

\"rackDn\": \"NE=34603009\",

\"rackIP\":\"192.168.11.20\",

\"deviceDn\": \"NE=34605715\",

\"deviceIndex\": \"10\",

\"deviceBMCIP\": \"192.168.13.20\",

\"hostIP\": \"10.10.10.1\",

\"hostId\": \"host1\",

\"hostName\": \"host1\",

\"platformDn\": \"NE=34603110\",

\"platformDomain\": \"h.h.com\",

\"virtualType\": 0,

\"platformType\": 1,

\"alarmGroupID\": \"278413609\",

\"alarmCode\": \"117506047\",

\"alarmName\": \"test=\",

\"alarmLevel\": \"2\",

\"eventTime\": \"1480153460709\",

\"isClear\": 0,

\"alarmLocation\": \",Component=blade10\"

}]"

request.getParameter("description")

""

request.getParameter("timestamp")

"2016-11-26 17:44:20"

request.getParameter("extendedData")

"{}"

The value null indicates that the actual value of an attribute is empty.

Translation
Download
Updated: 2019-10-30

Document ID: EDOC1100044386

Views: 15401

Downloads: 83

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next