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).
Resource Management Interfaces

Resource Management Interfaces

Common Interfaces

Query All Device Categories

Function

This interface is used to query all device categories.

URI

/rest/openapi/necategory

Access Method

GET

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Value Range

openid

Mandatory

Request message header

String

Indicates the session identifier. It is used for open API authentication.

NOTE:

A third-party invokes the login interface (section Log In to the eSight) for security management to obtain this parameter.

Result

Field

Value Type

Description

code

int

Indicates the code of the returned result. The options are as follows:

  • 0: successful
  • others: failed. Code 1001 indicates that the license is invalid; code 1002 indicates that the license does not support the open API function; code 1204 indicates that authentication fails.

data

String[]

Indicates the list composing device category arrays.

description

String

Indicates the description of the returned result.

Precautions

None

Example

package com.huawei.oms.ros.test;

import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
import com.huawei.oms.ros.test.GlobalVar;
import com.huawei.oms.ros.test.NewHttpsAccess;
import com.huawei.oms.ros.test.NewRosSecurity;


/**
 * Query All Device Categories 
 */
public class QueryNeCategory {
 private static final String EAM_CATEGORY = "/rest/openapi/necategory";

 public static void main(String[] args) throws Exception {
  Login.login();
  queryNeCategoryTest();
 }

 public static void queryNeCategoryTest() throws Exception {
  //set the URL and method
  String openidURL = EAM_CATEGORY;
  String method = "GET";
  
  //set headers
  BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
  //set parameters
  BasicNameValuePair[] parameters = null;
  
  //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": [
        "com.huawei.mo.pc", 
        "com.huawei.mo.server", 
        "com.huawei.mo.application", 
        "com.huawei.oms.application"
    ], 
    "description": "Operation success."
}

Query Device Types based on Parameter Settings

Function

This interface is used to query device types based on parameter settings.

URI

/rest/openapi/netype

Access Method

GET

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Value Range

openid

Mandatory

Request message header

String

Indicates the session identifier. It is used for open API authentication.

NOTE:

A third-party invokes the login interface (section Log In to the eSight) for security management to obtain this parameter.

category

Optional

Parameter list

String

Indicates the device classification. It does not support fuzzy match of character strings and it can be get through the interface "Query All Device Categories".

start

Optional

Parameter list

int

Indicates the start position to return query results. Its default value is 0.

NOTE:

If the value is less than 0, the default value is used.

size

Optional

Parameter list

int

Indicates the total number of items in the query results that are returned. Its default value is 20.

NOTE:

If the value is less than 0, the default value is used.

orderby

Optional

Parameter list

String

Indicates the field to sort the query results. The default field to sort the results is netype. The fields can be netype, vendorid, sysoid, or category.

NOTE:

Separate multiple fields with a comma (,).

desc

Optional

Parameter list

boolean

Specifies whether query results are sorted in a descending order. The default value is false.

NOTE:

This parameter is valid only after the orderby parameter is set.

Result

Field

Value Type

Description

code

int

Indicates the code of the returned result. The options are as follows:

  • 0: successful
  • others: failed. Code 1001 indicates that the license is invalid; code 1002 indicates that the license does not support the open API function; code 1204 indicates that authentication fails; code 2101 indicates that no MeType which conforms to condition was found.

data

List<InternalRtnNeTypeInfo>

Indicates the device types.

description

String

Indicates the description of the returned result.

The object InternalRtnNeTypeInfo contains the following information.

Field

Value type

Description

netype

String

Indicates the device type.

vendorid

String

Indicates the vendor ID.

sysoid

String

Indicates the device sysoid.

category

String

Indicates the device type.

Precautions

None

Example

package com.huawei.oms.ros.test;

import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
import com.huawei.oms.ros.test.GlobalVar;
import com.huawei.oms.ros.test.NewHttpsAccess;
import com.huawei.oms.ros.test.NewRosSecurity;


/**
 * Query Device Types based on Parameter Settings
 */
public class QueryNeType {
 private static final String EAM_TYPE = "/rest/openapi/netype";

 public static void main(String[] args) throws Exception {
  Login.login();
  queryNeTypeTest();
 }

 public static void queryNeTypeTest() throws Exception {
  //set the URL and method
  String openidURL = EAM_TYPE;
  String method = "GET";
  
  //set headers
  BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
  //set parameters
  BasicNameValuePair[] parameters =
        {
                new BasicNameValuePair("category", ""), 
                new BasicNameValuePair("start", "50"), 
                new BasicNameValuePair("size", ""), 
                new BasicNameValuePair("orderby", ""), 
                new BasicNameValuePair("desc", "")
        };
  
  //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": [
        {
            "netype": "ICMP", 
            "vendorid": "ICMP", 
            "sysoid": "", 
            "category": "enterprise.app.vendor.server|enterprise.app.series.microsoft"
        }, 
        {
            "netype": "{Microsoft}MicrosoftWindowsDomainController", 
            "vendorid": "Microsoft", 
            "sysoid": "1.3.6.1.4.1.311.1.1.3.1.3", 
            "category": "enterprise.app.vendor.server|enterprise.app.series.microsoft"
        }, 
        {
            "netype": "{Microsoft}MicrosoftWindowsServer", 
            "vendorid": "Microsoft", 
            "sysoid": "1.3.6.1.4.1.311.1.1.3.1.2", 
            "category": "enterprise.app.vendor.server|enterprise.app.series.microsoft"
        }, 
        {
            "netype": "{Microsoft}MicrosoftWindowsWorkstation", 
            "vendorid": "Microsoft", 
            "sysoid": "1.3.6.1.4.1.311.1.1.3.1.1", 
            "category": "enterprise.app.vendor.server|enterprise.app.series.microsoft"
        }
    ], 
    "description": "Operation success."
}

Query Device Information based on Parameter Settings

Function

This interface is used to query device information based on parameter settings.

URI

/rest/openapi/nedevice

Access Method

GET

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Value Range

openid

Mandatory

Request message header

String

Indicates the session identifier. It is used for open API authentication.

NOTE:

A third-party invokes the login interface (section Log In to the eSight) for security management to obtain this parameter.

necategory

Optional

Parameter list

String

Indicates the device classification. It does not support fuzzy match of character strings and it can be get through the interface "Query All Device Categories".

netype

Optional

Parameter list

String

Indicates the device type. It does not support fuzzy match of character strings and it can be get through the interface "Query Device Types based on Parameter Settings".

neip

Optional

Parameter list

String

Indicates the IP address of the device. It does not support fuzzy match of character strings.

nestate

Optional

Parameter list

int

Indicates the network device state. The options are as follows:

  • 0: noDetect
  • 1: online
  • 2: offline
  • 3: invalid

start

Optional

Parameter list

int

Indicates the start position to return query results. Its default value is 0.

NOTE:

If the value is less than 0, the default value is used.

size

Optional

Parameter list

int

Indicates the total number of items in the query results that are returned. Its default value is 20.

NOTE:

If the value is less than 0, the default value is used.

orderby

Optional

Parameter list

String

Indicates the field to sort the query results. The default field to sort the results is nedn. The fields can be nedn, nename, necategory, netype, neip, nesysoid, or nestate.

NOTE:

Separate multiple fields with a comma (,).

desc

Optional

Parameter list

boolean

Specifies whether query results are sorted in a descending order. The default value is false.

NOTE:

This parameter is valid only after the orderby parameter is set.

Result

Field

Value Type

Description

code

int

Indicates the code of the returned result. The options are as follows:

  • 0: successful
  • others: failed. Code 1001 indicates that the license is invalid; code 1002 indicates that the license does not support the open API function; code 1204 indicates that authentication fails.

data

List<InternalRtnNodeInfo>

Indicates the device information which is sorted in ascending order.

description

String

Indicates the description of the returned result.

The object InternalRtnNodeInfo contains the following information.

Field

Value type

Description

nedn

String

Indicates the device DN.

nename

String

Indicates the device name.

necategory

String

Indicates the device category.

netype

String

Indicates the device type.

nevendorname

String

Indicates the device vendor name.

neip

String

Indicates the device IP addresses. They are separated with a comma (,).

nesysoid

String

Indicates the device sysoid.

nestate

int

Indicates the device state. The options are as follows:

  • 0: noDetect
  • 1: online
  • 2: offline
  • 3: invalid

timezoneid

String

Indicates the device time zone.

Precautions

None

Example

package com.huawei.oms.ros.test;

import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
import com.huawei.oms.ros.test.GlobalVar;
import com.huawei.oms.ros.test.NewHttpsAccess;
import com.huawei.oms.ros.test.NewRosSecurity;


/**
 * Query Device Information based on Parameter Settings
 */
public class QueryDeviceList {
 private static final String EAM_NEDEVICE = "/rest/openapi/nedevice";

 public static void main(String[] args) throws Exception {
  Login.login();
  queryNeDeviceTest();
 }

 public static void queryNeDeviceTest() throws Exception {
  //set the URL and method
  String openidURL = EAM_NEDEVICE;
  String method = "GET";
  
  //set headers
  BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
  //set parameters
  BasicNameValuePair[] parameters =
        {
                new BasicNameValuePair("necategory", ""), 
                new BasicNameValuePair("netype", ""), 
                new BasicNameValuePair("neip", ""), 
                new BasicNameValuePair("nestate", ""), 
                new BasicNameValuePair("start", ""), 
                new BasicNameValuePair("size", ""), 
                new BasicNameValuePair("orderby", ""), 
                new BasicNameValuePair("desc", "")
        };
  
  //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": [
        {
            "nedn": "DN=TEST_ME_1372305062666", 
            "nename": "node1", 
            "necategory": null, 
            "netype": "NE10TE", 
            "nevendorname": "Huawei", 
            "neip": "192.0.0.1", 
            "nesysoid": "1.3.6.1.4.1.2011.2.35.5", 
            "nestate": 2, 
            "timezoneid": ""
        }, 
        {
            "nedn": "DN=TEST_ME_1372305179318", 
            "nename": "node11", 
            "necategory": null, 
            "netype": "NE10TE", 
            "nevendorname": "Huawei", 
            "neip": "192.0.1.1", 
            "nesysoid": "1.3.6.1.4.1.2011.2.35.5", 
            "nestate": 2, 
            "timezoneid": ""
        }, 
        {
            "nedn": "DN=TEST_ME_1372305214749", 
            "nename": "node112", 
            "necategory": null, 
            "netype": "NE10TE", 
            "nevendorname": "Huawei", 
            "neip": "192.0.1.1", 
            "nesysoid": "1.3.6.1.4.1.2011.2.35.5", 
            "nestate": 2, 
            "timezoneid": ""
        }, 
        {
            "nedn": "OS=1", 
            "nename": "LocalNMS", 
            "necategory": null, 
            "netype": "OMS", 
            "nevendorname": "Huawei", 
            "neip": "", 
            "nesysoid": null, 
            "nestate": 0, 
            "timezoneid": null
        }
    ], 
    "description": "Operation success."
}

Network Management APIs

This section describes network resource management RESTful APIs.

Query the Network Device List

Function

This interface is used to query the network device list based on parameter settings.

URI

/rest/openapi/network/nedevice

Access Method

GET

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.

nedn

Optional

URL

String

Indicates the device DN.

neid

Optional

URL

String

Indicates the device ID.

aliasname

Optional

URL

String

Indicates the name of the network management system.

nename

Optional

URL

String

Indicates the device name.

necategory

Optional

URL

String

Indicates the device category.

netype

Optional

URL

String

Indicates the device type.

nevendorname

Optional

URL

String

Indicates the device vendor name (device vendor ID).

neip

Optional

URL

String

Indicates the device's IP address.

nemac

Optional

URL

String

Indicates the device's MAC address.

version

Optional

URL

String

Indicates the device version.

nepatchversion

Optional

URL

String

Indicates the patch version.

nesysoid

Optional

URL

String

Indicates the system object ID of the device.

nestate

Optional

URL

int

Indicates the status of the network device. The options are as follows:

  • 0: not detected
  • 1: online
  • 2: offline
  • 3: unknown
  • 4: unreachable through SNMP
  • 5: error

lastpolltime

Optional

URL

String

Indicates the last synchronization time.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD hh:mm:ss format.

createtime

Optional

URL

String

Indicates the time when the device is created.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD hh:mm:ss format.

timezoneid

Optional

URL

String

Indicates the time zone of the device.

neiptype

Optional

URL

int

Indicates the IP address type. The options are as follows:

  • 0: IPv4
  • 1: IPv6

subnet

Optional

URL

String

Indicates the subnet.

negroupname

Optional

URL

String

Indicates the group name.

neosversion

Optional

URL

String

Indicates the software version.

necontact

Optional

URL

String

Indicates the contact person.

neposition

Optional

URL

String

Indicates the device location.

memo

Optional

URL

String

Indicates remarks about the device.

maintainunit

Optional

URL

String

Indicates the maintenance unit.

putintoactiontime

Optional

URL

String

Indicates the put-into-use time.

Indicates the local time of the eSight server. The value must be in the YYYY-MM-DD hh:mm:ss format.

usefullife

Optional

URL

String

Indicates the expiry date of maintenance.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD format.

neruntime

Optional

URL

String

Indicates the device startup time.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD hh:mm:ss format.

nedescribe

Optional

URL

String

Indicates device description.

assetManager

Optional

URL

String

Indicates the asset manager.

assetNumber

Optional

URL

String

Indicates the asset number.

assetDate

Optional

URL

String

Indicates the date at which the asset is purchased.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD format.

start

Optional

URL

int

Indicates the start position to return query results. The default value is 0.

NOTE:
  • If the value is less than 0, the default value is used.
  • This parameter must be used together with the orderby parameter. The field specified by orderby is unique in the query result set. You are advised to set orderby to nedn.

size

Optional

URL

int

Indicates the total number of items in the query results that are returned. The default value is 20.

NOTE:
  • If the value is less than 0, the default value is used.
  • It is recommended that the maximum data size be 10,000.

orderby

Optional

URL

String

Indicates the field to sort the query results. The default field to sort the results is nedn.

The fields can be nedn, nename, necategory, netype, neip, nesysoid, or nestate.

desc

Optional

URL

boolean

Specifies whether query results are sorted in a descending order. The default value is false.

NOTE:

This parameter is valid only after the orderby parameter is specified.

fields

Optional

URL

String

Specifies the fields to be included in the query result. The value of the fields parameter specifies the field name. If multiple fields exist, separate them with commas (,).

NOTE:

If the fields parameter is specified, the query result contains only the specified fields. Otherwise, the query result contains all the fields.

Request Example

This API has many parameters. The openid parameter is mandatory. Here, the nedn parameter is used as an example.
GET https://10.120.22.178:32102/rest/openapi/network/nedevice?nedn=NE=34603225

Headers: key = openid,value = 48bb9862ce7449ce0d2e0894e6001c76ee26060c420e4065

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

List<NeDetailInfo>

Indicates the network device information list.

description

String

Indicates the description of the interface invoking result.

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

Field

Value Type

Description

nedn

String

Indicates the device DN.

neid

String

Indicates the device ID.

aliasname

String

Indicates the name of the network management system.

nename

String

Indicates the device name.

necategory

String

Indicates the device category (for example, router or switch).

netype

String

Indicates the device type.

nevendorname

String

Indicates the device vendor name (device vendor ID).

neip

String

Indicates the device's IP address. Multiple IP addresses are separated by commas (,).

nemac

String

Indicates the device's MAC address.

version

String

Indicates the device version.

nepatchversion

String

Indicates the patch version.

nesysoid

String

Indicates the system object ID of the device.

nestate

int

Indicates the device status. The options are as follows:

  • 0: not detected
  • 1: online
  • 2: offline
  • 3: unknown

lastpolltime

String

Indicates the last synchronization time.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD hh:mm:ss format.

createtime

String

Indicates the time when the device is created.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD hh:mm:ss format.

timezoneid

String

Indicates the time zone of the device.

neiptype

int

Indicates the IP address type. The options are as follows:

  • 0: IPv4
  • 1: IPv6

NEIP2NUMBER

int

Indicates the number converted from the IP address.

subnet

String

Indicates the subnet.

negroupname

String

Indicates the group name.

neosversion

String

Indicates the software version.

necontact

String

Indicates the contact person.

neposition

String

Indicates the device location.

memo

String

Indicates remarks about the device.

maintainunit

String

Indicates the maintenance unit.

putintoactiontime

String

Indicates the put-into-use time.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD format.

usefullife

String

Indicates the expiry date of maintenance.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD format.

neruntime

String

Indicates the device startup time.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD hh:mm:ss format.

nedescribe

String

Indicates device description.

assetManager

String

Indicates the asset manager.

assetNumber

String

Indicates the asset number.

