Skip to main content
POST
/
firewalls
/
{firewall_id}
/
assignments
Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os


with Latitudesh(
    bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:

    res = latitudesh.firewalls.assign(firewall_id="fw_Av9BVDavORm1W", data={
        "type": latitudesh_python_sdk.CreateFirewallAssignmentFirewallsType.FIREWALL_ASSIGNMENTS,
        "attributes": {
            "server_id": "sv_2695BdKrOevVo",
        },
    })

    # Handle response
    print(res)
{
  "data": {
    "id": "fwasg_0g1mbDwBqLv5B",
    "type": "firewall_assignments",
    "attributes": {
      "server": {
        "id": "sv_lpbV0DgRq4AWz",
        "hostname": "Incredible Paper Chair",
        "primary_ipv4": "248.110.161.199"
      },
      "firewall_id": "fw_Av9BVDavORm1W"
    }
  }
}

Authorizations

Authorization
string
header
required

Path Parameters

firewall_id
string
required

The Firewall ID

Body

data
object
required

Response

201 - application/vnd.api+json

Created

id
string
type
enum<string>
Available options:
firewall_servers
attributes
object
I