Skip to main content
GET
/
user
/
usage
Get Resource Usage
curl --request GET \
  --url http://localhost:8080/user/usage \
  --cookie _me_sess=
import requests

url = "http://localhost:8080/user/usage"

headers = {"cookie": "_me_sess="}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {cookie: '_me_sess='}};

fetch('http://localhost:8080/user/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/user/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "_me_sess=",
]);

$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 := "http://localhost:8080/user/usage"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("cookie", "_me_sess=")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("http://localhost:8080/user/usage")
.header("cookie", "_me_sess=")
.asString();
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/user/usage")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["cookie"] = '_me_sess='

response = http.request(request)
puts response.read_body
{
  "cpu": {
    "usage": 123,
    "cores": 123,
    "threads": 123
  },
  "memory": {
    "used": 123,
    "total": 123
  },
  "disk": {
    "used": 123,
    "total": 123
  }
}
{
"error": {
"code": 401,
"message": "<string>"
}
}
{
"error": {
"code": 500,
"message": "<string>"
}
}

Authorizations

_me_sess
string
cookie
required

Session token for authentication.

Cookies

_me_sess
string
required

Session token for authentication.

Example:

"_me_sess=token; Path=/; HttpOnly; SameSite=Lax; Secure"

Response

OK

Response body for getting CPU, memory and disk usage of the server.

cpu
object
required
memory
object
required
disk
object
required