Class: Fog::Compute::AWS::DhcpOption
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::AWS::DhcpOption
- Defined in:
- lib/fog/aws/models/compute/dhcp_option.rb
Instance Method Summary collapse
-
#associate(vpc_id) ⇒ Object
Associates an existing dhcp configration set with a VPC.
-
#destroy ⇒ Object
Removes an existing dhcp configuration set.
-
#initialize(attributes = {}) ⇒ DhcpOption
constructor
A new instance of DhcpOption.
-
#save ⇒ Object
Create a dhcp configuration set.
Constructor Details
#initialize(attributes = {}) ⇒ DhcpOption
Returns a new instance of DhcpOption.
11 12 13 |
# File 'lib/fog/aws/models/compute/dhcp_option.rb', line 11 def initialize(attributes={}) super end |
Instance Method Details
#associate(vpc_id) ⇒ Object
Associates an existing dhcp configration set with a VPC
dhcp_option.attach(dopt-id, vpc-id)
Returns
True or false depending on the result
23 24 25 26 27 |
# File 'lib/fog/aws/models/compute/dhcp_option.rb', line 23 def associate(vpc_id) requires :id service.(id, vpc_id) reload end |
#destroy ⇒ Object
Removes an existing dhcp configuration set
dhcp_option.destroy
Returns
True or false depending on the result
38 39 40 41 42 |
# File 'lib/fog/aws/models/compute/dhcp_option.rb', line 38 def destroy requires :id service.(id) true end |
#save ⇒ Object
Create a dhcp configuration set
>> g = AWS.dhcp_options.new()
>> g.save
Returns:
requestId and a dhcpOptions object
54 55 56 57 58 59 60 61 62 |
# File 'lib/fog/aws/models/compute/dhcp_option.rb', line 54 def save requires :dhcp_configuration_set data = service.(dhcp_configuration_set).body['dhcpOptionsSet'].first new_attributes = data.reject {|key,value| key == 'requestId'} merge_attributes(new_attributes) true true end |