Get execution environment usage
curl --request GET \
--url https://api.ravion.com/execution-environments/{id}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ravion.com/execution-environments/{id}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ravion.com/execution-environments/{id}/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_URL => "https://api.ravion.com/execution-environments/{id}/usage",
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.ravion.com/execution-environments/{id}/usage"
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.ravion.com/execution-environments/{id}/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/execution-environments/{id}/usage")
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{
"data": {
"complete": true,
"days": [
{
"category": "RUNNER_COMPUTE",
"date": "<string>",
"usd": 123
}
],
"lines": [
{
"category": "RUNNER_COMPUTE",
"quantity": 123,
"usd": 123,
"instanceType": "<string>",
"onDemandUsd": 123,
"pipelineId": "<string>",
"pipelineName": "<string>",
"projectedOnDemandUsd": 123,
"projectedQuantity": 123,
"projectedUsd": 123,
"purchaseOption": "ON_DEMAND",
"repository": "<string>",
"stepId": "<string>",
"workflowName": "<string>"
}
],
"period": "CURRENT",
"periodEnd": "2023-11-07T05:31:56Z",
"periodStart": "2023-11-07T05:31:56Z",
"ravion": {
"grossUsd": 123,
"includedMinutes": 123,
"minutes": 123,
"netUsd": 123,
"organizationMinutes": 123,
"ratePerMinuteUsd": 123,
"projectedGrossUsd": 123,
"projectedMinutes": 123,
"projectedNetUsd": 123
},
"dataThrough": "2023-11-07T05:31:56Z",
"startup": {
"capacityWait": {
"count": 123,
"medianSeconds": 123,
"p95Seconds": 123,
"totalSeconds": 123
},
"runnerStart": {
"count": 123,
"medianSeconds": 123,
"p95Seconds": 123,
"totalSeconds": 123
},
"total": {
"count": 123,
"medianSeconds": 123,
"p95Seconds": 123,
"totalSeconds": 123
}
}
}
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}ExecutionEnvironments
Get execution environment usage
Returns execution-environment usage, daily cost totals, pipeline attribution, and Ravion minutes for the selected billing period.
GET
/
execution-environments
/
{id}
/
usage
Get execution environment usage
curl --request GET \
--url https://api.ravion.com/execution-environments/{id}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ravion.com/execution-environments/{id}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ravion.com/execution-environments/{id}/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_URL => "https://api.ravion.com/execution-environments/{id}/usage",
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.ravion.com/execution-environments/{id}/usage"
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.ravion.com/execution-environments/{id}/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/execution-environments/{id}/usage")
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{
"data": {
"complete": true,
"days": [
{
"category": "RUNNER_COMPUTE",
"date": "<string>",
"usd": 123
}
],
"lines": [
{
"category": "RUNNER_COMPUTE",
"quantity": 123,
"usd": 123,
"instanceType": "<string>",
"onDemandUsd": 123,
"pipelineId": "<string>",
"pipelineName": "<string>",
"projectedOnDemandUsd": 123,
"projectedQuantity": 123,
"projectedUsd": 123,
"purchaseOption": "ON_DEMAND",
"repository": "<string>",
"stepId": "<string>",
"workflowName": "<string>"
}
],
"period": "CURRENT",
"periodEnd": "2023-11-07T05:31:56Z",
"periodStart": "2023-11-07T05:31:56Z",
"ravion": {
"grossUsd": 123,
"includedMinutes": 123,
"minutes": 123,
"netUsd": 123,
"organizationMinutes": 123,
"ratePerMinuteUsd": 123,
"projectedGrossUsd": 123,
"projectedMinutes": 123,
"projectedNetUsd": 123
},
"dataThrough": "2023-11-07T05:31:56Z",
"startup": {
"capacityWait": {
"count": 123,
"medianSeconds": 123,
"p95Seconds": 123,
"totalSeconds": 123
},
"runnerStart": {
"count": 123,
"medianSeconds": 123,
"p95Seconds": 123,
"totalSeconds": 123
},
"total": {
"count": 123,
"medianSeconds": 123,
"p95Seconds": 123,
"totalSeconds": 123
}
}
}
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}Was this page helpful?