1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-24 02:03:52 +03:00

Merge branch 'feature-3202'

This commit is contained in:
Javi Fontan 2014-10-10 15:37:50 +02:00
commit 4373f9c4c4
2 changed files with 36 additions and 3 deletions

View File

@ -82,6 +82,36 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper
# :description => "Number of addresses to reserve"
# }
GATEWAY = [
:name => "gateway",
:large => "--gateway ip",
:format => String,
:description=> "IP of the gateway"
]
NETMASK = [
:name => "netmask",
:large => "--netmask mask",
:format => String,
:description=> "Netmask in dot notation"
]
VLAN = [
:name => "vlan",
:large => "--vlan",
:description=> "Use network isolation"
]
VLAN_ID = [
:name => "vlanid",
:large => "--vlanid id",
:format => String,
:description=> "VLAN ID assigned"
]
ADDAR_OPTIONS = [
SIZE, MAC, IP, IP6_GLOBAL, IP6_ULA, GATEWAY, NETMASK, VLAN, VLAN_ID ]
def self.rname
"VNET"
end

View File

@ -112,9 +112,8 @@ cmd=CommandParser::CmdParser.new(ARGV) do
Adds an address range to the Virtual Network
EOT
command :addar, addar_desc, :vnetid, :options=>STD_OPTIONS + [OneVNetHelper::SIZE,
OneVNetHelper::MAC, OneVNetHelper::IP, OneVNetHelper::IP6_GLOBAL,
OneVNetHelper::IP6_ULA ] do
command :addar, addar_desc, :vnetid,
:options => STD_OPTIONS + OneVNetHelper::ADDAR_OPTIONS do
helper.perform_action(args[0],options,"lease added") do |vn|
ar = "AR = [ "
@ -143,6 +142,10 @@ cmd=CommandParser::CmdParser.new(ARGV) do
ar << ", MAC = " << options[:mac] if options[:mac]
ar << ", GLOBAL_PREFIX = " << options[:ip6_global] if options[:ip6_global]
ar << ", ULA_PREFIX = " << options[:ip6_ula] if options[:ip6_ula]
ar << ", GATEWAY = " << options[:gateway] if options[:gateway]
ar << ", MASK = " << options[:netmask] if options[:netmask]
ar << ", VLAN = YES" if options[:vlan]
ar << ", VLAN_ID = " << options[:vlanid] if options[:vlanid]
ar << "]"