Skip to main content
GET
/
firewalls
/
{firewall_id}
/
assignments
Go (SDK)
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"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Path Parameters

firewall_id
string
required

The Firewall ID

Query Parameters

page[size]
integer
default:20

Number of items to return per page

Required range: x >= 1
page[number]
integer
default:1

Page number to return (starts at 1)

Required range: x >= 1

Response

200 - application/vnd.api+json

Success

data
object[]
meta
object