CLI (odx)Command reference
odx firewall
Manage firewalls
odx firewall add-label
Add labels to a firewall
Usage:
odx firewall add-label [--overwrite] <firewall> <key=value>... [flags]
Flags:
-h, --help help for add-label
--overwrite overwrite labels that already existodx firewall add-rule
Add a rule to a firewall
Usage:
odx firewall add-rule --direction in|out --protocol <protocol> [options] <firewall> [flags]
Examples:
odx firewall add-rule --direction in --protocol tcp --port 443 --source-ips 0.0.0.0/0,::/0 web
Flags:
--description string rule description
--destination-ips strings destination CIDRs (outgoing rules, repeatable)
--direction string in or out (required)
-h, --help help for add-rule
--no-wait do not wait for the action to finish
--port string port or range, e.g. 80 or 1000-2000 (tcp and udp)
--protocol string tcp, udp, icmp, esp or gre (required)
--source-ips strings source CIDRs (incoming rules, repeatable)odx firewall apply-to-resource
Apply a firewall to a server or a label selector
Usage:
odx firewall apply-to-resource --type server|label_selector (--server <server> | --label-selector <selector>) <firewall> [flags]
Flags:
-h, --help help for apply-to-resource
-l, --label-selector string label selector (with --type label_selector)
--no-wait do not wait for the action to finish
--server string server name or ID (with --type server)
--type string resource type: server or label_selector (required)odx firewall create
Create a firewall
Usage:
odx firewall create --name <name> [--rules-file <file>] [flags]
Examples:
odx firewall create --name web --rules-file rules.json
rules.json:
[{"direction": "in", "protocol": "tcp", "port": "22", "source_ips": ["0.0.0.0/0", "::/0"]}]
Flags:
-h, --help help for create
--label stringArray label key=value (repeatable)
--name string firewall name (required)
--no-wait do not wait for the action to finish
--rules-file string JSON file with rules (use - for stdin)odx firewall delete
Delete one or more firewalls
Usage:
odx firewall delete <firewall>... [flags]
Flags:
-h, --help help for delete
--no-wait do not wait for the action to finishodx firewall delete-rule
Delete a rule from a firewall
Usage:
odx firewall delete-rule --direction in|out --protocol <protocol> [options] <firewall> [flags]
Flags:
--description string rule description
--destination-ips strings destination CIDRs (outgoing rules, repeatable)
--direction string in or out (required)
-h, --help help for delete-rule
--no-wait do not wait for the action to finish
--port string port or range, e.g. 80 or 1000-2000 (tcp and udp)
--protocol string tcp, udp, icmp, esp or gre (required)
--source-ips strings source CIDRs (incoming rules, repeatable)odx firewall describe
Describe a firewall
Usage:
odx firewall describe <firewall> [flags]
Flags:
-h, --help help for describe
-o, --output stringArray output format: json or yamlodx firewall list
List firewalls.
Columns: age, applied_to_count, created, id, labels, name, rules_count
Usage:
odx firewall list [options] [flags]
Aliases:
list, ls
Flags:
-h, --help help for list
-o, --output stringArray output format: json, yaml, noheader, columns=a,b,c (repeatable)
-l, --selector string label selector, e.g. env=prod,!tmpodx firewall remove-from-resource
Remove a firewall from a server or a label selector
Usage:
odx firewall remove-from-resource --type server|label_selector (--server <server> | --label-selector <selector>) <firewall> [flags]
Flags:
-h, --help help for remove-from-resource
-l, --label-selector string label selector (with --type label_selector)
--no-wait do not wait for the action to finish
--server string server name or ID (with --type server)
--type string resource type: server or label_selector (required)odx firewall remove-label
Remove labels from a firewall
Usage:
odx firewall remove-label <firewall> (--all | <key>...) [flags]
Flags:
-a, --all remove all labels
-h, --help help for remove-labelodx firewall replace-rules
Replace all rules of a firewall
Usage:
odx firewall replace-rules --rules-file <file> <firewall> [flags]
Flags:
-h, --help help for replace-rules
--no-wait do not wait for the action to finish
--rules-file string JSON file with rules (use - for stdin, required)odx firewall update
Update a firewall
Usage:
odx firewall update --name <name> <firewall> [flags]
Flags:
-h, --help help for update
--name string new name