Files
ubicloud/cli-commands/pg/post/reset-superuser-password.rb
Jeremy Evans e90e6deaf7 Reimplement CLI processing using the Ruby SDK
This changes the custom code in UbiCli and the cli-commands files to use
the Ruby SDK for all changes.  This is slightly slower, but allows for
testing Ruby SDK using the existing tests for the CLI.

The only spec change is to an error message, and the error message is now
more helpful.

As the Ruby SDK uses symbol keys instead of string keys, this switches
UbiCli and the cli-commands files to also use symbol keys.

This adds an UbiCli#check_no_slash helper method to DRY up code that
checks for slashes in strings used as path fragments.
2025-03-28 16:25:47 -07:00

15 lines
422 B
Ruby

# frozen_string_literal: true
UbiCli.on("pg").run_on("reset-superuser-password") do
desc "Reset the superuser password for a PostgreSQL database"
banner "ubi pg (location/pg-name | pg-id) reset-superuser-password new-password"
args 1
run do |password|
id = sdk_object.reset_superuser_password(password).id
response("Superuser password reset scheduled for PostgreSQL database with id: #{id}")
end
end