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).
Real-time Performance Notification

Real-time Performance Notification

Subscribing to the Real-time Performance Notification

Function

This interface is used to subscribe to the real-time performance notification.

Third-party systems send subscription requests to eSight through this interface. To obtain real-time performance push data, the interface for creating a real-time performance task must be invoked.

URI

/rest/openapi/notification/common/realtimePerformance

Access Method

PUT

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

Indicates a session ID, used for open API authorization.

NOTE:

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

systemID

Mandatory

Parameter list

String

Indicates the third-party system ID.
NOTE:

The value is a string of 1 to 64 valid characters including uppercase letters A to Z, lowercase letters a to z, digits 0 to 9, and special characters except [], {}, =, and space characters.

This parameter is configured through the id field under system in the configuration file eSight\AppBase\etc\oms.ros\ros.web.notification.xml. The modification takes effect upon restart.

openID

Mandatory

Parameter list

String

Indicates a character string assigned by a third-party system for eSight authentication when eSight actively connects to the third-party system.

The value is a string of 1 to 1024 valid characters including uppercase letters A to Z, lowercase letters a to z, digits 0 to 9, and special characters except [], {}, =, and spaces.

dataType

Optional

Parameter list

String

Indicates the type of the notification message. Currently, only JSON (default value) is supported.

url

Mandatory

Parameter list

String

Indicates the URL to which eSight sends notification messages in POST mode, for example, http://10.10.10.10:8080/device.

The URL correctness must be ensured by the notification message 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.

desc

Optional

Parameter list

String

Indicates the third-party system description. The default value is null, indicating that no description is provided.

The value is a string of 1 to 1024 characters without any restriction.

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

List

The field is displayed as null.

description

String

Indicates the description of the interface invoking result.

Precautions

None.

Example

package com.huawei.oms.ros.test;

import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;

public class SubRealtimeNotification
{
    public static void main(String[] args) throws Exception
    {
        Login.login();
        subC("/rest/openapi/notification/common/realtimePerformance");
    }

    public static void subC(String subResource) throws Exception
    {
        // set the URL and method 
        String openidURL = subResource;// "/rest/openapi/notification/common/realtimePerformance" 
        String method = "PUT";

        // set headers 
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        // set parameters 
        BasicNameValuePair[] parameters = {
                new BasicNameValuePair("systemID", "example@system"), new BasicNameValuePair("openID", "123456"),
                new BasicNameValuePair("url", "http://10.135.38.54:8080/testOpenAPI/processNoticeData"), new BasicNameValuePair("desc", "info")
        };
        // send the request 
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        // get the result 
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    }
}


The returned result is as follows:
{"code":0,"data":null,"description":"Operation success."}

Unsubscribing from the Real-time Performance Notification

Function

This interface is used to unsubscribe from the real-time performance notification.

Third-party systems unsubscribe from real-time performance messages through this interface. To delete the delivered real-time performance task, the interface for deleting real-time performance task must be invoked.

URI

/rest/openapi/notification/common/realtimePerformance

Access Method

DELETE

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

Indicates a session ID, used for open API authorization.

NOTE:

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

systemID

Mandatory

Parameter list

String

Indicates the third-party system ID.
NOTE:

The value is a string of 1 to 64 valid characters including uppercase letters A to Z, lowercase letters a to z, digits 0 to 9, and special characters except [], {}, =, and space characters.

This parameter is configured through the id field under system in the configuration file eSight\AppBase\etc\oms.ros\ros.web.notification.xml. The modification takes effect upon restart.

desc

Optional

Parameter list

String

Indicates the third-party system description.

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

List

The field is displayed as null.

description

String

Indicates the description of the interface invoking result.

Example

package com.huawei.oms.ros.test;

import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;

public class UnsubRealTimeNotification
{
    public static void main(String[] args) throws Exception
    {
        Login.login();
        unsubC("/rest/openapi/notification/common/realtimePerformance");
    }

    public static void unsubC(String resource) throws Exception
    {
        // set the URL and method 
        String openidURL = resource;// "/rest/openapi/notification/common/realtimePerformance" 
        String method = "DELETE";

        // set headers 
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        // set parameters 
        BasicNameValuePair[] parameters = {
                new BasicNameValuePair("systemID", "example@system"), new BasicNameValuePair("desc", "info")
        };
        // send the request 
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        // get the result 
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    }
}
The returned result is as follows:
{"code":0,"data":null,"description":"Operation success."}

Data Structure of the Real-Time Performance Notification

Message Data

Field

Value Type

Description

timestamp

String

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

resourceURI

