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).
Server Firmware Upgrade and Management Interfaces

Server Firmware Upgrade and Management Interfaces

The V300R010C00SPC500 version does not support this function. The V300R010C00SPC500 version having a patch version later than V300R010C00SPC500 installed also does not support this function.Versions upgraded from V300R010C00SPC300 (Upgrade Tool 5.0) do not support this function.The V300R010C00CP5022 patch does not support this function.

Upload an Upgrade Package

Function

This interface is used to upload an upgrade package.

URI

/rest/openapi/server/firmware/basepackages/upload

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 authentication.

NOTE:

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

basepackageName

Mandatory

Parameter list

String

Indicates a template name. The value is a string of 6 to 32 characters, consisting of uppercase or lowercase letters, digits, hyphens (-), and underscores (_).

basepackageType

Mandatory

Parameter list

String

Indicates an upgrade package type. The options are Firmware, Driver, and Bundle.

basepackageDescription

Optional

Parameter list

String

Indicates the description of an upgrade package. The value can contain a maximum of 128 characters.

fileList

Mandatory

Parameter list

String

Indicates the list of upgrade package files. The upgrade package files must be stored in the default directory on the SFTP server.

NOTE:

For firmware and driver packages, ZIP and digital signature certificates must be uploaded. For bundle packages, only ZIP packages need to be uploaded.

sftpserverIP

Mandatory

Parameter list

String

Indicates the IP address of the SFTP server.

username

Optional

Parameter list

String

Indicates the user name of the SFTP server. The value can contain a maximum of 64 characters.

password

Optional

Parameter list

String

Indicates the password of the SFTP server. The value can contain a maximum of 64 characters.

port

Mandatory

Parameter list

String

Indicates the port number of the SFTP service. The value ranges from 0 to 65535.

Result

Field

Value Type

Description

code

long

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

  • 0: successful
  • Others: failed (For details, see the interface return code list.)

data

JSON<data>

Indicates the task name data.

resverd

String

Indicates a reserved field. The value is null.

description

String

Indicates the description of the interface invoking result.

data description

Field

Value Type

Description

taskName

String

Indicates a task name automatically generated by the interface. It is the unique identifier of a task. The format is as follows: API@UploadFMWareTask_Current system time (ms).

Precautions

The size of the uploaded file cannot exceed 5 GB.

When you upload a firmware upgrade package, the capacity of the disk where eSight is installed must be equal to or larger than 40 GB.

Example

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

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;

public class UploadBasepackages
{
    private static final String UPLOAD_BASEPACKAGES_URL = "/rest/openapi/server/firmware/basepackages/upload";
    public static void main(String[] args) throws Exception
    {
        // TODO Auto-generated method stub
        Login.login();
        UploadBasepackagesTest();
    }
    
    public static void UploadBasepackagesTest() throws Exception
    {
        String openidURL = UPLOAD_BASEPACKAGES_URL;
        String method = "POST";
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        
        //example 1: creating a firmware package upload task
        BasicNameValuePair[] parameters = 
            {
                new BasicNameValuePair("basepackageName", "basepackage"),
                new BasicNameValuePair("basepackageDescription", "This is a basepackage."),
                new BasicNameValuePair("basepackageType", "Firmware"),
                new BasicNameValuePair("fileList", "iBMC.zip,iBMC.zip.asc"),
                new BasicNameValuePair("sftpserverIP", "188.10.18.103"),
                new BasicNameValuePair("username", "itSftpUser"), 
                new BasicNameValuePair("password", "Huawei@123"),
                new BasicNameValuePair("port", "31922")
            };
        //example 2: creating a bundle package upload task
        BasicNameValuePair[] parameters2 = 
            {
                new BasicNameValuePair("basepackageName", "bundle"),
                new BasicNameValuePair("basepackageDescription", "This is a Bundle."),
                new BasicNameValuePair("basepackageType", "Bundle"),
                new BasicNameValuePair("fileList", "bundle.zip"),
                new BasicNameValuePair("sftpserverIP", "188.10.18.103"),
                new BasicNameValuePair("username", "itSftpUser"), 
                new BasicNameValuePair("password", "Huawei@123"),
                new BasicNameValuePair("port", "31922")
            };
        
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters2);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    
    }
    
}

