Skip to content

Conversation

@zliang-akamai
Copy link
Member

📝 Description

This is to add firewall_settings and firewall_settings_info module.

✔️ How to Test

You might need to enable default firewall for your account to test it.

Note that once it's enabled for an account, it cannot be turned off, which means you will have to permanently have a default firewall for each of the resources in you account.

curl --request PUT \
     --url https://api.linode.com/v4beta/networking/firewalls/settings \
     --header 'accept: application/json' \
     --header "authorization: Bearer $TOKEN" \   
     --header 'content-type: application/json' \
     --data '
{
    "default_firewall_ids": { 
        "public_interface": YOUR_DEFAULT_FIREWALL_ID,
        "vpc_interface": YOUR_DEFAULT_FIREWALL_ID,
        "linode": YOUR_DEFAULT_FIREWALL_ID,
        "nodebalancer": YOUR_DEFAULT_FIREWALL_ID
    }                 
}

'

Testing the modules:

make test-int TEST_SUITE=firewall_settings

@zliang-akamai zliang-akamai requested a review from a team as a code owner May 23, 2025 06:51
@zliang-akamai zliang-akamai requested review from ezilber-akamai and lgarber-akamai and removed request for a team May 23, 2025 06:51
@zliang-akamai zliang-akamai force-pushed the zhiwei/firewall-settings-module branch from aeb4ca5 to decc5fe Compare May 23, 2025 08:11
@lgarber-akamai lgarber-akamai added the new-feature for new features in the changelog. label May 23, 2025
@lgarber-akamai
Copy link
Contributor

lgarber-akamai commented May 23, 2025

This looks great, nice work!

For the null default_firewall_ids.X issue you mentioned: it looks like the _serialize(...) method is excluding the keys of null fields from FirewallSettingsDefaultFirewallIDs, which is preventing handle_updates(...) from detecting a diff on those keys. Would it make sense to use include_none_values, always_include, or put_class in the class implementation in the Python SDK to address this?

Copy link
Contributor

@ezilber-akamai ezilber-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tests passing locally.

@zliang-akamai
Copy link
Member Author

Hi @lgarber-akamai, I enabled include_none_values in FirewallSettingsDefaultFirewallIDs in linode/linode_api4-python#558

Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing my feedback in the Python SDK!

@zliang-akamai zliang-akamai merged commit 1239b60 into linode:proj/linode-interfaces May 28, 2025
12 checks passed
@zliang-akamai zliang-akamai deleted the zhiwei/firewall-settings-module branch May 28, 2025 21:20
zliang-akamai added a commit that referenced this pull request Nov 20, 2025
* Override Python SDK version to be the feature branch

* Add interface as an allowed firewall device (#676)

* Add interface as an allowed firewall device

* Add todo

* Firewall settings modules (#681)

* Fix `parse_linode_types` for `JSONObject`

* Add `firewall_settings` module and docs

* Add `firewall_settings_info` module, docs, and tests

* Fix helper

* lint fix

* more lint fix

* more more lint fixes

* Add interface_id to IP docs (#684)

* Update VPC docs (#675)

* Fix doc for entity_type

* Fix lint

* Implement firewall template modules (#686)

* Implement firewall template modules

* Fix lint

* Linode Interfaces: Support endpoints under /linode/instances/{id}/interfaces (#687)

* Linode Interfaces: Support endpoints under /linode/instances/{id}/interfaces

* Revert inventory

* make gendocS

* oops

* Add docs example

* Finishing touches

* Adjustments

* oops

* make gendocs

* oops

* WIP

* Fix weird wording

* Scope attributes in settings info module

* instance_id -> linode_id

* oops

* fix firewall issue

* Update tests/integration/targets/instance_linode_interface/tasks/main.yaml

Co-authored-by: Erik Zilber <ezilber@akamai.com>

---------

Co-authored-by: Erik Zilber <ezilber@akamai.com>

* Fix doc

* Fix null firewall_id during creation of instance with linode interface (#719)

* VPC Dual Stack: Add support for Linode Interfaces (#721)

* Implement Linode Interfaces IPv6

* minor bug fix

* Minor docs fix

* Fix expecting error test (#724)

* Catch all exceptions from running `exec_module`

* Fail when the error message is not in `msg`

* make format

* Change BaseException to Exception

* Update format_generic_error

---------

Co-authored-by: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com>
Co-authored-by: Erik Zilber <ezilber@akamai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants