Class: Fog::Openstack::Planning::Plan
Constant Summary
collapse
- MASTER_TEMPLATE_NAME =
'plan.yaml'
- ENVIRONMENT_NAME =
'environment.yaml'
Instance Attribute Summary
#project
Instance Method Summary
collapse
#initialize, #save
Instance Method Details
#add_role(role_uuid) ⇒ Object
42
43
44
|
# File 'lib/fog/openstack/models/planning/plan.rb', line 42
def add_role(role_uuid)
service.add_role_to_plan(uuid, role_uuid)
end
|
#create ⇒ Object
56
57
58
59
60
|
# File 'lib/fog/openstack/models/planning/plan.rb', line 56
def create
requires :name
merge_attributes(service.create_plan(self.attributes).body)
self
end
|
#destroy ⇒ Object
50
51
52
53
54
|
# File 'lib/fog/openstack/models/planning/plan.rb', line 50
def destroy
requires :uuid
service.delete_plan(uuid)
true
end
|
#environment ⇒ Object
28
29
30
|
# File 'lib/fog/openstack/models/planning/plan.rb', line 28
def environment
templates[ENVIRONMENT_NAME]
end
|
#master_template ⇒ Object
24
25
26
|
# File 'lib/fog/openstack/models/planning/plan.rb', line 24
def master_template
templates[MASTER_TEMPLATE_NAME]
end
|
#patch(parameters) ⇒ Object
38
39
40
|
# File 'lib/fog/openstack/models/planning/plan.rb', line 38
def patch(parameters)
service.patch_plan(uuid, parameters[:parameters]).body
end
|
#provider_resource_templates ⇒ Object
32
33
34
35
36
|
# File 'lib/fog/openstack/models/planning/plan.rb', line 32
def provider_resource_templates
templates.select do |key, template|
![MASTER_TEMPLATE_NAME, ENVIRONMENT_NAME].include?(key)
end
end
|
#remove_role(role_uuid) ⇒ Object
46
47
48
|
# File 'lib/fog/openstack/models/planning/plan.rb', line 46
def remove_role(role_uuid)
service.remove_role_from_plan(uuid, role_uuid)
end
|
#templates ⇒ Object
20
21
22
|
# File 'lib/fog/openstack/models/planning/plan.rb', line 20
def templates
service.get_plan_templates(uuid).body
end
|
#update(parameters = nil) ⇒ Object
62
63
64
65
66
|
# File 'lib/fog/openstack/models/planning/plan.rb', line 62
def update(parameters=nil)
requires :uuid
merge_attributes(service.patch_plan(uuid, parameters).body)
self
end
|