Response example:

REST_SUCCESS   
{
    "code": 0,
    "data": {
        "taskName": "API@UploadFMwareTask_1506384770607"
    },
    "resverd": null,
    "description": "task of upload FMwaresource created success."
}

Query the Upgrade Package Upload Progress

Function

This interface is used to query the upgrade package upload progress.

URI

/rest/openapi/server/firmware/basepackages/progress

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.

taskName

Mandatory

Parameter list

String

Indicates the name of the task whose progress is to be queried.

Result

Field

Value Type

Description

code

long

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

  • 0: successful
  • Others: failed (For details, see the interface return code list.)

data

JSON<data>

Indicates the upgrade package details.

description

String

Indicates the description of the interface invoking result.

data description

Field

Value Type

Description

taskName

String

Indicates the name of an upgrade package upload task. A task name is automatically generated by the interface and is the unique identifier of a task.

basepackageName

String

Indicates the name of an upgrade package.

taskStatus

String

Indicates the status of an upgrade package upload task. The options are as follows:

  • Idle: The task has not been started.
  • Running: The task is in progress.
  • Complete: The task is finished.

taskProgress

int

Indicates the progress of an upgrade package upload task. The value ranges from 0 to 100.

taskResult

String

Indicates the result of an upgrade package upload task. When the task status is Idle or Running, this field is left blank. When the task status is Complete, the options are as follows:

  • Success
  • Failed

taskCode

String

Indicates the result of an upgrade package upload task. When the task status is Idle or Running, this field is left blank. When the task status is Complete, the options are as follows:

  • 0: successful
  • Others: failed (For details, see the interface return code list.)
NOTE:

For details about the task failure error codes, see the task error code list.

errorDetail

String

Indicates the result details of an upgrade package upload task. When the task status is Idle or Running, this field is left blank. When the task status is Complete and the task is successful, this field is left blank. When the task status is Complete and the task failed, the failure cause is returned.

Precautions

None

Example

Request example:

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

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;

public class QueryBasepackagesProgress
{
    private static final String QUERY_BASEPACKAGES_PROGRESS_URL = "/rest/openapi/server/firmware/basepackages/progress";
    public static void main(String[] args) throws Exception
    {
        // TODO Auto-generated method stub
        Login.login();
        QueryBasepackagesProgressTest();
    }
    
    public static void QueryBasepackagesProgressTest() throws Exception
    {
        String openidURL = QUERY_BASEPACKAGES_PROGRESS_URL;
        String method = "GET";
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        
        
        BasicNameValuePair[] parameters = 
            {
                new BasicNameValuePair("taskName", "API@UploadFMwareTask_1519511054602")
            };
        
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    
    }
    
}

Response example:

REST_SUCCESS   
{
     "code" : 0, 
     "data" : 
     {
       "taskName" : "API@UploadFMwareTask_1519511054602",
       "basepackageName" : "basePackage1",
       "taskStatus" : "Complete",        
       "taskProgress" : "100",         
       "taskResult" : "Success",        
       "taskCode" : "0",                
       "errorDetail" : "" 
     },
     "description" : "Get upload FMWare Progress success."
}

Query the Upgrade Package List

Function

This interface is used to query the upgrade package list.

URI

/rest/openapi/server/firmware/basepackages/list

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.

pageNo

Optional

Parameter list

int

Indicates the page number. The default value is 1.

pageSize

Optional

Parameter list

int

Indicates the number of records on a page. The default value is 20.

Result

Field

Value Type

Description

code

long

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

  • 0: successful
  • Others: failed (For details, see the interface return code list.)

totalNum

int

Indicates the total number of upgrade packages.

data

JSON<data>

Indicates the upgrade package list data.

description

String

Indicates the description of the interface invoking result.

data description

Field

Value Type

Description

basepackageName

String

Indicates the name of an upgrade package.

basepackageDesc

String

Indicates the description of an upgrade package.

basepackageType

String

Indicates the type of an upgrade package.

Precautions

