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 11

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).
Configuration Management APIs

Configuration Management APIs

Query Configuration File Changes

Function

This interface is used to query configuration file changes.

URI

/rest/openapi/configfile/configchange

Access Method

GET

Request Example

GET https://10.120.70.220:32102/rest/openapi/configfile/configchange?changeTime=123456789&pageSize=20&pageNo=1
Headers: key = openid, value = d21ee8aae2f9c05b2098e82a33b3430b37e1c6980d26004f

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request header parameter list

String

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

NOTE:

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

changeTime

Mandatory

Request entity parameter list

long

Indicates the start time (UTC time) from which configuration file change information is queried. The time is accurate to milliseconds.

pageNo

Mandatory

Request entity parameter list

int

Indicates the page number for the page-based query. The number starts from 1.

pageSize

Mandatory

Request entity parameter list

int

Indicates the number of records on each page. The minimum value is 1 and the maximum value is 100.

Result

Field

Value Type

Description

code

int

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

  • 0: successful
  • Non-0: failed

description

String

Indicates the description of the returned result.

data

ConfigChangePage

Indicates configuration file changes.

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

Field

Value Type

Description

configChangeInfo

List

Indicates configuration file changes.

curPage

int

Indicates the current page number.

totalPage

int

Indicates the number of total pages.

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

Field

Value Type

Description

neDn

String

Indicates the unique identifier of an NE.

changeTime

long

Indicates the change time (UTC time). The time is accurate to milliseconds.

oldFile

String

Indicates the old file name.

newFile

String

Indicates the new file name.

fileType

String

Indicates the backup file type.

r: running configuration file

s: startup configuration file

added

String

Indicates added commands.

modified

String

Indicates modified commands.

baseModified

String

Indicates commands before modification.

deleted

String

Indicates deleted commands.

addNum

int

Indicates the number of added lines.

modifyNum

int

Indicates the number of modified lines.

deleteNum

int

Indicates the number of deleted lines.

Response Example

{
    "code": 0, 
    "data": {
        "configChangeInfo": [
            {
                "neDn": "NE=34622313", 
                "changeTime": 1479450011876, 
                "oldFile": "20161118141713R.cfg", 
                "newFile": "20161118141953R.cfg", 
                "fileType": "r", 
                "added": "ap-group name employee", 
                "modified": null, 
                "baseModified": null, 
                "deleted": null, 
                "addNum": 1, 
                "modifyNum": 0, 
                "deleteNum": 0
            }
        ], 
        "curPage": 1, 
        "totalPage": 1
    }, 
    "description": ""
}

Precautions

None.

Example

package com.huawei.oms.ros.test;

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

public class QueryConfigChange {
    private static final String CONFIGCHANGEPATH = "/rest/openapi/configfile/configchange";
    public static void main(String[] args) throws Exception {
        Login.login();
        queryConfigChange();
    }
    public static void queryConfigChange() throws Exception 
    {
        //set the URL and method
        String openidURL = CONFIGCHANGEPATH;
        String method = "GET";
        //set headers
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        //set parameters
        BasicNameValuePair[] parameters =
        {
                new BasicNameValuePair("changeTime", "123456789"),
                new BasicNameValuePair("pageSize", "20"),
                new BasicNameValuePair("pageNo", "1"),
        };
        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": {
"configChangeInfo": [
{
"neDn": "NE=34622313",
"changeTime": 1479450011876,
"oldFile": "20161118141713R.cfg",
"newFile": "20161118141953R.cfg",
"fileType": "r",
"added": "ap-group name employee\n",
"modified": null,
"baseModified": null,
"deleted": null,
"addNum": 1,
"modifyNum": 0,
"deleteNum": 0
}],
"curPage": 1,
"totalPage": 1
},
"description": ""
}

Querying SSID and VAP Profile Information

Function

This interface is used to query SSID and VAP profile information.

URI

/rest/openapi/sct/ssid

Access Method

GET

Request Example

GET https://10.120.70.220:32102/rest/openapi/sct/ssid?nedn=NE=34603109&profileType=ssid&profileName=whtest002
Headers: key = openid, value = d21ee8aae2f9c05b2098e82a33b3430b37e1c6980d26004f

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request header parameter list

String

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

NOTE:

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

nedn

Mandatory

Request entity parameter list

String

Indicates the NE DN, which uniquely identifies a device on eSight.

profileType

Mandatory

Request entity parameter list

String

Indicates the type of the profile to be queried. The options are as follows:

  • ssid: SSID profile
  • vap: VAP profile

profileName

Optional

Request entity parameter list

String

Name of the profile to be queried.

NOTE:

If this parameter is left empty, all SSID or VAP profiles on the device are queried.

Result

Field

Type

Description

code

int

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

  • 0: successful
  • Others: failed

description

String

Indicates the description of the interface invoking result.

data

ProfileInfo

Indicates the profile information.

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

Field

Value Type

Description

nedn

String

Indicates the device ID.

profileType

String

Indicates the type of the profile to be queried.

vapProfileList

List<VapProfileInfo>

Indicates the VAP profile information.

NOTE:

If the profile type is SSID, the value of vapProfileList is null.

ssidProfileList

List<SsidProfileInfo>

Indicates the SSID profile information.

NOTE:

If the profile type is VAP, the value of ssidProfileList is null.

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

Field

Value Type

Description

vapProfileName

String

Indicates the VAP profile name.

referedSsidProfileName

String

Indicates the name of the SSID profile referenced by a VAP profile.

referedSsidName

String

Indicates the SSID name in the SSID profile referenced by a VAP profile.

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

Field

Value Type

Description

ssidProfileName

String

Indicates the SSID profile name.

ssidName

String

