Class: Fog::Compute::Terremark::InternetService
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Terremark::InternetService
- Defined in:
- lib/fog/compute/terremark/models/internetservice.rb
Instance Method Summary collapse
Instance Method Details
#destroy(delete_public_ip = true) ⇒ Object
14 15 16 17 18 |
# File 'lib/fog/compute/terremark/models/internetservice.rb', line 14 def destroy(delete_public_ip = true) service.delete_internet_service(self.Id) service.delete_public_ip(self.PublicIpAddress["Id"]) if delete_public_ip true end |
#save ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fog/compute/terremark/models/internetservice.rb', line 20 def save requires :Name, :Protocol, :Port if !public_ip_address_id #Create the first internet service and allocate public IP data = service.create_internet_service( vdc = service.default_vdc_id, name = self.Name, protocol = self.Protocol, port = self.Port, = { "Enabled" => "true", "Description" => self.Name } ) else #create additional services to existing Public IP data = service.add_internet_service( ip_id = public_ip_address_id, name = self.Name, protocol = self.Protocol, port = self.Port, = { "Enabled" => "true", "Description" => self.Name } ) end merge_attributes(data.body) true end |