None

Example

Request example:

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

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;

public class QueryBasepackagesList
{
    private static final String QUERY_BASEPACKAGES_LIST_URL = "/rest/openapi/server/firmware/basepackages/list";
    public static void main(String[] args) throws Exception
    {
        // TODO Auto-generated method stub
        Login.login();
        QueryBasepackagesProgressTest();
    }
    
    public static void QueryBasepackagesProgressTest() throws Exception
    {
        String openidURL = QUERY_BASEPACKAGES_LIST_URL;
        String method = "GET";
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        
        
        BasicNameValuePair[] parameters = 
            {
                new BasicNameValuePair("pageNo", "1"),
                new BasicNameValuePair("pageSize", "20"),
            };
        
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    
    }
    
}

Response example:

REST_SUCCESS   
{
    "code": 0,
    "totalNum": 6,
    "description": "Get basePackage list success.",
    "data": [
        {
            "basepackageName": "firmware",
            "basepackageDesc": "@@@@@@@@@@@@",
            "basepackageType": "Firmware"
        },
        {
            "basepackageName": "driver",
            "basepackageDesc": "@@@@@@@@@@@@",
            "basepackageType": "Driver"
        },
        {
            "basepackageName": "bundle",
            "basepackageDesc": "@@@@@@@@@@@@",
            "basepackageType": "Bundle"
        },
        {
            "basepackageName": "AAAAAAAAA",
            "basepackageDesc": "",
            "basepackageType": "Bundle"
        },
        {
            "basepackageName": "5288v3",
            "basepackageDesc": "",
            "basepackageType": "Firmware"
        },
        {
            "basepackageName": "111111111111",
            "basepackageDesc": "",
            "basepackageType": "Firmware"
        }
    ]
}

Query Upgrade Package Details

Function

This interface is used to query upgrade package details.

URI

/rest/openapi/server/firmware/basepackage/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.

basepackageName

Mandatory

Parameter list

String

Indicates the name of the upgrade package. The value is a string of 6 to 32 characters, consisting of uppercase or lowercase letters, digits, hyphens (-), and underscores (_).

Result

Field

Value Type

Description

code

long

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

  • 0: successful
  • Others: failed (For details, see the interface return code list.)

data

JSON<data>

Indicates the upgrade package details.

description

String

Indicates the description of the interface invoking result.

data description

Field

Value Type

Description

basepackageName

String

Indicates the name of an upgrade package.

basepackageDesc

String

Indicates the description of an upgrade package.

basepackageType

String

Indicates the type of an upgrade package.

basepackageProp

JSON<basepackageProp>

Indicates the details of an upgrade package.

basepackageProp description (package type: firmware)

Field

Value Type

Description

firmwareType

String

Indicates a firmware type.

version

String

Indicates a firmware version.

activeMode

String

Indicates an activation mode.

supported device models

String

Indicates the supported device types.

basepackageProp description (package type: Driver and Bundle)

Field

Value Type

Description

driverPackageName

String

Indicates the name of a driver package.

supportOS or device type

String

Indicates the operating systems supported.

releaseDate

String

Indicates the release date.

driverPackageProp

JSON<driverPackageProp>

Indicates the details of a driver package. This field applies only to driver and bundle packages.

driverPackageProp description

Field

Value Type

Description

firmwareType

String

Indicates a firmware type.

version

String

Indicates a firmware version.

supported device models

String

Indicates the models supported.

Precautions

None

Example

Request example:

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

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;

public class QueryBasepackagesDetail
{
    private static final String QUERY_BASEPACKAGES_DETAIL_URL = "/rest/openapi/server/firmware/basepackage/detail";
    public static void main(String[] args) throws Exception
    {
        // TODO Auto-generated method stub
        Login.login();
        QueryBasepackagesDetailTest();
    }
    
    public static void QueryBasepackagesDetailTest() throws Exception
    {
        String openidURL = QUERY_BASEPACKAGES_DETAIL_URL;
        String method = "GET";
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        
        
        BasicNameValuePair[] parameters = 
            {
                new BasicNameValuePair("basepackageName", "basepackage")
            };
        
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    
    }
    
}

