Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B #2416: onevcenter tool improvements and fixes #2418

Merged
merged 1 commit into from
Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/cli/one_helper/onevcenter_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def show_header(vcenter_host)
# @param type [String] String representing the vCenter resource
#
def set_object(type)
raise "you need to use -o option!" unless type

type = type.downcase
if (type == "datastores")
@vobject = VOBJECT::DATASTORE
Expand Down
30 changes: 28 additions & 2 deletions src/cli/onevcenter
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
:short => "-o object",
:large => "--object object ",
:format => String,
:description => "vCenter object"
:description => "vCenter object: [datastores, templates, networks, datastores, images]"
}

HOST = {
Expand Down Expand Up @@ -128,8 +128,16 @@ cmd=CommandParser::CmdParser.new(ARGV) do
############################################################################
list_desc = <<-EOT.unindent
Show a list with unimported vCenter objects
EOT

Examples:
- listing available templates:

onevcenter list -o templates -h <host_id>

- listing available images:

onevcenter list -o datastores -h <host_id> -d <ds-img_id>
EOT
command :list, list_desc, :options=>[ OBJECT, HOST, DATASTORE, VCENTER, USER, PASS ] do
begin
args = helper.parse_opts(options)
Expand All @@ -148,6 +156,19 @@ cmd=CommandParser::CmdParser.new(ARGV) do

import_desc = <<-EOT.unindent
Import the the desired vCenter object

Examples:
- importing first datastore

onevcenter list -o templates -h <host_id>

- importing 2 concrete templates:

onevcenter import "vm-1252, vm-553, vm-1248" -o templates -h <host_id>

- importing a image range:

onevcenter import 0..10 -o images -h <host_id> -d <ds-img_id>
EOT

command :import, import_desc, [:oid, nil], :options=>[ OBJECT, HOST, DATASTORE ] do
Expand Down Expand Up @@ -194,6 +215,11 @@ cmd=CommandParser::CmdParser.new(ARGV) do
############################################################################
host_desc = <<-EOT.unindent
Import vCenter clusters as OpenNebula hosts

Example:
- Get available clusters:

onevcenter hosts --vcenter <vcenter> --vuser <vcenter_user> --vpass <password>
EOT
command :hosts, host_desc, :options=>[ VCENTER, USER, PASS, USE_DEFAULTS ] do
con_ops = helper.connection_options("Hosts", options)
Expand Down