Skip to content

Networks

Fetching networks

Fetching a network can be done in two ways. If you know the ID of the network, you can fetch based on this ID. Or you can search for networks.

Fetching by ID

To fetch a network by ID the network endpoint can be used with a GET operation along with the ID. The response body will be JSON formatted, and contain all information on the network.

1
curl -X GET -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/customernetworks/v1/network/<id>

Tip

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

To search for networks the search endpoint can be used with a POST operation and the search criteria submitted as JSON. The response body will be JSON formatted, and contain all search results.

1
2
3
curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/customernetworks/v1/network/search -d '{
  "keywords": ["dns"]
}'

In addition to supporting JSON, this endpoint also supports returning search results in CSV and Excel. Replace the Content-Type header value with text/csv or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet to use these.

The table below describes the different search criteria and what they do.

Field Name Default Description
limit 25
offset 0
includeDeleted false
subCriteria A list of objects that may contain any of the fields described in this table. Used in combination with exclude/required as described below
exclude false Whether to exclude results matching these criteria. This is only relevant when used in combination with sub criteria
required false Whether to require that these critieria are met. This is only relevant when used in combination with sub criteria
customerID Restrict the search to data belonging to specified customers
addresses A set of IP addresses matched against networks
includeSupernet true Whether to include super-networks in the search results
includeSubnet true Whether to include sub-networks in the search results
keywords A set of keywords matched against the description of networks
startTimestamp The start of the time search period. Used in combination with endTimestamp, timeMatchStrategy, and timeFieldStrategy
endTimestamp The end of the time search period. Used in combination with startTimestamp, timeMatchStrategy, and timeFieldStrategy
timeMatchStrategy any Whether all or any of the keywords must match. Used in combination with startTimestamp, endTimestamp, and timeFieldStrategy
timeFieldStrategy createdTimestamp Which time field to use when searching within a time period. Used in combination with startTimestamp, endTimestamp, and timeMatchStrategy
sortBy What field(s) to sort the results by
includeFlags Require certain flags that must be present on the network
excludeFlags Require that certain flags are not present on the network

Tip

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Adding networks

There are three different ways of adding networks using the customer networks API; single, bulk, and lenient bulk. The bulk endpoint will be deprecated in the near future, and eventually removed. As such, it is advised to use the Lenient bulk endpoint instead.

Single

To add a single network the networks endpoint must be used with the POST operation, and the body submitted as JSON. The response body will be JSON formatted, and contain the added network.

1
2
3
4
5
curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/customernetworks/v1/network/ -d '{
  "customer": 141,
  "description": "properly described",
  "networkAddress": "194.168.201.0/24"
}'

Tip

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Lenient Bulk

This endpoint should be used if more than one network should be added at the same time. To use this endpoint use the lenient bulk add endpoint with the POST operation and the body in JSON format. The response body will be JSON formatted and contain information such as the number of accepted networks, and error messages.

If the ignoreOnFailed field is false, no networks will be added if one or more failed to be added (for example if it already exists and overwrite is false). If true all networks that can be added are added.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/customernetworks/v1/network/bulk/lenient -d '{
  "customer": 141,
  "ignoreOnFailed": true,
  "networks": [{
    "networkAddress": "192.168.100.0/24",
    "description": "local net"
  },
  {
    "networkAddress": "192.168.100.123",
    "description": "host ip"
  }],
}'

Tip

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Bulk

Warning: this endpoint will be deprecated in the near future, and eventually removed. It is advised to use the Lenient bulk endpoint described above instead. To use this endpoint use the bulk add endpoint with the POST operation and the body in JSON format. The response body will be JSON formatted and contain all the added networks.

No networks will be added if one or more failed to be added (for example if it already exists and overwrite is false).

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
curl -X POST -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/customernetworks/v1/network/bulk -d '{
  "customer": 141,
  "networks": [{
    "networkAddress": "192.168.100.0/24",
    "description": "local net"
  },
  {
    "networkAddress": "192.168.100.123",
    "description": "host ip"
  }],
}'

Tip

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Updating a network

To update a network, the networks endpoint must be used with a PUT operation. The response body will be the updated customer network formatted as JSON.

1
2
3
4
curl -X PUT -H "Argus-API-Key: my/api/key" -H "Content-Type: application/json" https://api.mnemonic.no/customernetworks/v1/network/<id> -d '{
  "description": "a description of the network",
  "flagsToEnable": ["UNASSIGNED"]
}'

Tip

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Verifying a network

To verify a network, the verify endpoint must be used with a PUT operation. The response body will be the updated customer network formatted as JSON.

1
curl -X PUT -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/customernetworks/v1/network/<id>/verify

Tip

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Un-verifying a network

To un-verify a network, the unverify endpoint must be used with a PUT operation. The response body will be the updated customer network formatted as JSON.

1
curl -X PUT -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/customernetworks/v1/network/<id>/unverify

Tip

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.

Deleting a network

To delete a network, the network endpoint must be used with a DELETE operation. The response body will be the updated customer network formatted as JSON. Note that the network will not be removed from the database, but rather marked as DELETED with a flag. The network will be excluded from search results by default. A network can be "un-deleted" by adding it again, by using one of the add network endpoints.

1
curl -X DELETE -H "Argus-API-Key: my/api/key" https://api.mnemonic.no/customernetworks/v1/network/<id>

Tip

For more detailed information on what the response model looks like, you can check out the Swagger API documentation.