assetDate

String

Indicates the date at which the asset is purchased.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD format.

Response Example

{
    "code": 0,
    "data": [
        {
            "nedn": "NE=34603225",
            "neid": null,
            "aliasname": "S7706",
            "nename": "S7706",
            "necategory": "ne.category.switch",
            "netype": "S7703",
            "nevendorname": "Huawei",
            "neip": "10.136.252.19",
            "nemac": "78-1D-BA-52-BC-7F",
            "version": "S7703V200R010C00",
            "nepatchversion": null,
            "nesysoid": "1.3.6.1.4.1.2011.2.223.1",
            "nestate": "1",
            "lastpolltime": "1543164109307",
            "createtime": "1543158247357",
            "timezoneid": "Asia/Shanghai",
            "neiptype": "0",
            "NEIP2NUMBER": "176749587",
            "subnet": "/",
            "negroupname": "Switch",
            "neosversion": "VRP5.17 V200R010C00SPC600",
            "necontact": null,
            "neposition": "Beijing China",
            "memo": null,
            "maintainunit": null,
            "putintoactiontime": null,
            "usefullife": null,
            "neruntime": "1539075948553",
            "nedescribe": "Quidway S7703\r\nHuawei Versatile Routing Platform Software\r\nVRP (R) Software, Version 5.170 (S7700 V200R010C00SPC600)\r\nCopyright (c) 2000-2016 Huawei Technologies Co., Ltd\r\n",
            "assetManager": null,
            "assetNumber": null,
            "assetDate": null
        }
    ],
    "description": "Operation success."
}

Precautions

None.

Example

package com.huawei.oms.ros.test;

import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
import com.huawei.oms.ros.test.GlobalVar;
import com.huawei.oms.ros.test.NewHttpsAccess;
import com.huawei.oms.ros.test.NewRosSecurity;


/**
 * Query Device Information based on Parameter Settings
 */
public class QueryNetworkDeviceList {
    private static final String EAM_NEDEVICE = "/rest/openapi/network/nedevice";

    public static void main(String[] args) throws Exception {
        Login.login();
        queryNeDeviceTest();
    }

    public static void queryNeDeviceTest() throws Exception {
        //set the URL and method
        String openidURL = EAM_NEDEVICE;
        String method = "GET";
        
        //set headers
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        BasicNameValuePair[] parameters =
        {
                new BasicNameValuePair("necategory", ""), 
                new BasicNameValuePair("netype", ""), 
                new BasicNameValuePair("nedn", "NE=34603011"), 
                new BasicNameValuePair("createtime", ""),
                new BasicNameValuePair("nestate", ""), 
                new BasicNameValuePair("start", ""), 
                new BasicNameValuePair("size", ""), 
                new BasicNameValuePair("orderby", ""), 
                new BasicNameValuePair("desc", "")

        };
        
        //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":[
{"nedn":"NE=34603011",
"neid":"",
"aliasname":"CX600-X8-ASG-9",
"nename":"CX600-X8-ASG-9",
"necategory":"ne.category.unknown",
"netype":"HuaweiDevice",
"nevendorname":"Huawei",
"neip":"10.137.61.9",
"nemac":"00-25-9E-99-84-4B",
"version":"",
"nepatchversion":"",
"nesysoid":"1.3.6.1.4.1.2011.2.87.18",
"nestate":"1",
"lastpolltime":"1414143600369"
"createtime":"1414135951940",
"timezoneid":"GMT+08:00",
"neiptype":"0",
"NEIP2NUMBER":"176766217"
"subnet":"/",
"negroupname":"Huawei",
"neosversion":"VRP5.13 V600R007C00",
"necontact":"R&D Beijing, Huawei Technologies co.,Ltd.",
"neposition":"beijing China",
"memo":"ceshi",
"maintainunit":"huawei",
"putintoactiontime":"1413388800000",
"usefullife":"1476633600000",
"neruntime":"1413374071667",
"nedescribe":"Huawei Versatile Routing Platform Software\r\nVRP (R) software, Version 5.130 (CX600 V600R007C00)\r\nCopyright (C) 2000-2013 Huawei Technologies Co., Ltd.\r\nCX600-X8 \r\n",
"assetManager":"shishi",
"assetNumber":"cs123",
"assetDate":"1413302400000"
}
],
"description":"Successful"
}

Add or Modify Network Devices

Function

This interface is used to add or modify network devices.

  • Add device: Only one device can be added by an IP address or a port number.
  • Modify device: Only the device name can be modified based on the nedn field.

URI

/rest/openapi/network/nedevice

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.

neip

Mandatory

URL

String

Indicates the device's IP address.

NOTE:

IPv6 addresses are supported too.

snmpport

Mandatory

URL

int

Indicates the SNMP port.

NOTE:

The default value is 161. Value range: 0–65535

readcommunity

Optional

URL

String

Indicates the read community name.

NOTE:

The value is case-sensitive. This parameter is mandatory when the SNMPv2c protocol is used.

protocoltype

Optional

URL

String

Indicates the protocol type.

NOTE:

The default value is SNMP. Only SNMP is supported.

retrytimes

Optional

URL

int

Indicates the retry count.

NOTE:

The default value is 5. Value range: 0-5

timeout

Optional

URL

int

Indicates the timeout period.

NOTE:

The default value is 3. Value range: 1-60 The unit is second.

protocolVersion

Optional

URL

String

Indicates the protocol version.

NOTE:

The default value is V2c. The SNMPv2c and SNMPv3 protocols are supported. The value is case-sensitive. If the SNMPv3 protocol is used, protocolVersion must be set to V3.

parentDn

Optional

URL

String

Indicates the subnet DN.

NOTE:

The value format is SN=34603287. The default directory is the root directory (/). This parameter needs to be set only when devices are added and is case-sensitive. If the value of this parameter cannot be obtained, it is recommended that you leave this parameter empty and set the subnet parameter. Either this parameter or the subnet parameter must be set. After a device is added successfully, the device is automatically added to the subnet.

subnet

Optional

Parameter list

String

Indicates the subnet path.

NOTE:

The value format is /China/Jiangsu/Nanjing..., excluding the following special characters: \"#%&'+;<=>? Choose Resource > Common > Resource Group > Subnet from the main menu to view the existing subnet name and enter the subnet path based on the name. The default path is / (root directory). This parameter is mandatory only when the subnet is added. The parameter value is case-sensitive. Either this parameter or the parentDn parameter must be set. After a device is added successfully, the device is automatically added to the subnet.

writecommunity

Optional

URL

String

Indicates the write community name.

NOTE:

This field is empty by default.

nename

Optional

URL

String

Indicates the device name displayed on eSight.

NOTE:

If this field is left empty when you add a device, eSight automatically obtains the device name from the device.

nedn

Optional

URL

String

Indicates the device DN.

NOTE:

Indicates the unique identifier distributed during device addition. (The value is obtained from the nemgr.tbl_ne_info table in the database.)

Specify this parameter when you modify a device. Do not specify this parameter when you add a device. The value is case sensitive.

securityName

Optional

URL

String

Indicates the security name.

NOTE:

The value is case-sensitive. This parameter is mandatory when the SNMPv3 protocol is used.

context

Optional

URL

String

Indicates the context name.

NOTE:

This field is empty by default.

authProtocol

Optional

URL

String

Indicates the authorization protocol.

NOTE:

The default value is HMAC_SHA, which indicates the authentication protocol used by SNMPv3. The options include HMAC_SHA and HMAC_MD5, which is case-sensitive.

authKey

Optional

URL

String

Indicates the authentication key.

NOTE:

This field is empty by default. It indicates the authentication password used by the SNMPv3 protocol and is case-sensitive.

privProtocol

Optional

URL

String

Indicates the proprietary protocol.

NOTE:

The default value is AES_128, which indicates the data encryption protocol used by SNMPv3. The options include AES_128 and CBC_DES, which is case-sensitive.

privKey

Optional

URL

String

Indicates the private key.

NOTE:

This field is empty by default. It indicates the encryption password used by the SNMPv3 protocol and is case-sensitive.

Request Example

  • Adding network devices
This API has many parameters. The openid, neip, and snmpport parameters are mandatory. Here, the readcommunity parameter is used as an example.
PUT https://10.120.22.178:32102/rest/openapi/network/nedevice?neip=10.136.252.22&snmpport=161&readcommunity="public123"

Headers: key = openid,value = c971939d611d7cbce24652358dc5fbd75b5dd9e4fef7474f
  • Modifying network devices
This API has many parameters. The openid, neip, and snmpport parameters are mandatory. Here, the nedn and nename parameters are used as an example.
PUT https://10.120.22.178:32102/rest/openapi/network/nedevice?neip=10.136.252.22&snmpport=161&nename="test-openapi-name"&nedn=NE=34603309

Headers: key = openid,value = c971939d611d7cbce24652358dc5fbd75b5dd9e4fef7474f

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

0: succeeded

Non-0: failed

operateresult

String

Indicates error description.

neid

String

Indicates the device ID. This field is reserved and empty permanently.

nedn

String

Indicates the device DN.

data

NULL

Indicates the device information list. This field is not included in the response for device addition.

neRosReturn

Map<String, Integer>

This field is reserved and requires no concern.

Response Example

  • Adding network devices
{
    "code": 0,
    "neid": null,
    "nedn": "NE=34603309",
    "operateresult": "Operation success.",
    "data": null,
    "neRosReturn": {
        "code": 0
    }
}
  • Modifying network devices
{
    "code": 0,
    "neid": null,
    "nedn": "NE=34603309",
    "operateresult": "the device is exist. And modify Operation success.",
    "data": null,
    "neRosReturn": {
        "code": 0
    }
}

Precautions

None.

Example (Add Device)

package com.huawei.oms.ros.test;

import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
import com.huawei.oms.ros.test.GlobalVar;
import com.huawei.oms.ros.test.NewHttpsAccess;
import com.huawei.oms.ros.test.NewRosSecurity;


/**
 * Add Device based on Parameter Settings
 */
public class AddDevice{
    private static final String EAM_NEDEVICE = "/rest/openapi/network/nedevice";

    public static void main(String[] args) throws Exception {
        Login.login();
        addDeviceTest();
    }

    public static void addDeviceTest() throws Exception {
        //set the URL and method
        String openidURL = EAM_NEDEVICE;
        String method = "PUT";
        //set headers
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        BasicNameValuePair[] parameters =
        {
                new BasicNameValuePair("neip", "10.137.59.139"), 
                new BasicNameValuePair("readcommunity", "public"),
                new BasicNameValuePair("writecommunity", "private"),
                new BasicNameValuePair("snmpport", "10004") ,

        };
        //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,
    "neid":"null",
    "nedn":"NE=34603609",
    "operateresult":"Operation success.",
    "data":null,
    "neRosReturn":{"code":0}
}

Example (Modify Device Name)

package com.huawei.oms.ros.test;

import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
import com.huawei.oms.ros.test.GlobalVar;
import com.huawei.oms.ros.test.NewHttpsAccess;
import com.huawei.oms.ros.test.NewRosSecurity;


/**
 * Add Device based on Parameter Settings
 */
public class ModifyDevice {
    private static final String EAM_NEDEVICE = "/rest/openapi/network/nedevice";

    public static void main(String[] args) throws Exception {
        Login.login();
        modifyDeviceTest();
    }

    public static void modifyDeviceTest() throws Exception {
        //set the URL and method
        String openidURL = EAM_NEDEVICE;
        String method = "PUT";
        //set headers
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        BasicNameValuePair[] parameters =
        {
                new BasicNameValuePair("nedn", "NE=34603609"), 
                new BasicNameValuePair("neip", "10.137.59.139"),
                new BasicNameValuePair("nename", "fgfhhh"),

        };
        //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,
    "neid":"null",
    "nedn":"NE=34603609",
    "operateresult":"the device is exist. And modify Operation success.",
    "data":null,
    "neRosReturn":{"code":0}
}

Delete a Network Device

Function

This interface is used to delete network devices.

URI

/rest/openapi/network/nedevice

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.

neid

Optional

URL

String

Indicates the device ID.

NOTE:

The neid is specified by a third-party system to uniquely identify a device. eSight uses the nedn field to uniquely identify a device. There is one-to-one mapping between neid and nedn.

nedn

Optional

URL

String

Indicates the device DN.

NOTE:

Either the device DN or the device ID must be available.

Request Example

The openid parameter is mandatory for the API. Here, the nedn parameter is used as an example.
DELETE https://10.120.22.178:32102/rest/openapi/network/nedevice?nedn=NE=34603309

Headers: key = openid,value = c971939d611d7cbce24652358dc5fbd75b5dd9e4fef7474f

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

neid

String

Indicates the device ID.

nedn

String

Indicates the device DN.

operateresult

String

Indicates the operation result.

Response Example

{
    "code": 0,
    "neid": "null",
    "nedn": "NE=34603309",
    "operateresult": "Operation success.",
    "data": null,
    "neRosReturn": {
        "code": 0
    }
}

Precautions

None.

Example

package com.huawei.oms.ros.test;

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

public class DeleteDevice 
{
    private static final String EAM_LINK = "/rest/openapi/network/nedevice";
    public static void main(String[] args) throws Exception {
        Login.login();
        delDevice();
    }
    public static void delDevice() throws Exception 
    {
        //set the URL and method
        String openidURL = EAM_LINK;
        String method = "DELETE";
        //set headers
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        BasicNameValuePair[] parameters =
        {
                new BasicNameValuePair("nedn", "NE=34604609")
        };
        //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,
 "neid":"null",
 "nedn":"NE=34604927",
 "operateresult":"del Operation success."}

Query the Port List

Function

This interface is used to query the port list based on parameter settings.

URI

/rest/openapi/network/port

Access Method

GET

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.

neip

Optional

URL

String

Indicates the device's IP address. Example: 10.137.240.83

nename

Optional

URL

String

Indicates the device name. Example: CE5855

nedn

Optional

URL

String

Indicates the device DN. Example: NE=34604111

portdn

Optional

URL

String

Indicates the port DN. Example: NE=34603916,FR=-1,S=1,SS=-1,PP=|1025|1|GigabitEthernet1/0/1

framedn

Optional

URL

String

Indicates the frame DN. Example: NE=34603916,FR=-1.

slotdn

Optional

URL

String

Indicates the slot DN. Example: NE=34603916,FR=-1,S=1

subslotdn

Optional

URL

String

Indicates the subcard DN. Example: NE=34604111,FR=1,S=1,SS=1

frameno

Optional

URL

int

Indicates the frame number. Example: 1

slotno

Optional

URL

int

Indicates the slot ID. Example: 5

subslotno

Optional

URL

int

Indicates the subcard ID. Example: 5

portindex

Optional

URL

int

Indicates the port index. Example: 167837696

portno

Optional

URL

int

Indicates the port number. Example: 3

descr

Optional

URL

String

Indicates the port description. Example: Huawei, Quidway Series, GigabitEthernet0/0/0 Interface

name

Optional

URL

String

Indicates the port name. Example: GigabitEthernet0/0/0

adminstatus

Optional

URL

int

Indicates the administrative status of the port. The options are as follows:

  • 1: up
  • 2: down

operstatus

Optional

URL

int

Indicates the running status of the port. The options are as follows:

  • 1: up
  • 2: down

ifindex

Optional

URL

int

Indicates the interface index. Example: 167837697

iftype

Optional

URL

int

Indicates the port type. The options are as follows:

