Get information about a stream
curl --request GET \
--url https://api.quiva.ai/storage/streams/{name} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.quiva.ai/storage/streams/{name}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.quiva.ai/storage/streams/{name}', 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.quiva.ai/storage/streams/{name}",
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.quiva.ai/storage/streams/{name}"
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.quiva.ai/storage/streams/{name}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quiva.ai/storage/streams/{name}")
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{
"body": {
"config": {
"name": "user-events",
"description": "User activity events",
"subjects": [
"events.user.*"
],
"retention": "Limits",
"max_consumers": -1,
"max_msgs": 1000000,
"max_bytes": 104857600,
"max_age": 0,
"max_msg_size": -1,
"storage": "file",
"discard": "old",
"num_replicas": 3,
"duplicate_window": 120000000000,
"deny_delete": false,
"deny_purge": false
},
"state": {
"messages": 15420,
"bytes": 2458320,
"first_seq": 1,
"first_ts": "2024-01-15T10:30:00Z",
"last_seq": 15420,
"last_ts": "2024-03-15T14:22:33Z",
"consumer_count": 3,
"num_subjects": 12
},
"created": "2024-01-15T10:30:00Z",
"cluster": {
"name": "nats-cluster",
"leader": "nats-1",
"replicas": [
{
"name": "nats-2",
"current": true,
"active": 0
},
{
"name": "nats-3",
"current": true,
"active": 0
}
]
}
}
}Streams
Get information about a stream
Retrieves detailed information about a specific stream, including its configuration and current state. This endpoint provides metrics such as the number of messages, bytes used, first and last sequence numbers, and more.
GET
/
storage
/
streams
/
{name}
Get information about a stream
curl --request GET \
--url https://api.quiva.ai/storage/streams/{name} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.quiva.ai/storage/streams/{name}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.quiva.ai/storage/streams/{name}', 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.quiva.ai/storage/streams/{name}",
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.quiva.ai/storage/streams/{name}"
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.quiva.ai/storage/streams/{name}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.quiva.ai/storage/streams/{name}")
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{
"body": {
"config": {
"name": "user-events",
"description": "User activity events",
"subjects": [
"events.user.*"
],
"retention": "Limits",
"max_consumers": -1,
"max_msgs": 1000000,
"max_bytes": 104857600,
"max_age": 0,
"max_msg_size": -1,
"storage": "file",
"discard": "old",
"num_replicas": 3,
"duplicate_window": 120000000000,
"deny_delete": false,
"deny_purge": false
},
"state": {
"messages": 15420,
"bytes": 2458320,
"first_seq": 1,
"first_ts": "2024-01-15T10:30:00Z",
"last_seq": 15420,
"last_ts": "2024-03-15T14:22:33Z",
"consumer_count": 3,
"num_subjects": 12
},
"created": "2024-01-15T10:30:00Z",
"cluster": {
"name": "nats-cluster",
"leader": "nats-1",
"replicas": [
{
"name": "nats-2",
"current": true,
"active": 0
},
{
"name": "nats-3",
"current": true,
"active": 0
}
]
}
}
}⌘I