Sha256: 3e8ede6944c588460af1adc41261ed2eff064daf546a62c300626bbb1ae71859
Contents?: true
Size: 1.46 KB
Versions: 10
Compression:
Stored size: 1.46 KB
Contents
require "fog/brightbox/model" module Fog module Compute class Brightbox class FirewallRule < Fog::Brightbox::Model identity :id attribute :url attribute :resource_type attribute :description attribute :source attribute :source_port attribute :destination attribute :destination_port attribute :protocol attribute :icmp_type_name attribute :created_at, :type => :time attribute :firewall_policy_id, :aliases => "firewall_policy", :squash => "id" # Sticking with existing Fog behaviour, save does not update but creates a new resource def save raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? requires :firewall_policy_id options = { :firewall_policy => firewall_policy_id, :protocol => protocol, :description => description, :source => source, :source_port => source_port, :destination => destination, :destination_port => destination_port, :icmp_type_name => icmp_type_name }.delete_if { |k, v| v.nil? || v == "" } data = service.create_firewall_rule(options) merge_attributes(data) true end def destroy requires :identity service.destroy_firewall_rule(identity) true end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems