Authorizations
Path Parameters
The Firewall ID
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.ListAssignments(ctx, "fw_z8Nkvdy1deLpx", latitudeshgosdk.Pointer[int64](20), latitudeshgosdk.Pointer[int64](1))
if err != nil {
log.Fatal(err)
}
if res.FirewallAssignments != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}{
"data": [
{
"id": "fwasg_zGr47qlMDAg0m",
"type": "firewall_assignments",
"attributes": {
"server": {
"id": "sv_2695BdKrOevVo",
"hostname": "Incredible Silk Watch",
"primary_ipv4": "218.124.123.71"
},
"firewall_id": "fw_z8Nkvdy1deLpx"
}
},
{
"id": "fwasg_w5AEmq7XDBkWX",
"type": "firewall_assignments",
"attributes": {
"server": {
"id": "sv_byQrJdNJd30gv",
"hostname": "Durable Cotton Knife",
"primary_ipv4": "84.9.159.24"
},
"firewall_id": "fw_z8Nkvdy1deLpx"
}
}
]
}List servers assigned to 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.ListAssignments(ctx, "fw_z8Nkvdy1deLpx", latitudeshgosdk.Pointer[int64](20), latitudeshgosdk.Pointer[int64](1))
if err != nil {
log.Fatal(err)
}
if res.FirewallAssignments != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}{
"data": [
{
"id": "fwasg_zGr47qlMDAg0m",
"type": "firewall_assignments",
"attributes": {
"server": {
"id": "sv_2695BdKrOevVo",
"hostname": "Incredible Silk Watch",
"primary_ipv4": "218.124.123.71"
},
"firewall_id": "fw_z8Nkvdy1deLpx"
}
},
{
"id": "fwasg_w5AEmq7XDBkWX",
"type": "firewall_assignments",
"attributes": {
"server": {
"id": "sv_byQrJdNJd30gv",
"hostname": "Durable Cotton Knife",
"primary_ipv4": "84.9.159.24"
},
"firewall_id": "fw_z8Nkvdy1deLpx"
}
}
]
}The Firewall ID
Number of items to return per page
x >= 1Page number to return (starts at 1)
x >= 1Was this page helpful?