H3C Technologies H3C Intelligent Management Center User Manual

Page 501

Advertising
background image

487

Property

name

Description Required Remarks

class

Entity class used
by the REST
operation

N

If the REST method is POST or PUT, this parameter
is typically required. When the parameter is

provided, the instantiation of an entity object is

done, and an XML file is generated and sent to the
REST server. At this time, the entityProperty and

dataType properties must be specified for each

Parameter element.

If the REST method is GET or DELETE, this

parameter is typically not required. When the

parameter is not provided, the system sends the
parameter value input by the user as the URL

parameter to the REST server. At this time, the

system ignores the entityProperty and dataType
properties of the Parameter elements.

Example 1: use static URL values

<RestAction id="getXXXXAction" protocol="http" ip="10.153.88.70" port="8080"

uri="/imcrs/XXXX" userName="${IMC_USER_NAME}" userPassword="${IMC_USER_PWD}"

method="1">

<Parameter name="devId" value="${DEVICE_ID}"/>

</RestAction>

Example 2: use replaceable URL variables

<RestAction id="getXXXXAction" protocol="http" ip="${RestServerIP}"

port="${RestServerPort}" uri="/imcrs/XXXX" userName="${IMC_USER_NAME}"

userPassword="${IMC_USER_PWD}" method="1">

<Parameter name="devId" value="${DEVICE_ID}"/>

</RestAction>

Example 3: send REST request by using the entity class

<RestAction id="addXXXXAction" protocol="http" ip="${RestServerIP}"

port="${RestServerPort}" uri="/imcrs/XXXX" userName="${IMC_USER_NAME}"

userPassword="${IMC_USER_PWD}" method="2" class="com.h3c.imc.XXXEntity">

<Parameter name="devId" value="${DEVICE_ID}" entityProperty="id"

dataType="java.math.BigInteger"/>

</RestAction>

Example 4: send REST request by using the URL parameter

<RestAction id="getXXXXAction" protocol="http" ip="${RestServerIP}"

port="${RestServerPort}" uri="/imcrs/XXXX" userName="${IMC_USER_NAME}"

userPassword="${IMC_USER_PWD}" method="1">

<Parameter name="devId" value="${DEVICE_ID}"/>

</RestAction>

Table 13 Properties supported by the Asn1Action element

Property

name

Description

Require

d

Remarks

id Action

ID

Y

A character string consisting of letters or digits; unique in an
operation; consistent with the actionName in the

background script.

Advertising