SNMP

SNMP

GET /snmp

Get SNMP settings

curl
curl -X GET "https://appliance.example.com/api/v1/snmp" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/snmp';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/snmp", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/snmp', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "uid": "a2a-4f2-a2a-1ad",
  "message": "SNMP settings",
  "data": {
    "enabledV2": false,
    "enabledV3": false,
    "community": "",
    "location": "",
    "contact": "",
    "serviceIpId": "",
    "port": 161
  }
}

PUT /snmp

Update SNMP settings

This change is staged. Send PUT /services/apply to apply it.

Body parameters
enabledV2 boolean
enabledV3 boolean
community string
location string
contact string
serviceIpId string Required
port integer
curl
curl -X PUT "https://appliance.example.com/api/v1/snmp" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "enabledV2": true,
  "enabledV3": true,
  "community": "<community>",
  "location": "<location>",
  "contact": "<contact>",
  "serviceIpId": "<serviceIpId>",
  "port": 0
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/snmp';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'enabledV2' => true,
    'enabledV3' => true,
    'community' => '<community>',
    'location' => '<location>',
    'contact' => '<contact>',
    'serviceIpId' => '<serviceIpId>',
    'port' => 0,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "enabledV2": true,
    "enabledV3": true,
    "community": "<community>",
    "location": "<location>",
    "contact": "<contact>",
    "serviceIpId": "<serviceIpId>",
    "port": 0
}

response = requests.put("https://appliance.example.com/api/v1/snmp", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/snmp', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "enabledV2": true,
  "enabledV3": true,
  "community": "<community>",
  "location": "<location>",
  "contact": "<contact>",
  "serviceIpId": "<serviceIpId>",
  "port": 0
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Successfully configured SNMP"
}

Users

GET /snmp/users

List the SNMP users

curl
curl -X GET "https://appliance.example.com/api/v1/snmp/users" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/snmp/users';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/snmp/users", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/snmp/users', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Successfully retrieved SNMP users"
}

POST /snmp/users

Add SNMP user

This change is staged. Send PUT /services/apply to apply it.

Body parameters
username string
writeAccess boolean
authAlgorithm md5 | sha
authPassphrase string
privacyAlgorithm des | aes
privacyPassphrase string
curl
curl -X POST "https://appliance.example.com/api/v1/snmp/users" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "username": "<username>",
  "writeAccess": true,
  "authAlgorithm": "md5",
  "authPassphrase": "<authPassphrase>",
  "privacyAlgorithm": "des",
  "privacyPassphrase": "<privacyPassphrase>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/snmp/users';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'username' => '<username>',
    'writeAccess' => true,
    'authAlgorithm' => 'md5',
    'authPassphrase' => '<authPassphrase>',
    'privacyAlgorithm' => 'des',
    'privacyPassphrase' => '<privacyPassphrase>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "username": "<username>",
    "writeAccess": true,
    "authAlgorithm": "md5",
    "authPassphrase": "<authPassphrase>",
    "privacyAlgorithm": "des",
    "privacyPassphrase": "<privacyPassphrase>"
}

response = requests.post("https://appliance.example.com/api/v1/snmp/users", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/snmp/users', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "username": "<username>",
  "writeAccess": true,
  "authAlgorithm": "md5",
  "authPassphrase": "<authPassphrase>",
  "privacyAlgorithm": "des",
  "privacyPassphrase": "<privacyPassphrase>"
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Successfully added SNMP user"
}

Users by ID

PUT /snmp/users/{id}

Update an SNMP user

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

.Body parameters

username string
writeAccess boolean
authAlgorithm md5 | sha
authPassphrase string
privacyAlgorithm des | aes
privacyPassphrase string
curl
curl -X PUT "https://appliance.example.com/api/v1/snmp/users/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "username": "<username>",
  "writeAccess": true,
  "authAlgorithm": "md5",
  "authPassphrase": "<authPassphrase>",
  "privacyAlgorithm": "des",
  "privacyPassphrase": "<privacyPassphrase>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/snmp/users/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'username' => '<username>',
    'writeAccess' => true,
    'authAlgorithm' => 'md5',
    'authPassphrase' => '<authPassphrase>',
    'privacyAlgorithm' => 'des',
    'privacyPassphrase' => '<privacyPassphrase>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "username": "<username>",
    "writeAccess": true,
    "authAlgorithm": "md5",
    "authPassphrase": "<authPassphrase>",
    "privacyAlgorithm": "des",
    "privacyPassphrase": "<privacyPassphrase>"
}

response = requests.put("https://appliance.example.com/api/v1/snmp/users/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/snmp/users/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "username": "<username>",
  "writeAccess": true,
  "authAlgorithm": "md5",
  "authPassphrase": "<authPassphrase>",
  "privacyAlgorithm": "des",
  "privacyPassphrase": "<privacyPassphrase>"
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Successfully edited SNMP user"
}

DELETE /snmp/users/{id}

Delete an SNMP user

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required
curl
curl -X DELETE "https://appliance.example.com/api/v1/snmp/users/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/snmp/users/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.delete("https://appliance.example.com/api/v1/snmp/users/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/snmp/users/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Successfully delete SNMP user"
}