Authorizations
Query Parameters
Number of items to return per page
Required range:
x >= 1Page number to return (starts at 1)
Required range:
x >= 1package 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.List(ctx, latitudeshgosdk.Pointer("incredible-bronze-car"), latitudeshgosdk.Pointer[int64](20), latitudeshgosdk.Pointer[int64](1))
if err != nil {
log.Fatal(err)
}
if res.Firewalls != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}{
"data": [
{
"id": "fw_w5AEmq7XDBkWX",
"type": "firewalls",
"attributes": {
"name": "Greenfelder-Brekke",
"project": {
"id": "proj_x1ZJrdx5qg4LV",
"name": "Incredible Bronze Car",
"slug": "incredible-bronze-car"
},
"rules": [
{
"from": "92.95.228.250",
"to": "43.35.45.108",
"port": "80",
"protocol": "TCP",
"default": false
}
]
}
}
]
}List firewalls
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.List(ctx, latitudeshgosdk.Pointer("incredible-bronze-car"), latitudeshgosdk.Pointer[int64](20), latitudeshgosdk.Pointer[int64](1))
if err != nil {
log.Fatal(err)
}
if res.Firewalls != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}{
"data": [
{
"id": "fw_w5AEmq7XDBkWX",
"type": "firewalls",
"attributes": {
"name": "Greenfelder-Brekke",
"project": {
"id": "proj_x1ZJrdx5qg4LV",
"name": "Incredible Bronze Car",
"slug": "incredible-bronze-car"
},
"rules": [
{
"from": "92.95.228.250",
"to": "43.35.45.108",
"port": "80",
"protocol": "TCP",
"default": false
}
]
}
}
]
}Number of items to return per page
x >= 1Page number to return (starts at 1)
x >= 1Was this page helpful?