Endurance

SNMP

Updated

SNMP

Get SNMP settings

GET /snmp

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();
Bruno
meta {
  name: Get the SNMP settings
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/snmp
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "uid": "a2a-4f2-a2a-1ad",
  "message": "SNMP settings",
  "data": {
    "enabledV2": false,
    "enabledV3": false,
    "community": "",
    "location": "",
    "contact": "",
    "serviceIpId": "",
    "port": 161
  }
}

Update SNMP settings

PUT /snmp

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

Body parameters
enabledV2 boolean
enabledV3 boolean
community string

A secret: never returned, so GET always reads an empty string. Leave it out (or send null) to keep the stored community. Required while enabledV2 is true, so an empty string is then refused; with v2c off, an empty string clears it.

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();
Bruno
meta {
  name: Update the SNMP settings
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/snmp
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "enabledV2": true,
    "enabledV3": true,
    "community": "<community>",
    "location": "<location>",
    "contact": "<contact>",
    "serviceIpId": "<serviceIpId>",
    "port": 0
  }
}
Response
{
  "status": "success",
  "message": "Successfully configured SNMP"
}

Users

List the SNMP users

GET /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();
Bruno
meta {
  name: List the SNMP users
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/snmp/users
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Successfully retrieved SNMP users"
}

Add SNMP user

POST /snmp/users

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

Body parameters
username string
writeAccess boolean
authAlgorithm md5 | sha
authPassphrase string

A secret: never returned, so GET always reads an empty string. Required, so an empty string is refused.

privacyAlgorithm des | aes
privacyPassphrase string

A secret: never returned, so GET always reads an empty string. Required, so an empty string is refused.

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();
Bruno
meta {
  name: Create an SNMP user
  type: http
  seq: 1
}

post {
  url: https://{{node-0}}:{{port}}/api/v1/snmp/users
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "username": "<username>",
    "writeAccess": true,
    "authAlgorithm": "md5",
    "authPassphrase": "<authPassphrase>",
    "privacyAlgorithm": "des",
    "privacyPassphrase": "<privacyPassphrase>"
  }
}
Response
{
  "status": "success",
  "message": "Successfully added SNMP user"
}

Users by ID

Update an SNMP user

PUT /snmp/users/{id}

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

A secret: never returned, so GET always reads an empty string. Required, so an empty string is refused. Leave it out to keep the stored auth passphrase.

privacyAlgorithm des | aes
privacyPassphrase string

A secret: never returned, so GET always reads an empty string. Required, so an empty string is refused. Leave it out to keep the stored privacy passphrase.

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();
Bruno
meta {
  name: Update an SNMP user
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/snmp/users/{id}
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "username": "<username>",
    "writeAccess": true,
    "authAlgorithm": "md5",
    "authPassphrase": "<authPassphrase>",
    "privacyAlgorithm": "des",
    "privacyPassphrase": "<privacyPassphrase>"
  }
}
Response
{
  "status": "success",
  "message": "Successfully edited SNMP user"
}

Delete an SNMP user

DELETE /snmp/users/{id}

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();
Bruno
meta {
  name: Delete an SNMP user
  type: http
  seq: 1
}

delete {
  url: https://{{node-0}}:{{port}}/api/v1/snmp/users/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Successfully delete SNMP user"
}