forked from ManageIQ/manageiq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
core.rb
75 lines (66 loc) · 2.62 KB
/
core.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
module ManagerRefresh::Inventory::Core
extend ActiveSupport::Concern
class_methods do
def provider_module
@provider_module ||= ManageIQ::Providers::Inflector.provider_module(self)
end
def has_authentications(options = {})
has_inventory({
:model_class => ::Authentication,
:manager_ref => [:manager_ref],
:inventory_object_attributes => %i(name userid type options),
}.merge(options))
end
def has_configuration_scripts(options = {})
has_inventory({
:model_class => ::ConfigurationScript,
:manager_ref => [:manager_ref],
:inventory_object_attributes => %i(name description survey_spec variables inventory_root_group authentications parent),
}.merge(options))
end
def has_configuration_script_sources(options = {})
has_inventory({
:model_class => ::ConfigurationScriptSource,
:manager_ref => [:manager_ref],
:inventory_object_attributes => %i(
name description scm_type scm_url scm_branch scm_clean scm_delete_on_update
scm_update_on_launch authentication status last_updated_on
),
}.merge(options))
end
def has_configuration_script_payloads(options = {})
has_inventory({
:model_class => ::ConfigurationScriptPayload,
:manager_ref => [:configuration_script_source, :manager_ref],
:inventory_object_attributes => %i(name),
}.merge(options))
end
def has_configuration_workflows(options = {})
has_inventory({
:model_class => ::ConfigurationWorkflow,
:manager_ref => [:manager_ref],
:inventory_object_attributes => %i(name description survey_spec variables),
}.merge(options))
end
def has_configured_systems(options = {})
has_inventory({
:model_class => ::ConfiguredSystem,
:manager_ref => [:manager_ref],
:inventory_object_attributes => %i(hostname virtual_instance_ref counterpart inventory_root_group),
}.merge(options))
end
def has_ems_folders(options = {})
has_inventory({
:model_class => ::EmsFolder,
:inventory_object_attributes => %i(name),
}.merge(options))
end
def has_vms(options = {})
has_inventory({
:model_class => ::Vm,
:manager_ref => [:uid_ems],
:inventory_object_attributes => %i(location name vendor),
}.merge(options))
end
end
end