Authorizations
Path Parameters
The Firewall ID
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"
}
}
}
Assign a server to a firewall
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"
}
}
}
The Firewall ID
Show child attributes
Was this page helpful?