crowbar-client 2.4.1 → 2.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +18 -6
- data/lib/crowbar/client.rb +54 -0
- data/lib/crowbar/client/app.rb +3 -0
- data/lib/crowbar/client/app/backup.rb +62 -1
- data/lib/crowbar/client/app/barclamp.rb +10 -0
- data/lib/crowbar/client/app/base.rb +50 -0
- data/lib/crowbar/client/app/batch.rb +25 -0
- data/lib/crowbar/client/app/entry.rb +26 -1
- data/lib/crowbar/client/app/host_ip.rb +24 -0
- data/lib/crowbar/client/app/installer.rb +16 -1
- data/lib/crowbar/client/app/interface.rb +21 -0
- data/lib/crowbar/client/app/network.rb +3 -0
- data/lib/crowbar/client/app/node.rb +3 -0
- data/lib/crowbar/client/app/proposal.rb +3 -0
- data/lib/crowbar/client/app/repository.rb +3 -0
- data/lib/crowbar/client/app/role.rb +3 -0
- data/lib/crowbar/client/app/server.rb +56 -0
- data/lib/crowbar/client/app/virtual_ip.rb +24 -0
- data/lib/crowbar/client/command.rb +3 -0
- data/lib/crowbar/client/command/backup.rb +3 -0
- data/lib/crowbar/client/command/backup/create.rb +3 -0
- data/lib/crowbar/client/command/backup/delete.rb +3 -0
- data/lib/crowbar/client/command/backup/download.rb +3 -0
- data/lib/crowbar/client/command/backup/list.rb +3 -0
- data/lib/crowbar/client/command/backup/restore.rb +3 -0
- data/lib/crowbar/client/command/backup/upload.rb +3 -0
- data/lib/crowbar/client/command/barclamp.rb +3 -0
- data/lib/crowbar/client/command/barclamp/list.rb +3 -0
- data/lib/crowbar/client/command/base.rb +3 -0
- data/lib/crowbar/client/command/batch.rb +3 -0
- data/lib/crowbar/client/command/batch/build.rb +3 -0
- data/lib/crowbar/client/command/batch/export.rb +3 -0
- data/lib/crowbar/client/command/host_ip.rb +3 -0
- data/lib/crowbar/client/command/host_ip/allocate.rb +3 -0
- data/lib/crowbar/client/command/host_ip/deallocate.rb +3 -0
- data/lib/crowbar/client/command/installer.rb +3 -0
- data/lib/crowbar/client/command/installer/start.rb +3 -0
- data/lib/crowbar/client/command/installer/status.rb +3 -0
- data/lib/crowbar/client/command/interface.rb +3 -0
- data/lib/crowbar/client/command/interface/disable.rb +3 -0
- data/lib/crowbar/client/command/interface/enable.rb +3 -0
- data/lib/crowbar/client/command/node.rb +3 -0
- data/lib/crowbar/client/command/node/allocate.rb +4 -1
- data/lib/crowbar/client/command/node/delete.rb +3 -0
- data/lib/crowbar/client/command/node/group.rb +3 -0
- data/lib/crowbar/client/command/node/hardware.rb +4 -1
- data/lib/crowbar/client/command/node/identify.rb +4 -1
- data/lib/crowbar/client/command/node/list.rb +3 -0
- data/lib/crowbar/client/command/node/powercycle.rb +4 -1
- data/lib/crowbar/client/command/node/poweroff.rb +4 -1
- data/lib/crowbar/client/command/node/poweron.rb +4 -1
- data/lib/crowbar/client/command/node/reboot.rb +4 -1
- data/lib/crowbar/client/command/node/reinstall.rb +4 -1
- data/lib/crowbar/client/command/node/rename.rb +3 -0
- data/lib/crowbar/client/command/node/reset.rb +4 -1
- data/lib/crowbar/client/command/node/role.rb +3 -0
- data/lib/crowbar/client/command/node/show.rb +3 -0
- data/lib/crowbar/client/command/node/shutdown.rb +4 -1
- data/lib/crowbar/client/command/node/status.rb +3 -0
- data/lib/crowbar/client/command/node/transition.rb +3 -0
- data/lib/crowbar/client/command/proposal.rb +3 -0
- data/lib/crowbar/client/command/proposal/commit.rb +3 -0
- data/lib/crowbar/client/command/proposal/create.rb +3 -0
- data/lib/crowbar/client/command/proposal/delete.rb +3 -0
- data/lib/crowbar/client/command/proposal/dequeue.rb +3 -0
- data/lib/crowbar/client/command/proposal/edit.rb +3 -0
- data/lib/crowbar/client/command/proposal/list.rb +3 -0
- data/lib/crowbar/client/command/proposal/reset.rb +3 -0
- data/lib/crowbar/client/command/proposal/show.rb +3 -0
- data/lib/crowbar/client/command/repository.rb +3 -0
- data/lib/crowbar/client/command/repository/activate.rb +3 -0
- data/lib/crowbar/client/command/repository/activate_all.rb +3 -0
- data/lib/crowbar/client/command/repository/deactivate.rb +3 -0
- data/lib/crowbar/client/command/repository/deactivate_all.rb +3 -0
- data/lib/crowbar/client/command/repository/list.rb +3 -0
- data/lib/crowbar/client/command/role.rb +3 -0
- data/lib/crowbar/client/command/role/list.rb +3 -0
- data/lib/crowbar/client/command/role/show.rb +3 -0
- data/lib/crowbar/client/command/server.rb +5 -0
- data/lib/crowbar/client/command/server/api.rb +3 -0
- data/lib/crowbar/client/command/server/check.rb +75 -0
- data/lib/crowbar/client/command/virtual_ip.rb +3 -0
- data/lib/crowbar/client/command/virtual_ip/allocate.rb +3 -0
- data/lib/crowbar/client/command/virtual_ip/deallocate.rb +3 -0
- data/lib/crowbar/client/config.rb +128 -1
- data/lib/crowbar/client/filter.rb +3 -0
- data/lib/crowbar/client/filter/array.rb +3 -0
- data/lib/crowbar/client/filter/base.rb +3 -0
- data/lib/crowbar/client/filter/hash.rb +3 -0
- data/lib/crowbar/client/filter/subset.rb +3 -0
- data/lib/crowbar/client/formatter.rb +3 -0
- data/lib/crowbar/client/formatter/array.rb +3 -0
- data/lib/crowbar/client/formatter/base.rb +3 -0
- data/lib/crowbar/client/formatter/hash.rb +3 -0
- data/lib/crowbar/client/formatter/nested.rb +3 -0
- data/lib/crowbar/client/mixin.rb +3 -0
- data/lib/crowbar/client/mixin/barclamp.rb +3 -0
- data/lib/crowbar/client/mixin/filter.rb +3 -0
- data/lib/crowbar/client/mixin/format.rb +3 -0
- data/lib/crowbar/client/request.rb +3 -0
- data/lib/crowbar/client/request/backup.rb +3 -0
- data/lib/crowbar/client/request/backup/create.rb +18 -0
- data/lib/crowbar/client/request/backup/delete.rb +13 -0
- data/lib/crowbar/client/request/backup/download.rb +13 -0
- data/lib/crowbar/client/request/backup/list.rb +13 -0
- data/lib/crowbar/client/request/backup/restore.rb +13 -0
- data/lib/crowbar/client/request/backup/upload.rb +13 -0
- data/lib/crowbar/client/request/barclamp.rb +3 -0
- data/lib/crowbar/client/request/barclamp/list.rb +13 -0
- data/lib/crowbar/client/request/base.rb +42 -11
- data/lib/crowbar/client/request/batch.rb +3 -0
- data/lib/crowbar/client/request/batch/build.rb +13 -0
- data/lib/crowbar/client/request/batch/export.rb +18 -0
- data/lib/crowbar/client/request/host_ip.rb +3 -0
- data/lib/crowbar/client/request/host_ip/allocate.rb +18 -0
- data/lib/crowbar/client/request/host_ip/deallocate.rb +18 -0
- data/lib/crowbar/client/request/installer.rb +3 -0
- data/lib/crowbar/client/request/installer/start.rb +18 -0
- data/lib/crowbar/client/request/installer/status.rb +13 -0
- data/lib/crowbar/client/request/interface.rb +3 -0
- data/lib/crowbar/client/request/interface/disable.rb +18 -0
- data/lib/crowbar/client/request/interface/enable.rb +18 -0
- data/lib/crowbar/client/request/node.rb +33 -0
- data/lib/crowbar/client/request/node/action.rb +13 -0
- data/lib/crowbar/client/request/node/allocate.rb +29 -0
- data/lib/crowbar/client/request/node/delete.rb +13 -0
- data/lib/crowbar/client/request/node/group.rb +13 -0
- data/lib/crowbar/client/request/node/hardware.rb +29 -0
- data/lib/crowbar/client/request/node/identify.rb +29 -0
- data/lib/crowbar/client/request/node/list.rb +13 -0
- data/lib/crowbar/client/request/node/powercycle.rb +29 -0
- data/lib/crowbar/client/request/node/poweroff.rb +29 -0
- data/lib/crowbar/client/request/node/poweron.rb +29 -0
- data/lib/crowbar/client/request/node/reboot.rb +29 -0
- data/lib/crowbar/client/request/node/reinstall.rb +29 -0
- data/lib/crowbar/client/request/node/rename.rb +18 -0
- data/lib/crowbar/client/request/node/reset.rb +29 -0
- data/lib/crowbar/client/request/node/role.rb +18 -0
- data/lib/crowbar/client/request/node/show.rb +13 -0
- data/lib/crowbar/client/request/node/shutdown.rb +29 -0
- data/lib/crowbar/client/request/node/status.rb +13 -0
- data/lib/crowbar/client/request/node/transition.rb +18 -0
- data/lib/crowbar/client/request/party.rb +3 -0
- data/lib/crowbar/client/request/proposal.rb +3 -0
- data/lib/crowbar/client/request/proposal/commit.rb +13 -0
- data/lib/crowbar/client/request/proposal/create.rb +18 -0
- data/lib/crowbar/client/request/proposal/delete.rb +13 -0
- data/lib/crowbar/client/request/proposal/dequeue.rb +13 -0
- data/lib/crowbar/client/request/proposal/edit.rb +18 -0
- data/lib/crowbar/client/request/proposal/list.rb +13 -0
- data/lib/crowbar/client/request/proposal/reset.rb +13 -0
- data/lib/crowbar/client/request/proposal/show.rb +13 -0
- data/lib/crowbar/client/request/proposal/template.rb +13 -0
- data/lib/crowbar/client/request/repository.rb +3 -0
- data/lib/crowbar/client/request/repository/activate.rb +18 -0
- data/lib/crowbar/client/request/repository/activate_all.rb +13 -0
- data/lib/crowbar/client/request/repository/deactivate.rb +18 -0
- data/lib/crowbar/client/request/repository/deactivate_all.rb +13 -0
- data/lib/crowbar/client/request/repository/list.rb +13 -0
- data/lib/crowbar/client/request/role.rb +3 -0
- data/lib/crowbar/client/request/role/list.rb +13 -0
- data/lib/crowbar/client/request/role/show.rb +13 -0
- data/lib/crowbar/client/request/server.rb +5 -0
- data/lib/crowbar/client/request/server/api.rb +13 -0
- data/lib/crowbar/client/request/server/check.rb +49 -0
- data/lib/crowbar/client/request/virtual_ip.rb +3 -0
- data/lib/crowbar/client/request/virtual_ip/allocate.rb +18 -0
- data/lib/crowbar/client/request/virtual_ip/deallocate.rb +18 -0
- data/lib/crowbar/client/util.rb +3 -0
- data/lib/crowbar/client/util/editor.rb +3 -0
- data/lib/crowbar/client/util/runner.rb +3 -0
- data/lib/crowbar/client/version.rb +23 -1
- data/spec/crowbar/client/command/backup/create_spec.rb +8 -16
- data/spec/crowbar/client/command/backup/delete_spec.rb +8 -16
- data/spec/crowbar/client/command/backup/download_spec.rb +8 -16
- data/spec/crowbar/client/command/backup/list_spec.rb +7 -15
- data/spec/crowbar/client/command/backup/restore_spec.rb +8 -16
- data/spec/crowbar/client/command/backup/upload_spec.rb +11 -19
- data/spec/crowbar/client/command/barclamp/list_spec.rb +7 -15
- data/spec/crowbar/client/command/batch/build_spec.rb +11 -19
- data/spec/crowbar/client/command/batch/export_spec.rb +7 -15
- data/spec/crowbar/client/command/host_ip/allocate_spec.rb +7 -15
- data/spec/crowbar/client/command/host_ip/deallocate_spec.rb +7 -15
- data/spec/crowbar/client/command/installer/start_spec.rb +8 -16
- data/spec/crowbar/client/command/installer/status_spec.rb +7 -15
- data/spec/crowbar/client/command/interface/disable_spec.rb +7 -15
- data/spec/crowbar/client/command/interface/enable_spec.rb +7 -15
- data/spec/crowbar/client/command/node/allocate_spec.rb +7 -15
- data/spec/crowbar/client/command/node/delete_spec.rb +7 -15
- data/spec/crowbar/client/command/node/group_spec.rb +7 -15
- data/spec/crowbar/client/command/node/hardware_spec.rb +7 -15
- data/spec/crowbar/client/command/node/identify_spec.rb +7 -15
- data/spec/crowbar/client/command/node/list_spec.rb +9 -17
- data/spec/crowbar/client/command/node/powercycle_spec.rb +7 -15
- data/spec/crowbar/client/command/node/poweroff_spec.rb +7 -15
- data/spec/crowbar/client/command/node/poweron_spec.rb +7 -15
- data/spec/crowbar/client/command/node/reboot_spec.rb +7 -15
- data/spec/crowbar/client/command/node/reinstall_spec.rb +7 -15
- data/spec/crowbar/client/command/node/rename_spec.rb +7 -15
- data/spec/crowbar/client/command/node/reset_spec.rb +7 -15
- data/spec/crowbar/client/command/node/role_spec.rb +7 -15
- data/spec/crowbar/client/command/node/show_spec.rb +7 -15
- data/spec/crowbar/client/command/node/shutdown_spec.rb +7 -15
- data/spec/crowbar/client/command/node/status_spec.rb +7 -15
- data/spec/crowbar/client/command/node/transition_spec.rb +7 -15
- data/spec/crowbar/client/command/proposal/commit_spec.rb +7 -15
- data/spec/crowbar/client/command/proposal/delete_spec.rb +7 -15
- data/spec/crowbar/client/command/proposal/dequeue_spec.rb +7 -15
- data/spec/crowbar/client/command/proposal/list_spec.rb +7 -15
- data/spec/crowbar/client/command/proposal/reset_spec.rb +7 -15
- data/spec/crowbar/client/command/proposal/show_spec.rb +7 -15
- data/spec/crowbar/client/command/repository/activate_all_spec.rb +7 -15
- data/spec/crowbar/client/command/repository/activate_spec.rb +7 -15
- data/spec/crowbar/client/command/repository/deactivate_all_spec.rb +7 -15
- data/spec/crowbar/client/command/repository/deactivate_spec.rb +7 -15
- data/spec/crowbar/client/command/repository/list_spec.rb +7 -15
- data/spec/crowbar/client/command/role/list_spec.rb +7 -15
- data/spec/crowbar/client/command/role/show_spec.rb +7 -15
- data/spec/crowbar/client/command/server/api_spec.rb +7 -15
- data/spec/crowbar/client/command/server/check_spec.rb +31 -0
- data/spec/crowbar/client/command/virtual_ip/allocate_spec.rb +7 -15
- data/spec/crowbar/client/command/virtual_ip/deallocate_spec.rb +7 -15
- data/spec/crowbar/client/request/server/check_spec.rb +50 -0
- data/spec/support/command_examples.rb +59 -0
- metadata +117 -95
@@ -17,12 +17,22 @@
|
|
17
17
|
module Crowbar
|
18
18
|
module Client
|
19
19
|
module App
|
20
|
+
#
|
21
|
+
# A Thor based CLI entry point which resolves the sub-commands
|
22
|
+
#
|
20
23
|
class Entry < Base
|
24
|
+
check_unknown_options!
|
25
|
+
|
21
26
|
map [
|
22
27
|
"--version",
|
23
28
|
"-v"
|
24
29
|
] => :version
|
25
30
|
|
31
|
+
map [
|
32
|
+
"--help",
|
33
|
+
"-h"
|
34
|
+
] => :help
|
35
|
+
|
26
36
|
class_option :alias,
|
27
37
|
type: :string,
|
28
38
|
default: Config.defaults[:alias],
|
@@ -56,7 +66,7 @@ module Crowbar
|
|
56
66
|
class_option :anonymous,
|
57
67
|
type: :boolean,
|
58
68
|
default: Config.defaults[:anonymous],
|
59
|
-
aliases: ["-
|
69
|
+
aliases: ["-A"],
|
60
70
|
desc: "Skip API user authentication"
|
61
71
|
|
62
72
|
class_option :debug,
|
@@ -65,6 +75,18 @@ module Crowbar
|
|
65
75
|
aliases: ["-d"],
|
66
76
|
desc: "Output more debug information"
|
67
77
|
|
78
|
+
# TODO(should): Prevent a --no-help alternative flag
|
79
|
+
# class_option :help,
|
80
|
+
# type: :boolean,
|
81
|
+
# aliases: ["-h"],
|
82
|
+
# desc: "Print this help information"
|
83
|
+
|
84
|
+
# TODO(should): Prevent a --no-version alternative flag
|
85
|
+
# class_option :version,
|
86
|
+
# type: :boolean,
|
87
|
+
# aliases: ["-v"],
|
88
|
+
# desc: "Print the current version of the CLI"
|
89
|
+
|
68
90
|
desc "version",
|
69
91
|
"Display the current version of the client"
|
70
92
|
|
@@ -74,6 +96,9 @@ module Crowbar
|
|
74
96
|
to debug some issue with the current implementation.
|
75
97
|
LONGDESC
|
76
98
|
|
99
|
+
#
|
100
|
+
# Command to print the version of Crowbar CLI
|
101
|
+
#
|
77
102
|
def version
|
78
103
|
say "crowbar-client v#{Crowbar::Client::Version}"
|
79
104
|
end
|
@@ -17,6 +17,9 @@
|
|
17
17
|
module Crowbar
|
18
18
|
module Client
|
19
19
|
module App
|
20
|
+
#
|
21
|
+
# A Thor based CLI wrapper for host IP commands
|
22
|
+
#
|
20
23
|
class HostIP < Base
|
21
24
|
namespace "network hostip"
|
22
25
|
|
@@ -28,6 +31,18 @@ module Crowbar
|
|
28
31
|
try to allocate a host IP address for the specified node.
|
29
32
|
LONGDESC
|
30
33
|
|
34
|
+
#
|
35
|
+
# Host IP allocate command
|
36
|
+
#
|
37
|
+
# It will try to allocate a host IP address for the specified
|
38
|
+
# node.
|
39
|
+
#
|
40
|
+
# @param proposal [String] the proposal name
|
41
|
+
# @param node [String] the node name or alias
|
42
|
+
# @param network [String] the network name
|
43
|
+
# @param range [String] the network range
|
44
|
+
# @param suggestion [String] an optional suggestion
|
45
|
+
#
|
31
46
|
def allocate(proposal, node, network, range, suggestion = nil)
|
32
47
|
Command::HostIP::Allocate.new(
|
33
48
|
*command_params(
|
@@ -50,6 +65,15 @@ module Crowbar
|
|
50
65
|
a host IP address for the specified node.
|
51
66
|
LONGDESC
|
52
67
|
|
68
|
+
#
|
69
|
+
# Host IP deallocate command
|
70
|
+
#
|
71
|
+
# It will try to deallocate a host IP address.
|
72
|
+
#
|
73
|
+
# @param proposal [String] the proposal name
|
74
|
+
# @param node [String] the node name or alias
|
75
|
+
# @param network [String] the network name
|
76
|
+
#
|
53
77
|
def deallocate(proposal, node, network)
|
54
78
|
Command::HostIP::Deallocate.new(
|
55
79
|
*command_params(
|
@@ -17,6 +17,9 @@
|
|
17
17
|
module Crowbar
|
18
18
|
module Client
|
19
19
|
module App
|
20
|
+
#
|
21
|
+
# A Thor based CLI wrapper for installer commands
|
22
|
+
#
|
20
23
|
class Installer < Base
|
21
24
|
desc "status",
|
22
25
|
"Show current installer status"
|
@@ -65,6 +68,13 @@ module Crowbar
|
|
65
68
|
banner: "<filter>",
|
66
69
|
desc: "Filter by criteria, display only data that contains filter"
|
67
70
|
|
71
|
+
#
|
72
|
+
# Installer status command
|
73
|
+
#
|
74
|
+
# It will print out information about the current status of the
|
75
|
+
# installer. You can display the list in different output formats
|
76
|
+
# and you can filter the list by any search criteria.
|
77
|
+
#
|
68
78
|
def status
|
69
79
|
Command::Installer::Status.new(
|
70
80
|
*command_params
|
@@ -77,7 +87,7 @@ module Crowbar
|
|
77
87
|
"Start the insallation of Crowbar"
|
78
88
|
|
79
89
|
long_desc <<-LONGDESC
|
80
|
-
`start` will trigger the installation of the
|
90
|
+
`start` will trigger the installation of the server.
|
81
91
|
|
82
92
|
With --force you can enforce a reinstallation if the installation
|
83
93
|
has already been finished. Be careful with that option as you will
|
@@ -90,6 +100,11 @@ module Crowbar
|
|
90
100
|
aliases: [],
|
91
101
|
desc: "Force Administration Server installation"
|
92
102
|
|
103
|
+
#
|
104
|
+
# Installer start command
|
105
|
+
#
|
106
|
+
# It will trigger the installation of the server.
|
107
|
+
#
|
93
108
|
def start
|
94
109
|
Command::Installer::Start.new(
|
95
110
|
*command_params
|
@@ -17,6 +17,9 @@
|
|
17
17
|
module Crowbar
|
18
18
|
module Client
|
19
19
|
module App
|
20
|
+
#
|
21
|
+
# A Thor based CLI wrapper for interface commands
|
22
|
+
#
|
20
23
|
class Interface < Base
|
21
24
|
namespace "network interface"
|
22
25
|
|
@@ -28,6 +31,15 @@ module Crowbar
|
|
28
31
|
specified network interface on the specified node.
|
29
32
|
LONGDESC
|
30
33
|
|
34
|
+
#
|
35
|
+
# Interface enable command
|
36
|
+
#
|
37
|
+
# Enable a network interface.
|
38
|
+
#
|
39
|
+
# @param proposal [String] the proposal name
|
40
|
+
# @param node [String] the node name or alias
|
41
|
+
# @param network [String] the network name
|
42
|
+
#
|
31
43
|
def enable(proposal, node, network)
|
32
44
|
Command::Interface::Enable.new(
|
33
45
|
*command_params(
|
@@ -48,6 +60,15 @@ module Crowbar
|
|
48
60
|
specified network interface on the specified node.
|
49
61
|
LONGDESC
|
50
62
|
|
63
|
+
#
|
64
|
+
# Interface disable command
|
65
|
+
#
|
66
|
+
# Disable a network interface.
|
67
|
+
#
|
68
|
+
# @param proposal [String] the proposal name
|
69
|
+
# @param node [String] the node name or alias
|
70
|
+
# @param network [String] the network name
|
71
|
+
#
|
51
72
|
def disable(proposal, node, network)
|
52
73
|
Command::Interface::Disable.new(
|
53
74
|
*command_params(
|
@@ -17,6 +17,9 @@
|
|
17
17
|
module Crowbar
|
18
18
|
module Client
|
19
19
|
module App
|
20
|
+
#
|
21
|
+
# A Thor based CLI wrapper for server commands
|
22
|
+
#
|
20
23
|
class Server < Base
|
21
24
|
desc "api BARCLAMP",
|
22
25
|
"Show the API documentation"
|
@@ -35,6 +38,59 @@ module Crowbar
|
|
35
38
|
rescue => e
|
36
39
|
catch_errors(e)
|
37
40
|
end
|
41
|
+
|
42
|
+
desc "check",
|
43
|
+
"Perform sanity checks on the server"
|
44
|
+
|
45
|
+
long_desc <<-LONGDESC
|
46
|
+
`check` will perform sanity checks on the server.
|
47
|
+
|
48
|
+
With --format <format> option you can choose an output format
|
49
|
+
with the available options table, json or plain. You can also
|
50
|
+
use the shortcut options --table, --json or --plain.
|
51
|
+
|
52
|
+
With --filter <filter> option you can limit the result of
|
53
|
+
printed out elements. You can use any substring that is part
|
54
|
+
of the found elements.
|
55
|
+
LONGDESC
|
56
|
+
|
57
|
+
method_option :format,
|
58
|
+
type: :string,
|
59
|
+
default: "table",
|
60
|
+
banner: "<format>",
|
61
|
+
desc: "Format of the output, valid formats are table, json or plain"
|
62
|
+
|
63
|
+
method_option :table,
|
64
|
+
type: :boolean,
|
65
|
+
default: false,
|
66
|
+
aliases: [],
|
67
|
+
desc: "Format output as table, a shortcut for --format table option"
|
68
|
+
|
69
|
+
method_option :json,
|
70
|
+
type: :boolean,
|
71
|
+
default: false,
|
72
|
+
aliases: [],
|
73
|
+
desc: "Format output as table, a shortcut for --format json option"
|
74
|
+
|
75
|
+
method_option :plain,
|
76
|
+
type: :boolean,
|
77
|
+
default: false,
|
78
|
+
aliases: [],
|
79
|
+
desc: "Format output as table, a shortcut for --format plain option"
|
80
|
+
|
81
|
+
method_option :filter,
|
82
|
+
type: :string,
|
83
|
+
default: nil,
|
84
|
+
banner: "<filter>",
|
85
|
+
desc: "Filter by criteria, display only data that contains filter"
|
86
|
+
|
87
|
+
def check
|
88
|
+
Command::Server::Check.new(
|
89
|
+
*command_params
|
90
|
+
).execute
|
91
|
+
rescue => e
|
92
|
+
catch_errors(e)
|
93
|
+
end
|
38
94
|
end
|
39
95
|
end
|
40
96
|
end
|
@@ -17,6 +17,9 @@
|
|
17
17
|
module Crowbar
|
18
18
|
module Client
|
19
19
|
module App
|
20
|
+
#
|
21
|
+
# A Thor based CLI wrapper for virtual IP commands
|
22
|
+
#
|
20
23
|
class VirtualIP < Base
|
21
24
|
namespace "network virtualip"
|
22
25
|
|
@@ -28,6 +31,18 @@ module Crowbar
|
|
28
31
|
try to allocate a virtual IP address for the specified service.
|
29
32
|
LONGDESC
|
30
33
|
|
34
|
+
#
|
35
|
+
# Virtual IP allocate command
|
36
|
+
#
|
37
|
+
# It will try to allocate a virtual IP address for the specified
|
38
|
+
# service.
|
39
|
+
#
|
40
|
+
# @param proposal [String] the proposal name
|
41
|
+
# @param service [String] the service name
|
42
|
+
# @param network [String] the network name
|
43
|
+
# @param range [String] the network range
|
44
|
+
# @param suggestion [String] an optional suggestion
|
45
|
+
#
|
31
46
|
def allocate(proposal, service, network, range, suggestion = nil)
|
32
47
|
Command::VirtualIP::Allocate.new(
|
33
48
|
*command_params(
|
@@ -50,6 +65,15 @@ module Crowbar
|
|
50
65
|
a virtual IP address for the specified service.
|
51
66
|
LONGDESC
|
52
67
|
|
68
|
+
#
|
69
|
+
# Virtual IP deallocate command
|
70
|
+
#
|
71
|
+
# It will try to deallocate a virtual IP address.
|
72
|
+
#
|
73
|
+
# @param proposal [String] the proposal name
|
74
|
+
# @param service [String] the service name
|
75
|
+
# @param network [String] the network name
|
76
|
+
#
|
53
77
|
def deallocate(proposal, service, network)
|
54
78
|
Command::VirtualIP::Deallocate.new(
|
55
79
|
*command_params(
|