class Chef::Knife::RackspaceNetworkCreate

Public Instance Methods

run() click to toggle source
# File lib/chef/knife/rackspace_network_create.rb, line 23
def run
  if version_one?
    ui.error "Networks are not supported in v1"
    exit 1
  else
    networks_list = [
      ui.color("Label", :bold),
      ui.color("CIDR", :bold),
      ui.color("ID", :bold),
    ]
  end
  options = {}
  %i{cidr label}.each do |key|
    options[key] = config[key]
  end
  net = connection.networks.create(options)

  msg_pair("Network ID", net.id)
  msg_pair("Label", net.label)
  msg_pair("CIDR", net.cidr)
end