Files
ubicloud/cli-commands/pg/post/add-firewall-rule.rb
Jeremy Evans c723771550 Remove custom invalid args messages from CLI
These were not used consistently, only for some vm and pg commands.
They made sense to have before we started including help output
with errors.  However, now that we show help output with errors,
it's easy to see the usage to determine what args are expected.
2025-03-19 14:08:49 -07:00

16 lines
397 B
Ruby

# frozen_string_literal: true
UbiCli.on("pg").run_on("add-firewall-rule") do
desc "Add a PostgreSQL firewall rule"
banner "ubi pg (location/pg-name | pg-id) add-firewall-rule cidr"
args 1
run do |cidr|
post(pg_path("/firewall-rule"), "cidr" => cidr) do |data|
["Firewall rule added to PostgreSQL database.\n rule id: #{data["id"]}, cidr: #{data["cidr"]}"]
end
end
end