libcloud icon indicating copy to clipboard operation
libcloud copied to clipboard

[Feature] DigitalOceean Firewall

Open ccrvlh opened this issue 3 years ago • 3 comments

I couldn't find DigitalOcean's firewall feature. I can start working on it right away. Would it make sense for PR? Thanks!

ccrvlh avatar Apr 07 '22 03:04 ccrvlh

I guess this could be implemented with a series of extensions methods, somewhat similar to what already exists for the floating ip resource.

Probably the biggest design decision here is whether to use a similar approach as the one used for EC2 security groups, in which rules and sources are being handled directly on a method, or to go with an object-first approach and make a new object for rules/sources (the two nested objects that DOs firewall uses).

Maybe making it closer to EC2 could be a good idea: if there was a strong enough argument to make firewall part of the core (non ex) lib in the future, the APIs would already be similar. With this directive I would be happy to start working on this.

ccrvlh avatar Apr 07 '22 04:04 ccrvlh

@lowercase00 That approach reasonable to me.

It's also worth noting that some APIs (e.g. storage) support both approaches - driver methods call object methods or vice versa.

So the object approach is really just a convenience.

Kami avatar May 10 '22 22:05 Kami

Thanks @Kami, I'll push a few commits to my local fork before a PR and let you know how things evolve

ccrvlh avatar May 11 '22 22:05 ccrvlh