Update a traffic policy profile
Updates a traffic policy profile.
PATCH
/
traffic
/
policy
/
profiles
/
{id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const trafficPolicyProfile = await client.trafficPolicyProfiles.update(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(trafficPolicyProfile.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
)
traffic_policy_profile = client.traffic_policy_profiles.update(
id="6a09cdc3-8948-47f0-aa62-74ac943d6c58",
)
print(traffic_policy_profile.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"),
)
trafficPolicyProfile, err := client.TrafficPolicyProfiles.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TrafficPolicyProfileUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", trafficPolicyProfile.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.trafficpolicyprofiles.TrafficPolicyProfileUpdateParams;
import com.telnyx.sdk.models.trafficpolicyprofiles.TrafficPolicyProfileUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TrafficPolicyProfileUpdateResponse trafficPolicyProfile = client.trafficPolicyProfiles().update("6a09cdc3-8948-47f0-aa62-74ac943d6c58");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
traffic_policy_profile = telnyx.traffic_policy_profiles.update("6a09cdc3-8948-47f0-aa62-74ac943d6c58")
puts(traffic_policy_profile)<?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 {
$trafficPolicyProfile = $client->trafficPolicyProfiles->update(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
domains: ['netflix.com'],
ipRanges: ['10.64.0.0/24'],
limitBwKbps: 1024,
services: ['service_123'],
type: 'whitelist',
);
var_dump($trafficPolicyProfile);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx traffic-policy-profiles update \
--api-key 'My API Key' \
--id 6a09cdc3-8948-47f0-aa62-74ac943d6c58curl --request PATCH \
--url https://api.telnyx.com/v2/traffic/policy/profiles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "whitelist",
"services": [
"service_123"
],
"ip_ranges": [
"10.64.0.0/24"
],
"domains": [
"netflix.com"
],
"limit_bw_kbps": 1024
}
'{
"data": {
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "traffic_policy_profile",
"type": "whitelist",
"services": [
"service_123",
"service_456"
],
"ip_ranges": [
"10.64.0.0/24",
"10.64.0.0/25"
],
"domains": [
"www.hbomax.com",
"netflix.com"
],
"limit_bw_kbps": 512,
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z"
}
}{
"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": {}
}
]
}{
"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.
Path Parameters
Identifies the traffic policy profile.
Example:
"6a09cdc3-8948-47f0-aa62-74ac943d6c58"
Body
application/json
The type of the traffic policy profile.
Available options:
whitelist, blacklist, throttling Example:
"whitelist"
Array of PCEF service IDs to include in the profile.
Example:
["service_123"]
Array of IP ranges in CIDR notation.
Example:
["10.64.0.0/24"]
Array of domain names.
Example:
["netflix.com"]
Bandwidth limit in kbps. Must be 512 or 1024, or null to remove.
Available options:
512, 1024, null Example:
1024
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 trafficPolicyProfile = await client.trafficPolicyProfiles.update(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(trafficPolicyProfile.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
)
traffic_policy_profile = client.traffic_policy_profiles.update(
id="6a09cdc3-8948-47f0-aa62-74ac943d6c58",
)
print(traffic_policy_profile.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"),
)
trafficPolicyProfile, err := client.TrafficPolicyProfiles.Update(
context.TODO(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.TrafficPolicyProfileUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", trafficPolicyProfile.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.trafficpolicyprofiles.TrafficPolicyProfileUpdateParams;
import com.telnyx.sdk.models.trafficpolicyprofiles.TrafficPolicyProfileUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TrafficPolicyProfileUpdateResponse trafficPolicyProfile = client.trafficPolicyProfiles().update("6a09cdc3-8948-47f0-aa62-74ac943d6c58");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
traffic_policy_profile = telnyx.traffic_policy_profiles.update("6a09cdc3-8948-47f0-aa62-74ac943d6c58")
puts(traffic_policy_profile)<?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 {
$trafficPolicyProfile = $client->trafficPolicyProfiles->update(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
domains: ['netflix.com'],
ipRanges: ['10.64.0.0/24'],
limitBwKbps: 1024,
services: ['service_123'],
type: 'whitelist',
);
var_dump($trafficPolicyProfile);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx traffic-policy-profiles update \
--api-key 'My API Key' \
--id 6a09cdc3-8948-47f0-aa62-74ac943d6c58curl --request PATCH \
--url https://api.telnyx.com/v2/traffic/policy/profiles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "whitelist",
"services": [
"service_123"
],
"ip_ranges": [
"10.64.0.0/24"
],
"domains": [
"netflix.com"
],
"limit_bw_kbps": 1024
}
'{
"data": {
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "traffic_policy_profile",
"type": "whitelist",
"services": [
"service_123",
"service_456"
],
"ip_ranges": [
"10.64.0.0/24",
"10.64.0.0/25"
],
"domains": [
"www.hbomax.com",
"netflix.com"
],
"limit_bw_kbps": 512,
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z"
}
}{
"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": {}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}