Files
ubicloud/cli-commands/pg/post/restore.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

20 lines
489 B
Ruby

# frozen_string_literal: true
UbiCli.on("pg").run_on("restore") do
desc "Restore a PostgreSQL database backup to a new database"
banner "ubi pg (location/pg-name | pg-id) restore new-db-name restore-time"
args 2
run do |name, restore_target|
params = {
"name" => name,
"restore_target" => restore_target
}
post(pg_path("/restore"), params) do |data|
["Restored PostgreSQL database scheduled for creation with id: #{data["id"]}"]
end
end
end