Get resources
curl --request GET \
--url https://api.vantage.sh/v2/resources \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vantage.sh/v2/resources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vantage.sh/v2/resources', 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.vantage.sh/v2/resources",
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.vantage.sh/v2/resources"
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.vantage.sh/v2/resources")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vantage.sh/v2/resources")
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{
"links": {
"self": "https://api.vantage.sh/v2/resources?resource_report_token=prvdr_rsrc_rprt_a92daa2d9d885dcc&include_cost=true",
"first": "https://api.vantage.sh/v2/resources?resource_report_token=prvdr_rsrc_rprt_a92daa2d9d885dcc&include_cost=true&page=1",
"next": null,
"last": "https://api.vantage.sh/v2/resources?resource_report_token=prvdr_rsrc_rprt_a92daa2d9d885dcc&include_cost=true&page=1",
"prev": null
},
"resources": [
{
"token": "prvdr_rsrc_4a1f4a30d86a586f",
"uuid": "0a997b68-281b-441b-865a-1ce183ae5f51",
"type": "aws_instance",
"label": "Faker::Business",
"metadata": {
"instance_id": null,
"image_id": null,
"region": null,
"vpc_id": null,
"subnet_id": null,
"public_ip_address": null,
"private_ip_address": null,
"public_dns_name": null,
"instance_type": null,
"platform": null,
"spot_instance_request_id": null,
"launch_time": 1728332095,
"instance_lifecycle": null,
"name": null,
"platform_type": "Linux/UNIX",
"spot_info": null,
"spot_price": null,
"datadog_agent_installed": null,
"network_interfaces": null,
"tags": null,
"instance_type_name": "t2.micro",
"lifecycle": "normal"
},
"account_id": "734912804094",
"billing_account_id": "734912804094",
"provider": "aws",
"region": "us-east-1",
"cost": 200,
"created_at": "2024-10-06T20:14:55.898Z"
},
{
"token": "prvdr_rsrc_21a16d1b66e134d9",
"uuid": "0f21a7dc-a466-43fb-81e8-1cc2346482f4",
"type": "aws_instance",
"label": "Faker::Business",
"metadata": {
"instance_id": null,
"image_id": null,
"region": null,
"vpc_id": null,
"subnet_id": null,
"public_ip_address": null,
"private_ip_address": null,
"public_dns_name": null,
"instance_type": null,
"platform": null,
"spot_instance_request_id": null,
"launch_time": 1728332095,
"instance_lifecycle": null,
"name": null,
"platform_type": "Linux/UNIX",
"spot_info": null,
"spot_price": null,
"datadog_agent_installed": null,
"network_interfaces": null,
"tags": null,
"instance_type_name": "t2.micro",
"lifecycle": "normal"
},
"account_id": "734912804094",
"billing_account_id": "734912804094",
"provider": "aws",
"region": "us-east-1",
"cost": 100,
"created_at": "2024-10-07T20:14:55.898Z"
}
]
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}Resources
Get resources
Return Resources contained in a ResourceReport
GET
/
resources
Get resources
curl --request GET \
--url https://api.vantage.sh/v2/resources \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vantage.sh/v2/resources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vantage.sh/v2/resources', 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.vantage.sh/v2/resources",
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.vantage.sh/v2/resources"
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.vantage.sh/v2/resources")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vantage.sh/v2/resources")
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{
"links": {
"self": "https://api.vantage.sh/v2/resources?resource_report_token=prvdr_rsrc_rprt_a92daa2d9d885dcc&include_cost=true",
"first": "https://api.vantage.sh/v2/resources?resource_report_token=prvdr_rsrc_rprt_a92daa2d9d885dcc&include_cost=true&page=1",
"next": null,
"last": "https://api.vantage.sh/v2/resources?resource_report_token=prvdr_rsrc_rprt_a92daa2d9d885dcc&include_cost=true&page=1",
"prev": null
},
"resources": [
{
"token": "prvdr_rsrc_4a1f4a30d86a586f",
"uuid": "0a997b68-281b-441b-865a-1ce183ae5f51",
"type": "aws_instance",
"label": "Faker::Business",
"metadata": {
"instance_id": null,
"image_id": null,
"region": null,
"vpc_id": null,
"subnet_id": null,
"public_ip_address": null,
"private_ip_address": null,
"public_dns_name": null,
"instance_type": null,
"platform": null,
"spot_instance_request_id": null,
"launch_time": 1728332095,
"instance_lifecycle": null,
"name": null,
"platform_type": "Linux/UNIX",
"spot_info": null,
"spot_price": null,
"datadog_agent_installed": null,
"network_interfaces": null,
"tags": null,
"instance_type_name": "t2.micro",
"lifecycle": "normal"
},
"account_id": "734912804094",
"billing_account_id": "734912804094",
"provider": "aws",
"region": "us-east-1",
"cost": 200,
"created_at": "2024-10-06T20:14:55.898Z"
},
{
"token": "prvdr_rsrc_21a16d1b66e134d9",
"uuid": "0f21a7dc-a466-43fb-81e8-1cc2346482f4",
"type": "aws_instance",
"label": "Faker::Business",
"metadata": {
"instance_id": null,
"image_id": null,
"region": null,
"vpc_id": null,
"subnet_id": null,
"public_ip_address": null,
"private_ip_address": null,
"public_dns_name": null,
"instance_type": null,
"platform": null,
"spot_instance_request_id": null,
"launch_time": 1728332095,
"instance_lifecycle": null,
"name": null,
"platform_type": "Linux/UNIX",
"spot_info": null,
"spot_price": null,
"datadog_agent_installed": null,
"network_interfaces": null,
"tags": null,
"instance_type_name": "t2.micro",
"lifecycle": "normal"
},
"account_id": "734912804094",
"billing_account_id": "734912804094",
"provider": "aws",
"region": "us-east-1",
"cost": 100,
"created_at": "2024-10-07T20:14:55.898Z"
}
]
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Query Parameters
The ResourceReport token.
The filter query language to apply to the Resources. Additional documentation available at https://docs.vantage.sh/vql.
The Workspace in which the Resources are located.
Include cost information in the response.
The page number for pagination.
The number of resources to return per page.
⌘I