firewall_add_droplets {analogsea}R Documentation

Add/remove droplets to a firewall

Description

Add/remove droplets to a firewall

Usage

firewall_add_droplets(id, droplet_ids, ...)

firewall_remove_droplets(id, droplet_ids, ...)

Arguments

id

(character) A firewall id (not the name) to delete

droplet_ids

(integer/numeric) a vector of droplet ids

...

Options passed on to httr::POST or httr::DELETE

Examples

## Not run: 
drops <- droplets_create()
drop_ids <- vapply(drops, "[[", numeric(1), "id")
inbound <- list(list(protocol = "tcp", ports = "80", 
  sources = list(addresses = "18.0.0.0/8")))
outbound <- list(list(protocol = "tcp", ports = "80", 
  destinations = list(addresses = "0.0.0.0/0")))
res <- firewall_create("myfirewall", inbound, outbound)
firewall_add_droplets(id = res$id, droplet_ids = drop_ids)
firewalls()[[1]]$droplet_ids
firewall_remove_droplets(id = res$id, droplet_ids = drop_ids)

## End(Not run)

[Package analogsea version 1.0.3 Index]