For option arguments that must be members of an array, do the check in the option parsing by providing an array of allowed option arguments (e.g. vm create -s bad). Emit better errors for options arguments that should be integers (e.g. fw add-rule -s/-e), and for regular arguments that should be integers (e.g. lb create src-port/dst-port). Include help output in additional cases: * invalid id formats with slashes * invalid/duplicate/missing fields used when multiple fields separated by a comma is allowed * invalid object references when using post subcommands * invalid location for list -l option
16 lines
428 B
Ruby
16 lines
428 B
Ruby
# frozen_string_literal: true
|
|
|
|
UbiCli.on("pg").run_on("delete-firewall-rule") do
|
|
desc "Delete a PostgreSQL firewall rule"
|
|
|
|
banner "ubi pg (location/pg-name | pg-id) delete-firewall-rule rule-id"
|
|
|
|
args 1
|
|
|
|
run do |ubid, _, cmd|
|
|
check_no_slash(ubid, "invalid firewall rule id format", cmd)
|
|
sdk_object.delete_firewall_rule(ubid)
|
|
response("Firewall rule, if it exists, has been scheduled for deletion")
|
|
end
|
|
end
|