Depot snmp templates
This page is generated from the Depot route table. Every operation carries the permission it needs and the anchor an agent can link to.
GET /api/v1/snmp/templates
Section titled “GET /api/v1/snmp/templates”GETdiscovery:readshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
GET /api/v1/snmp/templates
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, object | Success. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold discovery:read. |
500 | application/problem+json, ProblemDetails | The request failed. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/snmp/templates' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/snmp/templates' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/snmp/templates"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/snmp/templates", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/snmp/templates";
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/snmp/templates");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());POST /api/v1/snmp/templates
Section titled “POST /api/v1/snmp/templates”POSTprofile:manage_mandatoryshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
POST /api/v1/snmp/templates
Request body
Section titled “Request body”Required, sent as application/json.
| Field | Type | Description |
|---|---|---|
bundledrequired | boolean | |
idrequired | string | |
monitorsrequired | array of Monitor | |
monitors[].alert | Alert | |
monitors[].alert.breachesrequired | integer | |
monitors[].alert.operatorrequired | string | |
monitors[].alert.recoveriesrequired | integer | |
monitors[].alert.severityrequired | string | |
monitors[].alert.value | string | |
monitors[].idrequired | string | |
monitors[].kindrequired | string | |
monitors[].labels | object | |
monitors[].namerequired | string | |
monitors[].offset | number | double. |
monitors[].oidrequired | string | |
monitors[].scalerequired | number | double. |
monitors[].unit | string | |
namerequired | string | |
revisionrequired | integer | int64. |
source | string | |
vendor | string |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SNMPTemplate | Success. |
400 | application/problem+json, ProblemDetails | The request body is not valid JSON. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold profile:manage_mandatory. |
404 | application/problem+json, ProblemDetails | Template not found. |
409 | application/problem+json, ProblemDetails | Template changed. Reload before saving. |
500 | application/problem+json, ProblemDetails | Could not save template. |
503 | application/problem+json, ProblemDetails | Template storage unavailable. |
200 response body
| Field | Type | Description |
|---|---|---|
bundledrequired | boolean | |
idrequired | string | |
monitorsrequired | array of Monitor | |
monitors[].alert | Alert | |
monitors[].alert.breachesrequired | integer | |
monitors[].alert.operatorrequired | string | |
monitors[].alert.recoveriesrequired | integer | |
monitors[].alert.severityrequired | string | |
monitors[].alert.value | string | |
monitors[].idrequired | string | |
monitors[].kindrequired | string | |
monitors[].labels | object | |
monitors[].namerequired | string | |
monitors[].offset | number | double. |
monitors[].oidrequired | string | |
monitors[].scalerequired | number | double. |
monitors[].unit | string | |
namerequired | string | |
revisionrequired | integer | int64. |
source | string | |
vendor | string |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X POST 'https://depot.example.com/api/v1/snmp/templates' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '{ "bundled": false, "id": "string", "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string" }, "id": "string", "kind": "string", "labels": { "key": "string" }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string" } ], "name": "string", "revision": 0, "source": "string", "vendor": "string"}'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'{ "bundled": false, "id": "string", "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string" }, "id": "string", "kind": "string", "labels": { "key": "string" }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string" } ], "name": "string", "revision": 0, "source": "string", "vendor": "string"}'@
$response = Invoke-RestMethod ` -Method Post ` -Uri 'https://depot.example.com/api/v1/snmp/templates' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/snmp/templates"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = { "bundled": False, "id": "string", "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string", }, "id": "string", "kind": "string", "labels": { "key": "string", }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string", }, ], "name": "string", "revision": 0, "source": "string", "vendor": "string",}
response = requests.post(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`{ "bundled": false, "id": "string", "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string" }, "id": "string", "kind": "string", "labels": { "key": "string" }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string" } ], "name": "string", "revision": 0, "source": "string", "vendor": "string"}`)
req, err := http.NewRequest(http.MethodPost, "https://depot.example.com/api/v1/snmp/templates", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/snmp/templates";
const response = await fetch(url, { method: "POST", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify({ "bundled": false, "id": "string", "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string" }, "id": "string", "kind": "string", "labels": { "key": "string" }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string" } ], "name": "string", "revision": 0, "source": "string", "vendor": "string" }),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """{ "bundled": false, "id": "string", "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string" }, "id": "string", "kind": "string", "labels": { "key": "string" }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string" } ], "name": "string", "revision": 0, "source": "string", "vendor": "string"}""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://depot.example.com/api/v1/snmp/templates");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());DELETE /api/v1/snmp/templates/{templateId}
Section titled “DELETE /api/v1/snmp/templates/{templateId}”DELETEprofile:manage_mandatoryshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
DELETE /api/v1/snmp/templates/{templateId}
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
templateId | path | string | Yes | A uuid. |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
204 | None | Success, with no body. |
400 | application/problem+json, ProblemDetails | One or more validation errors occurred. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold profile:manage_mandatory. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
500 | application/problem+json, ProblemDetails | The request failed. |
503 | application/problem+json, ProblemDetails | Template storage unavailable. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X DELETE 'https://depot.example.com/api/v1/snmp/templates/<templateId>' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Delete ` -Uri 'https://depot.example.com/api/v1/snmp/templates/<templateId>' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/snmp/templates/<templateId>"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.delete(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodDelete, "https://depot.example.com/api/v1/snmp/templates/<templateId>", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/snmp/templates/<templateId>";
const response = await fetch(url, { method: "DELETE", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://depot.example.com/api/v1/snmp/templates/<templateId>");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/v1/snmp/templates/{templateId}/{revision}
Section titled “GET /api/v1/snmp/templates/{templateId}/{revision}”GETdiscovery:readshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
GET /api/v1/snmp/templates/{templateId}/{revision}
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
revision | path | string | Yes | |
templateId | path | string | Yes |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, SNMPTemplate | Success. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold discovery:read. |
404 | application/problem+json, ProblemDetails | Template not found. |
500 | application/problem+json, ProblemDetails | Could not read template. |
200 response body
| Field | Type | Description |
|---|---|---|
bundledrequired | boolean | |
idrequired | string | |
monitorsrequired | array of Monitor | |
monitors[].alert | Alert | |
monitors[].alert.breachesrequired | integer | |
monitors[].alert.operatorrequired | string | |
monitors[].alert.recoveriesrequired | integer | |
monitors[].alert.severityrequired | string | |
monitors[].alert.value | string | |
monitors[].idrequired | string | |
monitors[].kindrequired | string | |
monitors[].labels | object | |
monitors[].namerequired | string | |
monitors[].offset | number | double. |
monitors[].oidrequired | string | |
monitors[].scalerequired | number | double. |
monitors[].unit | string | |
namerequired | string | |
revisionrequired | integer | int64. |
source | string | |
vendor | string |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>";
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());GET /api/v1/snmp/templates/{templateId}/{revision}/overrides
Section titled “GET /api/v1/snmp/templates/{templateId}/{revision}/overrides”GETdiscovery:readshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
Snmp overrides
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
revision | path | string | Yes | |
templateId | path | string | Yes |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, object | Success. |
400 | application/problem+json, ProblemDetails | The request body is not valid JSON. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold discovery:read. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
500 | application/problem+json, ProblemDetails | No client store in request context. |
503 | application/problem+json, ProblemDetails | SNMP storage unavailable. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X GET 'https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -b 'outpost_console=<console-session>'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$response = Invoke-RestMethod ` -Method Get ` -Uri 'https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides' ` -Headers $headers
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json",}cookies = { "outpost_console": "<console-session>",}
response = requests.get(url, headers=headers, cookies=cookies, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "fmt" "io" "log" "net/http")
func main() { req, err := http.NewRequest(http.MethodGet, "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides", nil) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides";
const response = await fetch(url, { method: "GET", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", }, credentials: "include",});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;
using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());PUT /api/v1/snmp/templates/{templateId}/{revision}/overrides
Section titled “PUT /api/v1/snmp/templates/{templateId}/{revision}/overrides”PUTdiscovery:manageshared facehosteditmspremoteIdempotent
From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.
Source: [object Object]
Snmp overrides
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
revision | path | string | Yes | |
templateId | path | string | Yes |
Request body
Section titled “Request body”Required, sent as application/json.
| Field | Type | Description |
|---|---|---|
monitorsrequired | array of Monitor | |
monitors[].alert | Alert | |
monitors[].alert.breachesrequired | integer | |
monitors[].alert.operatorrequired | string | |
monitors[].alert.recoveriesrequired | integer | |
monitors[].alert.severityrequired | string | |
monitors[].alert.value | string | |
monitors[].idrequired | string | |
monitors[].kindrequired | string | |
monitors[].labels | object | |
monitors[].namerequired | string | |
monitors[].offset | number | double. |
monitors[].oidrequired | string | |
monitors[].scalerequired | number | double. |
monitors[].unit | string |
Responses
Section titled “Responses”| Status | Body | Description |
|---|---|---|
200 | application/json, object | Success. |
400 | application/problem+json, ProblemDetails | The request body is not valid JSON. |
401 | application/problem+json, ProblemDetails | No signed-in identity. |
403 | application/problem+json, ProblemDetails | The identity does not hold discovery:manage. |
404 | application/problem+json, ProblemDetails | No resource matches that id. |
500 | application/problem+json, ProblemDetails | No client store in request context. |
503 | application/problem+json, ProblemDetails | SNMP storage unavailable. |
Request samples
Section titled “Request samples”# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.curl -X PUT 'https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides' \ -H 'X-CSRF-Token: <csrf-token>' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -b 'outpost_console=<console-session>' \ --data '{ "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string" }, "id": "string", "kind": "string", "labels": { "key": "string" }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string" } ]}'# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
$headers = @{ 'X-CSRF-Token' = '<csrf-token>' 'Accept' = 'application/json' 'Content-Type' = 'application/json' 'Cookie' = 'outpost_console=<console-session>'}
$body = @'{ "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string" }, "id": "string", "kind": "string", "labels": { "key": "string" }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string" } ]}'@
$response = Invoke-RestMethod ` -Method Put ` -Uri 'https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides' ` -Headers $headers ` -ContentType 'application/json' ` -Body $body
$response | ConvertTo-Json -Depth 10# Sign in first. outpost_console is a session cookie, so send it with every request.# This operation is idempotent. Repeating it does not repeat its effect.
import requests
url = "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides"headers = { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json",}cookies = { "outpost_console": "<console-session>",}payload = { "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string", }, "id": "string", "kind": "string", "labels": { "key": "string", }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string", }, ],}
response = requests.put(url, headers=headers, cookies=cookies, json=payload, timeout=30)response.raise_for_status()print(response.json())// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.package main
import ( "bytes" "fmt" "io" "log" "net/http")
func main() { body := []byte(`{ "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string" }, "id": "string", "kind": "string", "labels": { "key": "string" }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string" } ]}`)
req, err := http.NewRequest(http.MethodPut, "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides", bytes.NewReader(body)) if err != nil { log.Fatal(err) }
req.Header.Set("X-CSRF-Token", "<csrf-token>") req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.AddCookie(&http.Cookie{Name: "outpost_console", Value: "<console-session>"})
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
out, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } fmt.Println(resp.Status, string(out))}// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.// The session cookie is set by signing in. A script cannot set it itself.
const url = "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides";
const response = await fetch(url, { method: "PUT", headers: { "X-CSRF-Token": "<csrf-token>", "Accept": "application/json", "Content-Type": "application/json", }, credentials: "include", body: JSON.stringify({ "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string" }, "id": "string", "kind": "string", "labels": { "key": "string" }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string" } ] }),});
if (!response.ok) { throw new Error(`Request failed with status ${response.status}`);}
const data = await response.json();console.log(data);// Sign in first. outpost_console is a session cookie, so send it with every request.// This operation is idempotent. Repeating it does not repeat its effect.
using System;using System.Net.Http;using System.Text;
using var client = new HttpClient();
const string body = """{ "monitors": [ { "alert": { "breaches": 0, "operator": "string", "recoveries": 0, "severity": "string", "value": "string" }, "id": "string", "kind": "string", "labels": { "key": "string" }, "name": "string", "offset": 0, "oid": "string", "scale": 0, "unit": "string" } ]}""";
var request = new HttpRequestMessage(HttpMethod.Put, "https://depot.example.com/api/v1/snmp/templates/<templateId>/<revision>/overrides");request.Headers.TryAddWithoutValidation("X-CSRF-Token", "<csrf-token>");request.Headers.TryAddWithoutValidation("Accept", "application/json");request.Headers.TryAddWithoutValidation("Cookie", "outpost_console=<console-session>");request.Content = new StringContent(body, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());Content is licensed CC BY 4.0. Code samples are MIT. Outpost and the Outpost mark are trademarks of Outpost Business Solutions, PBC and are not covered by either license.