  • 2: Ethernet
  • 5: Atm
  • 6: Pos
  • 7: Serial
  • 9: E1
  • 10: T1
  • 11: Cpos
  • 19: Aux
  • 20: E3
  • 21: T3
  • 22: Meth
  • 32: Cellular

ipaddress

Optional

URL

String

Indicates the port IP address, for example, 10.0.3.1.

ifspeed

Optional

URL

String

Indicates the port rate (bit/s). Example: 162529280

start

Optional

URL

int

Indicates the start position to return query results. The default value is 0.

NOTE:
  • If the value is less than 0, the default value is used.
  • This parameter must be used together with the orderby parameter. The field specified by orderby is unique in the query result set. You are advised to set orderby to portdn.

size

Optional

URL

int

Indicates the total number of query result sets. The value ranges from 1 to 100. The default value is 20.

NOTE:

If the value is less than 1 or greater than 100, the default value is used.

orderby

Optional

URL

String

Indicates the field to sort the query results. The default field to sort the results is nedn.

The fields can be nedn, nename, portdn, or name.

NOTE:
  • Separate multiple fields with commas (,).
  • When you use the start and size parameters to perform pagination query, you must set orderby to portdn.

desc

Optional

URL

boolean

Specifies whether query results are sorted in a descending order. The default value is false.

NOTE:

This parameter is valid only after the orderby parameter is specified.

fields

Optional

URL

String

Specifies the fields to be included in the query result. The value of the fields parameter specifies the field name. If multiple fields exist, separate them with commas (,).

NOTE:

If the fields parameter is specified, the query result contains only the specified fields. Otherwise, the query result contains all the fields.

Request Example

This API has many parameters. The openid parameter is mandatory. Here, the neip, framedn, slotdn, and portdn parameters are used as an example.
GET https://10.120.22.178:32102/rest/openapi/network/port?neip=10.136.252.210&framedn=NE=34603009,FR=1&slotdn=NE=34603009,FR=1,S=1&portdn=NE=34603009,FR=1,S=1,SS=-1,PP=|1025|5|GE1/0/1

Headers: key = openid,value = c971939d611d7cbce24652358dc5fbd75b5dd9e4fef7474f

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

List<PortResData>

Indicates the port list.

pageSize

int

Indicates the total pages of records that meet search criteria.

totalSize

int

Indicates the total number of records that meet search criteria.

description

String

Indicates the description of the interface invoking result.

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

Field

Value Type

Description

neip

String

Indicates the device's IP address. Multiple IP addresses are separated by commas (,).

nename

String

Indicates the device name.

nedn

String

Indicates the device DN.

portdn

String

Indicates the port DN.

framedn

String

Indicates the frame DN.

slotdn

String

Indicates the slot DN.

subslotdn

String

Indicates the subcard DN.

frameno

int

Indicates the frame ID.

slotno

int

Indicates the slot ID.

subslotno

int

Indicates the subcard ID.

portindex

int

Indicates the port index.

portno

int

Indicates the port number.

descr

String

Indicates the port description.

name

String

Indicates the port name.

adminstatus

int

Indicates the management status.

operstatus

int

Indicates the running status.

ifindex

int

Indicates the interface index.

iftype

int

Indicates the port type.

ipaddress

String

Indicates the port IP address.

ipnetmask

String

Indicates the port subnet mask.

ifspeed

String

Indicates the port rate (bit/s).

Response Example

{
    "code": 0,
    "data": [
        {
            "neip": "10.136.252.210",
            "nename": "ce5810",
            "nedn": "NE=34603009",
            "framedn": "NE=34603009,FR=1",
            "slotdn": "NE=34603009,FR=1,S=1",
            "portdn": "NE=34603009,FR=1,S=1,SS=-1,PP=|1025|5|GE1/0/1",
            "subslotdn": "-1",
            "frameno": 1,
            "slotno": 1,
            "subslotno": -1,
            "portindex": 16847106,
            "portno": 5,
            "descr": "GE1/0/1",
            "name": "GE1/0/1",
            "adminstatus": 1,
            "operstatus": 2,
            "ifindex": 5,
            "iftype": 2,
            "ipaddress": null,
            "ipnetmask": null,
            "ifspeed": "1000000000"
        }
    ],
    "description": "Operation success.",
    "pageSize": 1,
    "totalSize": 1
}

Precautions

Port in this section refers to a physical port but not an interface.

Example

package com.huawei.oms.ros.test;

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

/**
 * Query All Device port 
 */
public class QueryPortRes
{
    private static final String EAM_CATEGORY = "/rest/openapi/network/port";
    
    public static void main(final String[] args)
        throws Exception
    {
        Login.login();
        queryNeCategoryTest();
    }
    
    public static void queryNeCategoryTest()
        throws Exception
    {
        //set the URL and method
        final String openidURL = EAM_CATEGORY;
        final String method = "GET";
        
        //set headers
        final BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        final BasicNameValuePair[] parameters =
            {new BasicNameValuePair("iftype", "2"), new BasicNameValuePair("nename", "S9312_61.36"),
                new BasicNameValuePair("name", "GigabitEthernet10/1/1"), new BasicNameValuePair("size", "100")};
        
        //send the request
        final HttpResponse response =
            NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        //get the result
        final String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    }
}

The returned result is as follows:

{
"code":0,
"data":[
{
"neip":"10.137.61.36",
"nename":"S9312_61.36",
"nedn":"NE=34603642",
"portdn":"NE=34603642,FR=1,S=10,SS=-1,PP=|1025|23|GigabitEthernet10/1/11",
"framedn":"NE=34603642,FR=1",
"slotdn":"NE=34603642,FR=1,S=10",
"subslotdn":"-1",
"frameno":1,
"slotno":10,
"subslotno":-1,
"portindex":69862094,
"portno":23,
"descr":"HUAWEI, Quidway Series, GigabitEthernet10/1/11 Interface",
"name":"GigabitEthernet10/1/11",
"adminstatus":1,
"operstatus":2,
"ifindex":125,
"iftype":2,
"ipaddress":null,
"ipnetmask":null,
"ifspeed":"1000000000"
},
{
"neip":"10.137.61.36",
"nename":"S9312_61.36",
"nedn":"NE=34603642",
"portdn":"NE=34603642,FR=1,S=10,SS=-1,PP=|1025|22|GigabitEthernet10/1/10",
"framedn":"NE=34603642,FR=1",
"slotdn":"NE=34603642,FR=1,S=10",
"subslotdn":"-1",
"frameno":1,
"slotno":10,
"subslotno":-1,
"portindex":69862030,
"portno":22,
"descr":"HUAWEI, Quidway Series, GigabitEthernet10/1/10 Interface",
"name":"GigabitEthernet10/1/10",
"adminstatus":1,
"operstatus":2,
"ifindex":124,
"iftype":2,
"ipaddress":null,
"ipnetmask":null,
"ifspeed":"1000000000"
},
{
"neip":"10.137.61.36",
"nename":"S9312_61.36",
"nedn":"NE=34603642",
"portdn":"NE=34603642,FR=1,S=10,SS=-1,PP=|1025|13|GigabitEthernet10/1/1",
"framedn":"NE=34603642,FR=1",
"slotdn":"NE=34603642,FR=1,S=10",
"subslotdn":"-1",
"frameno":1,
"slotno":10,
"subslotno":-1,
"portindex":69861454,
"portno":13,
"descr":"HUAWEI, Quidway Series, GigabitEthernet10/1/1 Interface",
"name":"GigabitEthernet10/1/1",
"adminstatus":1,
"operstatus":2,
"ifindex":115,
"iftype":2,
"ipaddress":null,
"ipnetmask":null,
"ifspeed":"1000000000"
}
],"description":"Operation success."}

Query the Optical Port List

Function

This interface is used to query the optical port list based on parameter settings.

URI

/rest/openapi/network/otpoint

Access Method

GET

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

Indicates a session ID, which is 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.

nedn

Optional

Parameter list

String

Indicates the device DN. Example: NE=34604111

start

Optional

Parameter list

int

Indicates the start position to return query results. The default value is 0.

NOTE:

If the value is less than 0, the default value is used.

size

Optional

Parameter list

int

Indicates the total number of query result sets. The value ranges from 1 to 100. The default value is 20.

NOTE:

If the value is less than 1 or greater than 100, the default value is used.

fields

Optional

Parameter list

String

Specifies the fields to be included in the query result. The value of the fields parameter specifies the field name. If multiple fields exist, separate them with commas (,).

NOTE:

If the fields parameter is specified, the query result contains only the specified fields. Otherwise, the query result contains all the fields.

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Others: failed

data

List<OTPointResData>

Indicates the device group information list.

pageSize

int

Indicates the total pages of records that meet search criteria.

totalSize

int

Indicates the total number of records that meet search criteria.

description

String

Indicates the description of the interface invoking result.

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

Field

Value Type

Description

name

String

Indicates the optical port name.

adminstatus

String

Indicates the management status.

operstatus

String

Indicates the running status.

ipaddress

String

Indicates the optical port IP address.

ipnetmask

String

Indicates the optical port subnet mask.

portindex

String

Indicates the optical port index.

Precautions

Optical port in this section refers to a physical port but not an interface.

Example

package com.huawei.oms.ros.test;

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

/**
 * Query All Device port 
 */
public class QueryPortRes
{
    private static final String EAM_CATEGORY = "/rest/openapi/network/otpoint";
    
    public static void main(final String[] args)
        throws Exception
    {
        Login.login();
        queryNeCategoryTest();
    }
    
    public static void queryNeCategoryTest()
        throws Exception
    {
        //set the URL and method
        final String openidURL = EAM_CATEGORY;
        final String method = "GET";
        
        //set headers
        final BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        final BasicNameValuePair[] parameters =
            {new BasicNameValuePair("nedn", "NE=32540127")};
        
        //send the request
        final HttpResponse response =
            NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        //get the result
        final String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    }
}

The returned result is as follows:

{
"code":0,
"data":[
{
"portindex":69862094,
"name":"GigabitEthernet10/1/11",
"adminstatus":"1",
"operstatus":"2",
"ipaddress":null,
"ipnetmask":null
},
{
"portindex":69862030,
"name":"GigabitEthernet10/1/10",
"adminstatus":"1",
"operstatus":"2",
"ipaddress":null,
"ipnetmask":null
},
{
"portindex":69861454,
"name":"GigabitEthernet10/1/1",
"adminstatus":"1",
"operstatus":"2",
"ipaddress":null,
"ipnetmask":null
}
],"description":"Operation success."}

Query the Board List

Function

This interface is used to query the board list based on parameter settings.

URI

/rest/openapi/network/slot

Access Method

GET

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.

nedn

Optional

URL

String

Indicates the device DN. Example: NE=34604111

nename

Optional

URL

String

Indicates the device name. Example: CE5855

framedn

Optional

URL

String

Indicates the frame DN. Example: NE=34603916,FR=-1.

framename

Optional

URL

String

Indicates the frame name. Example: AR1220V

frameno

Optional

URL

int

Indicates the frame number. Example: 1

slotdn

Optional

URL

String

Indicates the board DN. Example: NE=34603916,FR=-1,S=1

slotindex

Optional

URL

int

Indicates the board index. Example: 151060480

slotno

Optional

URL

int

Indicates the board number. Example: 12

vendortype

Optional

URL

String

Indicates the vendor type. Example: .1.3.6.1.4.1.2011.20021210.12.3797

descr

Optional

URL

String

Indicates board description. Example: NE20E 8GE-F Card

slotname

Optional

URL

String

Indicates the slot name. Example: 8GE-F

physicalclass

Optional

URL

int

Indicates categories of entities on a device. The options are as follows:

  • 3: frame
  • 4: backplane
  • 5: slot
  • 6: power supply
  • 7: fan
  • 9: board
  • 10: port

adminstatus

Optional

URL

int

Indicates the management status. The options are as follows:

  • 4 and 11: normal
  • 2, 3, and 12: error
  • 13: loopback

operstatus

Optional

URL

int

Indicates the operating status. The options are as follows:

  • 3, 11, 13, 15, and 16: normal
  • 2, 12, and 17: error
  • 4: offline

Others: unknown

standbystatus

Optional

URL

int

Indicates the active/standby status. The options are as follows:

  • 1: not supported
  • 2: hot standby
  • 3: cold standby
  • 4: providing service

hardversion

Optional

URL

String

Indicates the hardware version. Example: VER.A

firmversion

Optional

URL

String

Indicates the firmware version. Example: 109 Hex: 31 30 39

softversion

Optional

URL

String

Indicates the software version. Example: Version 8.100 V100R005C10

serialnum

Optional

URL

String

Indicates the sequence number. Example: 210231A69UH09400

mfgname

Optional

URL

String

Indicates the vendor name. Example: Huawei

modelname

Optional

URL

String

Indicates the module name. Example: huawei

alarmlight

Optional

URL

String

Indicates a reserved field, which has no meaning currently.

start

Optional

URL

int

Indicates the start position to return query results. The default value is 0.

NOTE:
  • If the value is less than 0, the default value is used.
  • This parameter must be used together with the orderby parameter. The field specified by orderby is unique in the query result set. You are advised to set orderby to slotdn.

size

Optional

URL

int

Indicates the total number of items in the query results that are returned. The default value is 20.

NOTE:

1. If the value is less than 0, the default value is used.

2. It is recommended that the maximum data size be 10,000.

orderby

Optional

URL

String

Indicates the field to sort the query results. The default field to sort the results is nedn.

The fields can be nedn, nename, framedn, framename, or slotdn.

NOTE:
  • Separate multiple fields with commas (,).
  • When you use the start and size parameters to perform pagination query, you must set orderby to slotdn.

desc

Optional

URL

boolean

Specifies whether query results are sorted in a descending order. The default value is false.

NOTE:

This parameter is valid only after the orderby parameter is specified.

fields

Optional

URL

String

Specifies the fields to be included in the query result. The value of the fields parameter specifies the field name. If multiple fields exist, separate them with commas (,).

NOTE:

If the fields parameter is specified, the query result contains only the specified fields. Otherwise, the query result contains all the fields.

Request Example

This API has many parameters. The openid parameter is mandatory. Here, the neip and framedn parameters are used as an example.
GET https://10.120.22.178:32102/rest/openapi/network/slot?neip=10.136.252.210&framedn=NE=34603009,FR=1

Headers: key = openid,value = c971939d611d7cbce24652358dc5fbd75b5dd9e4fef7474f

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

List<SlotResData>

Indicates board information list.

description

String

Indicates the description of the interface invoking result.

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

Field

Value Type

Description

nedn

String

Indicates the device DN.

neName

String

Indicates the device name.

framedn

String

Indicates the frame DN.

framename

String

Indicates the frame name.

frameno

int

Indicates the frame ID.

slotdn

String

Indicates the board DN.

slotindex

int

Indicates the board index.

slotno

int

Indicates the board number.

vendortype

String

Indicates the vendor type.

descr

String

Indicates board description.

slotname

String

Indicates the board name.

physicalclass

int

Indicates categories of entities on a device. The options are as follows:

  • 3: frame
  • 4: backplane
  • 5: slot
  • 6: power supply
  • 7: fan
  • 9: board
  • 10: port

adminstatus

int

Indicates the management status. The options are as follows:

  • 4 and 11: normal
  • 2, 3, and 12: error
  • 13: loopback

operstatus

int

Indicates the operating status. The options are as follows:

  • 3, 11, 13, 15, and 16: normal
  • 2, 12, and 17: error
  • 4: offline

Others: unknown

standbystatus

int

Indicates the active/standby status. The options are as follows:

  • 1: not supported
  • 2: hot standby
  • 3: cold standby
  • 4: providing service

hardversion

String

Indicates the hardware version.

firmversion

String

Indicates the firmware version.

softversion

String

Indicates the software version.

serialnum

String

Indicates the sequence number.

mfgname

String

Indicates the vendor name.

modelname

String

Indicates the module name.

alarmlight

String

Indicates a reserved field, which has no meaning currently.

Response Example

{
    "code": 0,
    "data": [
        {
            "nedn": "NE=34603009",
            "framedn": "NE=34603009,FR=1",
            "framename": "virtual frame ",
            "frameno": 1,
            "slotdn": "NE=34603009,FR=1,S=1",
            "slotindex": 16842753,
            "slotno": 1,
            "vendortype": ".1.3.6.1.4.1.2011.20021210.12.688165",
            "descr": "Basic Configuration,CloudEngine 5800,CE5810-EI-B00,CE5810-48T4S-EI Switch(2*150W AC Power Module,2*FAN Box,Port side exhaust)",
            "slotname": "CE5810-48T4S-EI 1",
            "physicalclass": 9,
            "adminstatus": 4,
            "operstatus": 3,
            "firmversion": "312",
            "softversion": "Version 8.100 V100R005C10SPC200",
            "standbystatus": 4,
            "hardversion": "CEM48T4SP01 VER A",
            "modelname": "--",
            "alarmlight": null,
            "serialnum": "210235908110G8000035",
            "mfgname": "Huawei",
            "neName": "ce5810"
        }
    ],
    "description": "Operation success."
}

Precautions

None.

Example

package com.huawei.oms.ros.test;

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

/**
 * Query Device Types based on Parameter Settings
 */
public class QuerySlot
{
    private static final String EAM_TYPE = "/rest/openapi/network/slot";
    
    public static void main(String[] args)
        throws Exception
    {
        Login.login();
        queryNeTypeTest();
    }
    
