ubicloud/cli-commands/ps/post/connect.rb
Jeremy Evans 21128e2d8f Do not require location name when connecting/disconnecting subnets
Subnets must now be in the same location, so the location name would
be redundant.  Make the ps connect/disconnect similar to other cli
commands and no longer require the location name.

This removes the last remaining use of the convert_loc_name_to_id
helper method. All cli use allowing referencing objects by name
instead id now only supports objects in the same location.
2025-10-02 17:21:27 -07:00

14 lines
375 B
Ruby

# frozen_string_literal: true
UbiCli.on("ps").run_on("connect") do
desc "Connect a private subnet to another private subnet"
banner "ubi ps (location/ps-name | ps-id) connect (ps-name | ps-id)"
args 1
run do |ps_id|
id = sdk_object.connect(convert_name_to_id(sdk.private_subnet, ps_id)).id
response("Connected private subnet #{ps_id} to #{id}")
end
end