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).
System Power on Message

System Power on Message

This section describes the system power-on message interface.

Subscription Message Sending Configuration

Function

During power-on, eSight attempts to send a power-on message to a configured URL for receiving power-on messages. After the third-party system receives the message, the third-party system considers that eSight is powered on and operations, such as data synchronization and message notification re-subscription, can be performed.

Configuration Method

  • Method 1 (recommended): Configure on the GUI.
    1. Choose System > System Settings > Northbound Integration from the main menu.
    2. In the navigation tree, choose Third-party System Settings and then click Create.
    3. Set the third-party system IP address.
    4. Set Protocol type to HTTPS. Set System ID, which maps the third-party system ID in the configuration file. The default system ID ranges from NMSinfo1 to NMSinfo20. Change it during the creation.
    5. Next to Notification, select the Receive system power-on notification check box and set URL for power-on notification. For example, http://127.0.0.1:8443/notification, The IP address and port number are the IP address and port number set by the information receive system.
    6. After you have performed the preceding operations, the configurations will be synchronized to eSight installation directory/AppBase/etc/oms.ros/ros.web.notification.xml.
  • Method 2: Configure in the configuration file.
    1. Set the system-up-url field in etc/oms.ros/ros.web.notification.xml. For details, see section Preparation Using Open APIs.
      <system-list>
      <system>
      <!-- Third-party system ID -->
      <id>example@system</id>
      <!-- URL for receiving system power-on messages -->
      <system-up-url>http://127.0.0.1:8443/notification</system-up-url>
      <!-- Message aggregation configuration -->
      <max-event-aggregation-number>10</max-event-aggregation-number>
      </system>
      </system-list>
    2. Restart eSight

Precautions

eSight attempts to resend the messages based on the configuration file. If the message still fails to be sent, eSight discards the message and stops sending subsequent messages. After the third-party system successfully subscribes to any message, eSight sends subsequent messages.

The HTTP and HTTPS protocols are supported, but no openID can be contained.

Message Sending Interface

Message Data

Field

Value Type

Description

resourceURI

String

Indicates the resource type URI. For a device change message notification, the URI is /rest/openapi/notification/common/systemStatus.

msgType

Int

Indicates the message type. The value is fixed at 96 (system power-on).

data

List

Indicates the data object described in JSON data array format.

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. For details about the decryption method, see Decryption Example.

extendedData

String

Additional data object described in JSON format. Here, the value is the null object {}.

description

String

Indicates the message notification description.

timestamp

String

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

The following table describes the data structure of the data field.

Field

Value Type

Description

systemID

String

Indicates the unique ID of the eSight system.

NOTE:

The value can be set in the configuration file. you can also configure it in local system information page. For details, see section Preparation Using Open APIs.

systemName

String

Indicates the name of the eSight system.

NOTE:

The value can be set in the configuration file. you can also configure it in local system information page. For details, see section Preparation Using Open APIs.

version

String

Indicates the eSight version number.

NOTE:

The value can be set in the configuration file. For details, see section Preparation Using Open APIs.

vendor

String

Indicates the eSight vendor. The value is fixed at Huawei.

systemEscapedTime

String

Indicates the system escaped time. During power-on, the value is fixed at 0 Day 00 Hour 00 Min 00 Sec 000 MilliSec.

Decryption Example

private static String decrypt(String data){
  String result = "";

  // Note: The following two key strings are added by referring to fetc/oms.ros/ros.web.notification.xml and must be in plaintext.
  String decryptedKey = "E5DF96DE53ED56CBAE25368624DC25Ef";
  String decryptedIv = "E2CDBCA5693654EF2E6F38693653564E";
  // Obtain the result, KEY and IV values.
  final byte[] key = strToBytes( decryptedKey.toUpperCase() );
  final byte[] iv = strToBytes( decryptedIv.toUpperCase() );
  try {
   // Obtain the key generator.
   KeyGenerator kgen = KeyGenerator.getInstance("AES", "SunJCE");

   SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG", "SUN");
   secureRandom.setSeed( key );
   // Initialize the key generator.
   kgen.init( 128, secureRandom );
   // Algorithm parameters.
   AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
   // Generate the key.
   SecretKey secretKey = kgen.generateKey();
   // Encipher.
   Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding", "SunJCE");
   // Initialize the encipher.
   cipher.init( Cipher.DECRYPT_MODE, secretKey, paramSpec);
   // Obtain the decryption result.
   byte[] res = cipher.doFinal(strToBytes(data));
   try {
    result = new String( res,"UTF-8" );
   } catch (UnsupportedEncodingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
  } catch( final GeneralSecurityException e ) {
   e.printStackTrace();
   result = null;
  }
  return result;
 }
 public static byte[] strToBytes(final String str)
    {
        // Verify parameters.
        if (null == str || str.isEmpty() || !str.matches("[0-9a-zA-Z]{1,}"))
        {
            return null;
        }

        // Convert parameter characters to uppercase characters.
        final String upperCaseString = str.toUpperCase(Locale.US);

        // String length.
        final int strLen = upperCaseString.length();

        // Encrypted arrays.
        final byte[] bytes = new byte[16];

        // Compute encrypted arrays in a cyclic manner.
        for (int i = 0; i < (strLen / 2); i++)
        {
            // High and low bits.
            int high = charToHex(upperCaseString.charAt(i * 2));
            int low = charToHex(upperCaseString.charAt(i * 2 + 1));
            // Obtain the result.
            bytes[i] = (byte) ((high << 4) | low);
        }

        return bytes;
    }
/**
     * Convert the char into hexadecimal characters and enter the characters that only contain [0-9A-Z].
     * 
     * @param ch Characters.
     * @return Return the array represented by the characters.
     */
    private static int charToHex(final char ch)
    {
        if (Character.isUpperCase(ch))
        {
            // Return the uppercase characters.
            return ch - 'A' + 10;
        }
        else
        {
            // Return numbers.
            return ch - '0';
        }
    }

Example

{
    "timestamp":"2014-12-19 11:08:51",
    "extendedData":{},
    "resourceURI":"/rest/openapi/notification/common/systemStatus",
    "description":"",
    "data":
    [
        {
        "systemEscapedTime":"0 Day 00 Hour 00 Min 00 Sec 000 MilliSec            ",
        "vendor":"Huawei",
        "systemName":"HuaweiPlatform",
        "systemID":"HuaweiPlatform",
        "version":"V300R003C00"
        }
    ],
    "msgType":96
}
Translation
Download
Updated: 2019-10-30

Document ID: EDOC1100044386

Views: 17237

Downloads: 86

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