module Cumulus::VPC::Loader

Public Class Methods

network_acl(acl_name) click to toggle source

Public: Load a network acl as a NetworkAclConfig

Returns the NetworkAclConfig

# File lib/vpc/loader/Loader.rb, line 66
def self.network_acl(acl_name)
  Common::BaseLoader::resource(acl_name, @@network_acls_dir, &NetworkAclConfig.method(:new))
end
policy(policy_name) click to toggle source

Public: Load the specified policy as a JSON object

Returns the JSON object for the policy

# File lib/vpc/loader/Loader.rb, line 36
def self.policy(policy_name)
  Common::BaseLoader::resource(policy_name, @@policies_dir) do |policy_name, policy|
    policy
  end
end
route_table(rt_name) click to toggle source

Public: Load a route table as a RouteTableConfig

Returns the RouteTableConfig

# File lib/vpc/loader/Loader.rb, line 59
def self.route_table(rt_name)
  Common::BaseLoader::resource(rt_name, @@route_tables_dir, &RouteTableConfig.method(:new))
end
subnet(subnet_name) click to toggle source

Public: Load a subnet as a SubnetConfig

Returns the SubnetConfig

# File lib/vpc/loader/Loader.rb, line 52
def self.subnet(subnet_name)
  Common::BaseLoader::resource(subnet_name, @@subnets_dir, &SubnetConfig.method(:new))
end
subnets() click to toggle source

Public: Load all subnets as SubnetConfig objects

Returns an array of SubnetConfig

# File lib/vpc/loader/Loader.rb, line 45
def self.subnets
  Common::BaseLoader::resources(@@subnets_dir, &SubnetConfig.method(:new))
end
vpc(vpc_name) click to toggle source

Public: Load a single VPC configuration

Returns a VpcConfig

# File lib/vpc/loader/Loader.rb, line 29
def self.vpc(vpc_name)
  Common::BaseLoader::resource(vpc_name, @@vpcs_dir, &VpcConfig.method(:new))
end
vpcs() click to toggle source

Public: Load all the VPC configurations as VpcConfig objects

Returns an array of VpcConfig

# File lib/vpc/loader/Loader.rb, line 22
def self.vpcs
  Common::BaseLoader::resources(@@vpcs_dir, &VpcConfig.method(:new))
end