    public static void queryNeTypeTest()
        throws Exception
    {
        //set the URL and method
        String openidURL = EAM_TYPE;
        String method = "GET";
        
        //set headers
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        BasicNameValuePair[] parameters =
            {new BasicNameValuePair("nedn", "NE=34603009"),
                new BasicNameValuePair("fields", "nedn,nename")};
        
        //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":[{"nedn":"NE=34603009","neName":"ac6605d"}],"description":"Operation success."}

Query the Subcard List

Function

This interface is used to query the subcard list based on parameter settings.

URI

/rest/openapi/network/subslot

Access Method

GET

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.

nedn

Optional

URL

String

Indicates the device DN. Example: NE=34603918

nename

Optional

URL

String

Indicates the device name. Example: CE68

framedn

Optional

URL

String

Indicates the frame DN. Example: NE=34603918,FR=-1

slotdn

Optional

URL

String

Indicates the slot DN. Example: NE=34603918,FR=-1,S=0

slotname

Optional

URL

String

Indicates the board name. Example: board 0

subslotdn

Optional

URL

String

Indicates the subcard DN. Example: NE=34603916,FR=-1,S=5,SS=5

frameno

Optional

URL

int

Indicates the frame number. Example: 1

slotno

Optional

URL

int

Indicates the slot number. Example: 2

subslotindex

Optional

URL

int

Indicates the subcard index. Example: 201457920

subslotno

Optional

URL

int

Indicates the subcard ID. Example: 5

descr

Optional

URL

String

Indicates subcard description. Example: NE20E CompactFlash Cfcard

subslotname

Optional

URL

String

Indicates the subcard name. Example: subcard 2/1

vendortype

Optional

URL

String

Indicates the vendor type. Example: .1.3.6.1.4.1.2011.10.3.1.9.4.38

physicalclass

Optional

URL

int

Indicates categories of entities on a device. The options are as follows:

  • 3: frame
  • 4: backplane
  • 5: slot
  • 6: power supply
  • 7: fan
  • 9: board
  • 10: port

hardversion

Optional

URL

String

Indicates the hardware version. Example: VER.0

firmversion

Optional

URL

String

Indicates the firmware version. Example: Hex: 31 30 39

softversion

Optional

URL

String

Indicates the software version. Example: 0

adminstatus

Optional

URL

int

Indicates the management status. The options are as follows:

  • 4 and 11: normal
  • 2, 3, and 12: error
  • 13: loopback

operstatus

Optional

URL

int

Indicates the operating status. The options are as follows:

  • 3, 11, 13, 15, and 16: normal
  • 2, 12, and 17: error
  • 4: offline

Others: unknown

modelname

Optional

URL

String

Indicates the module name. Example: huawei

serialnum

Optional

URL

String

Indicates the sequence number. Example: 030KSB10B3000060

mfgname

Optional

URL

String

Indicates the vendor name. Example: Huawei

start

Optional

URL

int

Indicates the start position to return query results. The default value is 0.

NOTE:
  • If the value is less than 0, the default value is used.
  • This parameter must be used together with the orderby parameter. The field specified by orderby is unique in the query result set. You are advised to set orderby to slotdn.

size

Optional

URL

int

Indicates the total number of items in the query results that are returned. The default value is 20.

NOTE:

If the value is less than 0, the default value is used.

orderby

Optional

URL

String

Indicates the field to sort the query results. The default field to sort the results is nedn.

The fields can be nedn, nename, framedn, slotdn, or slotname.

NOTE:
  • Separate multiple fields with commas (,).
  • When you use the start and size parameters to perform pagination query, you must set orderby to slotdn.

desc

Optional

URL

boolean

Specifies whether query results are sorted in a descending order. The default value is false.

NOTE:

This parameter is valid only after the orderby parameter is specified.

Request Example

This API has many parameters. The openid parameter is mandatory. Here, the neip, framedn, subslotindex, and subslotname parameters are used as an example.
GET https://10.120.22.178:32102/rest/openapi/network/subslot?neip=10.136.252.210&framedn=NE=34603009,FR=1&subslotindex=16847360&subslotname=FAN 1/1

Headers: key = openid,value = c971939d611d7cbce24652358dc5fbd75b5dd9e4fef7474f

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

List<SubSlotResData>

Indicates the subcard information list.

description

String

Indicates the description of the interface invoking result.

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

Field

Value Type

Description

nedn

String

Indicates the device DN.

neName

String

Indicates the device name.

framedn

String

Indicates the frame DN.

slotdn

String

Indicates the board DN.

slotname

String

Indicates the board name.

subslotdn

String

Indicates the subcard DN.

frameno

int

Indicates the frame ID.

slotno

int

Indicates the board number.

subslotindex

int

Indicates the subcard index.

subslotno

int

Indicates the subcard ID.

descr

String

Indicates subcard description.

subslotname

String

Indicates the subcard name.

vendortype

String

Indicates the vendor type.

physicalclass

int

Indicates categories of entities on a device. The options are as follows:

  • 3: frame
  • 4: backplane
  • 5: slot
  • 6: power supply
  • 7: fan
  • 9: board
  • 10: port

hardversion

String

Indicates the hardware version.

firmversion

String

Indicates the firmware version.

softversion

String

Indicates the software version.

adminstatus

int

Indicates the management status. The options are as follows:

  • 4 and 11: normal
  • 2, 3, and 12: error
  • 13: loopback

operstatus

int

Indicates the operating status. The options are as follows:

  • 3, 11, 13, 15, and 16: normal
  • 2, 12, and 17: error
  • 4: offline

Others: unknown

modelname

String

Indicates the module name.

serialnum

String

Indicates the sequence number.

mfgname

String

Indicates the vendor name.

Response Example

{
    "code": 0,
    "data": [
        {
            "nedn": "NE=34603009",
            "framedn": "NE=34603009,FR=1",
            "slotdn": "NE=34603009,FR=1,S=1",
            "slotname": "CE5810-48T4S-EI 1",
            "subslotdn": "NE=34603009,FR=1,S=1,SS=1",
            "frameno": 1,
            "slotno": 1,
            "subslotindex": 16847360,
            "subslotno": 1,
            "descr": "Assembling Components,Fan box(SB,Front to Back,FAN panel side intake),FAN-40SB-F,Fan box(SB,Front to Back,FAN panel side intake)",
            "subslotname": "FAN 1/1",
            "vendortype": ".1.3.6.1.4.1.2011.20021210.13.688128",
            "physicalclass": 7,
            "hardversion": null,
            "firmversion": null,
            "softversion": null,
            "adminstatus": 4,
            "operstatus": 3,
            "modelname": "--",
            "serialnum": "21023561536TG5000059",
            "mfgname": "Huawei",
            "neName": "ce5810"
        }
    ],
    "description": "Operation success."
}

Precautions

None.

Example

package com.huawei.oms.ros.test;

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

/**
 * Query Device Types based on Parameter Settings
 */
public class QuerySubSlot
{
    private static final String EAM_TYPE = "/rest/openapi/network/subslot";
    
    public static void main(String[] args)
        throws Exception
    {
        Login.login();
        queryNeTypeTest();
    }
    
    public static void queryNeTypeTest()
        throws Exception
    {
        //set the URL and method
        String openidURL = EAM_TYPE;
        String method = "GET";
        
        //set headers
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        BasicNameValuePair[] parameters =
            {new BasicNameValuePair("nedn", "NE=34603033")};
        //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":[{"neName":"CX600-8-RSG-5","nedn":"NE=34603033","framedn":"NE=34603033,FR=1","slotdn":"NE=34603033,FR=1,S=7","slotname":null,"subslotdn":"NE=34603033,FR=1,S=7,SS=0","frameno":1,"slotno":7,"subslotindex":17236224,"subslotno":0,"vendortype":".1.3.6.1.4.1.2011.20021210.13.561155","descr":"--","physicalclass":9,"adminstatus":4,"operstatus":2,"hardversion":"CR52EAGF REV A","firmversion":"PIC0 EPLD ver 004","softversion":"","serialnum":"","modelname":"--","mfgname":"Huawei"}],"description":"Operation success"}

Query the Link List

Function

This interface is used to query the link list based on parameter settings.

URI

/rest/openapi/network/link

Access Method

GET

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.

anedn

Optional

URL

String

Indicates the source NE DN.

anename

Optional

URL

String

Indicates the source NE name.

aneip

Optional

URL

String

Indicates the IP address of the source NE.

anestate

Optional

URL

int

Indicates the status of the source NE. The options are as follows:

0: not detected

1: online

2: offline

3: unknown

aportdn

Optional

URL

String

Indicates the source port DN.

aportname

Optional

URL

String

Indicates the source port name.

aportip

Optional

URL

String

Indicates the IP address of the source port.

aportadminstatus

Optional

URL

int

Indicates the administrative status of the source port. The options are as follows:

1: up

2: down

3: testing

aportoperstatus

Optional

URL

int

Indicates the running status of the source port. The options are as follows:

1: up

2: down

3: testing

4: unknown

5: dormant

6: notPresent

7: lowerLayerDown

znedn

Optional

URL

String

Indicates the destination NE DN.

znename

Optional

URL

String

Indicates the destination NE name.

zneip

Optional

URL

String

Indicates the IP address of the destination NE.

znestate

Optional

URL

int

Indicates the status of the destination NE. The options are as follows:

0: not detected

1: online

2: offline

3: unknown

zportdn

Optional

URL

String

Indicates the destination port DN.

zportname

Optional

URL

String

Indicates the destination port name.

zportip

Optional

URL

String

Indicates the IP address of the destination port.

zportadminstatus

Optional

URL

int

Indicates the administrative status of the destination port. The options are as follows:

1: up

2: down

3: testing

zportoperstatus

Optional

URL

int

Indicates the running status of the destination port. The options are as follows:

1: up

2: down

3: testing

4: unknown

5: dormant

6: notPresent

7: lowerLayerDown

linkdn

Optional

URL

String

Indicates the link DN.

linkname

Optional

URL

String

Indicates the link name.

linkstatus

Optional

URL

int

Indicates the link status. The options are as follows:

0: normal

1: unknown

2: major fault

3: critical fault

4: offline

5: not detected

linktype

Optional

URL

int

Indicates the link type. The options include 1 (LLDP), 2 (Side-By-Side), 3 (MACARP), 4 (CDP), 5 (IP), 6 (Eth-Trunk links generated by physical links), and 99 (Manual).

speed

Optional

URL

String

Indicates the link speed, in Mbit/s.

start

Optional

URL

int

Indicates the start position to return query results. The default value is 0.

NOTE:
  • If the value is less than 0, the default value is used.
  • This parameter must be used together with the orderby parameter. The field specified by orderby is unique in the query result set. You are advised to set orderby to linkdn.

size

Optional

URL

int

Indicates the total number of items in the query results that are returned. The default value is 20.

NOTE:

If the value is less than 0, the default value is used.

orderby

Optional

URL

String

Indicates the field to sort the query results. The default field to sort the results is linkdn. The fields can be linkdn, linkname, anedn, anename, aportdn, aportname, znedn, znename, zportdn, zportname, linktype, or speed. Separate multiple fields with commas (,).

desc

Optional

URL

boolean

Specifies whether query results are sorted in a descending order. The default value is false. This parameter is valid only after the orderby parameter is specified.

Request Example

This API has many parameters. The openid parameter is mandatory. Here, the aneip parameter is used as an example.
GET https://10.120.22.178:32102/rest/openapi/network/link?aneip=10.136.252.19

Headers: key = openid,value = c971939d611d7cbce24652358dc5fbd75b5dd9e4fef7474f

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

List<LinkDataModel>

Indicates the link information list.

description

String

Indicates the description of the interface invoking result.

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

Field

Value Type

Description

linkdn

String

Indicates the link DN.

linkname

String

Indicates the link name.

anedn

String

Indicates the source NE DN.

anename

String

Indicates the source NE name.

aneip

String

Indicates the IP address of the source NE.

anestate

int

Indicates the status of the source NE.

aportdn

ng

Indicates the source port DN.

aportname

String

Indicates the source port name.

aportip

String

Indicates the IP address of the source port.

aportadminstatus

int

Indicates the administrative status of the source port.

aportoperstatus

int

Indicates the running status of the source port.

znedn

String

Indicates the destination NE DN.

znename

String

Indicates the destination NE name.

zneip

String

Indicates the IP address of the destination NE.

znestate

int

Indicates the status of the destination NE.

zportdn

String

Indicates the destination port DN.

zportname

String

Indicates the destination port name.

zportip

String

Indicates the IP address of the destination port.

zportadminstatus

int

Indicates the administrative status of the destination port.

zportoperstatus

int

Indicates the running status of the destination port.

linkstatus

int

Indicates the link status.

linktype

int

Indicates the link type.

speed

String

Indicates the bandwidth.

Response Example

{
    "code": 0,
    "data": [
        {
            "anedn": "NE=34603225",
            "anename": "S7706",
            "aneip": "10.136.252.19",
            "anestate": 1,
            "aportdn": "NE=34603225_1170",
            "aportname": "GigabitEthernet1/0/1",
            "aportip": "",
            "aportadminstatus": 1,
            "aportoperstatus": 2,
            "znedn": "NE=34603009",
            "znename": "ce5810",
            "zneip": "10.136.252.210",
            "znestate": 1,
            "zportdn": "NE=34603009_28",
            "zportname": "GE1/0/24",
            "zportip": "",
            "zportadminstatus": 1,
            "zportoperstatus": 2,
            "linkdn": "5_-1298870390198018597339391089014153",
            "linkname": "sdss",
            "linkstatus": 3,
            "linktype": 99,
            "speed": 1000
        }
    ],
    "description": "Operation success."
}

Precautions

None.

Example

package com.huawei.oms.ros.test;

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

public class QueryLink {
    private static final String EAM_LINK = "/rest/openapi/network/link";
    
    public static void main(String[] args) throws Exception {
        Login.login();
        queryLinkList();
    }
    
    public static void queryLinkList() throws Exception 
    {
        //set the URL and method
        String openidURL = EAM_LINK;
        String method = "GET";
        
        //set headers
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        BasicNameValuePair[] parameters =
        {
                new BasicNameValuePair("anedn", "NE=34604991")

        };
        
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, 
                headers, parameters);
        
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    }
}

The returned result is as follows:

"code":0,
"data":[
{"linkDn":"2_-129879503991-15331110521068312132",
 "linkName":"S5352C-EI-154_GigabitEthernet0/0/2_S3352-98_Ethernet0/0/1",
 "aneDn":"NE=34604991",
 "aneName":"S5352C-EI-154",
 "aneIp":"10.137.240.154",
 "aneState":1,
 "aportDn":"NE=34604991_9",
 "aportIp":"",
 "aportName":"GigabitEthernet0/0/2",
 "aportOperStatus":1,
 "aportAdminStatus":1,
 "zneDn":"NE=34604963",
 "zneName":"S3352-98",
 "zneIp":"10.137.240.98",
 "zneState":1,
 "zportDn":"NE=34604963_514",
 "zportName":"Ethernet0/0/1",
 "zportIp":"",
 "zportAdminStatus":1,
 "zportOperStatus":1,
 "linkStatus":0,
 "linkType":1,
 "speed":100,}],
 "description":"Successful"}

Query Frame Information

Function

This interface is used to query frame information based on parameter settings.

URI

/rest/openapi/network/frame

Access Method

GET

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.

nedn

Optional

URL

String

Indicates the device DN. Example: NE=34603916

nename

Optional

URL

String

Indicates the device name. Example: Ce68

framedn

Optional

URL

String

Indicates the frame DN. Example: NE=34603916,FR=-1

shelfindex

Optional

URL

int

Indicates the root index of all resources. Example: -1

frameindex

Optional

URL

int

Indicates the frame index. Example: 51445760

frameno

Optional

URL

int

Indicates the frame number. Example: 1

vendortype

Optional

URL

String

Indicates the vendor type. Example: .1.3.6.1.4.1.25506.1.148

mfgname

Optional

URL

String

Indicates the vendor name. Example: Huawei

serialnum

Optional

URL

String

Indicates the sequence number. Example: 628512

physicalclass

Optional

URL

int

Indicates categories of entities on a device. The options are as follows:

  • 3: frame
  • 4: backplane
  • 5: slot
  • 6: power supply
  • 7: fan
  • 9: board
  • 10: port

descr

Optional

URL

String

Indicates frame description. Example: Quidway NE20E Router

framename

Optional

URL

String

Indicates the frame name. Example: Quidway NE20E Router

adminstatus

Optional

URL

int

Indicates the management status. The options are as follows:

  • 4 and 11: normal
  • 2, 3, and 12: error
  • 13: loopback
  • Others: unknown

operstatus

Optional

URL

int

Indicates the operating status. The options are as follows:

  • 3, 11, 13, 15, and 16: normal
  • 2, 12, and 17: error
  • 4: offline
  • Others: unknown

standbystatus

Optional

URL

int

Indicates the active/standby status. The options are as follows:

  • 1: not supported
  • 2: hot standby
  • 3: cold standby
  • 4: providing service

softversion

Optional

URL

String

Indicates the software version.

start

Optional

URL

int

Indicates the start position to return query results. The default value is 0.

NOTE:
  • If the value is less than 0, the default value is used.
  • This parameter must be used together with the orderby parameter. The field specified by orderby is unique in the query result set. You are advised to set orderby to framedn.

size

Optional

URL

int

Indicates the total number of items in the query results that are returned. The default value is 20.

Note:

If the value is less than 0, the default value is used.

orderby

Optional

URL

String

Indicates the field to sort the query results. The default field to sort the results is nedn.

The fields can be nedn, nename, framedn, or framename.

NOTE:

When you use the start and size parameters to perform pagination query, you must set orderby to framedn.

desc

Optional

URL

boolean

Specifies whether query results are sorted in a descending order. The default value is false.

Note:

This parameter is valid only after the orderby parameter is specified.

Request Example

This API has many parameters. The openid parameter is mandatory. Here, the framedn parameter is used as an example.
GET https://10.120.22.178:32102/rest/openapi/network/frame?framedn=NE=34603009,FR=1

Headers: key = openid,value = c971939d611d7cbce24652358dc5fbd75b5dd9e4fef7474f

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

List<FrameModelForRest>

Indicates the frame information list.

description

String

Indicates the description of the interface invoking result.

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

Field

Value Type

Description

neDN

String

Indicates the device DN.

neName

String

Indicates the NE name.

frameDN

String

Indicates the frame DN.

shelfIndex

int

Indicates the root index of all resources.

frameIndex

int

Indicates the frame index.

frameNo

int

Indicates the frame ID.

vendorType

String

Indicates the vendor type.

mfgName

String

Indicates the vendor name.

serialNum

String

Indicates the sequence number.

physicalClass

int

Indicates categories of entities on a device. The options are as follows:

  • 3: frame
  • 4: backplane
  • 5: slot
  • 6: power supply
  • 7: fan
  • 9: board
  • 10: port

descr

String

Indicates frame description.

frameName

String

Indicates the frame name.

adminStatus

int

Indicates the management status. The options are as follows:

  • 4 and 11: normal
  • 2, 3, and 12: error
  • 13: loopback
  • Others: unknown

operStatus

int

Indicates the operating status. The options are as follows:

  • 3, 11, 13, 15, and 16: normal
  • 2, 12, and 17: error
  • 4: offline
  • Others: unknown

standBystatus

int

Indicates the active/standby status. The options are as follows:

  • 1: not supported
  • 2: hot standby
  • 3: cold standby
  • 4: providing service

softVersion

String

Indicates the software version.

Response Example

{
    "code": 0,
    "data": [
        {
            "neDN": "NE=34603009",
            "neName": "ce5810",
            "frameDN": "NE=34603009,FR=1",
            "shelfIndex": -1,
            "frameIndex": 16777216,
            "frameNo": 1,
            "vendorType": ".1.3.6.1.4.1.2011.20021210.11.688135",
            "mfgName": null,
            "serialNum": null,
            "physicalClass": 3,
            "descr": "virtual frame ",
            "frameName": "virtual frame ",
            "adminStatus": 4,
            "operStatus": 3,
            "standBystatus": 4,
            "softVersion": null
        }
    ],
    "description": "Operation success."
}

Precautions

None.

Example

package com.huawei.oms.ros.test;

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

public class QueryFrameInfo
{
     private static final String EAM_FRAME = "/rest/openapi/network/frame";

     public static void main(String[] args) throws Exception {
         Login.login();
         queryFrameInfo();
     }

     public static void queryFrameInfo() throws Exception
     { 
         //set the URL and method
         String openidURL = EAM_FRAME;
         String method = "GET";

         //set headers
         BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
         //set parameters
         BasicNameValuePair[] parameters =
         {
              new BasicNameValuePair("nedn", "NE=34603015")
         };

         HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method,
                  headers, parameters);

         String body = NewHttpsAccess.getResult(response);
         System.out.println(body);
     }
}

The returned result is as follows:

{"code":0,
"data":
[{"frameDN":"NE=34603015,FR=1",
"frameNo":1,
"frameName":"Quidway S9303 frame",
"operStatus":3,
"adminStatus":4,
"softVersion":"Version 5.150 V200R006C00",
"neDN":"NE=34603015",
"neName":"S9300",
"shelfIndex":-1,
"frameIndex":67108867,
"vendorType":".1.3.6.1.4.1.2011.20021210.11.659456",
"mfgName":"Huawei",
"serialNum":"9300050123456789",
"physicalClass":-1,
"descr":"Quidway S9303 frame","standBystatus":4}],
"description":"Successful"}

Query Device Group Information

Function

This interface is used to query device group information based on parameter settings.

URI

/rest/openapi/network/group

Access Method

GET

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

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.

id

Optional

URL

String

Indicates the device group ID.

name

Optional

URL

String

Indicates the group name.

description

Optional

URL

String

Indicates group description.

last_changed

Optional

URL

long

Indicates the last change time. The value is a number of milliseconds elapsed since 00:00:00 of January 1, 1970.

tag_name

Optional

URL

String

Indicates the group category.

start

Optional

URL

int

Indicates the start position to return query results. The default value is 0.

Note:

If the value is less than 0, the default value is used.

size

Optional

URL

int

Indicates the total number of items in the query results that are returned. The default value is 20.

Note:

If the value is less than 0, the default value is used.

orderby

Optional

URL

String

Indicates the field to sort the query results. The default field to sort the results is nedn.

The fields can be id or name.

desc

Optional

URL

boolean

Specifies whether query results are sorted in a descending order. The default value is false.

Note:

This parameter is valid only after the orderby parameter is specified.

Request Example

This API has many parameters. The openid parameter is mandatory. Here, the id parameter is used as an example.
GET https://10.120.22.178:32102/rest/openapi/network/group?id=IVSDefaultGroup

Headers: key = openid,value = c971939d611d7cbce24652358dc5fbd75b5dd9e4fef7474f

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

List<NeGroupModel>

Indicates the device group information list.

description

String

Indicates the description of the interface invoking result.

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

Field

Value Type

Description

id

String

Indicates the device group ID.

name

String

Indicates the group name.

description

String

Indicates group description.

lastChanged

long

Indicates when the last change occurs.

Indicates the local time of the eSight server.

The value must be in the YYYY-MM-DD hh:mm:ss format.

tagName

String

Indicates the group category.

Response Example

{
    "code": 0,
    "data": [
        {
            "id": "IVSDefaultGroup",
            "name": "Default group",
            "description": " ",
            "lastChanged": 1542970922065,
            "tagName": "IVSDefaultGroup"
        }
    ],
    "description": "Operation success."
}

Precautions

None

Example

package com.huawei.oms.ros.test;

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

public class QueryNeGroup
{
private static final String EAM_FRAME = "/rest/openapi/network/group";

public static void main(String[] args) throws Exception {
Login.login();
queryNeGroupInfo();
}

public static void queryNeGroupInfo() throws Exception
{
//set the URL and method
String openidURL = EAM_FRAME;
String method = "GET";

//set headers
BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
//set parameters
BasicNameValuePair[] parameters =
{
new BasicNameValuePair("description","AC")
};

HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method,
headers, parameters);

String body = NewHttpsAccess.getResult(response);
System.out.println(body);
}
}

The returned result is as follows:

{"code":0,
"data":[
{"id":"negroup=networkdefault4",
"name":"AC",
"description":"AC",
"lastChanged":1092779379,
"tagName":"by preset device category"}],
"description":"Successful"}

Deliver Telnet Commands

This interface is disabled by default.

eSight provides only the Telnet connection and transparent command transmission capabilities. The data returned by the interface is consistent with that on the device side. Users need to evaluate the impact caused by command changes and command delivery. Therefore, use this command with caution.

This interface is controlled by the isTelnetOpenAPIEnable parameter in the eSight installation directory\AppBase\etc\neadapter\nebaseinfo\neaccess.cfg file.

Function

This interface is used to deliver Telnet commands.

URI

/rest/openapi/network/telnet/

Access Method

PUT

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request header parameter list

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.

ip

Optional

Request entity parameter list

String

Indicates the IP address of the specified device.

nedn

Optional

Request entity parameter list

String

Indicates the DN of the specified device.

Note: Either an IP address or a DN must be contained.

cmdOrder

Mandatory

Request entity parameter list

String

Indicates the key value in a Telnet command.

cmd1

Mandatory

Request entity parameter list

String

Indicates a specified Telnet command.

cmd2

Optional

Request entity parameter list

String

Indicates a specified Telnet command.

cmd3

Optional

Request entity parameter list

String

Indicates a specified Telnet command.

cmd4

Optional

Request entity parameter list

String

Indicates a specified Telnet command.

cmd5

Optional

Request entity parameter list

String

Indicates a specified Telnet command.

The cmdOrder parameter is in the cmd1,cmd2,cmd3,cmd4,cmd5 format. Multiple key values are separated by a comma (,). The number of key values is equal to the number of commands.

Request Example

The openid, cmdOrder, and cmd1 parameters are mandatory for the API. At least one Telnet command parameter must be included. Here, the ip parameter is used as an example. 
PUT https://10.120.22.178:32102/rest/openapi/network/telnet/

Headers: key = openid,value = c971939d611d7cbce24652358dc5fbd75b5dd9e4fef7474f
Body:
ip:10.136.252.46
cmdOrder:cmd1
cmd1:system-view

Result

Field

Value Type

Note:

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

devIP

String

Indicates the device's IP address.

operateresult

String

Indicates the description of the interface invoking result.

respInfo

String

Indicates the Telnet command output.

dNMap

Map

Indicates a group of DNs corresponding to an IP address.

Response Example

{
    "code": 0,
    "devIP": "10.136.252.46",
    "operateresult": "Command execution success.",
    "respInfo": "\r\nWarning: Telnet is not a secure protocol, and it is recommended to use Stelnet.\n\nLogin authentication\n\n\nPassword:\nWarning: There is a risk on the user-interface which you login through. Please change the configuration of the user-interface as soon as possible. \n\nInfo: The max number of VTY users is 20, and the number\n      of current VTY users on line is 2.\n      The current login time is 2018-09-04 09:47:01+08:00.\n<ipca-252.46>system-view\nEnter system view, return user view with Ctrl+Z.\n[ipca-252.46]",
    "dNMap": null
}

Precautions

None.

Example

package com.huawei.oms.ros.test;

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

public class QueryTelnetList
{
    private static final String EAM_NEDEVICE = "/rest/openapi/network/telnet";

