Class: Fog::Terremark::Shared::InternetService
- Inherits:
-
Model
- Object
- Model
- Fog::Terremark::Shared::InternetService
- Defined in:
- lib/fog/terremark/models/shared/internetservice.rb
Instance Method Summary collapse
Instance Method Details
#destroy(delete_public_ip = true) ⇒ Object
16 17 18 19 20 |
# File 'lib/fog/terremark/models/shared/internetservice.rb', line 16 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
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 50 51 |
# File 'lib/fog/terremark/models/shared/internetservice.rb', line 22 def save requires :Name, :Protocol, :Port if not 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 |