API Docs

This functionality of the Ubiquity API has been disabled. Looking for information on this transition to LeaseWeb? Click here for answers to FAQs and here for information on the LeaseWeb customer portal. Click here for information about the Leaseweb API.

Get to know fw_profile_apply

Overview: Applies a firewall profile to an indicated VM.

fw_profile_apply expects the following parameters:

  • vm_id - The identifier of the VM.
  • profile_id - The identifier of the firewall profile.

Example:

$params = array(
    'vm_id'         => 100987,
    'profile_id'    => 77
);
$api->call('cloud.fw_profile_apply', $params);

Output:

Array
(
    [profile_id] => 77
    [rules] => Array
        (
            [0] => Array
                (
                    [direction] => ingress
                    [remote_ip_prefix] => 0.0.0.0/0
                    [protocol] => TCP
                    [port_range_max] => 70
                    [port_range_min] => 70
                )

            [1] => Array
                (
                    [direction] => ingress
                    [remote_ip_prefix] =>
                    [protocol] =>
                    [port_range_max] =>
                    [port_range_min] =>
                )

            [2] => Array
                (
                    [direction] => egress
                    [remote_ip_prefix] => 169.254.169.254/32
                    [protocol] => TCP
                    [port_range_max] => 80
                    [port_range_min] => 80
                )

            [3] => Array
                (
                    [direction] => egress
                    [remote_ip_prefix] =>
                    [protocol] =>
                    [port_range_max] =>
                    [port_range_min] =>
                )

            [4] => Array
                (
                    [direction] => ingress
                    [remote_ip_prefix] => 169.254.169.254/32
                    [protocol] => TCP
                    [port_range_max] => 80
                    [port_range_min] => 80
                )

        )

)