Materialise resource attribution
curl --request POST \
--url https://api.example.com/api/v1/inventory/resource-attributions/materialise/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nova_server_uuid": "<string>",
"environment": "<string>",
"openstack_region_name": "<string>",
"source_observed_at": "2023-11-07T05:31:56Z",
"resolution_status": "unresolved",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"failure_code": "",
"diagnostic_detail": "",
"issues": [
{
"code": "<string>",
"retryable": false,
"diagnostic_detail": ""
}
],
"uni_instance": {
"uni_instance_id": "<string>",
"uni_server_id": "<string>",
"organisation_id": "<string>",
"region_id": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"project_id": ""
},
"placement": {
"placement_id": "<string>",
"placement_server_id": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"reservation_id": "",
"managed_by": "",
"owner_id": "",
"organisation_id": "",
"region_id": "",
"project_id": ""
},
"kubernetes_clusters": [
{
"cluster_id": "<string>",
"organisation_id": "<string>",
"project_id": "<string>",
"project_name": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"region_id": ""
}
]
}
'import requests
url = "https://api.example.com/api/v1/inventory/resource-attributions/materialise/"
payload = {
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nova_server_uuid": "<string>",
"environment": "<string>",
"openstack_region_name": "<string>",
"source_observed_at": "2023-11-07T05:31:56Z",
"resolution_status": "unresolved",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"failure_code": "",
"diagnostic_detail": "",
"issues": [
{
"code": "<string>",
"retryable": False,
"diagnostic_detail": ""
}
],
"uni_instance": {
"uni_instance_id": "<string>",
"uni_server_id": "<string>",
"organisation_id": "<string>",
"region_id": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"project_id": ""
},
"placement": {
"placement_id": "<string>",
"placement_server_id": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"reservation_id": "",
"managed_by": "",
"owner_id": "",
"organisation_id": "",
"region_id": "",
"project_id": ""
},
"kubernetes_clusters": [
{
"cluster_id": "<string>",
"organisation_id": "<string>",
"project_id": "<string>",
"project_name": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"region_id": ""
}
]
}
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({
device_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nova_server_uuid: '<string>',
environment: '<string>',
openstack_region_name: '<string>',
source_observed_at: '2023-11-07T05:31:56Z',
resolution_status: 'unresolved',
last_attempted_at: '2023-11-07T05:31:56Z',
last_resolved_at: '2023-11-07T05:31:56Z',
stale_since: '2023-11-07T05:31:56Z',
failure_code: '',
diagnostic_detail: '',
issues: [{code: '<string>', retryable: false, diagnostic_detail: ''}],
uni_instance: {
uni_instance_id: '<string>',
uni_server_id: '<string>',
organisation_id: '<string>',
region_id: '<string>',
observed_at: '2023-11-07T05:31:56Z',
last_attempted_at: '2023-11-07T05:31:56Z',
last_resolved_at: '2023-11-07T05:31:56Z',
stale_since: '2023-11-07T05:31:56Z',
project_id: ''
},
placement: {
placement_id: '<string>',
placement_server_id: '<string>',
observed_at: '2023-11-07T05:31:56Z',
last_attempted_at: '2023-11-07T05:31:56Z',
last_resolved_at: '2023-11-07T05:31:56Z',
stale_since: '2023-11-07T05:31:56Z',
reservation_id: '',
managed_by: '',
owner_id: '',
organisation_id: '',
region_id: '',
project_id: ''
},
kubernetes_clusters: [
{
cluster_id: '<string>',
organisation_id: '<string>',
project_id: '<string>',
project_name: '<string>',
observed_at: '2023-11-07T05:31:56Z',
last_attempted_at: '2023-11-07T05:31:56Z',
last_resolved_at: '2023-11-07T05:31:56Z',
stale_since: '2023-11-07T05:31:56Z',
region_id: ''
}
]
})
};
fetch('https://api.example.com/api/v1/inventory/resource-attributions/materialise/', 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/inventory/resource-attributions/materialise/",
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([
'device_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nova_server_uuid' => '<string>',
'environment' => '<string>',
'openstack_region_name' => '<string>',
'source_observed_at' => '2023-11-07T05:31:56Z',
'resolution_status' => 'unresolved',
'last_attempted_at' => '2023-11-07T05:31:56Z',
'last_resolved_at' => '2023-11-07T05:31:56Z',
'stale_since' => '2023-11-07T05:31:56Z',
'failure_code' => '',
'diagnostic_detail' => '',
'issues' => [
[
'code' => '<string>',
'retryable' => false,
'diagnostic_detail' => ''
]
],
'uni_instance' => [
'uni_instance_id' => '<string>',
'uni_server_id' => '<string>',
'organisation_id' => '<string>',
'region_id' => '<string>',
'observed_at' => '2023-11-07T05:31:56Z',
'last_attempted_at' => '2023-11-07T05:31:56Z',
'last_resolved_at' => '2023-11-07T05:31:56Z',
'stale_since' => '2023-11-07T05:31:56Z',
'project_id' => ''
],
'placement' => [
'placement_id' => '<string>',
'placement_server_id' => '<string>',
'observed_at' => '2023-11-07T05:31:56Z',
'last_attempted_at' => '2023-11-07T05:31:56Z',
'last_resolved_at' => '2023-11-07T05:31:56Z',
'stale_since' => '2023-11-07T05:31:56Z',
'reservation_id' => '',
'managed_by' => '',
'owner_id' => '',
'organisation_id' => '',
'region_id' => '',
'project_id' => ''
],
'kubernetes_clusters' => [
[
'cluster_id' => '<string>',
'organisation_id' => '<string>',
'project_id' => '<string>',
'project_name' => '<string>',
'observed_at' => '2023-11-07T05:31:56Z',
'last_attempted_at' => '2023-11-07T05:31:56Z',
'last_resolved_at' => '2023-11-07T05:31:56Z',
'stale_since' => '2023-11-07T05:31:56Z',
'region_id' => ''
]
]
]),
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/inventory/resource-attributions/materialise/"
payload := strings.NewReader("{\n \"device_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nova_server_uuid\": \"<string>\",\n \"environment\": \"<string>\",\n \"openstack_region_name\": \"<string>\",\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"resolution_status\": \"unresolved\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"failure_code\": \"\",\n \"diagnostic_detail\": \"\",\n \"issues\": [\n {\n \"code\": \"<string>\",\n \"retryable\": false,\n \"diagnostic_detail\": \"\"\n }\n ],\n \"uni_instance\": {\n \"uni_instance_id\": \"<string>\",\n \"uni_server_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"region_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"project_id\": \"\"\n },\n \"placement\": {\n \"placement_id\": \"<string>\",\n \"placement_server_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"reservation_id\": \"\",\n \"managed_by\": \"\",\n \"owner_id\": \"\",\n \"organisation_id\": \"\",\n \"region_id\": \"\",\n \"project_id\": \"\"\n },\n \"kubernetes_clusters\": [\n {\n \"cluster_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"region_id\": \"\"\n }\n ]\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/inventory/resource-attributions/materialise/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"device_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nova_server_uuid\": \"<string>\",\n \"environment\": \"<string>\",\n \"openstack_region_name\": \"<string>\",\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"resolution_status\": \"unresolved\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"failure_code\": \"\",\n \"diagnostic_detail\": \"\",\n \"issues\": [\n {\n \"code\": \"<string>\",\n \"retryable\": false,\n \"diagnostic_detail\": \"\"\n }\n ],\n \"uni_instance\": {\n \"uni_instance_id\": \"<string>\",\n \"uni_server_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"region_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"project_id\": \"\"\n },\n \"placement\": {\n \"placement_id\": \"<string>\",\n \"placement_server_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"reservation_id\": \"\",\n \"managed_by\": \"\",\n \"owner_id\": \"\",\n \"organisation_id\": \"\",\n \"region_id\": \"\",\n \"project_id\": \"\"\n },\n \"kubernetes_clusters\": [\n {\n \"cluster_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"region_id\": \"\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/inventory/resource-attributions/materialise/")
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 \"device_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nova_server_uuid\": \"<string>\",\n \"environment\": \"<string>\",\n \"openstack_region_name\": \"<string>\",\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"resolution_status\": \"unresolved\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"failure_code\": \"\",\n \"diagnostic_detail\": \"\",\n \"issues\": [\n {\n \"code\": \"<string>\",\n \"retryable\": false,\n \"diagnostic_detail\": \"\"\n }\n ],\n \"uni_instance\": {\n \"uni_instance_id\": \"<string>\",\n \"uni_server_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"region_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"project_id\": \"\"\n },\n \"placement\": {\n \"placement_id\": \"<string>\",\n \"placement_server_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"reservation_id\": \"\",\n \"managed_by\": \"\",\n \"owner_id\": \"\",\n \"organisation_id\": \"\",\n \"region_id\": \"\",\n \"project_id\": \"\"\n },\n \"kubernetes_clusters\": [\n {\n \"cluster_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"region_id\": \"\"\n }\n ]\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>"
}{
"detail": "<string>"
}Inventory
Materialise resource attribution
Persist one complete attribution observation from an OpenStack agent.
POST
/
api
/
v1
/
inventory
/
resource-attributions
/
materialise
/
Materialise resource attribution
curl --request POST \
--url https://api.example.com/api/v1/inventory/resource-attributions/materialise/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nova_server_uuid": "<string>",
"environment": "<string>",
"openstack_region_name": "<string>",
"source_observed_at": "2023-11-07T05:31:56Z",
"resolution_status": "unresolved",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"failure_code": "",
"diagnostic_detail": "",
"issues": [
{
"code": "<string>",
"retryable": false,
"diagnostic_detail": ""
}
],
"uni_instance": {
"uni_instance_id": "<string>",
"uni_server_id": "<string>",
"organisation_id": "<string>",
"region_id": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"project_id": ""
},
"placement": {
"placement_id": "<string>",
"placement_server_id": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"reservation_id": "",
"managed_by": "",
"owner_id": "",
"organisation_id": "",
"region_id": "",
"project_id": ""
},
"kubernetes_clusters": [
{
"cluster_id": "<string>",
"organisation_id": "<string>",
"project_id": "<string>",
"project_name": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"region_id": ""
}
]
}
'import requests
url = "https://api.example.com/api/v1/inventory/resource-attributions/materialise/"
payload = {
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nova_server_uuid": "<string>",
"environment": "<string>",
"openstack_region_name": "<string>",
"source_observed_at": "2023-11-07T05:31:56Z",
"resolution_status": "unresolved",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"failure_code": "",
"diagnostic_detail": "",
"issues": [
{
"code": "<string>",
"retryable": False,
"diagnostic_detail": ""
}
],
"uni_instance": {
"uni_instance_id": "<string>",
"uni_server_id": "<string>",
"organisation_id": "<string>",
"region_id": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"project_id": ""
},
"placement": {
"placement_id": "<string>",
"placement_server_id": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"reservation_id": "",
"managed_by": "",
"owner_id": "",
"organisation_id": "",
"region_id": "",
"project_id": ""
},
"kubernetes_clusters": [
{
"cluster_id": "<string>",
"organisation_id": "<string>",
"project_id": "<string>",
"project_name": "<string>",
"observed_at": "2023-11-07T05:31:56Z",
"last_attempted_at": "2023-11-07T05:31:56Z",
"last_resolved_at": "2023-11-07T05:31:56Z",
"stale_since": "2023-11-07T05:31:56Z",
"region_id": ""
}
]
}
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({
device_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nova_server_uuid: '<string>',
environment: '<string>',
openstack_region_name: '<string>',
source_observed_at: '2023-11-07T05:31:56Z',
resolution_status: 'unresolved',
last_attempted_at: '2023-11-07T05:31:56Z',
last_resolved_at: '2023-11-07T05:31:56Z',
stale_since: '2023-11-07T05:31:56Z',
failure_code: '',
diagnostic_detail: '',
issues: [{code: '<string>', retryable: false, diagnostic_detail: ''}],
uni_instance: {
uni_instance_id: '<string>',
uni_server_id: '<string>',
organisation_id: '<string>',
region_id: '<string>',
observed_at: '2023-11-07T05:31:56Z',
last_attempted_at: '2023-11-07T05:31:56Z',
last_resolved_at: '2023-11-07T05:31:56Z',
stale_since: '2023-11-07T05:31:56Z',
project_id: ''
},
placement: {
placement_id: '<string>',
placement_server_id: '<string>',
observed_at: '2023-11-07T05:31:56Z',
last_attempted_at: '2023-11-07T05:31:56Z',
last_resolved_at: '2023-11-07T05:31:56Z',
stale_since: '2023-11-07T05:31:56Z',
reservation_id: '',
managed_by: '',
owner_id: '',
organisation_id: '',
region_id: '',
project_id: ''
},
kubernetes_clusters: [
{
cluster_id: '<string>',
organisation_id: '<string>',
project_id: '<string>',
project_name: '<string>',
observed_at: '2023-11-07T05:31:56Z',
last_attempted_at: '2023-11-07T05:31:56Z',
last_resolved_at: '2023-11-07T05:31:56Z',
stale_since: '2023-11-07T05:31:56Z',
region_id: ''
}
]
})
};
fetch('https://api.example.com/api/v1/inventory/resource-attributions/materialise/', 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/inventory/resource-attributions/materialise/",
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([
'device_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nova_server_uuid' => '<string>',
'environment' => '<string>',
'openstack_region_name' => '<string>',
'source_observed_at' => '2023-11-07T05:31:56Z',
'resolution_status' => 'unresolved',
'last_attempted_at' => '2023-11-07T05:31:56Z',
'last_resolved_at' => '2023-11-07T05:31:56Z',
'stale_since' => '2023-11-07T05:31:56Z',
'failure_code' => '',
'diagnostic_detail' => '',
'issues' => [
[
'code' => '<string>',
'retryable' => false,
'diagnostic_detail' => ''
]
],
'uni_instance' => [
'uni_instance_id' => '<string>',
'uni_server_id' => '<string>',
'organisation_id' => '<string>',
'region_id' => '<string>',
'observed_at' => '2023-11-07T05:31:56Z',
'last_attempted_at' => '2023-11-07T05:31:56Z',
'last_resolved_at' => '2023-11-07T05:31:56Z',
'stale_since' => '2023-11-07T05:31:56Z',
'project_id' => ''
],
'placement' => [
'placement_id' => '<string>',
'placement_server_id' => '<string>',
'observed_at' => '2023-11-07T05:31:56Z',
'last_attempted_at' => '2023-11-07T05:31:56Z',
'last_resolved_at' => '2023-11-07T05:31:56Z',
'stale_since' => '2023-11-07T05:31:56Z',
'reservation_id' => '',
'managed_by' => '',
'owner_id' => '',
'organisation_id' => '',
'region_id' => '',
'project_id' => ''
],
'kubernetes_clusters' => [
[
'cluster_id' => '<string>',
'organisation_id' => '<string>',
'project_id' => '<string>',
'project_name' => '<string>',
'observed_at' => '2023-11-07T05:31:56Z',
'last_attempted_at' => '2023-11-07T05:31:56Z',
'last_resolved_at' => '2023-11-07T05:31:56Z',
'stale_since' => '2023-11-07T05:31:56Z',
'region_id' => ''
]
]
]),
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/inventory/resource-attributions/materialise/"
payload := strings.NewReader("{\n \"device_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nova_server_uuid\": \"<string>\",\n \"environment\": \"<string>\",\n \"openstack_region_name\": \"<string>\",\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"resolution_status\": \"unresolved\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"failure_code\": \"\",\n \"diagnostic_detail\": \"\",\n \"issues\": [\n {\n \"code\": \"<string>\",\n \"retryable\": false,\n \"diagnostic_detail\": \"\"\n }\n ],\n \"uni_instance\": {\n \"uni_instance_id\": \"<string>\",\n \"uni_server_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"region_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"project_id\": \"\"\n },\n \"placement\": {\n \"placement_id\": \"<string>\",\n \"placement_server_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"reservation_id\": \"\",\n \"managed_by\": \"\",\n \"owner_id\": \"\",\n \"organisation_id\": \"\",\n \"region_id\": \"\",\n \"project_id\": \"\"\n },\n \"kubernetes_clusters\": [\n {\n \"cluster_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"region_id\": \"\"\n }\n ]\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/inventory/resource-attributions/materialise/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"device_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nova_server_uuid\": \"<string>\",\n \"environment\": \"<string>\",\n \"openstack_region_name\": \"<string>\",\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"resolution_status\": \"unresolved\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"failure_code\": \"\",\n \"diagnostic_detail\": \"\",\n \"issues\": [\n {\n \"code\": \"<string>\",\n \"retryable\": false,\n \"diagnostic_detail\": \"\"\n }\n ],\n \"uni_instance\": {\n \"uni_instance_id\": \"<string>\",\n \"uni_server_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"region_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"project_id\": \"\"\n },\n \"placement\": {\n \"placement_id\": \"<string>\",\n \"placement_server_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"reservation_id\": \"\",\n \"managed_by\": \"\",\n \"owner_id\": \"\",\n \"organisation_id\": \"\",\n \"region_id\": \"\",\n \"project_id\": \"\"\n },\n \"kubernetes_clusters\": [\n {\n \"cluster_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"region_id\": \"\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/inventory/resource-attributions/materialise/")
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 \"device_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nova_server_uuid\": \"<string>\",\n \"environment\": \"<string>\",\n \"openstack_region_name\": \"<string>\",\n \"source_observed_at\": \"2023-11-07T05:31:56Z\",\n \"resolution_status\": \"unresolved\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"failure_code\": \"\",\n \"diagnostic_detail\": \"\",\n \"issues\": [\n {\n \"code\": \"<string>\",\n \"retryable\": false,\n \"diagnostic_detail\": \"\"\n }\n ],\n \"uni_instance\": {\n \"uni_instance_id\": \"<string>\",\n \"uni_server_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"region_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"project_id\": \"\"\n },\n \"placement\": {\n \"placement_id\": \"<string>\",\n \"placement_server_id\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"reservation_id\": \"\",\n \"managed_by\": \"\",\n \"owner_id\": \"\",\n \"organisation_id\": \"\",\n \"region_id\": \"\",\n \"project_id\": \"\"\n },\n \"kubernetes_clusters\": [\n {\n \"cluster_id\": \"<string>\",\n \"organisation_id\": \"<string>\",\n \"project_id\": \"<string>\",\n \"project_name\": \"<string>\",\n \"observed_at\": \"2023-11-07T05:31:56Z\",\n \"last_attempted_at\": \"2023-11-07T05:31:56Z\",\n \"last_resolved_at\": \"2023-11-07T05:31:56Z\",\n \"stale_since\": \"2023-11-07T05:31:56Z\",\n \"region_id\": \"\"\n }\n ]\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>"
}{
"detail": "<string>"
}Authorizations
oauth2cookieAuth
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Write contract used by the OpenStack agent for one attribution snapshot.
pending- Pendingunassigned- Unassignedresolved- Resolvedpartially_resolved- Partially resolvedunresolved- Unresolvedstale- Stale
Available options:
pending, unassigned, resolved, partially_resolved, unresolved, stale Show child attributes
Show child attributes
Common freshness fields for an observed resource in a write payload.
Show child attributes
Show child attributes
Common freshness fields for an observed resource in a write payload.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
No response body