Class: Fog::Brightbox::Compute::FirewallPolicy
- Inherits:
-
Model
- Object
- Model
- Model
- Fog::Brightbox::Compute::FirewallPolicy
show all
- Defined in:
- lib/fog/brightbox/models/compute/firewall_policy.rb
Instance Method Summary
collapse
#collection_name, #resource_name
Instance Method Details
#apply_to(server_group_id) ⇒ Object
37
38
39
40
41
42
43
44
45
|
# File 'lib/fog/brightbox/models/compute/firewall_policy.rb', line 37
def apply_to(server_group_id)
requires :identity
options = {
server_group: server_group_id
}
data = service.apply_to_firewall_policy(identity, options)
merge_attributes(data)
true
end
|
#destroy ⇒ Object
57
58
59
60
61
|
# File 'lib/fog/brightbox/models/compute/firewall_policy.rb', line 57
def destroy
requires :identity
service.delete_firewall_policy(identity)
true
end
|
#remove(server_group_id) ⇒ Object
47
48
49
50
51
52
53
54
55
|
# File 'lib/fog/brightbox/models/compute/firewall_policy.rb', line 47
def remove(server_group_id)
requires :identity
options = {
server_group: server_group_id
}
data = service.remove_firewall_policy(identity, options)
merge_attributes(data)
true
end
|
#save ⇒ Object
Sticking with existing Fog behaviour, save does not update but creates a new resource
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/fog/brightbox/models/compute/firewall_policy.rb', line 25
def save
raise Fog::Errors::Error, "Resaving an existing object may create a duplicate" if persisted?
options = {
server_group: server_group_id,
name: name,
description: description
}.delete_if { |_k, v| v.nil? || v == "" }
data = service.create_firewall_policy(options)
merge_attributes(data)
true
end
|