Module: Puppet_X::EnterpriseModules::Oci::ModelAdditions
- Defined in:
- lib/puppet_x/enterprisemodules/oci/model_additions.rb
Overview
Docs
Instance Method Summary collapse
- #compartment? ⇒ Boolean
- #id_type ⇒ Object
- #present? ⇒ Boolean
-
#puppet_name ⇒ Object
The name puppet uses.
Instance Method Details
#compartment? ⇒ Boolean
12 13 14 |
# File 'lib/puppet_x/enterprisemodules/oci/model_additions.rb', line 12 def compartment? id_type == :compartment || id_type == :tenancy end |
#id_type ⇒ Object
8 9 10 |
# File 'lib/puppet_x/enterprisemodules/oci/model_additions.rb', line 8 def id_type id.scan(/ocid1\.(\w*)\./).first.first.to_sym end |
#present? ⇒ Boolean
31 32 33 34 35 |
# File 'lib/puppet_x/enterprisemodules/oci/model_additions.rb', line 31 def present? return true unless respond_to?(:lifecycle_state) %w[PROVISIONING SCALING AVAILABLE RUNNING ACTIVE ATTACHED ATTACHING ENABLED].include?(lifecycle_state) end |
#puppet_name ⇒ Object
The name puppet uses
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/puppet_x/enterprisemodules/oci/model_additions.rb', line 19 def puppet_name if respond_to?(:name) name elsif respond_to?(:display_name) display_name elsif respond_to?(:hostname) hostname else 'unknown name' end end |