Class: Fog::Compute::Cloudstack::EgressFirewallRule

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/cloudstack/models/compute/egress_firewall_rule.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



26
27
28
29
30
31
32
33
# File 'lib/fog/cloudstack/models/compute/egress_firewall_rule.rb', line 26

def destroy
  requires :id

  response = service.delete_egress_firewall_rule('id' => id )
  success_status = response['deleteegressfirewallruleresponse']['success']

  success_status == 'true'
end

#saveObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/fog/cloudstack/models/compute/egress_firewall_rule.rb', line 13

def save
  requires :protocol, :network_id

  options = {
    'protocol'    => protocol,
    'networkid'   => network_id,
    'cidrlist'    => cidr_list,
  }

  response = service.create_egress_firewall_rule(options)
  merge_attributes(response['createegressfirewallruleresponse'])
end