    public static void main(final String[] args)
        throws Exception
    {
        Login.login();
        queryTelnetTest();
    }

    public static void queryTelnetTest()
        throws Exception
    {
        final String openidURL = EAM_NEDEVICE;
        final String method = "PUT";
        final BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        final BasicNameValuePair[] parameters =
        {
             new BasicNameValuePair("ip", "10.137.240.118"), 
             new BasicNameValuePair("nedn", "NE=34603909"), 
             new BasicNameValuePair("cmdOrder", "cmd1,cmd2,cmd3,cmd4,cmd5"),
             new BasicNameValuePair("cmd1", "system-view"), 
             new BasicNameValuePair("cmd2", "stelnet server enable"),           
             new BasicNameValuePair("cmd3", "sftp server enable"),
             new BasicNameValuePair("cmd4", "sftp server enable"), 
             new BasicNameValuePair("cmd5", "ssh client first-time enable")};
        final HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        final String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    }
}
The returned result is as follows:
{
"code":0,
"devIP":10.137.240.118,
"operateresult":"Command execution success.",
"respInfo":"\r\r\nWarning: Telnet is not a secure protocol, and it is recommended to use Stelnet.\r\n\r\nLogin authentication\r\n\r\n\r\nPassword:\r\nWarning: There is a risk on the user-interface which you login through. Please change the configuration of the user-interface as soon as possible. \r\n\r\nInfo: The max number of VTY users is 20, and the number\r\n      of current VTY users on line is 3.\r\n      The current login time is 2015-08-05 22:59:01+08:00.\r\nWarning: Current license state is Trial. 15 days remain!\r\n<iPCA-S12708>system-view\r\nEnter system view, return user view with Ctrl+Z.\r\n[iPCA-S12708]stelnet server enable\r\nInfo: The Stelnet server is already started.\r\n[iPCA-S12708]sftp server enable\r\nInfo: The SFTP server is already started.\r\n[iPCA-S12708]sftp server enable\r\nInfo: The SFTP server is already started.\r\n[iPCA-S12708]ssh client first-time enable\r\n[iPCA-S12708]"
"dNMap":null
}

Query the Lower-Layer NMS's Link Information List

Function

This interface enables the upper-layer NMS to query the link information list of the lower-layer NMS fully or incrementally.

URI

/rest/openapi/linkmgr/lowforup/linklist

Access Method

GET

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

Indicates the session ID, 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.

upLayer

Mandatory

URL

String

Indicates the key based on which the upper-layer NMS synchronizes the link information list from a lower-layer NMS.

NOTE:

The key marks link data of the Map type cached on the lower-layer NMS. The key value can be "upper-layer NMS IP address+port number of lower-layer NMS", for example, 1.1.1.131943.

lowLayer

Mandatory

URL

String

Indicates the DN of a lower-layer NMS.

NOTE:

When a lower-layer NMS is added to the upper-layer NMS, the DN is automatically generated as the unique identifier of the lower-layer NMS.

getType

Mandatory

URL

boolean

Specifies whether the upper-layer NMS queries link lists of lower-layer NMSs fully.

NOTE:

If the parameter value is true, the list of all link information about the lower-layer NMS is returned. Otherwise, the list of added, deleted, or modified link information within the query interval is returned.

Request Example

GET https://10.171.43.80:32102/rest/openapi/linkmgr/lowforup/linklist?upLayer=10.120.22.17831943&lowLayer=NE=34603209&getType=false

Headers: key = openid,value = 810be029f59d8acc93a8e55576d9a99162695de61fd6ed93

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

Map<String, List<LinkInfoModel>>

Indicates information about added, deleted, and modified links. In full data synchronization mode, the LinkInfoModel is insert; in incremental data synchronization mode, the LinkInfoModel is insert, delete, and modify.

description

String

Indicates the description of the interface invoking result.

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

Field

Value Type

Description

linkDn

String

Indicates the link DN.

linkName

String

Indicates the link name.

linkNameAlias

String

Indicates the link alias.

linkTips

String

Indicates a link's tips information.

aneDn

String

Indicates the source NE DN.

aneName

String

Indicates the source NE name.

aneIp

String

Indicates the IP address of the source NE.

aportDn

String

Indicates the source port DN.

aifIndex

String

Indicates the source port index.

aportName

String

Indicates the source port name.

aportAdminStatus

int

Indicates the administrative status of the source port.

aportOperStatus

int

Indicates the running status of the source port.

aneState

int

Indicates the status of the source NE.

aportType

String

Indicates the source port type.

isAphysicalNodeVar

boolean

Indicates whether the source NE is a physical node.

zneDn

String

Indicates the destination NE DN.

zneName

String

Indicates the destination NE name.

zneIp

String

Indicates the IP address of the destination NE.

zportDn

String

Indicates the destination port DN.

zifIndex

String

Indicates the destination port index.

zportName

String

Indicates the destination port name.

zportAdminStatus

int

Indicates the administrative status of the destination port.

zportOperStatus

int

Indicates the running status of the destination port.

zneState

int

Indicates the status of the destination NE.

zportType

String

Indicates the destination port type.

isZphysicalNodeVar

boolean

Indicates whether the destination NE is a physical node.

linkStatus

int

Indicates the link status.

linkType

int

Indicates the link discovery algorithm.

linkCatagory

int

Indicates the link type.

speed

long

Indicates the link bandwidth.

linkUsedStatus

String

Indicates the link usage.

custom

int

Indicates the type for link name customization.

isDisplayInTopoVar

boolean

Indicates whether links are displayed in the physical topology.

Response Example

{
	"code": 0,
	"data": {
		"insert": [{
			"linkDn": "2_-129879503991-15331110521068312132",
			"linkName": "S5352C-EI-154_GigabitEthernet0/0/2_S3352-98_Ethernet0/0/1",
			"aneDn": "NE=34604991",
			"aneName": "S5352C-EI-154",
			"aneIp": "10.137.240.154",
			"aneState": 1,
			"aportDn": "NE=34604991_9",
			"aportIp": "",
			"aportName": "GigabitEthernet0/0/2",
			"aportOperStatus": 1,
			"aportAdminStatus": 1,
			"zneDn": "NE=34604963",
			"zneName": "S3352-98",
			"zneIp": "10.137.240.98",
			"zneState": 1,
			"zportDn": "NE=34604963_514",
			"zportName": "Ethernet0/0/1",
			"zportIp": "",
			"zportAdminStatus": 1,
			"zportOperStatus": 1,
			"linkStatus": 0,
			"linkType": 1,
			"speed": 100
		}],
		"modify": [],
		"delete": []
	},
	"description": "Successful"
}

Precautions

None.

Example

package com.huawei.oms.ros.test;

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

public class QueryLowforupLinklist {
    private static final String EAM_LINK = "/rest/openapi/linkmgr/lowforup/linklist";
    public static void main(String[] args) throws Exception {
        Login.login();
        queryLinkList();
    }
    public static void queryLinkList() throws Exception 
    {
        //set the URL and method
        String openidURL = EAM_LINK;
        String method = "GET";
        //set headers
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        BasicNameValuePair[] parameters =
        {
              new BasicNameValuePair("upLayer", "10.10.10.1031943"),               
              new BasicNameValuePair("lowLayer", "NE=34604991"),
              new BasicNameValuePair("getType", "false")
        };
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, 
                headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    }
}

The returned result is as follows:

{"code":0,
"data":{
"insert":[{"linkDn":"2_-129879503991-15331110521068312132",
 "linkName":"S5352C-EI-154_GigabitEthernet0/0/2_S3352-98_Ethernet0/0/1",
 "aneDn":"NE=34604991",
 "aneName":"S5352C-EI-154",
 "aneIp":"10.137.240.154",
 "aneState":1,
 "aportDn":"NE=34604991_9",
 "aportIp":"",
 "aportName":"GigabitEthernet0/0/2",
 "aportOperStatus":1,
 "aportAdminStatus":1,
 "zneDn":"NE=34604963",
 "zneName":"S3352-98",
 "zneIp":"10.137.240.98",
 "zneState":1,
 "zportDn":"NE=34604963_514",
 "zportName":"Ethernet0/0/1",
 "zportIp":"",
 "zportAdminStatus":1,
 "zportOperStatus":1,
 "linkStatus":0,
 "linkType":1,
 "speed":100}],
"modify":[],
"delete":[]},
 "description":"Successful"}

Delete the Link Information List Cached on the Lower-Layer NMS

Function

This interface is used to delete the link information list cached on the lower-layer NMS when the lower-layer NMS is deleted from the upper-layer NMS. The cached link information is to be synchronized to the upper-layer NMS fully or incrementally.

URI

/rest/openapi/linkmgr/lowforup/linklist

Access Method

POST

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

Indicates the session ID, 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.

upLayer

Mandatory

URL

String

Indicates the key based on which the upper-layer NMS synchronizes the link information list from a lower-layer NMS.

NOTE:

The key marks link data of the Map type cached on the lower-layer NMS. The key value can be "upper-layer NMS IP address+port number of lower-layer NMS", for example, 1.1.1.131943.

Request Example

POST https://10.171.43.80:32102/rest/openapi/linkmgr/lowforup/linklist?upLayer=10.120.22.17831943

Headers: key = openid,value = 810be029f59d8acc93a8e55576d9a99162695de61fd6ed93

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

String

If the list is deleted successfully, OK is returned.

description

String

Indicates the description of the interface invoking result.

Response Example

{
	"code": 0,
	"data": "OK",
	"description": "Successful"
}

Precautions

None.

Example

package com.huawei.oms.ros.test;

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

public class DelLowforupLinkCache {
    private static final String EAM_LINK = "/rest/openapi/linkmgr/lowforup/linklist";
    public static void main(String[] args) throws Exception {
        Login.login();
        queryLinkList();
    }
    public static void queryLinkList() throws Exception 
    {
        //set the URL and method
        String openidURL = EAM_LINK;
        String method = "POST";
        //set headers
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        BasicNameValuePair[] parameters =
        {
              new BasicNameValuePair("upLayer", "10.10.10.1031943")
        };
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, 
                headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    }
}

The returned result is as follows:

{"code":0,
"data":"OK"
"description":"Successful"}

Modify Interface Remarks for Devices

This interface is disabled by default.

This interface is controlled by the isOpenInterfacePage parameter in the eSight installation directory\AppBase\etc\neadapter\interface\customization.cfg file.

Function

This interface is provided for third parties to modify interface remarks for devices.

URI

/rest/openapi/network/interfaceRemark/modify

Access Method

POST

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

Indicates the session ID, which is used for open API authorization.

NOTE:

Third-party software can invoke the login interface for security management to obtain the parameter value.

interfaceList

Mandatory

Request entity parameter list

JSONArray

Indicates the query condition. (A maximum of 200 records can be queried.) This parameter contains the following attributes:

neName: name of the device whose interface remarks need to be modified

ifDesc: name of the interface whose remarks need to be modified

ifRemark: remarks to be modified

The following is a parameter example:

{

"interfaceList": [{

"neName": "AL1_59.141",

"ifDesc": "100GE1/0/3",

"ifRemark": "Ready for service"

}]

}

Result

Field

Value Type

Description

Code

int

Indicates the return code. The options are as follows:

0: succeeded

Other values: failed

Code 1001 indicates that the license is invalid, code 1002 indicates that the license does not support the open API function, and code 1204 indicates that authentication fails.

Data

IfModifyResult

Indicates the returned record information.

Description

String

Indicates the description.

The IfModifyResult object includes the following parameters.

Parameter

Value Type

Description

totalCount

Int

Indicates the total number of interfaces whose remarks need to be modified.

failCount

Int

Indicates the number of interfaces whose remarks fail to be modified.

successResult

List<IfReturnResult>

Indicates the list of interfaces whose remarks are modified successfully.

failResult

List<IfReturnResult>

Indicates the list of interfaces whose remarks fail to be modified.

The IfReturnResult object includes the following parameters.

Parameter

Value Type

Description

neName

String

Indicates the device name.

ifDesc

String

Indicates the interface name.

ifRemark

String

Indicates the remark name.

Precautions

This interface cannot be invoked when it is disabled.

Example

package com.huawei.oms.ros.test;
import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
 
import com.huawei.nms.openapi.demo.global.GlobalVar;
import com.huawei.nms.openapi.demo.global.NewHttpsAccess;
import com.huawei.nms.openapi.demo.global.NewRosSecurity;
 
/**
 * ModifyRemark
 */
public class ModifyRemarkDemo{
    @Test
    public void ModifyIf() throws Exception {
        String openidURL = "/rest/openapi/network/interfaceRemark/modify";
        String method = "POST";
        String openId = Demo.login();
        BasicNameValuePair[] headers = {
            new BasicNameValuePair("openid", openId)};
        List<Model> list = test("123");
        String param = JSonUtil.generateJson(list);
        BasicNameValuePair[] parameters = { new BasicNameValuePair("interfaceList", param)};
        Long t1 = System.currentTimeMillis();
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method,
            headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body); 
    }
    public List<Model> test(String remark) throws Exception{
        List<Model> list = new ArrayList<Model>();
        int i = 0;
        Model m = new Model();
        m.setNeName("10.136.252.185");
        m.setIfDesc("Eth-Trunk12");
        list.add(m);
        return list;
    }
}
The return result is as follows:
{
    "code": 0,
    "data": {
        "totalCount": 1,
        "failCount": 1,
        "successResult": null,
        "failResult": [
            {
                "neName": "10.136.252.185",
                "ifDesc": " Eth-Trunk12",
                "ifRemark": "123"
            }
        ]
    },
    "description": "Operation success."
}

Restore Interface Remarks for Devices

This interface is disabled by default.

This interface is controlled by the isOpenInterfacePage parameter in the eSight installation directory\AppBase\etc\neadapter\interface\customization.cfg file.

Function

This interface is provided for third parties to restore interface remarks for devices.

URI

/rest/openapi/network/interfaceRemark/restore

Access Method

POST

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

Indicates the session ID, which is used for open API authorization.

NOTE:

Third-party software can invoke the login interface for security management to obtain the parameter value.

interfaceList

Mandatory

Request entity parameter list

JSONArray

Indicates the query condition. (A maximum of 200 records can be queried.) This parameter contains the following attributes:

neName: name of the device whose interface remarks need to be restored

ifDesc: name of the interface whose remarks need to be restored

The following is a parameter example:

{

"interfaceList": [{

"neName": "AL1_59.141",

"ifDesc": "100GE1/0/3"

}]

}

Result

Field

Value Type

Description

Code

int

Indicates the return code. The options are as follows:

0: succeeded

Other values: failed Code 1001 indicates that the license is invalid, code 1002 indicates that the license does not support the open API function, and code 1204 indicates that authentication fails.

Data

IfModifyResult

Indicates the returned record information.

Description

String

Indicates the description.

The IfModifyResult object includes the following parameters.

Parameter

Value Type

Description

totalCount

Int

Indicates the total number of interfaces whose remarks need to be restored.

failCount

Int

Indicates the number of interfaces whose remarks fail to be restored.

successResult

List<IfReturnResult>

Indicates the list of interfaces whose remarks are restored successfully.

failResult

List<IfReturnResult>

Indicates the list of interfaces whose remarks fail to be restored.

The IfReturnResult object includes the following parameters.

Parameter

Value Type

Description

neName

String

Indicates the device name.

ifDesc

String

Indicates the interface name.

ifRemark

String

Indicates the remark name.

Precautions

This interface cannot be invoked when it is disabled.

Example

package com.huawei.oms.ros.test;
import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
 
import com.huawei.nms.openapi.demo.global.GlobalVar;
import com.huawei.nms.openapi.demo.global.NewHttpsAccess;
import com.huawei.nms.openapi.demo.global.NewRosSecurity;

public class ModifyRemarkDemo{
    @Test
    public void restoreIf() throws Exception {
        String openidURL = "/rest/openapi/network/interfaceRemark/restore";
        String method = "POST";
        String openId = Demo.login();
        BasicNameValuePair[] headers = {
            new BasicNameValuePair("openid", openId)};
        List<Model> list = test();
        String param = JSonUtil.generateJson(list);
        BasicNameValuePair[] parameters = { new BasicNameValuePair("interfaceList", param)};
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method,
            headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    }
       public List<Model> test() throws Exception{
        List<Model> list = new ArrayList<Model>();
        int i = 0;
        Model m = new Model();
        m.setNeName("10.136.252.185");
        m.setIfDesc("Eth-Trunk12");
        list.add(m);
        return list;
    }
}
The return result is as follows. (The remarks are restored.)
{
    "code": 0,
    "data": {
        "totalCount": 1,
        "failCount": 1,
        "successResult": [],
        "failResult": [
            {
                "neName": "10.136.252.185",
                "ifDesc": " Eth-Trunk12",
                "ifRemark": "123"
            }
        ]
    },
    "description": "Operation success."
}

Modify Device Remarks

This interface is disabled by default.

This interface is controlled by the isOpenInterfacePage parameter in the eSight installation directory\AppBase\etc\neadapter\interface\customization.cfg file.

Function

This interface is provided for third parties to modify device remarks.

URI

/rest/openapi/network/neRemark/modify

Access Method

POST

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

Indicates the session ID, which is used for open API authorization.

NOTE:

Third-party software can invoke the login interface for security management to obtain the parameter value.

neList

Mandatory

Request entity parameter list

List<String>

Indicates the set of devices whose devices need to be modified. (The set can contain a maximum of 200 records.)

neRemark

Mandatory

Request entity parameter list

String

Indicates the device remarks to be modified.

The following is a parameter example:

{

"neList": ["AL1_59.141"],

"neRemark": "In Service"

}

Result

Field

Value Type

Description

Code

int

Indicates the return code. The options are as follows:

0: succeeded

Other values: failed

Code 1001 indicates that the license is invalid, code 1002 indicates that the license does not support the open API function, and code 1204 indicates that authentication fails.

Data

NeModifyResult

Indicates the returned record information.

Description

String

Indicates the description.

The NeModifyResult object includes the following parameters.

Parameter

Value Type

Description

totalCount

Int

Indicates the total number of devices whose remarks are modified.

failCount

Int

Indicates the number of devices whose remarks fail to be modified.

neFailResult

List<String>

Indicates the set of devices whose remarks fail to be modified.

Precautions

This interface cannot be invoked when it is disabled.

Example

package com.huawei.oms.ros.test;
import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
import com.huawei.nms.openapi.demo.global.GlobalVar;
import com.huawei.nms.openapi.demo.global.NewHttpsAccess;
import com.huawei.nms.openapi.demo.global.NewRosSecurity;
 
public class ModifyRemarkDemo{
    @Test
    public void neModify() throws Exception {
        String openidURL = "/rest/openapi/network/neRemark/modify";
        String method = "POST";
        String openId = Demo.login();
        long t1 = System.currentTimeMillis();
        BasicNameValuePair[] headers = {
            new BasicNameValuePair("openid", openId)};
        List<String> list = test();
        String str = JSonUtil.generateJson(list);
        BasicNameValuePair[] parameters = { 
            new BasicNameValuePair("neList", str),
            new BasicNameValuePair("neRemark", "123")};
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method,
            headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
}
public List<Model> test(String remark) throws Exception{
        List<Model> list = new ArrayList<Model>();
        int i = 0;
        Model m = new Model();
        m.setNeName("AL_59.1211");
        list.add(m);
        return list;
    }
}
The return result is as follows:
{
    "code": 0,
    "data": {
        "totalCount": 1,
        "failCount": 1,
        "neFailResult": [
            "AL_59.1211"
        ],
        "neSuccessList": []
    },
    "description": "Operation success."
}

Restore Device Remarks

This interface is disabled by default.

This interface is controlled by the isOpenInterfacePage parameter in the eSight installation directory\AppBase\etc\neadapter\interface\customization.cfg file.

Function

This interface is provided for third parties to restore device remarks.

URI

/rest/openapi/network/neRemark/restore

Access Method

POST

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

Indicates the session ID, which is used for open API authorization.

NOTE:

Third-party software can invoke the login interface for security management to obtain the parameter value.

neList

Mandatory

Request entity parameter list

List<String>

Indicates the set of devices whose remarks need to be restored. (The set can contain a maximum of 200 records.)

The following is a parameter example:

{

"neList": ["AL1_59.141"]

}

Result

Field

Value Type

Description

Code

int

Indicates the return code. The options are as follows:

0: succeeded

Other values: failed

Code 1001 indicates that the license is invalid, code 1002 indicates that the license does not support the open API function, and code 1204 indicates that authentication fails.

Data

NeModifyResult

Indicates the returned record information.

Description

String

Indicates the description.

The NeModifyResult object includes the following parameters.

Parameter

Value Type

Description

totalCount

Int

Indicates the total number of devices whose remarks need to be restored.

failCount

Int

Indicates the number of devices whose remarks fail to be restored.

neSuccessList

List<Map<String, Object>>

Indicates the set of devices whose remarks are restored successfully. (key: device name; value: current device remarks)

neFailResult

List<String>

Indicates the set of devices whose remarks fail to be restored.

Precautions

This interface cannot be invoked when it is disabled.

Example

package com.huawei.oms.ros.test;
 
import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
import com.huawei.nms.openapi.demo.global.GlobalVar;
import com.huawei.nms.openapi.demo.global.NewHttpsAccess;
import com.huawei.nms.openapi.demo.global.NewRosSecurity;

public class ModifyRemarkDemo{
    @Test
    public void neRestore() throws Exception {
        String openidURL = "/rest/openapi/network/neRemark/restore";
        String method = "POST";
        String openId = Demo.login();
        BasicNameValuePair[] headers = {
            new BasicNameValuePair("openid", openId)};
        List<String> list = test();
        String str = JSonUtil.generateJson(list);
        BasicNameValuePair[] parameters = { new BasicNameValuePair("ifModifyNeRemark", "true"),
            new BasicNameValuePair("neList", str),};
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method,
            headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
}
public List<Model> test() throws Exception{
        List<Model> list = new ArrayList<Model>();
        int i = 0;
        Model m = new Model();
        m.setNeName("AL_59.121");
        list.add(m);
        return list;
    }
}
The return result is as follows. (The remarks are restored.)
{
    "code": 0,
    "data": {
        "totalCount": 1,
        "failCount": 0,
        "neFailResult": [],
        "neSuccessList": [
            {
                "neRemark": "In Service",
                "neName": "AL_59.121"
            }
        ]
    },
    "description": "Operation success."
}

Modify Device Remarks and Interface Remarks of Devices Associated with the Device

This interface is disabled by default.

This interface is controlled by the isOpenInterfacePage parameter in the eSight installation directory\AppBase\etc\neadapter\interface\customization.cfg file.

Function

This interface is provided for third parties to modify device remarks and interface remarks of devices associated with the device.

URI

/rest/openapi/network/deviceRemark/modify

Access Method

POST

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

Indicates the session ID, which is used for open API authorization.

NOTE:

Third-party software can invoke the login interface for security management to obtain the parameter value.

neList

Mandatory

Request entity parameter list

List<String>

Precautions (The set can contain a maximum of 200 records.)

neRemark

Optional

Request entity parameter list

String

Indicates the device remarks to be modified. (If ifModifyNeRemark is set to false, the background does not process this parameter. If ifModifyNeRemark is set to true, this parameter is mandatory and the default value is "".)

ifRemark

Mandatory

Request entity parameter list

String

Indicates the interface remarks to be modified. (The interface alias contains the name of the device whose remarks need to be modified.)

ifModifyNeRemark

Mandatory

Request entity parameter list

String

Indicates whether to modify the device remarks. The default value is true.

The following is a parameter example:

{

"neList": ["AL1_59.141"],

"neRemark": "In Service",

"ifRemark": "In Service",

"ifModifyNeRemark": "true"

}

Result

Field

Value Type

Description

Code

int

Indicates the return code. The options are as follows:

0: succeeded

Other values: failed

Code 1001 indicates that the license is invalid, code 1002 indicates that the license does not support the open API function, and code 1204 indicates that authentication fails.

Data

DeviceModifyResult

Indicates the returned record information.

Description

String

Indicates the description.

The DeviceModifyResult object includes the following parameters.

Parameter

Value Type

Description

neTotalCount

Int

Indicates the total number of devices whose remarks need to be modified.

neFailCount

Int

Indicates the number of devices whose remarks fail to be modified.

ifSuccessCount

Int

Indicates the number of associated interfaces whose remarks are modified successfully.

neFailResult

List<String>

Indicates the name set of devices whose remarks fail to be modified.

neSuccessResult

Map<String, Object>

Indicates the list of devices whose remarks are modified successfully.

ifSuccessResult

List<Map<String, Object>>

Indicates the list of interfaces whose remarks are modified successfully.

Precautions

This interface cannot be invoked when it is disabled.

Example

package com.huawei.oms.ros.test;
import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
import com.huawei.nms.openapi.demo.global.GlobalVar;
import com.huawei.nms.openapi.demo.global.NewHttpsAccess;
import com.huawei.nms.openapi.demo.global.NewRosSecurity;
 
public class ModifyRemarkDemo{
    @Test
    public void ModifyDevice() throws Exception {
        String openidURL = DEVICEOPENAPI;
        String method = "POST";
        String openId = Demo.login();
        BasicNameValuePair[] headers = {
            new BasicNameValuePair("openid", openId)};
        List<String> list = new ArrayList<String>();
        ObjectMapper mapper = new ObjectMapper();
        list.add("MS1_59.45");
        String str = JSonUtil.generateJson(list);
        BasicNameValuePair[] parameters = { new BasicNameValuePair("ifModifyNeRemark", "true"),
            new BasicNameValuePair("neList", str),
            new BasicNameValuePair("ifRemark", " testif123"),
            new BasicNameValuePair("neRemark", " testif123")};
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method,
            headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    }
The return result is as follows:
{
    "code": 0,
    "data": {
        "neTotalCount": 1,
        "neFailCount": 0,
        "ifSuccessCount": 4,
        "neFailResult": [],
        "neSuccessResult": {},
        "ifSuccessResult": [
            {
                "MS1_59.45": [
                    {
                        "neName": "ML2_59.31",
                        "ifDesc": "10GE8/0/22",
                        "ifRemark": "testif123"
                    },
                    {
                        "neName": "ML2_59.31",
                        "ifDesc": "100GE3/0/14",
                        "ifRemark": "testif123"
                    },
                    {
                        "neName": "AL_59.141",
                        "ifDesc": "10GE1/0/34",
                        "ifRemark": "testif123"
                    },
                    {
                        "neName": "AL_59.141",
                        "ifDesc": "Eth-Trunk270",
                        "ifRemark": "testif123"
                    }
                ]
            }
        ]
    },
    "description": "Operation success."
}

Restore Device Remarks and Interface Remarks of Devices Associated with the Device

This interface is disabled by default.

This interface is controlled by the isOpenInterfacePage parameter in the eSight installation directory\AppBase\etc\neadapter\interface\customization.cfg file.

Function

This interface is provided for third parties to restore device remarks and interface remarks of devices associated with the device.

URI

/rest/openapi/network/ deviceRemark/restore

Access Method

POST

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

Indicates the session ID, which is used for open API authorization.

NOTE:

Third-party software can invoke the login interface for security management to obtain the parameter value.

neList

Mandatory

Request entity parameter list

List<String>

Indicates the set of devices whose remarks need to be restored. (The set can contain a maximum of 200 records.)

ifModifyNeRemark

Mandatory

Request entity parameter list

String

Indicates whether to restore the device remarks. The default value is true.

The following is a parameter example:

{

"neList": ["AL1_59.141"],

"ifModifyNeRemark": "true"

}

Result

Field

Value Type

Description

Code

int

Indicates the return code. The options are as follows:

0: succeeded

Other values: failed

Code 1001 indicates that the license is invalid, code 1002 indicates that the license does not support the open API function, and code 1204 indicates that authentication fails.

Data

DeviceModifyResult

Indicates the returned record information.

Description

String

Indicates the description.

The DeviceModifyResult object includes the following parameters.

Parameter

Value Type

Description

neTotalCount

Int

Indicates the total number of devices whose remarks need to be restored.

neFailCount

Int

Indicates the number of devices whose remarks fail to be restored.

ifSuccessCount

Int

Indicates the number of associated interfaces whose remarks are restored successfully.

neFailResult

List<String>

Indicates the set of devices whose remarks fail to be restored.

neSuccessResult

Map<String, Object>

Indicates the list of devices whose remarks are restored successfully.

ifSuccessResult

List<Map<String, Object>>

Indicates the list of interfaces whose remarks are restored successfully.

Precautions

This interface cannot be invoked when it is disabled.

Example

package com.huawei.oms.ros.test;
import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
import com.huawei.nms.openapi.demo.global.GlobalVar;
import com.huawei.nms.openapi.demo.global.NewHttpsAccess;
import com.huawei.nms.openapi.demo.global.NewRosSecurity;
 
/**
 * Create a User
 */
public class ModifyRemarkDemo{
    @Test
    public void restoreDevice() throws Exception {
        String openidURL = "/rest/openapi/network/deviceRemark/restore";
        String method = "POST";
        String openId = Demo.login();
        BasicNameValuePair[] headers = {
            new BasicNameValuePair("openid", openId)};
        List<String> list = new ArrayList<String>();
        ObjectMapper mapper = new ObjectMapper();
        list.add("MS1_59.45");
        String str = JSonUtil.generateJson(list);
        BasicNameValuePair[] parameters = { new BasicNameValuePair("ifModifyNeRemark", "true"),
            new BasicNameValuePair("neList", str)};
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method,
            headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
   }
}
The return result is as follows. (The remarks are restored.)
{
    "code": 0,
    "data": {
        "neTotalCount": 1,
        "neFailCount": 0,
        "ifSuccessCount": 4,
        "neFailResult": [],
        "neSuccessResult": {
            "MS1_59.45": "test123"
        },
        "ifSuccessResult": [
            {
                "MS1_59.45": [
                    {
                        "neName": "ML2_59.31",
                        "ifDesc": "10GE8/0/22",
                        "ifRemark": "testif123"
                    },
                    {
                        "neName": "ML2_59.31",
                        "ifDesc": "100GE3/0/14",
                        "ifRemark": "testif123"
                    },
                    {
                        "neName": "AL_59.141",
                        "ifDesc": "10GE1/0/34",
                        "ifRemark": "testif123"
                    },
                    {
                        "neName": "AL_59.141",
                        "ifDesc": "Eth-Trunk270",
                        "ifRemark": "testif123"
                    }
                ]
            }
        ]
    },
    "description": "Operation success."
}

Query the Trunk Interface Configuration of a Network Device

Function

This interface is used to query the trunk interface configuration of a network device.

URI

/rest/openapi/network/vlan/trunk

Access Method

GET

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

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.

nedn

Mandatory

URL

String

Indicates the device DN.

Request Example

The openid parameter is mandatory. The mandatory parameter nedn is used as an example.
GET https://10.171.35.253:32102/rest/openapi/network/vlan/trunk?nedn=NE=34603369

Headers: key = openid, value = b3716876bca0a3ff1c7341205616a97c6ab09b548569f12e

Result

Field

Value Type

Description

code

int

Indicates the return code. The options are as follows:

