Skip to main content
GET
/
firewalls
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.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
          }
        ]
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Query Parameters

filter[project]
string
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