Authorizations
Path Parameters
The Firewall ID
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.firewalls.update({
firewallId: "fw_6A05EdQ1dvKYQ",
requestBody: {
data: {
type: "firewalls",
attributes: {
name: "new-name",
rules: [
{
from: "192.168.1.0/24",
to: "ANY",
protocol: "TCP",
port: "80",
},
],
},
},
},
});
console.log(result);
}
run();{
"data": {
"id": "fw_6A05EdQ1dvKYQ",
"type": "firewalls",
"attributes": {
"name": "new-name",
"project": {
"id": "proj_Ee8pKq05DWAob",
"name": "Small Wooden Chair",
"slug": "small-wooden-chair"
},
"rules": [
{
"from": "192.168.1.0/24",
"to": "ANY",
"port": "80",
"protocol": "TCP",
"default": false
}
]
}
}
}Update a firewall
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.firewalls.update({
firewallId: "fw_6A05EdQ1dvKYQ",
requestBody: {
data: {
type: "firewalls",
attributes: {
name: "new-name",
rules: [
{
from: "192.168.1.0/24",
to: "ANY",
protocol: "TCP",
port: "80",
},
],
},
},
},
});
console.log(result);
}
run();{
"data": {
"id": "fw_6A05EdQ1dvKYQ",
"type": "firewalls",
"attributes": {
"name": "new-name",
"project": {
"id": "proj_Ee8pKq05DWAob",
"name": "Small Wooden Chair",
"slug": "small-wooden-chair"
},
"rules": [
{
"from": "192.168.1.0/24",
"to": "ANY",
"port": "80",
"protocol": "TCP",
"default": false
}
]
}
}
}The Firewall ID
Show child attributes
Was this page helpful?