This URL retrieves the list/a particular rule template.
Resource URL
GET /sensor/<sensor_id>/packetcaptureruletemplate
Request Parameters
URL Parameters:
Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| Sensor id | Number | Yes |
Query Parameters:
Field Name | Description | Data Type | Mandatory |
|---|---|---|---|
| Name of the rule template. Default is empty which returns all the templates | String | no |
Response Parameters
Following fields are returned if the request parameters are correct, otherwise error details are returned.
Field Name | Description | Data Type |
|---|---|---|
| List of rule templates | Array |
Details of object in template:
Field Name | Description | Data Type |
|---|---|---|
| ID of template | Number |
| Name of template | String |
| Visible to child or not | Boolean |
| List of rules | Array |
Details of object in rule:
Field Name | Description | Data Type |
|---|---|---|
| Rule id | Number |
| Traffic | String |
| Protocol | String |
| IP version | String |
| Fragments only | Boolean |
| Source IP | String |
| Source mask | Number |
| Source port | Number |
| Destination IP | String |
| Destination mask | Number |
| Destination port | Number |
| VLAN id | Number |
| Protocol number | Number |
Example
Request
GET https://<NSM_IP>/sdkapi/sensor/1001/packetcaptureruletemplate?name=test
Response
{
"tempate": [{
"templateId": 101,
"templateName": "test",
"visibleToCild": true,
"rule": [{
"ruleId": 101,
"traffic": "ALL",
"protocol": "TCP",
"ipVersion": "IPV_4",
"fragmentsOnly": false,
"sourceIP": "0.0.0.0",
"sourceMask": 0,
"sourcePort": 0,
"destinationIP": "0.0.0.0",
"destinationMask": 0,
"destinationPort": 0,
"vlanId": 0,
"protocolNumber": 0
}]
}]
}
Error Information
Following error codes are returned by this URL:
No | HTTP Error Code | SDK API errorId | SDK API errorMessage |
|---|---|---|---|
1 | 404 | 1106 | Invalid Sensor |
2 | 500 | 1124 | The Sensor is inactive |
3 | 400 | 6201 | Packet capture not supported on this Sensor |