IP group management

The following fields are required for all IP group management API requests:

  • authToken - Authentication token generated by Plixer Scrutinizer to allow API access

  • rm - ipgroups (runmode corresponding to the function set being accessed)

  • action - One or more of the following actions to be initiated by the request:

    • saveRule - Creates an IP group with the specified rule

    • update - Modifies an existing IP group

    • loadTreeRootFast - Loads a condensed list of all IP group names and IDs

    • search - Searches for an IP group by name

    • loadRules - Loads a list of all rule definitions for an IP group

    • deleteRule - Removes a rule from an IP group

    • delete - Deletes an IP group

    • deleteAll - Deletes all IP group definitions from Plixer Scrutinizer

Rule definitions

Use the following JSON object formats to pass IP group inclusion rule definitions in requests:

Rule type

JSON

Single IP address(es)

[
 {
  "type": "ip"
  "address": "<IP_ADDRESS_1>"
 },
 {
  "type": "ip"
  "address": "<IP_ADDRESS_2>"
 }
]

IP address range

[
 {
  "type": "range"
  "sip": "<START_IP>"
  "eip": "<END_IP>"
 }
]

Subnet

[
 {
  "type": "network"
  "address": "<ADDRESS>"
  "mask": "<SUBNET_MASK>"
 }
]

Wildcard mask

[
 {
  "type": "wildcard"
  "address": "<ADDRESS>"
  "mask": "<WILDCARD_MASK>"
 }
]
Child group
(Child groups must be created before they can be added to parent groups)
[
 {
  "type": "child"
  "child_id": "<CHILD_IPGROUP_ID>"
 }
]

All IP addresses

[
 {
  "type": "ipall"
  "all": 1
 }
]

Request examples

Below are additional details and request examples for actions that can be included in an IP group management API call.

saveRule

The following additional fields can be passed in the request when creating new IP groups using the saveRule action:

  • new_fc - Specifies a name for the new IP group

  • added - Specifies a JSON array of one or more inclusion rule definitions to add to the new IP group

API request example

curl --location  --insecure --request POST 'https://<SCRUTINIZER_ADDRESS>/fcgi/scrut_fcgi.fcgi' \
--form 'authToken=<AUTH_TOKEN>' \
--form 'rm=ipgroups' \
--form 'action=saveRule' \
--form 'new_fc=UK Data Center' \
--form 'added=[
    {
        "type": "ip",
        "address": "10.30.10.1"
    }
]'

Returned JSON object

{
  "removed": [],
  "updated": [],
  "added": [
      {
          "rule_id": 506588,
          "cid": null,
          "type": "ip",
          "address": "10.30.10.1"
      }
  ],
  "warnings": [],
  "fc_id": 16900006,
  "myrules": "IP Address:10.30.10.1",
  "fc_name": "UK Data Center",
  "rule_id": 506588,
  "total": 1
}

update

The following additional fields can be passed in requests to add, replace, or remove a rule definition from an IP group using the update action:

  • name - Replaces the current name of the IP group if included

  • added - Specifies a JSON array of one or more inclusion rule definitions to add to the new IP group

  • updated - Specifies a JSON array of rules (based on the included rule_id field) that will be overwritten with the new definitions provided

  • removed - Specifies a JSON array of rule IDs to be deleted

API request example

curl --location  --insecure --request POST 'https://<SCRUTINIZER_ADDRESS>/fcgi/scrut_fcgi.fcgi' \
--header 'Content-Type: application/json' \
--form 'authToken=<AUTH_TOKEN>' \
--form 'rm=ipgroups' \
--form 'action=update' \
--form 'fc_id=16900006' \
--form 'name=Renamed Group' \
--form 'added=[
    {
        "type": "ip",
        "address": "10.1.4.66"
    }
]' \
--form 'updated=[
    {
        "rule_id": "84",
        "type": "ip",
        "address": "192.1.0.0"
    }
]' \
--form 'removed=[114]'

deleteRule

The deleteRule action deletes a rule definition with the specified rule_id from its IP group.

API request example

curl --location  --insecure --request POST 'https://<SCRUTINIZER_ADDRESS>/fcgi/scrut_fcgi.fcgi' \
--header 'Content-Type: application/json' \
--form 'authToken=<AUTH_TOKEN>' \
--form 'rm=ipgroups' \
--form 'action=deleteRule' \
--form 'rule_id=506588'

Returned JSON object

{
  "fc_id": 16900006,
  "success": 1,
  "myrules": "",
  "rule_id": 506588,
  "total": 0
}

delete

The delete action deletes the IP group(s) specified by the group id array passed in the request’s json field.

API request example

curl --location  --insecure --request POST 'https://<SCRUTINIZER_ADDRESS>/fcgi/scrut_fcgi.fcgi' \
--header 'Content-Type: application/json' \
--form 'authToken=<AUTH_TOKEN>' \
--form 'rm=ipgroups' \
--form 'action=delete' \
--form 'json=[
    {
        "id": "16900032",
    }
]'

Returned JSON object

{
  "processedCount": 1,
  "removed": [
      "16900032"
  ]
}