Service map
Get connection
Returns one network edge — both endpoints resolved to services, edge metadata, and counters aggregated over the range. Each service carries the whole network endpoint record plus its resolved inventory name, the same shape the service map returns. A connection with no traffic in the range returns zeroed counters
GET
/
api
/
v1
/
tenant
/
service-map
/
connections
/
{id}
Get connection
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/service-map/connections/{id} \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/service-map/connections/{id}"
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>', Authorization: '<api-key>'}
};
fetch('https://api.costgraph.ai/api/v1/tenant/service-map/connections/{id}', 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.costgraph.ai/api/v1/tenant/service-map/connections/{id}",
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: <api-key>",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>"
],
]);
$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.costgraph.ai/api/v1/tenant/service-map/connections/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
req.Header.Add("Authorization", "<api-key>")
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.costgraph.ai/api/v1/tenant/service-map/connections/{id}")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/service-map/connections/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"client": {
"cluster": "<string>",
"created_at": "<string>",
"endpoint_key": "<string>",
"group": "<string>",
"id": "<string>",
"kind": "<string>",
"labels": {},
"name": "<string>",
"parent_kind": "<string>",
"parent_name": "<string>",
"resolution_source": "<string>",
"superseded_by_endpoint_id": "<string>",
"tags": {},
"tenant_id": "<string>",
"updated_at": "<string>"
},
"counters": {
"bucket_start": "<string>",
"bytes_client_to_server": 123,
"bytes_server_to_client": 123,
"connections_active_max": 123,
"connections_closed": 123,
"connections_failed": 123,
"connections_opened": 123,
"connections_refused": 123,
"connections_reset": 123,
"created_at": "<string>",
"id": "<string>",
"network_report_id": "<string>",
"observed_from": "<string>",
"observed_seconds": 123,
"packets_client_to_server": 123,
"packets_server_to_client": 123,
"tenant_id": "<string>",
"updated_at": "<string>"
},
"id": "<string>",
"metadata": {
"attributed_cost_monthly": 123,
"charged_direction": "<string>",
"client_az": "<string>",
"client_endpoint_id": "<string>",
"cost_mechanism": "<string>",
"created_at": "<string>",
"id": "<string>",
"locality": "<string>",
"locality_source": "<string>",
"nat_translated": true,
"pricing_source": "<string>",
"proto": "<string>",
"server_az": "<string>",
"server_endpoint_id": "<string>",
"server_port": 123,
"service_vip_observed": true,
"tags": {},
"tenant_id": "<string>",
"updated_at": "<string>"
},
"server": {
"cluster": "<string>",
"created_at": "<string>",
"endpoint_key": "<string>",
"group": "<string>",
"id": "<string>",
"kind": "<string>",
"labels": {},
"name": "<string>",
"parent_kind": "<string>",
"parent_name": "<string>",
"resolution_source": "<string>",
"superseded_by_endpoint_id": "<string>",
"tags": {},
"tenant_id": "<string>",
"updated_at": "<string>"
}
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}Authorizations
Enter "Bearer {token}"
Headers
Tenant ID
Path Parameters
Connection ID (network report ID)
Query Parameters
Range start timestamp in RFC3339 format
Range end timestamp in RFC3339 format
Was this page helpful?
⌘I
Get connection
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/service-map/connections/{id} \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/service-map/connections/{id}"
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>', Authorization: '<api-key>'}
};
fetch('https://api.costgraph.ai/api/v1/tenant/service-map/connections/{id}', 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.costgraph.ai/api/v1/tenant/service-map/connections/{id}",
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: <api-key>",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>"
],
]);
$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.costgraph.ai/api/v1/tenant/service-map/connections/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
req.Header.Add("Authorization", "<api-key>")
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.costgraph.ai/api/v1/tenant/service-map/connections/{id}")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/service-map/connections/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"client": {
"cluster": "<string>",
"created_at": "<string>",
"endpoint_key": "<string>",
"group": "<string>",
"id": "<string>",
"kind": "<string>",
"labels": {},
"name": "<string>",
"parent_kind": "<string>",
"parent_name": "<string>",
"resolution_source": "<string>",
"superseded_by_endpoint_id": "<string>",
"tags": {},
"tenant_id": "<string>",
"updated_at": "<string>"
},
"counters": {
"bucket_start": "<string>",
"bytes_client_to_server": 123,
"bytes_server_to_client": 123,
"connections_active_max": 123,
"connections_closed": 123,
"connections_failed": 123,
"connections_opened": 123,
"connections_refused": 123,
"connections_reset": 123,
"created_at": "<string>",
"id": "<string>",
"network_report_id": "<string>",
"observed_from": "<string>",
"observed_seconds": 123,
"packets_client_to_server": 123,
"packets_server_to_client": 123,
"tenant_id": "<string>",
"updated_at": "<string>"
},
"id": "<string>",
"metadata": {
"attributed_cost_monthly": 123,
"charged_direction": "<string>",
"client_az": "<string>",
"client_endpoint_id": "<string>",
"cost_mechanism": "<string>",
"created_at": "<string>",
"id": "<string>",
"locality": "<string>",
"locality_source": "<string>",
"nat_translated": true,
"pricing_source": "<string>",
"proto": "<string>",
"server_az": "<string>",
"server_endpoint_id": "<string>",
"server_port": 123,
"service_vip_observed": true,
"tags": {},
"tenant_id": "<string>",
"updated_at": "<string>"
},
"server": {
"cluster": "<string>",
"created_at": "<string>",
"endpoint_key": "<string>",
"group": "<string>",
"id": "<string>",
"kind": "<string>",
"labels": {},
"name": "<string>",
"parent_kind": "<string>",
"parent_name": "<string>",
"resolution_source": "<string>",
"superseded_by_endpoint_id": "<string>",
"tags": {},
"tenant_id": "<string>",
"updated_at": "<string>"
}
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}