package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.elefork.com/v1/branches/example/metrics?range=15m"
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(res) fmt.Println(string(body))
}const url = 'https://api.elefork.com/v1/branches/example/metrics?range=15m';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.elefork.com/v1/branches/example/metrics?range=15m' \ --header 'Authorization: Bearer <token>'Samples of the branch’s Postgres taken every interval_seconds while it runs (pg_stat_database
summed over its databases, client sessions, database size). Counters are per-second rates since
the previous sample; they are null on the first sample after a gap, a new instance, or a stats
reset. gaps are periods without samples (the branch was paused). sampling is false when the
server does not sample (CP_PGSTATS_INTERVAL=0).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”Series
object
object
The instance VM’s resource use as last reported by the guest agent (every 30 s; omitted when older than 2 min, while paused, or without the guest agent). cpu_percent is null until two reports exist.
object
object
Example
{ "state": "creating"}Error
object
object
Example
{ "error": { "code": "not_found" }}Error
object
object
Example
{ "error": { "code": "not_found" }}Error
object
object
Example
{ "error": { "code": "not_found" }}Error
object
object
Example
{ "error": { "code": "not_found" }}Temporarily unavailable; retry after the Retry-After seconds. Codes:
database_unavailable (the metadata database is failing over) and
cube_admission (a compute node runs a sandbox shim below the
platform minimum, so creates, forks, checkpoints and resets are
refused until it is upgraded).
object
object
Example
{ "error": { "code": "not_found" }}