Skip to content

script commands

Yann Hervé edited this page Nov 23, 2018 · 4 revisions

So far we have seen how to describe resource elements and resource relationship using hnames.

Now we need to see how to manipulate these resource elements, that is: create them, update them and delete them.

script keywords

  • resource: create a resource (single_fw, policy...)
  • delete: delete a resource
  • update: update a resource
  • command: send a command to a resource

example

  • create a zone, a network and a router
  • delete the network we've just created
  • update the router to change its ip address
  • finally push the new configuration to a firewall using upload
    resource {
        interface_zone MGMT {}
    }

    resource {
        network mgtnw1 {ipv4_network = 192.168.100.0/24}
    }
    resource {
        router mgtnw1_router {address = 192.168.100.1}
    }

    delete "#network/mgtnw1";

    update "#router/mgtnw1_router" {
        set {
            address=192.168.100.254
        }
    }

    command "upload" {
         target="#single_fw/${fwname}"
         params.filter "${policy}";
     }

Clone this wiki locally