Authorizations
Path Parameters
The Firewall ID
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Firewalls.Get(ctx, "fw_xkjQwdENqYNVP")
if err != nil {
log.Fatal(err)
}
if res.Firewall != nil {
// handle response
}
}{
"data": {
"id": "fw_xkjQwdENqYNVP",
"type": "firewalls",
"attributes": {
"name": "Batz Inc",
"project": {
"id": "proj_Av9BVDavORm1W",
"name": "Heavy Duty Paper Hat",
"slug": "heavy-duty-paper-hat"
},
"rules": [
{
"from": "217.160.173.14",
"to": "99.87.69.88",
"port": "80",
"protocol": "TCP",
"default": false
},
{
"from": "79.209.217.107",
"to": "224.13.187.5",
"port": "80",
"protocol": "TCP",
"default": false
}
]
}
}
}Retrieve a firewall
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Firewalls.Get(ctx, "fw_xkjQwdENqYNVP")
if err != nil {
log.Fatal(err)
}
if res.Firewall != nil {
// handle response
}
}{
"data": {
"id": "fw_xkjQwdENqYNVP",
"type": "firewalls",
"attributes": {
"name": "Batz Inc",
"project": {
"id": "proj_Av9BVDavORm1W",
"name": "Heavy Duty Paper Hat",
"slug": "heavy-duty-paper-hat"
},
"rules": [
{
"from": "217.160.173.14",
"to": "99.87.69.88",
"port": "80",
"protocol": "TCP",
"default": false
},
{
"from": "79.209.217.107",
"to": "224.13.187.5",
"port": "80",
"protocol": "TCP",
"default": false
}
]
}
}
}The Firewall ID
Was this page helpful?