Import the Sensor Configuration

This URL imports the Sensor configuration from the XML file and pushes to the Sensor.

Resource URL

PUT /sensor/<sensor_id>/importconfiguration

Request Parameters

URL Parameters:

Field Name Description Data Type Mandatory
sensorId Sensor Id number Yes

Payload Request Parameters:

Field Name Description Data Type Mandatory
MultiPart Holds the BodyPart Objects object Yes

Details of BodyPart[0]:

Field Name Description Data Type Mandatory
BodyPart[0] Holds the ImportFileElement object application/json object Yes

Details of ImportFileElement:

Field Name Description Data Type Mandatory
fileName Name of the file string Yes
fileType FileType should be "XML" string Yes

Details of BodyPart[1]:

Field Name Description Data Type Mandatory
BodyPart[1] Holds the File as InputStream application/octet-stream Yes

Details of .xml File:

Field Name Description Data Type Mandatory
File Policy(File Input Stream) ByteArrayInput Stream Yes

Response Parameters

Following fields are returned if the request parameters are correct, otherwise error details are returned.

Field Name Description Data Type
status Set to 1 if the operation was successful number
message Message returned from the backend string

Example

Request

PUT https://<NSM_IP>/sdkapi/sensor/<sensor_id>/importconfiguration

Payload

----Boundary_1_12424925_1353496814940
Content-Type: application/json

{"fileType": "xml", "fileName": "sensor1002API"}



----Boundary_1_12424925_1353496814940
Content-Type: application/octet-stream

<Sensor swVersion="8.0.2.2">
 <PhysicalConfig originalSensorName="M-2950" failoverMode="standalone">
  <sensor description="MCAFEE-NETWORK-SECURITY-PLATFORM" model="M-2950" slotCount="2" //……
……
…..//

   <NI id="NI162" interfaceid="Interface132" adid="/Test Child Domain 1.1" vidsid="Vids148" name="Def NI of Interface 4A-4B on mfa/sensor 1002" nipolicytype="D" nilinktype="D"/>
  </NIs>
 </VidsConfig>
 <NonStandardPorts/>
 <BotConfigs>
  <botconfig status="disable" vidsId="Vids143">
   <zeroday inherit="true" scorethreshold="0"/>
  </botconfig>
 </BotConfigs>
 <L7FieldConfigs/>
</Sensor>

----Boundary_1_12424925_1353496814940--

Response

{
"status": 1,
"message": "IN PROGRESS:Queued: Generation of Signature file Segment for Sensor: M-2950 IN PROGRESS:Generating Signature Segments for Sensor: M-2950. Sig Version: 8.6.25.6 IN PROGRESS:Generating Response Segments for Sensor: M-2950 IN PROGRESS:Beginning Signature download to the sensor: M-2950 IN PROGRESS:Transferred files successfully applied for... DOWNLOAD COMPLETE "
}

Error Information

No HTTP Error Code SDK API errorId SDK API errorMessage
1 404 1106 Invalid sensor
2 400 5301 Invalid FileType given for import
3 400 1124 The sensor is inactive
4 500 2202 Input Stream read error
5 500 500 Fail Over Sensor required for importing this file
6 500 500 Standalone Sensor required for importing this file
7 500 500 IPv6 configuration mismatch. Correct this and try again.
8 500 500 Sensor model is different. Correct this and try again.
9 500 500 Invalid import file. Correct this and try again.
10 500 500 Physical Configuration is different. Correct this and try again.
11 400 1140 Sensor is currently running in Layer 2 bypass mode
12 400 1141 Concurrent process are running on the update server
13 400 1142 Please wait a minute and then try again,check the system log for details
14 400 1144 Sensor is not a standalone device.Signature set download cannot be done on a failover device
15 400 1147 Total Exception Objects count exceeded the limit of
16 400 1148 Sensor software version is not compatible with NSM