Code Monkey home page Code Monkey logo

Comments (5)

uroflavin avatar uroflavin commented on May 26, 2024

Code-Snipped is from https://hcloud-python.readthedocs.io/en/latest/_modules/hcloud/firewalls/client.html#FirewallsClient.apply_to_resources

from hcloud-python.

LKaemmerling avatar LKaemmerling commented on May 26, 2024

Hey @uroflavin,

sorry for the late answer!

Basically, you need to use a FirewallResource (hcloud.firewalls.domain.FirewallResource) (as stated in the documentation), not a Server. The FirewallResource is a Wrapper around a Server (currently the only supported resource, but there might be more in the future).

Does this help you @uroflavin?

  • Lukas

from hcloud-python.

uroflavin avatar uroflavin commented on May 26, 2024

Sorry, my fault. I should be more precisely.

the documentation name it „rules“, the function named it „resources“ - and now you introduce me to assign a firewall Ressource (which is a server) - to what? a Firewall-ressource ...

my main concern was the documentation, now with your explanation I’m just more confused than before...

My intention was, to get the doc-string fixed. 🙃

from hcloud-python.

LKaemmerling avatar LKaemmerling commented on May 26, 2024

Hey @uroflavin,

thank you, I submitted an MR to fix the docstring.

Basically, it is quite easy to use, you can find a sample within out tests: https://github.com/hetznercloud/hcloud-python/blob/master/tests/unit/firewalls/test_client.py#L307 (or for the BoundFirewall: https://github.com/hetznercloud/hcloud-python/blob/master/tests/unit/firewalls/test_client.py#L133)

from hcloud-python.

uroflavin avatar uroflavin commented on May 26, 2024

great work - thank you!

from hcloud-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.