Resource URL
PUT /botnetdetectors/import/manual
Content-type value
multipart/form-data; boundary=<x>
Request Parameters
Payload Request Parameters:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| MultiPart | Holds the body part objects | Object | Yes |
Details of BodyPart[0]:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| BodyPart[0] | Holds the file format object | Application/json object | Yes |
Details of file format:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| fileName | Name of the file | String | Yes |
| type | File type should be "ZIP" | String | Yes |
Details of BodyPart[1]:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| BodyPart[1] | Holds the file as input stream | Application/octet-stream | Yes |
Details of .zip file:
| Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| File | botnet 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 | Status returned by the update | Number |
Example
Request
PUT https://%3CNSM_IP%3E/sdkapi/botnetdetectors/import/manual
Payload:
NSM-SDK-API: QkI2Q0Y4NjgxNzUzNkY0RTc5Qjc5NUJCRUFCRUZEOUM6MQ==
Accept: application/vnd.nsm.v1.0+json
Content-Type: multipart/form-data; boundary=Boundary_1_13198090_1360147081930
MIME-Version: 1.0
User-Agent: Java/1.6.0_25
Host: 127.0.0.1:8888
Connection: keep-alive
Content-Length: 307803
--Boundary_1_13198090_1360147081930
Content-Type: application/json
{"fileName":"botnet_sdkapi","type":"ZIP"}
--Boundary_1_13198090_1360147081930
Content-Type: application/octet-stream
3WA«ˆJY header.json{"sha1": "d37a91be6f92f2620bf0bf0bdba985a2eecced94", "file-length": 229869, "iv": "D+grgU2y12NHI/OFt8LaRVzP0an/1Fwin8TWhuGIS4aQYfjBhZEQLTzmUGxYjePyPC+v6fQoDfEp\nT5qHAaZX4xn5b1gdeR9iQgIx9mui2hkHEd2zxaLwzzS/1mWOYbvoKO4DPxYpT3UdDFxhe5nd8PPI\nCGkDMExlmo2OwHjxiuUIwOOZfGEeA1SVHf8DiGKsmv25WVjF7LsTndRpeksyWyQX1/WESlnC+VkE\nOaJK6l4DBCfzror7GuFADOKIPcGeZzgUCn/EMYfG/QhFw2vfu+OVub4f6qJZB6fDBn1li8KL+DQ5\niDCI/Gq6zCIGksHPFJ9W+RN1RdlKVIkATdkkQQ==\n", "version": 31.0, "key": "sFXb40h4vS6dWlaynBPdojhuXJDv9WoN1Jh0ts5+G9x9siDy/tMwGo9U8pxoLveHJKu7mspI5nL5\nxFI8rR8EMzHjdeO9c9qMs/x6djhKpDn8LQDQT03zdIW5QXwt5uA2tByLAOoKK5LKsveApJzqJMGw\nu/20sgvouKBLESGVE1WTZ1rlRWC6JPQ5l6ZzkW4kkjtcqGbqSnATipJmyKD2a5sAztXpp7vpNOrK\nGUHH8jViWzgwnzlgW/8IcypQdCwFiYWnU2lDBzkBx24ROd/D7CavlBHBDUU6vvoeX6mtJLm0UcBN\nHZX/rLmVlqS4hWn79e6F+lkB9/+LntizVRb57g==\n", "date": 1350968439, "file-type": 1}
--Boundary_1_13198090_1360147081930
Response
{
"status":1
}
Error Information
Following error codes are returned by this URL:
| S.No | HTTP Error Code | SDK API errorId | SDK API errorMessage |
|---|---|---|---|
| 1 | 400 | 1001 | internal error |
| 2 | 400 | 3001 | Botnet supports only .zip file format |