module GClouder::Resources::Compute::Networks::Subnets

Public Class Methods

check() click to toggle source
# File lib/gclouder/resources/compute/networks/subnets.rb, line 38
def self.check
  return if Remote.list.empty?
  return if Local.list.empty?
  header :check
  Resources::Validate::Remote.instances(Local.list, Remote.list)
end
ensure() click to toggle source
# File lib/gclouder/resources/compute/networks/subnets.rb, line 24
def self.ensure
  return if Local.list.empty?
  header

  Local.list.each do |region, subnets|
    next if subnets.empty?
    info region, heading: true, indent: 2
    info
    subnets.each do |subnet|
      Subnet.ensure(region, subnet["network"], subnet["name"], subnet["range"])
    end
  end
end
header(stage = :ensure) click to toggle source
# File lib/gclouder/resources/compute/networks/subnets.rb, line 14
def self.header(stage = :ensure)
  info "[#{stage}] compute / network / subnet", title: true
end
validate() click to toggle source
# File lib/gclouder/resources/compute/networks/subnets.rb, line 18
def self.validate
  return if Local.list.empty?
  header :validate
  Local.validate
end