Class: DopCommon::InfrastructureProperties

Inherits:
Object
  • Object
show all
Includes:
HashParser, Validator
Defined in:
lib/dop_common/infrastructure_properties.rb

Instance Method Summary collapse

Methods included from HashParser

deep_symbolize_keys, hash_of_pattern_lists_valid?, is_valid_regexp?, key_aliases, load_content, load_content_valid?, parse_hash_of_pattern_lists, parse_pattern_list, pattern_list_valid?, represents_regexp?, symbolize_keys

Methods included from Validator

#log_validation_method, #set_not_valid, #try_validate_obj, #valid?

Constructor Details

#initialize(hash, parsed_infrastructure) ⇒ InfrastructureProperties

Returns a new instance of InfrastructureProperties.



10
11
12
13
# File 'lib/dop_common/infrastructure_properties.rb', line 10

def initialize(hash, parsed_infrastructure)
  @hash = symbolize_keys(hash)
  @parsed_infrastructure = parsed_infrastructure
end

Instance Method Details

#affinity_groupsObject



28
29
30
# File 'lib/dop_common/infrastructure_properties.rb', line 28

def affinity_groups
  @affinity_groups ||= affinity_groups_valid? ? @hash[:affinity_groups] : []
end

#clusterObject



45
46
47
# File 'lib/dop_common/infrastructure_properties.rb', line 45

def cluster
  @cluster ||= cluster_valid? ? @hash[:cluster] : nil
end

#datacenterObject



41
42
43
# File 'lib/dop_common/infrastructure_properties.rb', line 41

def datacenter
  @datacenter ||= datacenter_valid? ? @hash[:datacenter] : nil
end

#default_poolObject



49
50
51
# File 'lib/dop_common/infrastructure_properties.rb', line 49

def default_pool
  @default_pool ||= default_pool_valid? ? @hash[:default_pool] : nil
end

#dest_folderObject



53
54
55
# File 'lib/dop_common/infrastructure_properties.rb', line 53

def dest_folder
  @dest_folder ||= dest_folder_valid? ? @hash[:dest_folder] : nil
end

#domain_idObject



66
67
68
# File 'lib/dop_common/infrastructure_properties.rb', line 66

def domain_id
  @domain_id ||= domain_id_valid? ? create_domain_id : nil
end

#endpoint_typeObject



70
71
72
# File 'lib/dop_common/infrastructure_properties.rb', line 70

def endpoint_type
  @endpoint_type ||= endpoint_type_valid? ? create_endpoint_type : nil
end

#keep_ha?Boolean Also known as: keep_ha

Returns:

  • (Boolean)


36
37
38
# File 'lib/dop_common/infrastructure_properties.rb', line 36

def keep_ha?
  @keep_ha ||= keep_ha_valid? ? @hash[:keep_ha] : true
end

#security_groupsObject



32
33
34
# File 'lib/dop_common/infrastructure_properties.rb', line 32

def security_groups
  @security_groups ||= security_groups_valid? ? create_security_groups : @parsed_infrastructure.default_security_groups
end

#tenantObject



57
58
59
# File 'lib/dop_common/infrastructure_properties.rb', line 57

def tenant
  @tenant ||= tenant_valid? ? @hash[:tenant] : nil
end

#use_config_drive?Boolean Also known as: use_config_drive

Returns:

  • (Boolean)


61
62
63
# File 'lib/dop_common/infrastructure_properties.rb', line 61

def use_config_drive?
  @use_config_drive ||= use_config_drive_valid? ? @hash[:use_config_drive] : false
end

#validateObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/dop_common/infrastructure_properties.rb', line 15

def validate
  log_validation_method(:affinity_groups_valid?)
  log_validation_method(:keep_ha_valid?)
  log_validation_method(:datacenter_valid?)
  log_validation_method(:cluster_valid?)
  log_validation_method(:default_pool_valid?)
  log_validation_method(:dest_folder_valid?)
  log_validation_method(:tenant_valid?)
  log_validation_method(:use_config_drive_valid?)
  log_validation_method(:domain_id_valid?)
  log_validation_method(:endpoint_type_valid?)
end