lib/dcmgr.rb in wakame-vdc-dcmgr-11.06.0 vs lib/dcmgr.rb in wakame-vdc-dcmgr-11.12.0

- old
+ new

@@ -80,69 +80,61 @@ module Models class InvalidUUIDError < StandardError; end class UUIDPrefixDuplication < StandardError; end autoload :Base, 'dcmgr/models/base' - CREATE_TABLE_CLASSES=[:Account,:Tag,:TagMapping,:FrontendSystem, - :Image,:HostPool,:RequestLog,:Instance, - :NetfilterGroup, :NetfilterRule, - :StoragePool,:Volume,:VolumeSnapshot, - :InstanceNetfilterGroup, - :InstanceSpec, :InstanceNic, :Network, :IpLease, - :SshKeyPair, :History, :HostnameLease, :MacLease, - :VlanLease, :Quota - ].freeze autoload :BaseNew, 'dcmgr/models/base_new' autoload :Account, 'dcmgr/models/account' autoload :Tag, 'dcmgr/models/tag' autoload :TagMapping, 'dcmgr/models/tag_mapping' autoload :AccountResource, 'dcmgr/models/account_resource' autoload :Instance, 'dcmgr/models/instance' autoload :Image, 'dcmgr/models/image' - autoload :HostPool, 'dcmgr/models/host_pool' + autoload :HostNode, 'dcmgr/models/host_node' autoload :RequestLog, 'dcmgr/models/request_log' autoload :FrontendSystem, 'dcmgr/models/frontend_system' - autoload :StoragePool, 'dcmgr/models/storage_pool' + autoload :StorageNode, 'dcmgr/models/storage_node' autoload :Volume, 'dcmgr/models/volume' autoload :VolumeSnapshot, 'dcmgr/models/volume_snapshot' - autoload :NetfilterGroup, 'dcmgr/models/netfilter_group' - autoload :NetfilterRule, 'dcmgr/models/netfilter_rule' + autoload :SecurityGroup, 'dcmgr/models/security_group' + autoload :SecurityGroupRule, 'dcmgr/models/security_group_rule' autoload :InstanceSpec, 'dcmgr/models/instance_spec' autoload :InstanceNic, 'dcmgr/models/instance_nic' autoload :Network, 'dcmgr/models/network' autoload :IpLease, 'dcmgr/models/ip_lease' - autoload :InstanceNetfilterGroup, 'dcmgr/models/instance_netfilter_group' + autoload :InstanceSecurityGroup, 'dcmgr/models/instance_security_group' autoload :SshKeyPair, 'dcmgr/models/ssh_key_pair' autoload :History, 'dcmgr/models/history' autoload :HostnameLease, 'dcmgr/models/hostname_lease' autoload :MacLease, 'dcmgr/models/mac_lease' autoload :VlanLease, 'dcmgr/models/vlan_lease' autoload :Quota, 'dcmgr/models/quota' + autoload :DhcpRange, 'dcmgr/models/dhcp_range' + autoload :PhysicalNetwork, 'dcmgr/models/physical_network' end module Endpoints autoload :CoreAPI, 'dcmgr/endpoints/core_api' - autoload :Metadata, 'dcmgr/endpoints/metadata' + autoload :Ec2Metadata, 'dcmgr/endpoints/metadata' end module NodeModules autoload :StaCollector, 'dcmgr/node_modules/sta_collector' + autoload :StaTgtInitializer, 'dcmgr/node_modules/sta_tgt_initializer' autoload :HvaCollector, 'dcmgr/node_modules/hva_collector' autoload :InstanceHA, 'dcmgr/node_modules/instance_ha' + autoload :OpenFlowController, 'dcmgr/node_modules/openflow_controller' autoload :ServiceNetfilter, 'dcmgr/node_modules/service_netfilter' + autoload :ServiceOpenFlow, 'dcmgr/node_modules/service_openflow' autoload :InstanceMonitor, 'dcmgr/node_modules/instance_monitor' + autoload :Scheduler, 'dcmgr/node_modules/scheduler' end - module Stm - autoload :VolumeContext, 'dcmgr/stm/volume_context' - autoload :SnapshotContext, 'dcmgr/stm/snapshot_context' - autoload :Instance, 'dcmgr/stm/instance' - end - module Helpers autoload :CliHelper, 'dcmgr/helpers/cli_helper' autoload :NicHelper, 'dcmgr/helpers/nic_helper' + autoload :SnapshotStorageHelper, 'dcmgr/helpers/snapshot_storage_helper' end autoload :Tags, 'dcmgr/tags' module Cli @@ -155,18 +147,19 @@ autoload :AccountCli, 'dcmgr/cli/account' autoload :UsersCli, 'dcmgr/cli/user' autoload :Vlan, 'dcmgr/cli/vlan' autoload :Image, 'dcmgr/cli/image' autoload :KeyPair, 'dcmgr/cli/keypair' - autoload :Group, 'dcmgr/cli/group' + autoload :SecurityGroup, 'dcmgr/cli/security_group' autoload :Spec, 'dcmgr/cli/spec' autoload :Tag, 'dcmgr/cli/tag' autoload :Quota, 'dcmgr/cli/quota' end module Rpc autoload :HvaHandler, 'dcmgr/rpc/hva_handler' + autoload :StaHandler, 'dcmgr/rpc/sta_handler' autoload :KvmHelper, 'dcmgr/rpc/hva_handler' end # namespace for custom Rack HTTP middleware. module Rack @@ -174,14 +167,98 @@ autoload :RunInitializer, 'dcmgr/rack/run_initializer' end module Drivers autoload :SnapshotStorage, 'dcmgr/drivers/snapshot_storage' + autoload :LocalStorage, 'dcmgr/drivers/local_storage' autoload :S3Storage, 'dcmgr/drivers/s3_storage' autoload :IIJGIOStorage, 'dcmgr/drivers/iijgio_storage' autoload :Hypervisor, 'dcmgr/drivers/hypervisor' autoload :Kvm , 'dcmgr/drivers/kvm' autoload :Lxc , 'dcmgr/drivers/lxc' + autoload :BackingStore, 'dcmgr/drivers/backing_store' + autoload :Zfs, 'dcmgr/drivers/zfs' + autoload :Raw, 'dcmgr/drivers/raw' + autoload :IscsiTarget, 'dcmgr/drivers/iscsi_target' + autoload :SunIscsi, 'dcmgr/drivers/sun_iscsi' + autoload :LinuxIscsi, 'dcmgr/drivers/linux_iscsi' + autoload :Comstar, 'dcmgr/drivers/comstar' end autoload :StorageService, 'dcmgr/storage_service' + + require 'dcmgr/scheduler' + module Scheduler + module StorageNode + autoload :FindFirst, 'dcmgr/scheduler/storage_node/find_first' + autoload :LeastUsage, 'dcmgr/scheduler/storage_node/least_usage' + end + module HostNode + autoload :FindFirst, 'dcmgr/scheduler/host_node/find_first' + autoload :LeastUsage, 'dcmgr/scheduler/host_node/least_usage' + autoload :ExcludeSame, 'dcmgr/scheduler/host_node/exclude_same' + autoload :SpecifyNode, 'dcmgr/scheduler/host_node/specify_node' + end + module Network + autoload :FlatSingle, 'dcmgr/scheduler/network/flat_single' + autoload :NatOneToOne, 'dcmgr/scheduler/network/nat_one_to_one' + autoload :VifTemplate, 'dcmgr/scheduler/network/vif_template' + autoload :PerInstance, 'dcmgr/scheduler/network/per_instance' + end + end + + require 'dcmgr/vnet' + module VNet + autoload :ControllerFactory, 'dcmgr/vnet/factories' + autoload :IsolatorFactory, 'dcmgr/vnet/factories' + autoload :TaskFactory, 'dcmgr/vnet/factories' + autoload :TaskManagerFactory, 'dcmgr/vnet/factories' + + module Netfilter + autoload :NetfilterCache, 'dcmgr/vnet/netfilter/cache' + autoload :NetfilterController, 'dcmgr/vnet/netfilter/controller' + autoload :Chain, 'dcmgr/vnet/netfilter/chain' + autoload :IptablesChain, 'dcmgr/vnet/netfilter/chain' + autoload :EbtablesChain, 'dcmgr/vnet/netfilter/chain' + autoload :EbtablesRule, 'dcmgr/vnet/netfilter/ebtables_rule' + autoload :IptablesRule, 'dcmgr/vnet/netfilter/iptables_rule' + autoload :NetfilterTaskManager, 'dcmgr/vnet/netfilter/task_manager' + autoload :VNicProtocolTaskManager, 'dcmgr/vnet/netfilter/task_manager' + end + + module Tasks + autoload :AcceptAllDNS, 'dcmgr/vnet/tasks/accept_all_dns' + autoload :AcceptArpBroadcast, 'dcmgr/vnet/tasks/accept_arp_broadcast' + autoload :AcceptARPFromFriends, 'dcmgr/vnet/tasks/accept_arp_from_friends' + autoload :AcceptARPFromGateway, 'dcmgr/vnet/tasks/accept_arp_from_gateway' + autoload :AcceptARPToHost, 'dcmgr/vnet/tasks/accept_arp_to_host' + autoload :AcceptIpFromFriends, 'dcmgr/vnet/tasks/accept_ip_from_friends' + autoload :AcceptIpFromGateway, 'dcmgr/vnet/tasks/accept_ip_from_gateway' + autoload :AcceptIpToAnywhere, 'dcmgr/vnet/tasks/accept_ip_to_anywhere' + autoload :AcceptRelatedEstablished, 'dcmgr/vnet/tasks/accept_related_established' + autoload :AcceptTcpRelatedEstablished, 'dcmgr/vnet/tasks/accept_related_established' + autoload :AcceptUdpEstablished, 'dcmgr/vnet/tasks/accept_related_established' + autoload :AcceptIcmpRelatedEstablished, 'dcmgr/vnet/tasks/accept_related_established' + autoload :AcceptWakameDHCPOnly, 'dcmgr/vnet/tasks/accept_wakame_dhcp_only' + autoload :AcceptWakameDNSOnly, 'dcmgr/vnet/tasks/accept_wakame_dns_only' + autoload :DebugIptables, 'dcmgr/vnet/tasks/debug_iptables' + autoload :DropArpForwarding, 'dcmgr/vnet/tasks/drop_arp_forwarding' + autoload :DropArpToHost, 'dcmgr/vnet/tasks/drop_arp_to_host' + autoload :DropIpFromAnywhere, 'dcmgr/vnet/tasks/drop_ip_from_anywhere' + autoload :DropIpSpoofing, 'dcmgr/vnet/tasks/drop_ip_spoofing' + autoload :DropMacSpoofing, 'dcmgr/vnet/tasks/drop_mac_spoofing' + autoload :ExcludeFromNat, 'dcmgr/vnet/tasks/exclude_from_nat' + autoload :ExcludeFromNatIpSet, 'dcmgr/vnet/tasks/exclude_from_nat' + autoload :SecurityGroup, 'dcmgr/vnet/tasks/security_group' + autoload :StaticNat, 'dcmgr/vnet/tasks/static_nat' + autoload :StaticNatLog, 'dcmgr/vnet/tasks/static_nat' + autoload :TranslateMetadataAddress, 'dcmgr/vnet/tasks/translate_metadata_address' + end + + module Isolators + autoload :BySecurityGroup, 'dcmgr/vnet/isolators/by_securitygroup' + autoload :DummyIsolator, 'dcmgr/vnet/isolators/dummy' + end + + end + end