Module: GClouder::Resources::Compute::Networks::Subnets::Local

Includes:
Logging
Defined in:
lib/gclouder/resources/compute/networks/subnets.rb

Class Method Summary collapse

Methods included from Logging

#add, #bad, #change, #debug, #error, #fatal, #good, included, #info, log, loggers, #remove, report, #resource_state, setup, #warn, #warning

Class Method Details

.instancesObject



64
65
66
# File 'lib/gclouder/resources/compute/networks/subnets.rb', line 64

def self.instances
  Resources::Region.instances(path: ["subnets"])
end

.listObject



52
53
54
# File 'lib/gclouder/resources/compute/networks/subnets.rb', line 52

def self.list
  instances
end

.networksObject



68
69
70
71
72
# File 'lib/gclouder/resources/compute/networks/subnets.rb', line 68

def self.networks
  collection = { "global" => [] }
  list.each { |_region, subnets| subnets.each { |subnet| collection["global"].push({ "name" => subnet["network"] }) } }
  collection.delete_if { |_k, v| v.empty? }
end

.sectionObject



48
49
50
# File 'lib/gclouder/resources/compute/networks/subnets.rb', line 48

def self.section
  ["compute", "networks", "subnets"]
end

.validateObject



56
57
58
59
60
61
62
# File 'lib/gclouder/resources/compute/networks/subnets.rb', line 56

def self.validate
  Resources::Validate::Region.instances(
    instances,
    required_keys:  GClouder::Config::Arguments.required(section),
    permitted_keys: GClouder::Config::Arguments.permitted(section)
  )
end