Global IP Assignment Usage Metrics
GET
/
global_ip_assignments
/
usage
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const globalIPAssignmentsUsage = await client.globalIPAssignmentsUsage.retrieve();
console.log(globalIPAssignmentsUsage.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
global_ip_assignments_usage = client.global_ip_assignments_usage.retrieve()
print(global_ip_assignments_usage.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
globalIPAssignmentsUsage, err := client.GlobalIPAssignmentsUsage.Get(context.TODO(), telnyx.GlobalIPAssignmentsUsageGetParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPAssignmentsUsage.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.globalipassignmentsusage.GlobalIpAssignmentsUsageRetrieveParams;
import com.telnyx.sdk.models.globalipassignmentsusage.GlobalIpAssignmentsUsageRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
GlobalIpAssignmentsUsageRetrieveResponse globalIpAssignmentsUsage = client.globalIpAssignmentsUsage().retrieve();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
global_ip_assignments_usage = telnyx.global_ip_assignments_usage.retrieve
puts(global_ip_assignments_usage)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$globalIPAssignmentsUsage = $client->globalIPAssignmentsUsage->retrieve(
filter: ['globalIPAssignmentID' => 'string', 'globalIPID' => 'string']
);
var_dump($globalIPAssignmentsUsage);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx global-ip-assignments-usage retrieve \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/global_ip_assignments/usage \
--header 'Authorization: Bearer <token>'{
"data": [
{
"timestamp": "2020-01-01T00:00:00.000Z",
"global_ip": {
"id": "a836125b-20b6-452e-9c03-2653f09c7ed7",
"ip_address": "64.1.4.130"
},
"global_ip_assignment": {
"id": "a836125b-20b6-452e-9c03-2653f09c7ed7",
"wireguard_peer_id": "e66c496d-4a85-423b-8b2a-8e63fac20320",
"wireguard_peer": {
"name": "Wireguard Peer 1",
"ip_address": "172.1.0.1"
}
},
"transmitted": {
"amount": 100000,
"unit": "B"
},
"received": {
"amount": 100000,
"unit": "B"
}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Consolidated filter parameter (deepObject style). Originally: filter[global_ip_assignment_id][in], filter[global_ip_id][in]
Show child attributes
Show child attributes
Response
Successful response
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const globalIPAssignmentsUsage = await client.globalIPAssignmentsUsage.retrieve();
console.log(globalIPAssignmentsUsage.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
global_ip_assignments_usage = client.global_ip_assignments_usage.retrieve()
print(global_ip_assignments_usage.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
globalIPAssignmentsUsage, err := client.GlobalIPAssignmentsUsage.Get(context.TODO(), telnyx.GlobalIPAssignmentsUsageGetParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", globalIPAssignmentsUsage.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.globalipassignmentsusage.GlobalIpAssignmentsUsageRetrieveParams;
import com.telnyx.sdk.models.globalipassignmentsusage.GlobalIpAssignmentsUsageRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
GlobalIpAssignmentsUsageRetrieveResponse globalIpAssignmentsUsage = client.globalIpAssignmentsUsage().retrieve();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
global_ip_assignments_usage = telnyx.global_ip_assignments_usage.retrieve
puts(global_ip_assignments_usage)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$globalIPAssignmentsUsage = $client->globalIPAssignmentsUsage->retrieve(
filter: ['globalIPAssignmentID' => 'string', 'globalIPID' => 'string']
);
var_dump($globalIPAssignmentsUsage);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx global-ip-assignments-usage retrieve \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/global_ip_assignments/usage \
--header 'Authorization: Bearer <token>'{
"data": [
{
"timestamp": "2020-01-01T00:00:00.000Z",
"global_ip": {
"id": "a836125b-20b6-452e-9c03-2653f09c7ed7",
"ip_address": "64.1.4.130"
},
"global_ip_assignment": {
"id": "a836125b-20b6-452e-9c03-2653f09c7ed7",
"wireguard_peer_id": "e66c496d-4a85-423b-8b2a-8e63fac20320",
"wireguard_peer": {
"name": "Wireguard Peer 1",
"ip_address": "172.1.0.1"
}
},
"transmitted": {
"amount": 100000,
"unit": "B"
},
"received": {
"amount": 100000,
"unit": "B"
}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}