  • 0: succeeded
  • Non-0: failed

data

List<TrunkIfOpenModel>

Indicates the port trunk configurations.

description

String

Indicates the description of the interface invoking result.

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

Field

Value Type

Description

ifIndex

String

Indicates the trunk interface index.

ifName

String

Indicates the trunk interface name.

permitVlanInfo

String

Indicates information about the VLANs that are allowed to pass through the port.

ifChildren

List<InterfaceInfo>

Indicates the list of sub-interfaces.

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

Field

Value Type

Description

ifIndex

String

Indicates the sub-interface index.

ifName

String

Indicates the sub-interface name.

Response Example

{
    "code": 0,
    "data": [
        {
            "ifIndex": "55",
            "ifName": "Eth-Trunk0",
            "permitVlanInfo": "82",
            "ifChildren": [
                 {   
                       "ifIndex": "6",
                       "ifName": "Ethernet0/0/1"  
                 }
            ]
        }
    ] ,
   "description": "Operation success."
}

Precautions

None

Example

package com.huawei.oms.ros.test;

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

public class QueryTrunkList()
{
      private static final String EAM_NEDEVICE = "rest/openapi/network/vlan/trunk";

      public static void main(final String[] args)
          throws Exception
      {
          Login.login();
          queryTrunkTest();
      }