String

Indicates the resource URI, which is the same as the URI of the subscribed message. It is fixed as /rest/openapi/ common/ realtimePerformance.

description

String

Indicates the message description. For a message reporting collected performance data, the field is Periodically report collect real-time performance data, performance task ID: + performance task ID.

For a message deleting a real-time performance task, the field is empty.

msgType

Int

Indicates the type of a real-time performance message.

1. Reporting collected real-time performance data

2. Detecting task session timeout

3. Deleting a performance task

data

Object

Indicates a set of collected real-time performance data.

The following table lists the fields contained in the data object.

Field

Value Type

Description

systemID

String

Indicates the third-party system ID received during real-time performance subscription.

Indicates the third-party system ID.
NOTE:

The value is a string of 1 to 64 valid characters including uppercase letters A to Z, lowercase letters a to z, digits 0 to 9, and special characters except [], {}, =, and space characters.

This parameter is configured through the id field under system in the configuration file eSight\AppBase\etc\oms.ros\ros.web.notification.xml. The modification takes effect upon restart.

taskID

String

Indicates the real-time performance task ID defined by a third-party system.

taskLastModifyTimeMS

String

Indicates the timestamp of last task change.

monitorId

String

Indicates the ID of the real-time performance task, which is generated by eSight.

neDN

String

Indicates the NE DN, which uniquely identifies a device.

neIpAddress

String

Indicates the device's IP address.

subResourceName

String

Indicates the sub-resource name of a device.

subResourceType

String

Indicates the sub-resource type of a device.

indicatorsGroupKey

String

Indicates the indicator group name.

indicatorsData

List

Indicates the counter name.

measureObject2Index

Object

Indicates the data mapping structure between real-time measurement objects and counters.

periodType

Int

Indicates the collection interval. The options are as follows:

1: 5s

2: 10s

3: 15s

4: 30s

samplingUtcTime

Long

Indicates the time when data is collected.

timestampStr

String

Indicates the timestamp content. (The value is consistent with the UTC time without the time zone, such as 2015-03-06 10:46:00.)

isTrusted

Int

Indicates whether all indicators can be trusted.

1: All indicators can be trusted.

2. Some indicators can be trusted.

3. No indicator can be trusted.

The following table lists the fields contained in the indicatorsData object.

Field

Value Type

Description

indicatorKey

String

Indicates the counter key value.

symbol

Int

Indicates the threshold symbol, which is reserved.

thresholdValue

Int

Indicates the threshold value, which is reserved.

indicatorName

String

Indicates the counter name.

indicatorUnit

String

Indicates the counter unit.

indicatorData

String

Indicates the counter data.

id

Int

Indicates the counter ID, which is generated by eSight.

isLimited

Int

Indicates whether the threshold is exceeded. The options are as follows:

0: no

1: yes

The following table lists the fields contained in the measureObject2Index object.

Field

Value Type

Description

dn

String

Indicates the NE DN, which is generated by eSight.

realDn

String

Indicates the ID of an AP. This field is empty for non-WLAN devices.

neName

String

Indicates the NE name.

displayValue

String

Indicates the measurement object name.

indexId

Int

Indicates the counter ID.

indexName

String

Indicates the counter name. This field is empty by default.

objectHasInit

boolean

Indicates the status of the measurement object. true: Data is available in the database. false: No data exists in the database.

aggrType

Int

Indicates the aggregation algorithm. The value is 0 by default.

displayPeriod

Int

Indicates the display interval. The value is 0 by default.

The measureObject2Index is an internal data structure of the network management system. Only some of its fields are used. Default values are used for other fields, which indicates that the fields are not used but does not indicate their true status. Third-party systems do not use this data structure.

Example

The message 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("code")

0

request.getParameter("data")

[{

"taskID":"task2",

"neDN":"NE=34603409",

"neIpAddress":"10.137.61.2",

"subResourceName":"GigabitEthernet0/0/0",

"subResourceType":"interface",

"indicatorsGroupKey":"ifXEntryStat",

"indicatorsData":[{

"indicatorKey":"ifHCInOctets",

"indicatorName":"number of bytes received by an interface"

"indicatorUnit":"bytes",

"indicatorData":"6984",

"id":2,

"isLimited":0,

"symbol":0,

"thresholdValue":0

}],

"samplingUtcTime":1434338835000,

"timestampStr":"2015-06-15 11:27:15",

"isTrusted":1

}]

request.getParameter("description")

null

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

Translation
Download
Updated: 2019-10-30

Document ID: EDOC1100044386

Views: 15422

Downloads: 83

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