Sync a device firmware policy cache (internal)
curl --request POST \
--url https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"netbox_device_id": 2,
"fetched_at": "2023-11-07T05:31:56Z",
"freshness_deadline": "2023-11-07T05:31:56Z",
"netbox_last_updated_marker": "<string>",
"blob_size_bytes": 1073741823,
"policy": {
"digest_contract": "jcs-sha256-v1",
"canonical_payload_digest": "<string>",
"raw_content_hash": "<string>",
"raw_payload": {},
"policy_id": "<string>",
"schema_version": "<string>",
"rack_type": "<string>"
},
"error_detail": "<string>",
"policy_id": "<string>",
"schema_version": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/"
payload = {
"netbox_device_id": 2,
"fetched_at": "2023-11-07T05:31:56Z",
"freshness_deadline": "2023-11-07T05:31:56Z",
"netbox_last_updated_marker": "<string>",
"blob_size_bytes": 1073741823,
"policy": {
"digest_contract": "jcs-sha256-v1",
"canonical_payload_digest": "<string>",
"raw_content_hash": "<string>",
"raw_payload": {},
"policy_id": "<string>",
"schema_version": "<string>",
"rack_type": "<string>"
},
"error_detail": "<string>",
"policy_id": "<string>",
"schema_version": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
netbox_device_id: 2,
fetched_at: '2023-11-07T05:31:56Z',
freshness_deadline: '2023-11-07T05:31:56Z',
netbox_last_updated_marker: '<string>',
blob_size_bytes: 1073741823,
policy: {
digest_contract: 'jcs-sha256-v1',
canonical_payload_digest: '<string>',
raw_content_hash: '<string>',
raw_payload: {},
policy_id: '<string>',
schema_version: '<string>',
rack_type: '<string>'
},
error_detail: '<string>',
policy_id: '<string>',
schema_version: '<string>'
})
};
fetch('https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'netbox_device_id' => 2,
'fetched_at' => '2023-11-07T05:31:56Z',
'freshness_deadline' => '2023-11-07T05:31:56Z',
'netbox_last_updated_marker' => '<string>',
'blob_size_bytes' => 1073741823,
'policy' => [
'digest_contract' => 'jcs-sha256-v1',
'canonical_payload_digest' => '<string>',
'raw_content_hash' => '<string>',
'raw_payload' => [
],
'policy_id' => '<string>',
'schema_version' => '<string>',
'rack_type' => '<string>'
],
'error_detail' => '<string>',
'policy_id' => '<string>',
'schema_version' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/"
payload := strings.NewReader("{\n \"netbox_device_id\": 2,\n \"fetched_at\": \"2023-11-07T05:31:56Z\",\n \"freshness_deadline\": \"2023-11-07T05:31:56Z\",\n \"netbox_last_updated_marker\": \"<string>\",\n \"blob_size_bytes\": 1073741823,\n \"policy\": {\n \"digest_contract\": \"jcs-sha256-v1\",\n \"canonical_payload_digest\": \"<string>\",\n \"raw_content_hash\": \"<string>\",\n \"raw_payload\": {},\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\",\n \"rack_type\": \"<string>\"\n },\n \"error_detail\": \"<string>\",\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"netbox_device_id\": 2,\n \"fetched_at\": \"2023-11-07T05:31:56Z\",\n \"freshness_deadline\": \"2023-11-07T05:31:56Z\",\n \"netbox_last_updated_marker\": \"<string>\",\n \"blob_size_bytes\": 1073741823,\n \"policy\": {\n \"digest_contract\": \"jcs-sha256-v1\",\n \"canonical_payload_digest\": \"<string>\",\n \"raw_content_hash\": \"<string>\",\n \"raw_payload\": {},\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\",\n \"rack_type\": \"<string>\"\n },\n \"error_detail\": \"<string>\",\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"netbox_device_id\": 2,\n \"fetched_at\": \"2023-11-07T05:31:56Z\",\n \"freshness_deadline\": \"2023-11-07T05:31:56Z\",\n \"netbox_last_updated_marker\": \"<string>\",\n \"blob_size_bytes\": 1073741823,\n \"policy\": {\n \"digest_contract\": \"jcs-sha256-v1\",\n \"canonical_payload_digest\": \"<string>\",\n \"raw_content_hash\": \"<string>\",\n \"raw_payload\": {},\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\",\n \"rack_type\": \"<string>\"\n },\n \"error_detail\": \"<string>\",\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}Devices
Sync a device firmware policy cache (internal)
Replace one Device’s current NetBox firmware policy cache state.
POST
/
api
/
v1
/
devices
/
{id}
/
firmware-policy-cache
/
Sync a device firmware policy cache (internal)
curl --request POST \
--url https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"netbox_device_id": 2,
"fetched_at": "2023-11-07T05:31:56Z",
"freshness_deadline": "2023-11-07T05:31:56Z",
"netbox_last_updated_marker": "<string>",
"blob_size_bytes": 1073741823,
"policy": {
"digest_contract": "jcs-sha256-v1",
"canonical_payload_digest": "<string>",
"raw_content_hash": "<string>",
"raw_payload": {},
"policy_id": "<string>",
"schema_version": "<string>",
"rack_type": "<string>"
},
"error_detail": "<string>",
"policy_id": "<string>",
"schema_version": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/"
payload = {
"netbox_device_id": 2,
"fetched_at": "2023-11-07T05:31:56Z",
"freshness_deadline": "2023-11-07T05:31:56Z",
"netbox_last_updated_marker": "<string>",
"blob_size_bytes": 1073741823,
"policy": {
"digest_contract": "jcs-sha256-v1",
"canonical_payload_digest": "<string>",
"raw_content_hash": "<string>",
"raw_payload": {},
"policy_id": "<string>",
"schema_version": "<string>",
"rack_type": "<string>"
},
"error_detail": "<string>",
"policy_id": "<string>",
"schema_version": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
netbox_device_id: 2,
fetched_at: '2023-11-07T05:31:56Z',
freshness_deadline: '2023-11-07T05:31:56Z',
netbox_last_updated_marker: '<string>',
blob_size_bytes: 1073741823,
policy: {
digest_contract: 'jcs-sha256-v1',
canonical_payload_digest: '<string>',
raw_content_hash: '<string>',
raw_payload: {},
policy_id: '<string>',
schema_version: '<string>',
rack_type: '<string>'
},
error_detail: '<string>',
policy_id: '<string>',
schema_version: '<string>'
})
};
fetch('https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'netbox_device_id' => 2,
'fetched_at' => '2023-11-07T05:31:56Z',
'freshness_deadline' => '2023-11-07T05:31:56Z',
'netbox_last_updated_marker' => '<string>',
'blob_size_bytes' => 1073741823,
'policy' => [
'digest_contract' => 'jcs-sha256-v1',
'canonical_payload_digest' => '<string>',
'raw_content_hash' => '<string>',
'raw_payload' => [
],
'policy_id' => '<string>',
'schema_version' => '<string>',
'rack_type' => '<string>'
],
'error_detail' => '<string>',
'policy_id' => '<string>',
'schema_version' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/"
payload := strings.NewReader("{\n \"netbox_device_id\": 2,\n \"fetched_at\": \"2023-11-07T05:31:56Z\",\n \"freshness_deadline\": \"2023-11-07T05:31:56Z\",\n \"netbox_last_updated_marker\": \"<string>\",\n \"blob_size_bytes\": 1073741823,\n \"policy\": {\n \"digest_contract\": \"jcs-sha256-v1\",\n \"canonical_payload_digest\": \"<string>\",\n \"raw_content_hash\": \"<string>\",\n \"raw_payload\": {},\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\",\n \"rack_type\": \"<string>\"\n },\n \"error_detail\": \"<string>\",\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"netbox_device_id\": 2,\n \"fetched_at\": \"2023-11-07T05:31:56Z\",\n \"freshness_deadline\": \"2023-11-07T05:31:56Z\",\n \"netbox_last_updated_marker\": \"<string>\",\n \"blob_size_bytes\": 1073741823,\n \"policy\": {\n \"digest_contract\": \"jcs-sha256-v1\",\n \"canonical_payload_digest\": \"<string>\",\n \"raw_content_hash\": \"<string>\",\n \"raw_payload\": {},\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\",\n \"rack_type\": \"<string>\"\n },\n \"error_detail\": \"<string>\",\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/devices/{id}/firmware-policy-cache/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"netbox_device_id\": 2,\n \"fetched_at\": \"2023-11-07T05:31:56Z\",\n \"freshness_deadline\": \"2023-11-07T05:31:56Z\",\n \"netbox_last_updated_marker\": \"<string>\",\n \"blob_size_bytes\": 1073741823,\n \"policy\": {\n \"digest_contract\": \"jcs-sha256-v1\",\n \"canonical_payload_digest\": \"<string>\",\n \"raw_content_hash\": \"<string>\",\n \"raw_payload\": {},\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\",\n \"rack_type\": \"<string>\"\n },\n \"error_detail\": \"<string>\",\n \"policy_id\": \"<string>\",\n \"schema_version\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
A UUID string identifying this device.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
One flat command that replaces a device's current policy-cache state.
Required range:
x >= 1Maximum string length:
128Required range:
0 <= x <= 2147483647Available options:
valid, rejected Typed valid-policy branch of a cache sync command.
Show child attributes
Show child attributes
Available options:
missing_policy, unsupported_schema, parse_error, oversized_blob, missing_source_metadata, applicability_conflict, stale_source Maximum string length:
2048Maximum string length:
128Maximum string length:
32Response
No response body