= LinodeClient(os.getenv("LINODE_TOKEN"))
client print(client.is_firewall_enabled)
client.enable_firewall()print(client.is_firewall_enabled)
client.disable_firewall()print(client.is_firewall_enabled)
True
True
False
LinodeClient (token)
A client instance that facilitates communication with the Linode API.
We create a mechanism to control a firewall that is created for the Kubernetes cluster. Normally, it only allos web traffic but may allow other traffic depending on the needs of the cluster.
client = LinodeClient(os.getenv("LINODE_TOKEN"))
print(client.is_firewall_enabled)
client.enable_firewall()
print(client.is_firewall_enabled)
client.disable_firewall()
print(client.is_firewall_enabled)
True
True
False
enable_firewall ()
disable_firewall ()