rboss 0.8.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +117 -11
- data/bin/rboss-cli +86 -44
- data/bin/rboss-twiddle +2 -2
- data/lib/rboss/cli/invoker.rb +7 -7
- data/lib/rboss/cli/mappings/resources/connector.yaml +1 -1
- data/lib/rboss/cli/mappings/resources/datasource.yaml +1 -1
- data/lib/rboss/cli/mappings/resources/deployment-scanner.yaml +35 -0
- data/lib/rboss/cli/mappings/resources/interface.yaml +47 -0
- data/lib/rboss/cli/mappings/resources/server.yaml +6 -6
- data/lib/rboss/cli/resource.rb +19 -16
- data/lib/rboss/cli/result_parser.rb +1 -0
- data/lib/rboss/plaftorm.rb +8 -0
- data/lib/rboss/version.rb +1 -1
- data/lib/rboss/view/colorizers.rb +1 -1
- data/lib/rboss/view/table_builder.rb +2 -1
- data/rboss.gemspec +14 -14
- data/rboss.iml +2 -3
- data/rboss.ipr +11 -2
- metadata +6 -4
data/README.md
CHANGED
@@ -10,13 +10,13 @@ Installation
|
|
10
10
|
|
11
11
|
gem install rboss
|
12
12
|
|
13
|
-
### Dependencies
|
13
|
+
### Direct Dependencies
|
14
14
|
|
15
15
|
* yummi
|
16
16
|
|
17
17
|
### Configuration
|
18
18
|
|
19
|
-
Set a
|
19
|
+
Set a RBOSS_CLI_HOME variable pointing to your JBoss AS home location that has jboss-cli
|
20
20
|
for using rboss-cli, for using twiddle, set a RBOSS_TWIDDLE_HOME variable pointing to you JBoss AS
|
21
21
|
that has twiddle.
|
22
22
|
|
@@ -40,29 +40,35 @@ You can scan resources, detail information and execute operations.
|
|
40
40
|
|
41
41
|
### Invoking Operations
|
42
42
|
|
43
|
-
To see the operations for a resource, use the
|
43
|
+
To see the operations for a resource, use the "--list-operations" or "-l" option:
|
44
44
|
|
45
45
|
rboss-cli --server --list-operations
|
46
46
|
|
47
|
-
To detail an operation, use the
|
47
|
+
To detail an operation, use the "--detail-operation" or "-d" option:
|
48
48
|
|
49
49
|
rboss-cli --server --detail-operation shutdown
|
50
50
|
|
51
51
|
This will print a table showing both request and response parameters. To invoke the
|
52
|
-
operation, use the "--operation"
|
52
|
+
operation, use the "--operation" or "-o" option:
|
53
53
|
|
54
54
|
rboss-cli --server --operation shutdown
|
55
55
|
rboss-cli --server -o shutdown
|
56
56
|
|
57
57
|
Since this operation requires a parameter, rboss-cli will ask you to input them. If you
|
58
|
-
want to pass the required parameters, use the "--arguments"
|
58
|
+
want to pass the required parameters, use the "--arguments" or "-a" option:
|
59
59
|
|
60
60
|
rboss-cli --server --operation shutdown --arguments restart=true
|
61
61
|
rboss-cli --server -o shutdown -a restart=true
|
62
|
+
|
63
|
+
Multiple arguments are supported using commas:
|
64
|
+
|
65
|
+
rboss-cli --some-resource -o operation -a arg1=value1,arg2=value
|
62
66
|
|
63
67
|
If you want to skip optional arguments, use the "--skip-optional". rboss-cli will not ask
|
64
68
|
you to input the arguments, leaving "--arguments" as the only way to set them.
|
65
69
|
|
70
|
+
See rboss-cli --help for a complete list of commands.
|
71
|
+
|
66
72
|
### Known Issues
|
67
73
|
|
68
74
|
The datasource mapping (--datasource) retrieves incorrect information if you call either
|
@@ -75,7 +81,7 @@ leaving the '--datasource any' as a workaround.
|
|
75
81
|
rboss-cli --datasource --detail-operation add
|
76
82
|
rboss-cli --datasource a --detail-operation add
|
77
83
|
|
78
|
-
### Configuring mappings
|
84
|
+
### Configuring CLI mappings
|
79
85
|
|
80
86
|
To create and override mappings, just put a yaml file in "~/.rboss/rboss-cli/resources". The filename will
|
81
87
|
be used to identify the operation. Example: placing a file named datasource.yaml will override the
|
@@ -88,12 +94,112 @@ The yaml must contain the given definitions:
|
|
88
94
|
* scan (optional): a command to scan resources (by using this, the option may take an array of resource names)
|
89
95
|
* print (optional): an array of table definitions to print with "read-resource" operation.
|
90
96
|
|
97
|
+
Examples:
|
98
|
+
|
99
|
+
---
|
100
|
+
description: Datasource Information
|
101
|
+
path: /subsystem=datasources/data-source=${NAME}
|
102
|
+
scan: ls /subsystem=datasources/data-source
|
103
|
+
print:
|
104
|
+
- id: config
|
105
|
+
title: Datasource Details
|
106
|
+
layout: vertical
|
107
|
+
properties:
|
108
|
+
- jndi-name
|
109
|
+
- connection-url
|
110
|
+
- driver-name
|
111
|
+
- user-name
|
112
|
+
- enabled
|
113
|
+
header:
|
114
|
+
- JNDI Name
|
115
|
+
- Connection URL
|
116
|
+
- Driver Name
|
117
|
+
- User Name
|
118
|
+
- Enabled
|
119
|
+
format:
|
120
|
+
enabled: boolean
|
121
|
+
|
122
|
+
color:
|
123
|
+
jndi_name:
|
124
|
+
with: magenta
|
125
|
+
enabled: boolean
|
126
|
+
connection_url:
|
127
|
+
with: yellow
|
128
|
+
|
129
|
+
- id: pool
|
130
|
+
title: Datasource Pool Statistics
|
131
|
+
path: ${PATH}/statistics=pool
|
132
|
+
layout: vertical
|
133
|
+
properties:
|
134
|
+
- ActiveCount
|
135
|
+
- AvailableCount
|
136
|
+
- AverageBlockingTime
|
137
|
+
- AverageCreationTime
|
138
|
+
- CreatedCount
|
139
|
+
- DestroyedCount
|
140
|
+
- MaxCreationTime
|
141
|
+
- MaxUsedCount
|
142
|
+
- MaxWaitTime
|
143
|
+
- TimedOut
|
144
|
+
- TotalBlockingTime
|
145
|
+
- TotalCreationTime
|
146
|
+
|
147
|
+
header:
|
148
|
+
- Active
|
149
|
+
- Available
|
150
|
+
- Average Blocking
|
151
|
+
- Average Creation
|
152
|
+
- Created
|
153
|
+
- Destroyed
|
154
|
+
- Max Creation
|
155
|
+
- Max Wait
|
156
|
+
- Timed Out
|
157
|
+
- Total Blocking
|
158
|
+
- Total Creation
|
159
|
+
|
160
|
+
health:
|
161
|
+
active:
|
162
|
+
percentage:
|
163
|
+
max: available
|
164
|
+
using: active
|
165
|
+
|
166
|
+
---
|
167
|
+
description: Detail Server Information
|
168
|
+
path: /core-service=
|
169
|
+
print:
|
170
|
+
- id: platform
|
171
|
+
title: Operating System Information
|
172
|
+
path: ${PATH}platform-mbean/type=operating-system
|
173
|
+
properties:
|
174
|
+
- name
|
175
|
+
- arch
|
176
|
+
- version
|
177
|
+
- available-processors
|
178
|
+
- system-load-average
|
179
|
+
header:
|
180
|
+
- Name
|
181
|
+
- Arch
|
182
|
+
- Version
|
183
|
+
- Processors
|
184
|
+
- System Load
|
185
|
+
format:
|
186
|
+
system_load: percentage
|
187
|
+
color:
|
188
|
+
name:
|
189
|
+
with: bold.white
|
190
|
+
system_load:
|
191
|
+
threshold:
|
192
|
+
0.8: bold.red
|
193
|
+
0.7: red
|
194
|
+
0.5: yellow
|
195
|
+
0: green
|
196
|
+
|
91
197
|
To configure a table to print, just use the following parameters:
|
92
198
|
|
93
|
-
* id: a name that will be joined to the file name to allow print only this table
|
199
|
+
* id (required for multiple tables): a name that will be joined to the file name to allow print only this table
|
94
200
|
* title: the table title
|
95
201
|
* layout (horizontal | vertical): how the table must be printed. Use vertical for large number of properties
|
96
|
-
* properties: an array with the properties (returned by "read-resource") to print in this table
|
202
|
+
* properties: an array with the properties (returned by "read-resource") to print in this table, you can use a " -> " to navigate into nested properties (example: heap-memory-usage -> init)
|
97
203
|
* header: an array that maps a header text to the properties
|
98
204
|
* format: a hash that maps formatters to the table columns
|
99
205
|
* color: a hash that maps colors to the table columns
|
@@ -133,7 +239,7 @@ Examples:
|
|
133
239
|
|
134
240
|
### Adding new components
|
135
241
|
|
136
|
-
To add new Colorizers, Formatters or HealthCheckers, just put the code in the "~/.rboss/rboss.rb".
|
242
|
+
To add new Colorizers, Formatters or HealthCheckers, just put the code in the "~/.rboss/rboss.rb" file.
|
137
243
|
|
138
244
|
Example:
|
139
245
|
|
@@ -204,7 +310,7 @@ You can use a file in ~/.rboss/twiddle.rb for mapping new mbeans or overriding t
|
|
204
310
|
|
205
311
|
And use it normally
|
206
312
|
|
207
|
-
rboss-
|
313
|
+
rboss-twiddle --http-request
|
208
314
|
|
209
315
|
You can do every action using custom mbeans
|
210
316
|
|
data/bin/rboss-cli
CHANGED
@@ -29,6 +29,8 @@ require 'yaml'
|
|
29
29
|
require 'fileutils'
|
30
30
|
require 'yummi'
|
31
31
|
|
32
|
+
include RBoss::Platform
|
33
|
+
|
32
34
|
params = {}
|
33
35
|
@conf_dir = File.expand_path "~/.rboss"
|
34
36
|
servers_file = "#@conf_dir/jboss-cli-servers.yaml"
|
@@ -36,7 +38,7 @@ servers_file = "#@conf_dir/jboss-cli-servers.yaml"
|
|
36
38
|
@parameters = {}
|
37
39
|
@servers_file = File.expand_path(servers_file)
|
38
40
|
save = false
|
39
|
-
params[:jboss_home] = (ENV["
|
41
|
+
params[:jboss_home] = (ENV["RBOSS_CLI_HOME"] or Dir.pwd)
|
40
42
|
params[:host] = '127.0.0.1'
|
41
43
|
params[:port] = '9999'
|
42
44
|
|
@@ -46,9 +48,15 @@ def load_yaml
|
|
46
48
|
end
|
47
49
|
|
48
50
|
opts = OptionParser::new
|
51
|
+
|
52
|
+
opts.separator "Environment Options".bold.white
|
53
|
+
|
49
54
|
opts.on('-j', '--jboss-home PATH', 'Defines the JBOSS_HOME variable') do |home|
|
50
55
|
params[:jboss_home] = home
|
51
56
|
end
|
57
|
+
|
58
|
+
opts.separator "\nServer Options".bold.white
|
59
|
+
|
52
60
|
opts.on('-s URL', 'Defines the JBoss server') do |server|
|
53
61
|
params[:server] = server
|
54
62
|
end
|
@@ -58,58 +66,38 @@ end
|
|
58
66
|
opts.on('--port PORT', 'Defines the JBoss admin port') do |port|
|
59
67
|
params[:port] = port
|
60
68
|
end
|
61
|
-
opts.on('-c', '--connect SERVER_NAME',
|
62
|
-
"Uses a configured server in #{servers_file}") do |server|
|
63
|
-
config = load_yaml[server]
|
64
|
-
abort "No configuration for #{server}" unless config
|
65
|
-
config.each do |key, value|
|
66
|
-
params[key.to_sym] = value
|
67
|
-
end
|
68
|
-
end
|
69
|
-
opts.on('--save SERVER_NAME', "Saves the server configuration in #{servers_file}") do |server|
|
70
|
-
save = server
|
71
|
-
end
|
72
|
-
opts.on('--loop INTERVAL', Float, 'Run inside a loop') do |interval|
|
73
|
-
@loop = true
|
74
|
-
@interval = interval
|
75
|
-
end
|
76
|
-
|
77
|
-
opts.on('--no-color', 'Do not colorize output') do
|
78
|
-
require 'yummi/no_colors'
|
79
|
-
end
|
80
69
|
opts.on('-u', '--user USER', 'Defines the Admin User') do |user|
|
81
70
|
params[:user] = user
|
82
71
|
end
|
83
72
|
opts.on('-p', '--password PASSWORD', 'Defines the Admin Password') do |password|
|
84
73
|
params[:password] = password
|
85
74
|
end
|
86
|
-
opts.on('
|
87
|
-
|
75
|
+
opts.on('--save SERVER_NAME', "Saves the server configuration in #{servers_file}") do |server|
|
76
|
+
save = server
|
88
77
|
end
|
89
78
|
|
90
|
-
opts.
|
91
|
-
'Sets the operation to invoke (Defaults to "read-resource")') do |name|
|
92
|
-
@operation = name
|
93
|
-
end
|
79
|
+
opts.separator "\nCLI Options".bold.white
|
94
80
|
|
95
|
-
opts.on('
|
96
|
-
@
|
81
|
+
opts.on('--start-cli', 'Starts the JBoss Management CLI connected to the configured server in interactive mode') do
|
82
|
+
@start = true
|
97
83
|
end
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
84
|
+
opts.on('-c', '--connect SERVER_NAME',
|
85
|
+
"Uses a configured server in #{servers_file}") do |server|
|
86
|
+
config = load_yaml[server]
|
87
|
+
abort "No configuration for #{server}" unless config
|
88
|
+
config.each do |key, value|
|
89
|
+
params[key.to_sym] = value
|
90
|
+
end
|
102
91
|
end
|
103
|
-
|
104
|
-
|
105
|
-
params[:skip_optional] = true
|
92
|
+
opts.on('--native COMMANDS', Array, 'Executes the given commands using cli interface (each command must be comma separated)') do |commands|
|
93
|
+
@native = commands
|
106
94
|
end
|
107
|
-
|
108
|
-
|
109
|
-
'Specifies parameters in form of (name=value) for use with operation') do |parameters|
|
110
|
-
@parameters = Hash[(parameters.collect { |p| p.split( /=/, 2) })]
|
95
|
+
opts.on('--script FILE', 'Executes the script in the cli interface') do |file|
|
96
|
+
@script = file
|
111
97
|
end
|
112
98
|
|
99
|
+
opts.separator "\nMapped Resources".bold.white
|
100
|
+
|
113
101
|
RBoss::Cli::Mappings.resource_mappings.each do |name, config|
|
114
102
|
if config[:description]
|
115
103
|
if config[:scan]
|
@@ -124,17 +112,53 @@ RBoss::Cli::Mappings.resource_mappings.each do |name, config|
|
|
124
112
|
end
|
125
113
|
end
|
126
114
|
|
115
|
+
opts.separator ""
|
116
|
+
|
127
117
|
opts.on('--all', 'Display all available info') do
|
128
118
|
RBoss::Cli::Mappings.resource_mappings.each do |name, config|
|
129
119
|
@resources[name] = nil unless config[:derived]
|
130
120
|
end
|
131
121
|
end
|
132
122
|
|
123
|
+
opts.separator "\nResource Options".bold.white
|
124
|
+
|
125
|
+
opts.on('-l', '--list-operations', 'Lists the available operations for a resource') do
|
126
|
+
@operation = 'read-operation-names'
|
127
|
+
end
|
128
|
+
opts.on('-d', '--detail-operation NAME', 'Shows the operation details') do |operation_name|
|
129
|
+
@operation = 'read-operation-description'
|
130
|
+
@parameters = {'name' => operation_name}
|
131
|
+
end
|
132
|
+
opts.on('-a', '--args PARAMETERS', Array,
|
133
|
+
'Specifies parameters in form of (name=value) for use with operation') do |parameters|
|
134
|
+
@parameters = Hash[(parameters.collect { |p| p.split( /=/, 2) })]
|
135
|
+
end
|
136
|
+
opts.on('-o', '--operation NAME',
|
137
|
+
'Sets the operation to invoke (Defaults to "read-resource")') do |name|
|
138
|
+
@operation = name
|
139
|
+
end
|
140
|
+
opts.on('--skip-optional', 'Skips optional parameters while invoking a command ') do
|
141
|
+
params[:skip_optional] = true
|
142
|
+
end
|
143
|
+
|
144
|
+
opts.separator "\nCommon Options".bold.white
|
145
|
+
|
146
|
+
opts.on('--loop INTERVAL', Float, 'Run inside a loop') do |interval|
|
147
|
+
@loop = true
|
148
|
+
@interval = interval
|
149
|
+
end
|
150
|
+
opts.on('--no-color', 'Do not colorize output') do
|
151
|
+
require 'yummi/no_colors'
|
152
|
+
end
|
153
|
+
opts.on('-v', '--verbose', 'Displays jboss-cli commands before execution') do
|
154
|
+
params[:log_level] = Logger::DEBUG
|
155
|
+
end
|
133
156
|
opts.on("-h", "--help", "Shows this help message") do
|
134
157
|
puts opts; exit
|
135
158
|
end
|
136
|
-
opts.parse!(ARGV) rescue abort 'Invalid Option! Use --help or -h for usage help.'
|
159
|
+
opts.parse!(ARGV) rescue abort 'Invalid Option! Use --help or -h for usage help.'.red
|
137
160
|
|
161
|
+
@jboss_home = params[:jboss_home]
|
138
162
|
@jboss_cli = RBoss::Cli::Invoker::new params
|
139
163
|
|
140
164
|
if save
|
@@ -150,7 +174,25 @@ if save
|
|
150
174
|
f = File.open(@servers_file, 'w')
|
151
175
|
YAML::dump(config, f)
|
152
176
|
f.close
|
153
|
-
puts "Configuration saved!"
|
177
|
+
puts "Configuration saved!".green
|
178
|
+
exit 0
|
179
|
+
end
|
180
|
+
|
181
|
+
if @start
|
182
|
+
puts "Starting JBoss Management CLI connecting to ".bold.white << "#{@jboss_cli.server}".bold.green
|
183
|
+
system "#{@jboss_cli.command} --connect"
|
184
|
+
exit 0
|
185
|
+
end
|
186
|
+
|
187
|
+
if @native
|
188
|
+
result = @jboss_cli.execute(@native)
|
189
|
+
puts result.on_box
|
190
|
+
exit 0
|
191
|
+
end
|
192
|
+
|
193
|
+
if @script
|
194
|
+
system "#{@jboss_cli.command} --connect --file #{@script}"
|
195
|
+
exit 0
|
154
196
|
end
|
155
197
|
|
156
198
|
if @resources.empty? and not @operation
|
@@ -164,11 +206,11 @@ end
|
|
164
206
|
def execute_actions
|
165
207
|
begin
|
166
208
|
content = @jboss_cli.invoke(@operation, @resources, @parameters)
|
167
|
-
system
|
209
|
+
system clear if @loop
|
168
210
|
puts Yummi.colorize(Time.now.strftime("At %H:%M:%S%n"), :white) if @loop
|
169
211
|
puts content.chomp
|
170
212
|
rescue RBoss::Cli::InvocationFailed => e
|
171
|
-
puts
|
213
|
+
puts e.message.red
|
172
214
|
end
|
173
215
|
end
|
174
216
|
|
@@ -182,5 +224,5 @@ begin
|
|
182
224
|
execute_actions
|
183
225
|
|
184
226
|
rescue Interrupt
|
185
|
-
puts
|
227
|
+
puts "Aborted!".colorize(:red)
|
186
228
|
end
|
data/bin/rboss-twiddle
CHANGED
@@ -89,11 +89,11 @@ end
|
|
89
89
|
command = mbean_id.to_s.gsub(/_/, '-')
|
90
90
|
if mbean[:scan]
|
91
91
|
opts.on("--#{command} [name_a,name_b,...]", Array,
|
92
|
-
"Detail \"#{mbean[:
|
92
|
+
"Detail \"#{mbean[:title]}\" based on the given names (no names for scan)") do |names|
|
93
93
|
@mbeans[mbean_id] = names || :all
|
94
94
|
end
|
95
95
|
elsif mbean[:properties]
|
96
|
-
opts.on("--#{command}", "Detail \"#{mbean[:
|
96
|
+
opts.on("--#{command}", "Detail \"#{mbean[:title]}\"") do
|
97
97
|
@mbeans[mbean_id] = true
|
98
98
|
end
|
99
99
|
end
|
data/lib/rboss/cli/invoker.rb
CHANGED
@@ -95,7 +95,7 @@ module RBoss
|
|
95
95
|
help_printed = false
|
96
96
|
info = Yummi::colorize("Please input the requested parameters", :yellow)
|
97
97
|
props.each do |name, detail|
|
98
|
-
next if (@skip_optional and not detail['required'] or detail['default'])
|
98
|
+
next if (@skip_optional and (not detail['required'] or detail['default']))
|
99
99
|
parameter_type = detail['type']
|
100
100
|
input = parameters[name]
|
101
101
|
unless input
|
@@ -107,8 +107,8 @@ module RBoss
|
|
107
107
|
input_message << ' | ' << RBoss::Colorizers.type(parameter_type).colorize(parameter_type)
|
108
108
|
input_message << ' | ' << Yummi::colorize("Required", :red) if required
|
109
109
|
input_message << ' | ' << Yummi::colorize("Optional", :cyan) unless required
|
110
|
-
input_message << ' | ' << Yummi::colorize("
|
111
|
-
input_message << "\n" << Yummi::colorize(detail['description'],
|
110
|
+
input_message << ' | ' << Yummi::colorize("[#{default_value}]", :blue) if default_value
|
111
|
+
input_message << "\n" << Yummi::colorize(detail['description'], "bold.black")
|
112
112
|
puts input_message
|
113
113
|
input = get_input
|
114
114
|
while required and input.empty?
|
@@ -131,18 +131,18 @@ module RBoss
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
result = result("#{path}:#{builder}")
|
134
|
-
puts Yummi::colorize("Result:", :intense_yellow)
|
135
134
|
#TODO print a table using the returned parameters
|
136
|
-
|
135
|
+
YAML::dump(result).on_box
|
137
136
|
end
|
138
137
|
|
139
|
-
def execute(
|
138
|
+
def execute(commands)
|
139
|
+
commands = [commands] if commands.is_a? String
|
140
140
|
exec = "#{command} --command#{commands.size > 1 ? 's' : ''}=\"#{commands.join ','}\""
|
141
141
|
@logger.debug exec
|
142
142
|
`#{exec}`.chomp
|
143
143
|
end
|
144
144
|
|
145
|
-
def result(
|
145
|
+
def result(commands)
|
146
146
|
eval_result(execute commands)
|
147
147
|
end
|
148
148
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
---
|
2
|
+
description: Details Deployment Scanner
|
3
|
+
path: /subsystem=deployment-scanner/scanner=${NAME}
|
4
|
+
scan: ls /subsystem=deployment-scanner/scanner
|
5
|
+
print:
|
6
|
+
- title: Scanner
|
7
|
+
layout: vertical
|
8
|
+
properties:
|
9
|
+
- auto-deploy-exploded
|
10
|
+
- auto-deploy-xml
|
11
|
+
- auto-deploy-zipped
|
12
|
+
- deployment-timeout
|
13
|
+
- path
|
14
|
+
- relative-to
|
15
|
+
- scan-enabled
|
16
|
+
- scan-interv
|
17
|
+
header:
|
18
|
+
- Auto Deploy Exploded
|
19
|
+
- Auto Deploy XML
|
20
|
+
- Auto Deploy Zipped
|
21
|
+
- Deployment Timeout
|
22
|
+
- Path
|
23
|
+
- Relative To
|
24
|
+
- Scan Enabled
|
25
|
+
- Scan Interval
|
26
|
+
format:
|
27
|
+
auto_deploy_exploded: boolean
|
28
|
+
auto_deploy_xml: boolean
|
29
|
+
auto_deploy_zipped: boolean
|
30
|
+
scan_enabled: boolean
|
31
|
+
color:
|
32
|
+
auto_deploy_exploded: boolean
|
33
|
+
auto_deploy_xml: boolean
|
34
|
+
auto_deploy_zipped: boolean
|
35
|
+
scan_enabled: boolean
|
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
description: Details Interfaces
|
3
|
+
path: /interface=${NAME}
|
4
|
+
scan: ls /interface
|
5
|
+
print:
|
6
|
+
- title: Interfaces
|
7
|
+
layout: vertical
|
8
|
+
properties:
|
9
|
+
- any
|
10
|
+
- any-address
|
11
|
+
- any-ipv4-address
|
12
|
+
- any-ipv6-address
|
13
|
+
- inet-address
|
14
|
+
- link-local-address
|
15
|
+
- loopback
|
16
|
+
- loopback-address
|
17
|
+
- multicast
|
18
|
+
- nic
|
19
|
+
- nic-match
|
20
|
+
- not
|
21
|
+
- point-to-point
|
22
|
+
- public-address
|
23
|
+
- resolved-address
|
24
|
+
- site-local-address
|
25
|
+
- subnet-match
|
26
|
+
- up
|
27
|
+
- virtual
|
28
|
+
header:
|
29
|
+
- Any
|
30
|
+
- Any address
|
31
|
+
- Any IPv4 address
|
32
|
+
- Any IPv6 Address
|
33
|
+
- Inet Address
|
34
|
+
- Link Local Address
|
35
|
+
- Loopback
|
36
|
+
- Loopback Address
|
37
|
+
- Multicast
|
38
|
+
- NIC
|
39
|
+
- NIC Match
|
40
|
+
- Not
|
41
|
+
- Point-to-point
|
42
|
+
- Public Address
|
43
|
+
- Resolved Address
|
44
|
+
- Site Local Address
|
45
|
+
- Subnet Match
|
46
|
+
- Up
|
47
|
+
- Virtual
|
@@ -21,10 +21,10 @@ print:
|
|
21
21
|
system_load: percentage
|
22
22
|
color:
|
23
23
|
name:
|
24
|
-
with:
|
24
|
+
with: bold.white
|
25
25
|
system_load:
|
26
26
|
threshold:
|
27
|
-
0.8:
|
27
|
+
0.8: bold.red
|
28
28
|
0.7: red
|
29
29
|
0.5: yellow
|
30
30
|
0: green
|
@@ -47,7 +47,7 @@ print:
|
|
47
47
|
- Launch Type
|
48
48
|
color:
|
49
49
|
server_name:
|
50
|
-
with:
|
50
|
+
with: bold.white
|
51
51
|
|
52
52
|
- id: memory
|
53
53
|
title: Server Memory Usage
|
@@ -92,10 +92,10 @@ print:
|
|
92
92
|
|
93
93
|
color:
|
94
94
|
max_heap:
|
95
|
-
with:
|
95
|
+
with: bold.white
|
96
96
|
|
97
97
|
max_non_heap:
|
98
|
-
with:
|
98
|
+
with: bold.white
|
99
99
|
|
100
100
|
health:
|
101
101
|
used_heap:
|
@@ -187,4 +187,4 @@ print:
|
|
187
187
|
- Temp Directory
|
188
188
|
color:
|
189
189
|
server_name:
|
190
|
-
with:
|
190
|
+
with: bold.white
|
data/lib/rboss/cli/resource.rb
CHANGED
@@ -30,7 +30,7 @@ module RBoss
|
|
30
30
|
@invoker = invoker
|
31
31
|
@context = {
|
32
32
|
:name => '',
|
33
|
-
:read_resource => 'read-resource(include-runtime=true,recursive=true)'
|
33
|
+
:read_resource => 'read-resource(include-runtime=true,recursive=true,include-defaults=true,proxies=true)'
|
34
34
|
}
|
35
35
|
@context[:path] = parse(@config[:path])
|
36
36
|
@tables = []
|
@@ -42,7 +42,6 @@ module RBoss
|
|
42
42
|
send operation.to_key, resource_names, arguments
|
43
43
|
else
|
44
44
|
interact_to_invoke operation, resource_names, arguments
|
45
|
-
Yummi.colorize('Operation Executed!', :green)
|
46
45
|
end
|
47
46
|
end
|
48
47
|
|
@@ -62,25 +61,29 @@ module RBoss
|
|
62
61
|
add_row(p)
|
63
62
|
end
|
64
63
|
end
|
65
|
-
|
64
|
+
box = Yummi::TextBox::new
|
65
|
+
box.style.border[:color] = "bold.black"
|
66
|
+
width = 0
|
66
67
|
@tables.each do |table|
|
67
|
-
|
68
|
-
result << $/
|
68
|
+
width = [width, table.width].max
|
69
69
|
end
|
70
|
-
|
70
|
+
@tables.each do |table|
|
71
|
+
box << table.to_s
|
72
|
+
box.add("-" * width, :color => "bold.black") unless table == @tables.last
|
73
|
+
end
|
74
|
+
box.to_s
|
71
75
|
end
|
72
76
|
|
73
77
|
def read_operation_names(resource_name, arguments)
|
74
|
-
operations =
|
75
|
-
operations << $/
|
78
|
+
operations = ""
|
76
79
|
with resource_name do
|
77
80
|
result = @invoker.result("#{@context[:path]}:read-operation-names")
|
78
81
|
result.each do |operation|
|
79
|
-
operations <<
|
80
|
-
operations <<
|
82
|
+
operations << '- '.bold.magenta
|
83
|
+
operations << operation.bold.blue << $/
|
81
84
|
end
|
82
85
|
end
|
83
|
-
operations
|
86
|
+
operations.on_box
|
84
87
|
end
|
85
88
|
|
86
89
|
def read_operation_description (resource_name, arguments)
|
@@ -88,11 +91,11 @@ module RBoss
|
|
88
91
|
with resource_name do
|
89
92
|
operation_name = arguments['name']
|
90
93
|
table = Yummi::Table::new
|
91
|
-
buff <<
|
94
|
+
buff << operation_name.bold.green << $/
|
92
95
|
result = @invoker.result(
|
93
96
|
"#{@context[:path]}:read-operation-description(name=#{operation_name})"
|
94
97
|
)
|
95
|
-
buff <<
|
98
|
+
buff << result['description'].bold.black << $/ * 2
|
96
99
|
table.title = 'Request'
|
97
100
|
table.header = %w(Parameter Type Required Default)
|
98
101
|
table.aliases = %w(name type required default)
|
@@ -137,13 +140,13 @@ module RBoss
|
|
137
140
|
buff << table.to_s << $/
|
138
141
|
end
|
139
142
|
end
|
140
|
-
buff
|
143
|
+
buff.chomp.on_box
|
141
144
|
end
|
142
145
|
|
143
146
|
private
|
144
147
|
|
145
148
|
def build_nested(detail, parent_name = '', result = [])
|
146
|
-
if detail['value-type']
|
149
|
+
if detail['value-type'].respond_to? :each
|
147
150
|
detail['value-type'].each do |name, _detail|
|
148
151
|
name = "#{parent_name}#{name}"
|
149
152
|
_detail['name'] = name
|
@@ -156,7 +159,7 @@ module RBoss
|
|
156
159
|
|
157
160
|
def interact_to_invoke(operation, resource_name, arguments)
|
158
161
|
with resource_name do
|
159
|
-
@invoker.gets_and_invoke(@context[:path], operation, arguments)
|
162
|
+
return @invoker.gets_and_invoke(@context[:path], operation, arguments)
|
160
163
|
end
|
161
164
|
end
|
162
165
|
|
@@ -70,6 +70,7 @@ module RBoss
|
|
70
70
|
def eval_result(result)
|
71
71
|
undefined = nil #prevents error because undefined means nil in result object
|
72
72
|
result = result.gsub(/(\d+)L/, '\1') #removes the long type mark
|
73
|
+
result = result.gsub(/expression\s/, '') #removes the expression indicator
|
73
74
|
result = eval(result)
|
74
75
|
raise InvocationFailed::new(result["failure-description"]) if result["outcome"] == "failed"
|
75
76
|
result["result"]
|
data/lib/rboss/plaftorm.rb
CHANGED
@@ -40,6 +40,10 @@ module RBoss
|
|
40
40
|
def run_conf
|
41
41
|
"#{@jboss.profile}/run.conf.bat"
|
42
42
|
end
|
43
|
+
|
44
|
+
def clear
|
45
|
+
"cls"
|
46
|
+
end
|
43
47
|
end
|
44
48
|
else
|
45
49
|
module Platform
|
@@ -58,6 +62,10 @@ module RBoss
|
|
58
62
|
def run_conf
|
59
63
|
"#{@jboss.profile}/run.conf"
|
60
64
|
end
|
65
|
+
|
66
|
+
def clear
|
67
|
+
"clear"
|
68
|
+
end
|
61
69
|
end
|
62
70
|
end
|
63
71
|
|
data/lib/rboss/version.rb
CHANGED
@@ -38,6 +38,7 @@ module RBoss
|
|
38
38
|
|
39
39
|
def build_table
|
40
40
|
if @name_column
|
41
|
+
@config[:header] ||= []
|
41
42
|
@config[:header] = [] if @only_name
|
42
43
|
@config[:header] = [@name_column] + @config[:header]
|
43
44
|
end
|
@@ -59,7 +60,7 @@ module RBoss
|
|
59
60
|
table.format_null :with => 'undefined'
|
60
61
|
table.colorize_null :with => :red
|
61
62
|
|
62
|
-
table.colorize :name, :with =>
|
63
|
+
table.colorize :name, :with => "bold.white" if @name_column
|
63
64
|
|
64
65
|
table
|
65
66
|
end
|
data/rboss.gemspec
CHANGED
@@ -2,22 +2,22 @@
|
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
3
|
require "rboss/version"
|
4
4
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = "rboss"
|
7
|
+
gem.version = RBoss::VERSION
|
8
|
+
gem.authors = ["Ataxexe"]
|
9
|
+
gem.email = ["ataxexe@gmail.com"]
|
10
|
+
gem.homepage = "https://github.com/ataxexe/rboss"
|
11
|
+
gem.summary = %q{Manage your JBoss from your command line.}
|
12
|
+
gem.description = %q{Rboss gives you a set of command line tools to configure a JBoss instance
|
13
13
|
and use jboss-cli and twiddle wrapped by an elegant interface}
|
14
14
|
|
15
|
-
|
15
|
+
gem.rubyforge_project = "rboss"
|
16
16
|
|
17
|
-
|
17
|
+
gem.add_dependency 'yummi', '>=0.9.0'
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
gem.files = `git ls-files`.split("\n")
|
20
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
|
+
gem.require_paths = ["lib"]
|
23
23
|
end
|
data/rboss.iml
CHANGED
@@ -8,10 +8,9 @@
|
|
8
8
|
<sourceFolder url="file://$MODULE_DIR$/bin" isTestSource="false" />
|
9
9
|
<excludeFolder url="file://$MODULE_DIR$/pkg" />
|
10
10
|
</content>
|
11
|
-
<orderEntry type="
|
11
|
+
<orderEntry type="inheritedJdk" />
|
12
12
|
<orderEntry type="sourceFolder" forTests="false" />
|
13
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.
|
14
|
-
<orderEntry type="library" scope="PROVIDED" name="yummi (v0.6.2, RVM: ruby-1.9.3-p194) [gem]" level="application" />
|
13
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.2.3, RVM: ruby-1.9.3-p374) [gem]" level="application" />
|
15
14
|
</component>
|
16
15
|
<component name="org.twodividedbyzero.idea.findbugs">
|
17
16
|
<option name="_basePreferences">
|
data/rboss.ipr
CHANGED
@@ -86,7 +86,11 @@
|
|
86
86
|
<entry name="?*.ftl" />
|
87
87
|
<entry name="trace.info" />
|
88
88
|
</wildcardResourcePatterns>
|
89
|
-
<annotationProcessing
|
89
|
+
<annotationProcessing>
|
90
|
+
<profile default="true" name="Default" enabled="false">
|
91
|
+
<processorPath useClasspath="true" />
|
92
|
+
</profile>
|
93
|
+
</annotationProcessing>
|
90
94
|
</component>
|
91
95
|
<component name="CopyrightManager" default="">
|
92
96
|
<copyright>
|
@@ -157,6 +161,11 @@
|
|
157
161
|
<option name="LOCALE" />
|
158
162
|
<option name="OPEN_IN_BROWSER" value="true" />
|
159
163
|
</component>
|
164
|
+
<component name="Jenkins.Application.Settings">
|
165
|
+
<option name="rssSettings">
|
166
|
+
<RssSettings />
|
167
|
+
</option>
|
168
|
+
</component>
|
160
169
|
<component name="Palette2">
|
161
170
|
<group name="Swing">
|
162
171
|
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
@@ -314,7 +323,7 @@
|
|
314
323
|
<component name="ProjectResources">
|
315
324
|
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
|
316
325
|
</component>
|
317
|
-
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="RVM: ruby-1.9.3-
|
326
|
+
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="RVM: ruby-1.9.3-p374" project-jdk-type="RUBY_SDK">
|
318
327
|
<output url="file://$PROJECT_DIR$/out" />
|
319
328
|
</component>
|
320
329
|
<component name="ResourceManagerContainer">
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rboss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yummi
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.9.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.9.0
|
30
30
|
description: ! "Rboss gives you a set of command line tools to configure a JBoss instance\n
|
31
31
|
\ and use jboss-cli and twiddle wrapped by an elegant interface"
|
32
32
|
email:
|
@@ -51,6 +51,8 @@ files:
|
|
51
51
|
- lib/rboss/cli/mappings.rb
|
52
52
|
- lib/rboss/cli/mappings/resources/connector.yaml
|
53
53
|
- lib/rboss/cli/mappings/resources/datasource.yaml
|
54
|
+
- lib/rboss/cli/mappings/resources/deployment-scanner.yaml
|
55
|
+
- lib/rboss/cli/mappings/resources/interface.yaml
|
54
56
|
- lib/rboss/cli/mappings/resources/jdbc_driver.yaml
|
55
57
|
- lib/rboss/cli/mappings/resources/server.yaml
|
56
58
|
- lib/rboss/cli/resource.rb
|