Class: Ubicloud::PrivateSubnet
- Defined in:
- lib/ubicloud/model/private_subnet.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
-
#connect(subnet) ⇒ Object
Connect the given private subnet to the receiver.
-
#disconnect(subnet) ⇒ Object
Disconnect the given private subnet from the receiver.
Methods inherited from Model
[], #[], #check_exists, create, #destroy, #id, #info, #initialize, #inspect, list, #location, #name, resolve_associations, #to_h
Constructor Details
This class inherits a constructor from Ubicloud::Model
Instance Method Details
#connect(subnet) ⇒ Object
Connect the given private subnet to the receiver. Accepts either a PrivateSubnet instance or a private subnet id string. Returns self.
17 18 19 |
# File 'lib/ubicloud/model/private_subnet.rb', line 17 def connect(subnet) merge_into_values(adapter.post(_path("/connect"), "connected-subnet-ubid": to_id(subnet))) end |
#disconnect(subnet) ⇒ Object
Disconnect the given private subnet from the receiver. Accepts either a PrivateSubnet instance or a private subnet id string. Returns self.
23 24 25 26 27 |
# File 'lib/ubicloud/model/private_subnet.rb', line 23 def disconnect(subnet) subnet = to_id(subnet) check_no_slash(subnet, "invalid private subnet id format") merge_into_values(adapter.post(_path("/disconnect/#{subnet}"))) end |