Response example 1: bundle package details

REST_SUCCESS   
{
    "code": 0,
    "data": {
        "basepackageName": "basepackage",
        "basepackageDesc": "@@@@@@@@@@@@",
        "basepackageType": "Bundle",
        "basepackageProp": [
            {
                "driverPackageName": "RH2285 V2-BIOS-V516.zip",
                "supportOS or device type": "RH2285 V2",
                "releaseDate": "2016-12-30",
                "driverPackageProp": [
                    {
                        "firmwareType": "BIOS",
                        "version": "V509",
                        "supported device models": "RH2285 V2;RH2285H V2;RH2288 V2;RH2288H V2;RH1288 V2;RH2288E V2;BH622 V2;BH640 V2;DH320 V2;DH628 V2;XH320 V2;XH321 V2;DH321 V2;XH621 V2;RH2485 V2;DH626 V2;"
                    }
                ]
            },
            {
                "driverPackageName": "XH621 V2&DH621 V2&DH620 V2-BIOS-V510.zip",
                "supportOS or device type": "XH621 V2",
                "releaseDate": "2017-01-04",
                "driverPackageProp": [
                    {
                        "firmwareType": "BIOS",
                        "version": "V410",
                        "supported device models": "RH2285 V2;RH2285H V2;RH2288 V2;RH2288H V2;RH1288 V2;RH2288E V2;BH622 V2;BH640 V2;DH320 V2;DH628 V2;XH320 V2;XH321 V2;DH321 V2;XH621 V2;RH2485 V2;DH626 V2;"
                    }
                ]
            }
        ]
    },
    "description": "Query basepackage detail success."
}

Response example 2: firmware package details

REST_SUCCESS   
{
    "code": 0,
    "data": {
        "basepackageName": "firmware",
        "basepackageDesc": "@@@@@@@@@@@@",
        "basepackageType": "Firmware",
        "basepackageProp": [
            {
                "firmwareType": "BIOS",
                "version": "V513",
                "activeMode": "ResetServer",
                "supported device models": "RH1288A V2; RH2288A V2"
            }
        ]
    },
    "description": "Query basepackage detail success."
}

Response example 3: driver package details

