Query VM console logs
curl --request GET \
--url https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query', 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.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"stream": "<string>",
"lines": [
{
"date": "2023-11-07T05:31:56Z",
"message": "<string>",
"severity": "<string>"
}
],
"next_cursor": "<string>"
}{
"error": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"error": "not_found"
}{
"code": "<string>",
"detail": "<string>"
}Query VM console logs
Returns stored kernel or serial console lines for a VM, clamped to your reservation window. Pages are newest first by default.
GET
/
v1
/
observability
/
virtual-machines
/
{virtual_machine_id}
/
logs
/
{stream}
/
query
Query VM console logs
curl --request GET \
--url https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query', 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.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornn.com/v1/observability/virtual-machines/{virtual_machine_id}/logs/{stream}/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"stream": "<string>",
"lines": [
{
"date": "2023-11-07T05:31:56Z",
"message": "<string>",
"severity": "<string>"
}
],
"next_cursor": "<string>"
}{
"error": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"code": "<string>",
"detail": "<string>"
}{
"error": "not_found"
}{
"code": "<string>",
"detail": "<string>"
}Authorizations
Create an organization API key in Account Settings > Developer. Do not send this key to the Kubernetes API server.
Path Parameters
A VM ID in one of your reservations.
Console stream.
Available options:
kernel, serial Query Parameters
Range start, RFC 3339.
Range end, RFC 3339. An end at or before start returns no data.
Lines per page, from 1 to 1,000. Defaults to 200.
Required range:
1 <= x <= 1000next_cursor from the previous page, sent with the same start, end, and order.
desc returns the newest page first; asc walks oldest to newest.
Available options:
desc, asc Was this page helpful?