      public static void queryTrunkTest()
          throws Exception
      {
          // set the URL and method
          String openidURL = EAM_NEDEVICE;
          String method = "GET";
 
          // set headers
          BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
          // set parameters
          BasicNameValuePair[] parameters = {new BasicNameValuePair("nedn", " NE=34603317")};
 
          HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
 
          String body = NewHttpsAccess.getResult(response);
          System.out.println(body);
      }
}

The returned result is as follows:

{
    "code": 0,
    "data": [
        {
            "ifIndex": "80",
            "ifName": "Eth-Trunk10",
            "permitVlanInfo": "1,20,30,40,50,100",
            "ifChildren": [
                 {   
                       "ifIndex": "10",
                       "ifName": "GigabitEthernet0/0/5"  
                 },
                 {   
                       "ifIndex": "11",
                       "ifName": "GigabitEthernet0/0/6"  
                 }
            ]
        },
        {
            "ifIndex": "81",
            "ifName": "Eth-Trunk11",
            "permitVlanInfo": "1,20,30,40,50,100",
            "ifChildren": [
                 {   
                       "ifIndex": "12",
                       "ifName": "GigabitEthernet0/0/7"  
                 },
                 {   
                       "ifIndex": "13",
                       "ifName": "GigabitEthernet0/0/8"  
                 }
            ]
        }
    ],
    "description": "Operation success."
}

Server Management Interfaces

Query the Server Device List

Function

This interface is used to query the server device list based on the servertype parameter.

URI

/rest/openapi/server/device

Access Method

GET

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

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

NOTE:

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

servertype

Mandatory

Parameter list

String

Indicates the server type. The options are as follows:

NOTE:
  • rack: rack server
  • blade: blade server
  • highdensity: high-density server
  • kunlun: KunLun server
  • thirdpartyserver: third-party server
  • heterogeneous: heterogeneous server

start

Optional

Parameter list

int

Indicates the starting page to be queried. The value starts from 1 and the default value is 1.

NOTE:

If the start value is greater than the total number of pages, the last page is queried.

size

Optional

Parameter list

int

Indicates the number of records on each page, ranging from 1 to 100. The default value is 20.

NOTE:

If the size value is less than 1 or greater than 100, the default value 20 is used.

orderby

Optional

Parameter list

String

Indicates the field used to sort query result sets. Only one field can be specified.

The options are as follows: ipAddress and serverName.

desc

Optional

Parameter list

boolean

Indicates whether to sort query results in descending order. The default value is false.

Note:

This parameter takes effect only when the orderby parameter is specified.

Result

Field

Value Type

Description

code

int

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

  • 0: successful
  • Others: failed

data

List<data>

Indicates the server list.

description

String

Indicates the description of the interface invoking result.

size

int

Indicates the total number of device records that meet the query criteria. Blade servers, high-density servers, and G5500 are counted by chassis.

totalPage

int

Indicates the total number of pages to be queried. If the remainder of size/pageSize (here pageSize indicates the input parameter size) is greater than 0, the last page is not full. In this case, add the number by one.

The data field contains the following information.

Field

Value Type

Description

dn

String

Indicates the server unique identifier, for example:

"NE=xxx"

ipAddress

String

Indicates the server IPv4 or IPv6 address.

NOTE:

Only rack servers support IPv6 addresses.

serverName

String

Indicates the server name. The attribute character string is directly displayed, not in the form of enumerated values.

serverModel

String

Indicates the server model. The attribute character string is directly displayed, not in the form of enumerated values.

productSN

String

Indicates the server serial number. The attribute character string is directly displayed, not in the form of enumerated values.

location

String

Indicates the server location. The attribute character string is directly displayed, not in the form of enumerated values.

description

String

Indicates the server description. The attribute character string is directly displayed, not in the form of enumerated values.

uuid

String

Indicates the server unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

status

String

Indicates the server status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

manufacturer

String

Indicates the manufacturer name. The attribute character string is directly displayed, not in the form of enumerated values.

version

String

Indicates the BMC version.

This field is not supported by third-party servers.

childBlades

List<childBlades>

Indicates the blade list of blade servers, high-density servers, 8100 V5 servers, and G5500 servers. For other server types, this field is not supported or null.

You can query blade details through the interface to query component details about a specific server.

switchBoard

List<switchBoard>

Indicates the switch module list of blade servers. For other servers, this field is not supported or null.

The childBlades field contains the following information.

Field

Value Type

Description

dn

String

Indicates the blade unique identifier, for example:

"NE=xxx"

ipAddress

String

Indicates the server IPv4 or IPv6 address.

NOTE:

Only rack servers support IPv6 addresses.

state

String

Indicates the server status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

location

String

Indicates the blade location.

name

String

Indicates the name.

type

String

Indicates the device type.

version

String

Indicates the BMC version.

cpuHealthState

String

Indicates the CPU health status. The options are as follows:

  • -1: absent
  • -2: unknown
  • 0: normal
  • Others: faulty

memoryHealthState

String

Indicates the memory health status. The options are as follows:

  • -1: absent
  • -2: unknown
  • 0: normal
  • Others: faulty

The switchBoard field contains the following information.

Field

Value Type

Description

dn

String

Indicates the server unique identifier, for example:

"NE=xxx"

(Only switch module query is supported.)

parentDn

String

Indicates the parent DN, which is the DN of the blade server chassis where the switch module is located.

ipAddress

String

Indicates the server IPv4 address.

(Only switch module query is supported.)

name

String

Indicates the name. The attribute character string is directly displayed, not in the form of enumerated values.

healthState

String

Indicates the health status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

type

int

Indicates the board type. The options are as follows:

  • 0: mainboard
  • 1: switch module

sn

String

Indicates the board serial number. The attribute character string is directly displayed, not in the form of enumerated values.

partNumber

String

Indicates the board part number. The attribute character string is directly displayed, not in the form of enumerated values.

manufacture

String

Indicates the manufacturer. The attribute character string is directly displayed, not in the form of enumerated values.

manuTime

String

Indicates the manufacturing date. The attribute character string is directly displayed, not in the form of enumerated values.

presentState

String

Indicates the device presence status. The options are as follows:

  • 0: absent
  • Others: present
  • -2 or 2: unknown

assertTag

String

Indicates the asset tag.

moId

String

Indicates the index.

uuid

String

Indicates the board unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

Example

Request example:

package com.huawei.nms.openapi.demo.resource.server;

import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;
import com.huawei.nms.openapi.demo.global.GlobalVar;
import com.huawei.nms.openapi.demo.global.NewHttpsAccess;
import com.huawei.nms.openapi.demo.global.NewRosSecurity;
import com.huawei.nms.openapi.demo.sm.Login;

/**
 *  Query the Server Device List
 */
public class QueryServerDeviceListDemo
{
    private static final String EAM_NEDEVICE = "/rest/openapi/server/device";
    public static void main(String[] args) throws Exception
    {
        Login.login();
        queryNeDeviceTest();
    }
    public static void queryNeDeviceTest() throws Exception
    {
        /*
         * set the URL and method
         */
        String openidURL = EAM_NEDEVICE;
        String method = "GET";
        /*
         * set headers
         */
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL,
                method);
        /*
         * set parameters 
         */
        BasicNameValuePair[] parameters = {new BasicNameValuePair("servertype",
                "rack")};
        /*
         * 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);
    }
}

Response example:

{
  "code": 0,
  "data": [
    {
      "dn": "NE=34603409",
      "ipAddress": "192.168.7.60",
      "serverName": "RH2288 V3-192.168.7.60",
      "serverModel": "RH2288 V3",
      "productSN": "01HD21DLJ10C7000013",
      "location": "xian",
      "manufacturer": "Huawei",
      "uuid": "4777BC7C-1DD2-11B2-B1CF-883FD32D4680",
      "status": "0",
      "description": "",
      "version": "2.62",
      "childBlades": []
    },
    {
      "dn": "NE=34603023",
      "ipAddress": "192.168.10.10",
      "serverName": "RH2288H V3-192.168.10.10",
      "serverModel": "RH2288H V3",
      "productSN": "2102310YJV10H3000104",
      "location": "xian",
      "manufacturer": "Huawei",
      "uuid": "2E73853A-1DD2-11B2-AEC5-0018E1C5D866",
      "status": "0",
      "description": "",
      "version": "2.92",
      "childBlades": []
    }
  ],
  "size": 2,
  "totalPage": 1,
  "description": "Succeeded in querying the server list."
}

Precautions

None

Query Component Details About a Specific Server

Function

This interface is used to query component details about a specific server.

URI

/rest/openapi/server/device/detail

Access Method

GET

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request message header

String

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

NOTE:

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

dn

Mandatory

Parameter list

String

Indicates the device unique identifier, for example:

"NE=xxx"

Result

Field

Value Type

Description

code

int

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

  • 0: successful
  • Others: failed

data

List<data>

Indicates device details.

description

String

Indicates the description of the interface invoking result.

The data field contains the following information.

Field

Value Type

Description

dn

String

Indicates the device unique identifier, for example:

"NE=xxx"

parentDn

String

Indicates the parent DN, for example:

"NE=xxx"

NOTE:

This field is supported by blade servers, high-density servers, and G5500 heterogeneous computing servers. The returned value of top NEs is a slash (/).

ipAddress

String

Indicates the server IPv4 or IPv6 address.

NOTE:

Only rack servers support IPv6 addresses.

name

String

Indicates the device name. The attribute character string is directly displayed, not in the form of enumerated values.

type

String

Indicates the device model. The attribute character string is directly displayed, not in the form of enumerated values.

uuid

String

Indicates the server unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

status

String

Indicates the device status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

macAddr

String

Indicates the MAC address.

bmcMacAddr

String

Indicates the BMC MAC address.

NOTE:

This field is not supported by blade servers (chassis), third-party servers, or high-density servers (chassis).

smmMacAddr

String

Indicates the MAC address of a blade server.

NOTE:

This field is returned only when you query a blade server (chassis).

averagePower

String

Indicates the average power (W).

peakPower

String

Indicates the peak power (W).

powerConsumption

String

Indicates the power consumption (kWh).

serverSource

String

Indicates the server asset source.

serverFlag

String

Indicates a server application identifier.

serverState

String

Indicates the server asset status.

location

String

Indicates the location.

storageTime

String

Indicates the warehousing time.

usedTime

String

Indicates the duration since a device is put into operation (days).

freshTime

String

Indicates the refresh time.

preferredAndalternateNTPServer

String

Indicates the address of the active/standby NTP server.

ntpMaxAndMinimumPollingInterval

String

Indicates the NTP maximum/minimum polling interval.

realTimePower

String

Indicates the power consumption (W).

productSn

String

Indicates the product serial number.

desc

String

Indicates the description. The attribute character string is directly displayed, not in the form of enumerated values.

bmaVersion

String

Indicates the BMA version.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

bmaDriverVersion

String

Indicates the BMA driver version.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

osVersion

String

Indicates the operating system version.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

osKernelVersion

String

Indicates the OS kernel version.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

hostName

String

Indicates the host name.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

domainName

String

Indicates the domain name.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

hostDesc

String

Indicates the host description.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

cpuNums

String

Indicates the number of CPUs.

NOTE:

This field is not supported by KunLun servers and blade management modules.

cpuCores

String

Indicates the number of CPU cores.

NOTE:

This field is not supported by KunLun servers and blade management modules.

MemoryCapacity

String

Indicates the memory capacity.

NOTE:

This field is not supported by KunLun servers and blade management modules.

isV1Dev

String

Indicates whether a device connects to eSight through the V1 protocol.

NOTE:

This field is returned when a high-density blade is queried.

mode

String

Indicates the server blade model.

NOTE:

This field is returned only when you query information about a server blade.

powerStatisticStartTime

String

Indicates the start time of power statistics collection.

NOTE:

This field is not supported by third-party servers.

dnsSource

String

Indicates the DNS mode.

NOTE:

This field is not supported by third-party servers.

dnsName

String

Indicates the DNS name.

NOTE:

This field is not supported by third-party servers.

dnsServerIP

String

Indicates the address of the active/standby DNS server.

NOTE:

This field is not supported by third-party servers.

CPU

List<CPU>

Indicates CPU information.

Memory

List<Memory>

Indicates memory information.

Disk

List<Disk>

Indicates disk information.

psuOverallHealth

String

Indicates the overall power supply health status.

  • 0: normal
  • 2: faulty
  • 4: urgent
  • -2: unknown
NOTE:

This parameter is only supported by blade servers.

PSU

List<PSU>

Indicates power supply unit (PSU) information.

fanOverallHealth

String

Indicates the overall fan health status.

  • 0: normal
  • 2: faulty
  • 4: urgent
  • -2: unknown
NOTE:

This parameter is only supported by blade servers.

Fan

List<Fan>

Indicates fan information.

RAID

List<RAID>

Indicates RAID information.

NetworkCard

List<NetworkCard>

Indicates network port information.

NOTE:

This field is not supported by KunLun servers.

NetCard

List<NetCard>

Indicates the NIC information.

NOTE:

This field is only supported by rack servers, blade servers, and high-density servers.

PCIE

List<PCIE>

Indicates PCIe card information.

NOTE:

This field is not supported by blade servers.

Mezz

List<Mezz>

Indicates mezzanine card information.

NOTE:

This field is only supported by blades of E9000 blade servers.

GPU

List<GPU>

Indicates GPU information.

NOTE:

This field is only supported by heterogeneous servers.

board

List<board>

Indicates board information.

  • Blade server: switch module
  • Rack server or high-density server: mainboard

The CPU field contains the following information.

Field

Value Type

Description

name

String

Indicates the CPU name. The attribute character string is directly displayed, not in the form of enumerated values.

healthState

String

Indicates the CPU status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

frequency

String

Indicates the CPU frequency. The attribute character string is directly displayed, not in the form of enumerated values.

manufacture

String

Indicates the CPU manufacturer. The attribute character string is directly displayed, not in the form of enumerated values.

model

String

Indicates the model.

moId

String

Indicates the index.

uuid

String

Indicates the CPU unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

presentState

String

Indicates the device presence status. The options are as follows:

  • 0: absent
  • Others: present
  • -2 or 2: unknown

enableState

String

Indicates the enabling status. The options are as follows:

1: enabled

2: disabled

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

processorId

String

Indicates the processor ID.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

totalCores

String

Indicates the number of CPU cores.

NOTE:

This field is only supported by rack servers, blade servers, and high-density servers.

totalThreads

String

Indicates the number of CPU threads.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

l1CacheKiB

String

Indicates level-1 cache.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

l2CacheKiB

String

Indicates level-2 cache.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

l3CacheKiB

String

Indicates level-3 cache.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

partNumber

String

Indicates the component code.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

The Memory field contains the following information.

Field

Value Type

Description

name

String

Indicates the memory name. The attribute character string is directly displayed, not in the form of enumerated values.

healthState

String

Indicates the memory status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

capacity

String

Indicates the memory capacity, including the unit. The attribute character string is directly displayed, not in the form of enumerated values.

manufacture

String

Indicates the memory manufacturer. The attribute character string is directly displayed, not in the form of enumerated values.

frequency

String

Indicates the memory frequency. The attribute character string is directly displayed, not in the form of enumerated values.

moId

String

Indicates the index.

uuid

String

Indicates the memory unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

presentState

String

Indicates the device presence status. The options are as follows:

  • 0: absent
  • Others: present
  • -2 or 2: unknown

memoryType

String

Indicates the memory type.

NOTE:

This field is only supported by rack servers, blade servers, and high-density servers.

serialNumber

String

Indicates the serial number.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

minVoltage

String

Indicates the minimum voltage.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

rankCount

String

Indicates the number of ranks.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

dataWidthBits

String

Indicates the bit width.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

technology

String

Indicates the technology.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

partNumber

String

Indicates the component code.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

The Disk field contains the following information.

Field

Value Type

Description

name

String

Indicates the disk name. The attribute character string is directly displayed, not in the form of enumerated values.

healthState

String

Indicates the disk status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

location

int

Indicates slot information.

presentState

String

Indicates the device presence status. The options are as follows:

  • 0: absent
  • Others: present
  • -2 or 2: unknown

moId

String

Indicates the index.

uuid

String

Indicates the disk unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

The PSU field contains the following information.

Field

Value Type

Description

name

String

Indicates the PSU name. The attribute character string is directly displayed, not in the form of enumerated values.

healthState

String

Indicates the PSU status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

inputPower

String

Indicates power consumption.

manufacture

String

Indicates the PSU manufacturer. The attribute character string is directly displayed, not in the form of enumerated values.

version

String

Indicates the PSU version. The attribute character string is directly displayed, not in the form of enumerated values.

Some PSUs do not have the version information.

inputMode

int

Indicates the power input mode. The options are as follows:

  • 1: alternating current (AC)
  • 2: direct current (DC)
  • 3: AC/DC
  • Other values: invalid
    NOTE:

    This field is not supported by KunLun servers.

moId

String

Indicates the index.

uuid

String

Indicates the PSU unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

presentState

String

Indicates the device presence status. The options are as follows:

  • 0: absent
  • Others: present
  • -2 or 2: unknown

powerProtocol

String

Indicates the power protocol. The options are as follows:

  • 0: PSMI
  • 1: PMBUS
  • 2: PSU
  • 3: PMBUS OEM
  • " "/null : "--"

ratePower

String

Indicates the rated power.

model

String

Indicates the PSU model.

location

String

Indicates the location.

The Fan field contains the following information.

Field

Value Type

Description

name

String

Indicates the fan name. The attribute character string is directly displayed, not in the form of enumerated values.

healthState

String

Indicates the fan status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

rotate

int

Indicates the rotational speed.

NOTE:

The blade servers and KunLun servers do not support this field and return -1.

rotatePercent

int

Indicates the rotational speed percentage (%). The value is not an enumerated value.

NOTE:

The KunLun server does not support this field and returns -1.

controlModel

String

Indicates the fan mode. The options are as follows:

  • 0: automatic
  • 1: manual
    NOTE:

    The KunLun server does not support this field and returns -1.

moId

String

Indicates the index.

uuid

String

Indicates the fan unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

presentState

String

Indicates the device presence status. The options are as follows:

  • 0: absent
  • Others: present
  • -2 or 2: unknown

location

String

Indicates the location.

The GPU field contains the following information.

Field

Value Type

Description

name

String

Indicates the GPU name. The attribute character string is directly displayed, not in the form of enumerated values.

healthState

String

Indicates the GPU health status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

model

String

Indicates the model.

moId

String

Indicates the index.

uuid

String

Indicates the GPU unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

presentState

String

Indicates the device presence status. The options are as follows:

  • 0: absent
  • Others: present
  • -2 or 2: unknown

The board field contains the following information.

Field

Value Type

Description

name

String

Indicates the board name. The attribute character string is directly displayed, not in the form of enumerated values.

dn

String

Indicates the server unique identifier, for example:

"NE=xxx"

(Only switch module query is supported.)

parentDn

String

Indicates the parent DN, which is the DN of the blade server chassis where the switch module is located.

(Only switch module query is supported.)

ipAddress

String

Indicates the server IPv4 address.

(Only switch module query is supported.)

healthState

String

Indicates the board health status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

type

int

Indicates the board type. The options are as follows:

  • 0: mainboard
  • 1: switch module

sn

String

Indicates the board serial number. The attribute character string is directly displayed, not in the form of enumerated values.

partNumber

String

Indicates the board part number. The attribute character string is directly displayed, not in the form of enumerated values.

manufacture

String

Indicates the manufacturer. The attribute character string is directly displayed, not in the form of enumerated values.

manuTime

String

Indicates the manufacturing date. The attribute character string is directly displayed, not in the form of enumerated values.

presentState

String

Indicates the device presence status. The options are as follows:

  • 0: absent
  • Others: present
  • -2 or 2: unknown

assertTag

String

Indicates the asset tag.

moId

String

Indicates the index.

uuid

String

Indicates the board unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

The RAID field contains the following information.

Field

Value Type

Description

name

String

Indicates the RAID name. The attribute character string is directly displayed, not in the form of enumerated values.

healthState

String

Indicates the RAID health status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

raidType

String

Indicates the RAID type.

interfaceType

String

Indicates the interface type. The options are as follows:

  • 1: SPI
  • 2: SAS_3G
  • 3: SATA_1.5G
  • 4: SATA_3G
  • 5: SAS_6G
  • 6: SAS_12G
  • 255 or others: unknown

bbuType

String

Indicates the BBU type.

moId

String

Indicates the index.

uuid

String

Indicates the RAID unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

location

String

Indicates the location.

raidLevel

String

Indicates the level information supported by the RAID controller card.

raidMemorySize

Integer

Indicates the memory size of the RAID controller card, in MB.

raidSpeed

Integer

Indicates the interface rate of the RAID controller.

The NetworkCard field contains the following information.

Field

Value Type

Description

netWorkCardName

String

Indicates the network port name. The attribute character string is directly displayed, not in the form of enumerated values.

macAdress

String

Indicates the MAC address.

moId

String

Indicates the index.

uuid

String

Indicates the unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

portName

String

Indicates the port name.

NOTE:

This field is only supported by rack servers, blade servers, and high-density servers.

linkStatus

String

Indicates the link status.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

ipv4Addresses

List<IPV4>

Indicates the IPv4 address group.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

ipv6Addresses

List<IPV6>

Indicates the IPv6 address group.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

ipv6DefaultGateway

String

Indicates the default IPv6 gateway.

NOTE:

This field is only supported by V5 rack servers, V5 blade servers, and V5 high-density servers.

The NetCard field contains the following information.

Field

Value Type

Description

moId

String

Indicates the index.

uuid

String

Indicates the unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

deviceName

String

Indicates the device name. The value is the same as the value of netWorkCardName in NetworkCard.

healthState

String

Indicates the health status. The options are as follows:

  • 0: normal
  • -1: offline
  • -2: unknown
  • Others: faulty

cardName

String

Indicates the NIC name.

cardManufacturer

String

Indicates the NIC manufacturer.

cardModel

String

Indicates the NIC model.

chipManufacturer

String

Indicates the chip manufacturer.

chipModel

String

Indicates the chip model.

firmwarePkgVersion

String

Indicates the firmware version.

driverName

String

Indicates the driver name.

driverVersion

String

Indicates the driver version.

The PCIE field contains the following information.

Field

Value Type

Description

name

String

Indicates the PCIe card name. The attribute character string is directly displayed, not in the form of enumerated values.

pcieSsdCardHealthStatus

String

Indicates the PCIe card health status. The options are as follows:

  • 0: normal
  • -2: unknown
  • Others: faulty

pcieSsdCardLifeLeft

String

Indicates the device lifetime.

uuid

String

Indicates the PCIe card unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

pciecardManufacturer

String

Indicates the manufacturer.

moId

String

Indicates the index.

location

String

Indicates the location.

PCIeCardDescription

String

Indicates the PCIe description.

PCIeModel

String

Indicates the PCIe model.

The Mezz field contains the following information.

Field

Value Type

Description

name

String

Indicates the mezzanine card name. The attribute character string is directly displayed, not in the form of enumerated values.

presentState

int

Indicates the device presence status. The options are as follows:

  • 0: absent
  • Others: present

mezzHealthStatus

String

Indicates the mezzanine card status. The options are as follows:

  • 0: normal
  • -2/5: unknown
  • Others: faulty
NOTE:

When the value of presentState is -2, mezzHealthStatus is unknown.

mezzInfo

String

Indicates the description.

mezzLocation

String

Indicates the location.

mezzMac

String

Indicates the MAC address.

moId

String

Indicates the index.

uuid

String

Indicates the mezzanine card unique identifier. The attribute character string is directly displayed, not in the form of enumerated values.

The IPv4 field contains the following information.

Field