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.

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.

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.

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.

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).

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.

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.

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.

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.

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.