REST_SUCCESS   
{
    "code": 0,
    "data": {
        "basepackageName": "driver",
        "basepackageDesc": "@@@@@@@@@@@@",
        "basepackageType": "Driver",
        "basepackageProp": [
           {
               "driverPackageName": "onboard_driver_sles10sp4.iso",
               "supportOS or device type": "sles10sp4",
               "releaseDate": "2017-3-24",
               "driverPackageProp": [
                   {
                       "firmwareType": "RAID",
                       "version": "20.00.00.00",
                       "supported device models": "LSI2308"
                   },
                   {
                       "firmwareType": "RAID",
                       "version": "06.807.10.00",
                       "supported device models": "LSI2208"
                   },
                   {
                       "firmwareType": "CNA",
                       "version": "3.137j",
                       "supported device models": "MZ111;SM210;MZ110"
                   },
                   {
                       "firmwareType": "CNA",
                       "version": "4.0.3",
                       "supported device models": "MZ312;MU230;MZ310;SM231;MZ912_eth;SM233"
                   },
                   {
                       "firmwareType": "CNA",
                       "version": "5.2.15",
                       "supported device models": "SM212;SM211;MU212"
                   },
                   {
                       "firmwareType": "CNA",
                       "version": "4.6.345.0",
                       "supported device models": "MZ510;MZ512"
                   },
                   {
                       "firmwareType": "CNA",
                       "version": "0:8.2.2.30",
                       "supported device models": "MZ510;MZ910;MZ512"
                   },
                   {
                       "firmwareType": "CNA",
                       "version": "0:8.2.2.30",
                       "supported device models": "MZ910"
                    },
                    {
                       "firmwareType": "CNA",
                       "version": "4.6.442.5",
                       "supported device models": "MZ510;MZ910;MZ512"
                    }
               ]
           },
    "description": "Query basepackage detail success."
}

Create an Upgrade Task

Function

This interface is used to create an upgrade task.

URI

/rest/openapi/server/firmware/task

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 authentication.

NOTE:

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

basepackageName

Mandatory

Parameter list

String

Indicates the name of the upgrade package. The value is a string of 6 to 32 characters, consisting of uppercase or lowercase letters, digits, hyphens (-), and underscores (_).

NOTE:

Each upgrade task can use only one upgrade package.

firmwareList

Mandatory

Parameter list

String

Indicates the list of firmware to be upgraded. The options are as follows:

  • CNA_DRIVE
  • RAID_DIRVE
  • HMM
  • iBMC
  • BIOS
  • CPLD
  • LCD
  • Fabric
  • Base
  • FC
  • FAN
  • iBMA
  • CHN
  • RAID
  • HDD
  • NVDIMM
  • SSD
NOTE:

The CNA_DRIVE and RAID_DRIVE are driver firmware. The HMM, iBMC, BIOS, CPLD, LCD, Fabric, Base, FC, and FAN are out-of-band firmware. The CHN, RAID, HDD, NVDIMM, and SSD are in-band firmware. If this parameter is set to multiple pieces of firmware, use a semicolon (;) to separate the firmware names from each other. Firmware types cannot be duplicate.

The firmware type CNA_DRIVE includes the CNA, HBA, NIC, and IB drivers. The firmware type CHN includes the CNA, HBA, NIC, and IB.

dn

Mandatory

Parameter list

String

Indicates a DN, which is a unique identifier of a server, for example, NE=xxx. If there are multiple devices, separate device numbers with semicolons (;).

isforceupgrade

Mandatory

Parameter list

String

Indicates whether to match the device firmware type by force. The options are as follows:

  • false: forcible device firmware type matching
  • true: non-forcible device firmware type matching
NOTE:

Non-forcible device firmware type matching applies only to in-band upgrade.

effectiveMethod

Mandatory

Parameter list

String

Indicates the effective mode. The options are as follows:

  • 0: automatic restart after upgrade
  • 1: manual restart after upgrade
    NOTE:

    Automatic restart: After the firmware is upgraded, related components will be automatically restarted, which may interrupt services.

    Manual restart: After the firmware is upgraded, related components will not be automatically restarted. Users can determine the restart time.

    Manual restart is only supported by the BIOS and CPLD firmware of rack/high-density/E9000 compute nodes.

    Firmware (such as the iBMC and HMM) that does not affect the service system will be automatically restarted after the upgrade is complete. For details, see the firmware list.

    For other firmware, users cannot select the mode in which the firmware takes effect.

Result

Field

Value Type

Description

code

long

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

  • 0: successful
  • Others: failed (For details, see the interface return code list.)

data

JSON<data>

Indicates the task name data.

resverd

String

Indicates a reserved field. The value is null.

description

String

Indicates the description of the interface invoking result.

data description

Field

Value Type

Description

taskName

String

Indicates a task name automatically generated by the interface. It is the unique identifier of a task. The format is as follows: API@FirmWareTask_Current system time (ms).

Precautions

None

Example

Request example:

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

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;

public class CreateFirmwareUpgradeTask
{
    private static final String CREATE_FIRMWARE_UPGRADE_TASK_URL = "/rest/openapi/server/firmware/task";
    public static void main(String[] args) throws Exception
    {
        // TODO Auto-generated method stub
        Login.login();
        CreateFirmwareUpgradeTaskTest();
    }
    
    public static void CreateFirmwareUpgradeTaskTest() throws Exception
    {
        String openidURL = CREATE_FIRMWARE_UPGRADE_TASK_URL;
        String method = "POST";
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        
        
        BasicNameValuePair[] parameters = 
            {
                new BasicNameValuePair("basepackageName", "ch121v3"),
                new BasicNameValuePair("firmwareList", "BIOS;iBMC"),
                new BasicNameValuePair("dn", "NE=34603615;NE=34603537"),
                new BasicNameValuePair("isforceupgrade", "false"),
                new BasicNameValuePair("effectiveMethod", "0")
            };
        
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    
    }
    
}

Response example:

REST_SUCCESS   
{
    "code": 0,
    "data": {
        "taskName": "API@FirmWareTask_1506310928191"
    },
    "resverd": null,
    "description": "creat task success."
}

Query Upgrade Task Details

Function

This interface is used to query upgrade task details.

URI

/rest/openapi/server/firmware/taskdetail

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.

taskName

Mandatory

Parameter list

String

Indicates the name of the task whose details are to be queried.

Result

Field

Value Type

Description

code

long

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

  • 0: successful
  • Others: failed (For details, see the interface return code list.)

data

JSON<data>

Indicates the details of an upgrade task.

description

String

Indicates the description of the interface invoking result.

data description

Field

Value Type

Description

taskName

String

Indicates the name of an upgrade task.

dn

String

Indicates a DN, which is a unique identifier of a server, for example, NE=xxx. If there are multiple devices, separate device numbers with semicolons (;).

taskStatus

String

Indicates the status of an upgrade task. The options are as follows:

  • Idle: The task has not been started.
  • Running: The task is in progress.
  • Complete: The task is finished.

taskProgress

int

Indicates the progress of an upgrade task. The value ranges from 0 to 100.

taskResult

String

Indicates the result of an upgrade task. When the task status is Idle or Running, this field is left blank. When the task status is Complete, the options are as follows:

  • Success
  • Failed
  • Partion Success: partial success

Precautions

None

Example

Request example:

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

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;

public class QueryFirmwareUpgradeTaskDetail
{
    private static final String QUERY_FIRMWARE_UPGRADE_TASK_URL = "/rest/openapi/server/firmware/taskdetail";
    public static void main(String[] args) throws Exception
    {
        // TODO Auto-generated method stub
        Login.login();
        QueryFirmwareUpgradeTaskDetailTest();
    }
    
    public static void QueryFirmwareUpgradeTaskDetailTest() throws Exception
    {
        String openidURL = QUERY_FIRMWARE_UPGRADE_TASK_URL;
        String method = "GET";
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        
        
        BasicNameValuePair[] parameters = 
            {
                new BasicNameValuePair("taskName", "API@FirmWareTask_1519511217188")
            };
        
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    
    }
    
}

Response example:

REST_SUCCESS   
{
     "code" : 0, 
     "data" : 
     {
       "taskName" : "API@FirmWareTask_1519511217188",
       "dn" : "NE=12345678;NE=87654321",
       "taskStatus" : "Complete",        
       "taskProgress" : "100",         
       "taskResult" : "Success",        
     },
     "description" : "get task detail success."
}

Query Firmware Upgrade Details of Specified Devices in an Upgrade Task

Function

This interface is used to query firmware upgrade details of specified devices in an upgrade task.

URI

/rest/openapi/server/firmware/taskdevicedetail

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.

taskName

Mandatory

Parameter list

String

Indicates the name of the task whose details are to be queried.

dn

Mandatory

Parameter list

String

Indicates the unique server identifier, for example, NE=xxx.

NOTE:

This interface supports only the DN of a single device.

Result

Field

Value Type

Description

code

long

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

  • 0: successful
  • Others: failed (For details, see the interface return code list.)

data

JSON<data>

Indicates the details of an upgrade task.

description

String

Indicates the description of the interface invoking result.

data description

Field

Value Type

Description

taskName

String

Indicates a task name automatically generated by the interface. The task name is the unique identifier of a task.

dn

String

Indicates the unique server identifier, for example, NE=xxx.

deviceTaskStatus

String

Indicates the status of a device upgrade task. The options are as follows:

  • Idle: The task has not been started.
  • Running: The task is in progress.
  • Complete: The task is finished.

deviceTaskProgress

int

Indicates the progress of a device upgrade task. The value ranges from 0 to 100.

deviceTaskResult

String

Indicates the result of a device upgrade task. When the task status is Idle or Running, this field is left blank. When the task status is Complete, the options are as follows:

  • Success
  • Failed
  • Partion Success: partial success

firmwarelist

JSON<firmwarelist>

Indicates the device firmware upgrade details.

firmwarelist description

Field

Value Type

Description

firmwareType

String

Indicates a firmware type.

currentVersion

String

Indicates the current firmware version.

upgradeVersion

String

Indicates the target firmware version.

firmwareProgress

int

Indicates the firmware upgrade progress. The value ranges from 0 to 100.

result

String

Indicates the upgrade result. The options are as follows:

  • Success
  • Failed

details

String

Indicates the details of an upgrade result. When the upgrade is successful, this parameter is left blank. When the upgrade fails, an error code is returned.

NOTE:

For details about the task failure error codes, see the task error code list.

errorDetail

String

Indicates the details of an upgrade result. When the upgrade is successful, this parameter is left blank. When the upgrade fails, the error detail is returned according to the error code.

Precautions

None

Example

Request example:

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

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;

public class QueryTaskDeviceDetail
{
    private static final String QUERY_TASK_DEVICE_DETAIL_URL = "/rest/openapi/server/firmware/taskdevicedetail";
    public static void main(String[] args) throws Exception
    {
        // TODO Auto-generated method stub
        Login.login();
        QueryTaskDeviceDetailTest();
    }
    
    public static void QueryTaskDeviceDetailTest() throws Exception
    {
        String openidURL = QUERY_TASK_DEVICE_DETAIL_URL;
        String method = "GET";
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        
        
        BasicNameValuePair[] parameters = 
            {
                new BasicNameValuePair("taskName", "API@FirmWareTask_1519511217188"),
                new BasicNameValuePair("dn", "NE=34603615")
            };
        
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    
    }
    
}

Response example:

REST_SUCCESS   
{
    "code": 0,
    "data": {
        "taskName": "API@FirmWareTask_1519511217188",
        "dn": "NE=34603615",
        "deviceTaskStatus": "Running",
        "deviceTaskProgress": 3,
        "deviceTaskResult": "",
        "firmwarelist": [
            {
                "firmwareType": "BIOS",
                "firmwareProgress": 3,
                "result": "",
                "upgradeVersion": "3.60",
                "currentVersion": "3.60",
                "details": "",
                "errorDetail": ""
            }
        ]
    },
    "description": "Get task device detail success."
}

Delete an Upgrade Package

Function

This interface is used to delete an upgrade package.

URI

/rest/openapi/server/firmware/basepackage/del

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 authentication.

NOTE:

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

basepackageName

Mandatory

Parameter list

String

Indicates the name of the upgrade package. The value is a string of 6 to 32 characters, consisting of uppercase or lowercase letters, digits, hyphens (-), and underscores (_).

Result

Field

Value Type

Description

code

long

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

  • 0: successful
  • Others: failed

description

String

Indicates the description of the interface invoking result.

Precautions

None

Example

Request example:

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

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;

public class DeleteBasepackage
{
    private static final String DELETE_BASEPACKAGE_URL = "/rest/openapi/server/firmware/basepackage/del";
    public static void main(String[] args) throws Exception
    {
        // TODO Auto-generated method stub
        Login.login();
        DeleteBasepackageTest();
    }
    
    public static void DeleteBasepackageTest() throws Exception
    {
        String openidURL = DELETE_BASEPACKAGE_URL;
        String method = "POST";
        BasicNameValuePair[] headers = NewRosSecurity.getRosHttpHeader(openidURL, method);
        
        
        BasicNameValuePair[] parameters = 
            {
                new BasicNameValuePair("basepackageName", "bundle")
            };
        
        HttpResponse response = NewHttpsAccess.access(GlobalVar.GLOBAL_IP, GlobalVar.GLOBAL_PORT, openidURL, method, headers, parameters);
        String body = NewHttpsAccess.getResult(response);
        System.out.println(body);
    
    }
    
}

Response example 1: An upgrade package is successfully deleted.

REST_SUCCESS      {
    "code": 0,
    "description": "delete FMBasePackage File success."
}

Response example 2: Delete an upgrade package that does not exist.

REST_SUCCESS      
{
    "code": 200108,
    "description": "delete FMBasePackage File failed: FMBasePackage 
is not existed."
}
Translation
Download
Updated: 2019-10-30

Document ID: EDOC1100044386

Views: 17274

Downloads: 86

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