Update Firewall
curl --request PUT \
--url https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid} \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"name": "Updated Database Firewall",
"description": "Updated firewall for database servers",
"rules": [
{
"uuid": "db9acadc-91e1-4225-b934-7f264f9f75a2",
"direction": "inbound",
"protocol": "tcp",
"port_start": 3306,
"port_end": 3306,
"endpoint_spec_type": "ip_prefixes",
"endpoint_spec": [
"10.0.0.0/24",
"192.168.5.0/24"
]
}
]
}
'import requests
url = "https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}"
payload = {
"name": "Updated Database Firewall",
"description": "Updated firewall for database servers",
"rules": [
{
"uuid": "db9acadc-91e1-4225-b934-7f264f9f75a2",
"direction": "inbound",
"protocol": "tcp",
"port_start": 3306,
"port_end": 3306,
"endpoint_spec_type": "ip_prefixes",
"endpoint_spec": ["10.0.0.0/24", "192.168.5.0/24"]
}
]
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated Database Firewall',
description: 'Updated firewall for database servers',
rules: [
{
uuid: 'db9acadc-91e1-4225-b934-7f264f9f75a2',
direction: 'inbound',
protocol: 'tcp',
port_start: 3306,
port_end: 3306,
endpoint_spec_type: 'ip_prefixes',
endpoint_spec: ['10.0.0.0/24', '192.168.5.0/24']
}
]
})
};
fetch('https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}"
payload := strings.NewReader("{\n \"name\": \"Updated Database Firewall\",\n \"description\": \"Updated firewall for database servers\",\n \"rules\": [\n {\n \"uuid\": \"db9acadc-91e1-4225-b934-7f264f9f75a2\",\n \"direction\": \"inbound\",\n \"protocol\": \"tcp\",\n \"port_start\": 3306,\n \"port_end\": 3306,\n \"endpoint_spec_type\": \"ip_prefixes\",\n \"endpoint_spec\": [\n \"10.0.0.0/24\",\n \"192.168.5.0/24\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Database Firewall\",\n \"description\": \"Updated firewall for database servers\",\n \"rules\": [\n {\n \"uuid\": \"db9acadc-91e1-4225-b934-7f264f9f75a2\",\n \"direction\": \"inbound\",\n \"protocol\": \"tcp\",\n \"port_start\": 3306,\n \"port_end\": 3306,\n \"endpoint_spec_type\": \"ip_prefixes\",\n \"endpoint_spec\": [\n \"10.0.0.0/24\",\n \"192.168.5.0/24\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.put("https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Database Firewall\",\n \"description\": \"Updated firewall for database servers\",\n \"rules\": [\n {\n \"uuid\": \"db9acadc-91e1-4225-b934-7f264f9f75a2\",\n \"direction\": \"inbound\",\n \"protocol\": \"tcp\",\n \"port_start\": 3306,\n \"port_end\": 3306,\n \"endpoint_spec_type\": \"ip_prefixes\",\n \"endpoint_spec\": [\n \"10.0.0.0/24\",\n \"192.168.5.0/24\"\n ]\n }\n ]\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("apikey", "<api-key>");
request.AddJsonBody("{\n \"name\": \"Updated Database Firewall\",\n \"description\": \"Updated firewall for database servers\",\n \"rules\": [\n {\n \"uuid\": \"db9acadc-91e1-4225-b934-7f264f9f75a2\",\n \"direction\": \"inbound\",\n \"protocol\": \"tcp\",\n \"port_start\": 3306,\n \"port_end\": 3306,\n \"endpoint_spec_type\": \"ip_prefixes\",\n \"endpoint_spec\": [\n \"10.0.0.0/24\",\n \"192.168.5.0/24\"\n ]\n }\n ]\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Updated Database Firewall',
'description' => 'Updated firewall for database servers',
'rules' => [
[
'uuid' => 'db9acadc-91e1-4225-b934-7f264f9f75a2',
'direction' => 'inbound',
'protocol' => 'tcp',
'port_start' => 3306,
'port_end' => 3306,
'endpoint_spec_type' => 'ip_prefixes',
'endpoint_spec' => [
'10.0.0.0/24',
'192.168.5.0/24'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"uuid": "2a874f44-310f-4df8-9340-1dc274c2bd51",
"display_name": "Database Firewall",
"rules": [
{
"uuid": "db9acadc-91e1-4225-b934-7f264f9f75a2",
"direction": "inbound",
"protocol": "tcp",
"port_start": 3306,
"port_end": 3306,
"endpoint_spec_type": "ip_prefixes",
"endpoint_spec": [
"10.0.0.0/24",
"192.168.5.0/24"
]
}
],
"resources_assigned": []
}Firewall
Update Firewall
Updates an existing firewall configuration. Location-specific endpoint.
PUT
/
network
/
firewalls
/
{firewallUuid}
Update Firewall
curl --request PUT \
--url https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid} \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"name": "Updated Database Firewall",
"description": "Updated firewall for database servers",
"rules": [
{
"uuid": "db9acadc-91e1-4225-b934-7f264f9f75a2",
"direction": "inbound",
"protocol": "tcp",
"port_start": 3306,
"port_end": 3306,
"endpoint_spec_type": "ip_prefixes",
"endpoint_spec": [
"10.0.0.0/24",
"192.168.5.0/24"
]
}
]
}
'import requests
url = "https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}"
payload = {
"name": "Updated Database Firewall",
"description": "Updated firewall for database servers",
"rules": [
{
"uuid": "db9acadc-91e1-4225-b934-7f264f9f75a2",
"direction": "inbound",
"protocol": "tcp",
"port_start": 3306,
"port_end": 3306,
"endpoint_spec_type": "ip_prefixes",
"endpoint_spec": ["10.0.0.0/24", "192.168.5.0/24"]
}
]
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated Database Firewall',
description: 'Updated firewall for database servers',
rules: [
{
uuid: 'db9acadc-91e1-4225-b934-7f264f9f75a2',
direction: 'inbound',
protocol: 'tcp',
port_start: 3306,
port_end: 3306,
endpoint_spec_type: 'ip_prefixes',
endpoint_spec: ['10.0.0.0/24', '192.168.5.0/24']
}
]
})
};
fetch('https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}"
payload := strings.NewReader("{\n \"name\": \"Updated Database Firewall\",\n \"description\": \"Updated firewall for database servers\",\n \"rules\": [\n {\n \"uuid\": \"db9acadc-91e1-4225-b934-7f264f9f75a2\",\n \"direction\": \"inbound\",\n \"protocol\": \"tcp\",\n \"port_start\": 3306,\n \"port_end\": 3306,\n \"endpoint_spec_type\": \"ip_prefixes\",\n \"endpoint_spec\": [\n \"10.0.0.0/24\",\n \"192.168.5.0/24\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Database Firewall\",\n \"description\": \"Updated firewall for database servers\",\n \"rules\": [\n {\n \"uuid\": \"db9acadc-91e1-4225-b934-7f264f9f75a2\",\n \"direction\": \"inbound\",\n \"protocol\": \"tcp\",\n \"port_start\": 3306,\n \"port_end\": 3306,\n \"endpoint_spec_type\": \"ip_prefixes\",\n \"endpoint_spec\": [\n \"10.0.0.0/24\",\n \"192.168.5.0/24\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.put("https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Database Firewall\",\n \"description\": \"Updated firewall for database servers\",\n \"rules\": [\n {\n \"uuid\": \"db9acadc-91e1-4225-b934-7f264f9f75a2\",\n \"direction\": \"inbound\",\n \"protocol\": \"tcp\",\n \"port_start\": 3306,\n \"port_end\": 3306,\n \"endpoint_spec_type\": \"ip_prefixes\",\n \"endpoint_spec\": [\n \"10.0.0.0/24\",\n \"192.168.5.0/24\"\n ]\n }\n ]\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("apikey", "<api-key>");
request.AddJsonBody("{\n \"name\": \"Updated Database Firewall\",\n \"description\": \"Updated firewall for database servers\",\n \"rules\": [\n {\n \"uuid\": \"db9acadc-91e1-4225-b934-7f264f9f75a2\",\n \"direction\": \"inbound\",\n \"protocol\": \"tcp\",\n \"port_start\": 3306,\n \"port_end\": 3306,\n \"endpoint_spec_type\": \"ip_prefixes\",\n \"endpoint_spec\": [\n \"10.0.0.0/24\",\n \"192.168.5.0/24\"\n ]\n }\n ]\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tenbytecloud.com/v1/network/firewalls/{firewallUuid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Updated Database Firewall',
'description' => 'Updated firewall for database servers',
'rules' => [
[
'uuid' => 'db9acadc-91e1-4225-b934-7f264f9f75a2',
'direction' => 'inbound',
'protocol' => 'tcp',
'port_start' => 3306,
'port_end' => 3306,
'endpoint_spec_type' => 'ip_prefixes',
'endpoint_spec' => [
'10.0.0.0/24',
'192.168.5.0/24'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"uuid": "2a874f44-310f-4df8-9340-1dc274c2bd51",
"display_name": "Database Firewall",
"rules": [
{
"uuid": "db9acadc-91e1-4225-b934-7f264f9f75a2",
"direction": "inbound",
"protocol": "tcp",
"port_start": 3306,
"port_end": 3306,
"endpoint_spec_type": "ip_prefixes",
"endpoint_spec": [
"10.0.0.0/24",
"192.168.5.0/24"
]
}
],
"resources_assigned": []
}Authorizations
Path Parameters
UUID of the firewall to update
Body
application/json
Response
200 - application/json
Updated Firewall object
The response is of type object.
⌘I