Indicates the SSID name in the SSID profile.

Response Example

{
"code":0,
"data":"{
	"nedn":"NE=34603809",
	"profileType":"ssid",
	"vapProfileList":null,
        "ssidProfileList":[
        {
	    "ssidProfileName":"whtest002",
            "ssidName":"HUAWEI-WLAN"
        }
        ]
    }",
"description":"query ssid profile success "
}

Precautions

1. The query interface applies only to the AC V2R8C10 and later versions.

Example 1: Querying an SSID Profile

package com.huawei.oms.ros.test;

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

public class QuerySsidProfile {
    private static final String SSIDPROFILEPATH= "/rest/openapi/sct/ssid";
    
    public static void main(String[] args) throws Exception {
        Login.login();
       querySsidProfile();
    }
    
    public static void querySsidProfile() throws  Exception{  
 
        String openidURL = "/rest/openapi/sct/ssid";   
        String method = "GET";   
        JSONObject model = new JSONObject(); 
        model.put("nedn", "NE=34603809");  
        model.put("profileType", "ssid");  
        model.put("profileName", "whtest002"); 

        BasicNameValuePair[] parameters = convertJsonObj(model);  
       // set headers   
       BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);  
       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=34603809",
	"profileType":"ssid",
	"vapProfileList":null,
        "ssidProfileList":[
        {
	    "ssidProfileName":"whtest002",
            "ssidName":"HUAWEI-WLAN"
        }
        ]
    }",
"description":"query ssid profile success "
}

Example 2: Querying a VAP Profile

package com.huawei.oms.ros.test;

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

public class QuerySsidProfile {
    private static final String SSIDPROFILEPATH= "/rest/openapi/sct/ssid";
    
    public static void main(String[] args) throws Exception {
        Login.login();
       querySsidProfile();
    }
    
    public static void querySsidProfile() throws  Exception{  
 
        String openidURL = "/rest/openapi/sct/ssid";   
        String method = "GET";   
        JSONObject model = new JSONObject(); 
        model.put("nedn", "NE=34603809");  
        model.put("profileType", "vap");  
        model.put("profileName", "whtest002"); 

        BasicNameValuePair[] parameters = convertJsonObj(model);  
       // set headers   
       BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);  
       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=34603809",
	"profileType":"vap",
	"vapProfileList":[
        {
            "vapProfileName":"whtest002",
            "referedSsidProfileName":"whtest002",
            "referedSsidName":"HUAWEI-WLAN"
        }]
        "ssidProfileList":null
    }",
"description":"query ssid profile success "
}

Create SSID and VAP Profiles

Function

This interface is used to create SSID and VAP profiles.

URI

/rest/openapi/sct/ssid

Access Method

POST

Request Example

POST https://10.120.70.220:32102/rest/openapi/sct/ssid?nedn=NE=34603109&ssidProfileName=default&vapProfileName=default$apMacList=22-22-22-22-22-22,22-22-22-22-22-23&apGroupList=eSight,eSight001&wlanId=2&radioId=1
Headers: key = openid, value = d21ee8aae2f9c05b2098e82a33b3430b37e1c6980d26004f

Parameter Description

Parameter

Mandatory/Optional

Location

Value Type

Description

openid

Mandatory

Request header parameter list

String

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

NOTE:

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

nedn

Mandatory

Request entity parameter list

String

Indicates the NE DN, which uniquely identifies a device on eSight.

ssidProfileName

Mandatory

Request entity parameter list

String

Indicates the name of the SSID profile to be created.

vapProfileName

Mandatory

Request entity parameter list

String

Indicates the name of the VAP profile to be created.

apMacList

Optional

Request entity parameter list

String

Indicates the MAC address of an AP. Multiple MAC addresses are supported. Use commas (,) to separate multiple MAC addresses.

apGroupList

Optional

Request entity parameter list

String

Indicates the name of an AP group. Multiple AP group names are supported. Use commas to separate multiple AP groups.

wlanId

Optional

Request entity parameter list

String

Indicates the unique ID of the VAP profile in the AP group.

NOTE:

If apMacList or apGroupList is not empty, wlanId is mandatory.

radioId

Optional

Request entity parameter list

int

Indicates the radio ID. The value can be 0, 1, or 2.

NOTE:

If apMacList or apGroupList is not empty, radioId is mandatory.

Result

Field

Type

Description

code

int

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

  • 0: successful
  • Others: failed

data

String

The field is displayed as null.

description

String

Indicates the description of the interface invoking result.

Response Example

{
"code":0,
"data":null,
"description":"deploy success"
}

Precautions

None

Example

package com.huawei.oms.ros.test;

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

public class DeploySsidProfile {
    private static final String SSIDPROFILEPATH= "/rest/openapi/sct/ssid";
    public static void main(String[] args) throws Exception {
        Login.login();
       deploySsidProfile();
    }
    public static void deploySsidProfile() throws  Exception {  
        String openidURL = "/rest/openapi/sct/ssid";   
        String method = "POST";   
        JSONObject model = new JSONObject();   
        model.put("nedn", "NE=34603809");  
        model.put("ssidProfileName", "whtest002");  
        model.put("vapProfileName", "whtest002");  
        BasicNameValuePair[] parameters = convertJsonObj(model);  
        // set headers   
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);  
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP,GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);   
        // get the result  
        String body = NewHttpsAccess.getResult(response);   
        System.out.println(body);
    }

}

The returned result is as follows:

{
"code":0,
"data":null,
"description":"deploy success"
}
Download
Updated: 2019-12-13

Document ID: EDOC1100044386

Views: 20889

Downloads: 90

Average rating:
This Document Applies to these Products

Related Version

Related Documents

Share
Previous Next