ubicloud/cli-commands/ps/post/disconnect.rb
Jeremy Evans 949ddfcca0 Allow ps connect cli to accept location/ps-name for ps-id
We use a 404 response instead of a 400 response for invalid locations,
so update the golden files spec to support commands that should result
in 404 responses.
2025-08-21 12:41:25 -07:00

17 lines
514 B
Ruby

# frozen_string_literal: true
UbiCli.on("ps").run_on("disconnect") do
desc "Disconnect a private subnet from another private subnet"
banner "ubi ps (location/ps-name | ps-id) disconnect (location/ps-name | ps-id)"
args 1
run do |ps_id, _, cmd|
arg = ps_id
ps_id = convert_loc_name_to_id(sdk.private_subnet, ps_id)
check_no_slash(ps_id, "invalid private subnet id format", cmd)
id = sdk_object.disconnect(ps_id).id
response("Disconnected private subnet #{arg} from #{id}")
end
end