src/Actions/ManagesFirewallRules.php
public function createFirewallRule($serverId, array $data, $wait = true)
    {
        $rule = $this->post("servers/$serverId/firewall-rules", $data)['rule'];

        if ($wait) {
            return $this->retry($this->getTimeout(), function () use ($serverId, $rule) {
                $rule = $this->firewallRule($serverId, $rule['id']);

                return $rule->status == 'installed' ? $rule : null;
            });
        }

        return new FirewallRule($rule + ['server_id' => $serverId], $this);
    }
public function createFirewallRule($serverId, array $data, $wait = true)
    {
        $rule = $this->post("servers/$serverId/firewall-rules", $data)['rule'];

        if ($wait) {
            return $this->retry($this->getTimeout(), function () use ($serverId, $rule) {
                $rule = $this->firewallRule($serverId, $rule['id']);

                return $rule->status == 'installed' ? $rule : null;
            });
        }

        return new FirewallRule($rule + ['server_id' => $serverId], $this);
    }
public function createFirewallRule ( $ serverId , array $ data , $ wait = true ) { $ rule = $ this -> post ( "servers/$serverId/firewall-rules" , $ data ) [ 'rule' ] ; if ( $ wait ) { return $ this -> retry ( $ this -> getTimeout ( ) , function ( ) use ( $ serverId , $ rule ) { $ rule = $ this -> firewallRule ( $ serverId , $ rule [ 'id' ] ) ; return $ rule -> status == 'installed' ? $ rule : null ; } ) ; } return new FirewallRule ( $ rule + [ 'server_id' => $ serverId ] , $ this ) ; }
Create a new firewall rule.

@param  integer $serverId
@param  array $data
@param  boolean $wait
@return FirewallRule
Create a new firewall rule .