[BUG] - No way to create a firewall rule with FirewallService
mercymantis opened this issue · comments
mercymantis commented
The createFirewallRule function is missing in src/Services/Firewall/FirewallService.php file. After implementing it, I had trouble setting a subnet to 0.0.0.0/0 because getInitializedProps() routine wouldn't return properties with a value of 0.
I ended up writing this to get what I needed working.
- public function createFirewallRule(string $group_id, FirewallRule $rule) : FirewallRule
- {
-
$properties = $rule->getInitializedProps();
-
if ( !isset( $properties['subnet_size'] ) )
-
$properties['subnet_size'] = 0;
-
return $this->createObject('firewalls/'.$group_id.'/rules', new FirewallRule(), $properties);
- }
Vinnie Marone commented
Whoops, I forgot to implement this function.
I'll do that tomorrow.
Vinnie Marone commented
This has been implemented.
Good luck have fun!