Mu Ruby Gem
The Mu Ruby gem contains command line application (executables) designed to help you work with Scenarios, Test Sets, Scale tests and all results generated from those tests. The gem also supports older REST API commands that you can use to configure the test network interfaces on the appliance, get system status, or even access the appliance CLI. API library classes are exposed for use in your own custom gems.
Before Using the Gem
Before using this gem, you must install the necessary software, which
includes ruby 1.8.6 and the following gems (sudo gem install
gem
):
- hexy. This ensures that hex dumps print pretty :)
- json_pure. Don't confuse this with the json gem (that won't work).
- nokogiri. See http://nokogiri.org/tutorials/installing_nokogiri.html for help.
- rest-client. Used for HTTP calls.
- mime-types. Required by REST-client.
You also need to set the following environment variables:
- MU_IP. Set the default IP address of the appliance management interface.
- MU_ADMIN_USER. Set the default name of the admin user.
- MU_ADMIN_PASS. Set the default admin user password.
Supported Command Types
Executables are command-line applications are used for loading and verifying Scenarios, creating and running Test Sets, and configuring and running Scale tests.
Legacy REST API Commands provide access to legacy REST API commands supported by the appliance.
API Library Classes can be ‘required’ and used within Ruby scripts (like most ruby gems).
Documentation Format
Command documentation uses the format:
command
- description
- syntax
- example
options
-command-short-name/--command-long-name parameter
description
Executables
The following command-line applications are used for loading and verifying Scenarios, creating and running Test Sets, and configuring and running Scale tests.
cmd_appid
Use to run Scale tests for a multi-host App-ID .msl file or a directory of .msl files. Supports command-line options for setting test parameters (such as concurrency and pattern) and for configuring a client/server passthrough Test Bed. Spirent Studio automatically collapses all hosts in the App-ID Scenario to just two hosts, which must be set to two appliance interfaces.
» see cmd_appid options | » see documentation format | » back to top
help
- Gets help for all cmd_appid commands.
help
mu cmd_appid:help
run_file
- Runs the specified .msl file.
run_file -s
msl-filename
mu cmd_appid:run_file -s msl_file -i a1,a2 -m admin:[email protected] -p 1-10000:60
run_dir
- Runs all .msl files in the specified directory.
run_dir -d
msl-directory
mu cmd_appid:run_dir -d msl_file_directory -i a1-10000,a2 -m admin:[email protected] -p 1-100000:360
running?
- Gets status of the scale player.
running?
mu cmd_appid:running?
Options
-c/--csv csv-filename
Specify the .csv filename with test cases to run.
-d/--dir
Specify the directory with .msl files to run (required for run_dir).
-h/--help
Get help on command line options.
-i/--interfaces
Specify test interfaces as a comma-separated list. Example:
b1,b2
. When using an IP range, specify range and offset. Example:b1-1000:0,b2
.
-m/--mu_string user:pass@mu-ip
Specify the user, password, and management IP of the appliance. Example:
admin:[email protected]
.
-o/--output
Specify the filename to which you want to output logs.
-p/--pattern <start:dur,end:dur>
Specify pattern as concurrency-start:duration,concurrency-end:duration. Duration is in seconds. Example:
1-10000:60,10000-1:30
.
-s/--scenario
Specify the .msl filename (required for run_msl)
-t/--test
Run a verification check only.
-v/--verbose
Set the Logger::DEBUG level.
cmd_runscale
Use to run Scale tests by specifying a Scenario .msl file or a directory of .msl files. Supports command-line options for setting test parameters (such as concurrency and pattern) and for configuring the Test Bed with appliance interfaces and/or network hosts.
» see cmd_runscale options | » see documentation format | » back to top
help
- Gets help for all cmd_runscale commands
help
mu cmd_runscale:help
run_file
- Runs a Scale test for the specified .msl file
run_file -s
msl-filename
-i
interface,host
-p
pattern
mu cmd_runscale:run_file -s msl_file -i a1,dell-9 -p 1-100:30
run_dir
- Runs a Scale test for all .msl files in the specified directory. To include all .msl files in nested directories, use -r to perform a recursive directory search.
run_dir -d
msl_directory
-r
mu cmd_runscale:run_dir -d msl_file_directory
running?
- Gets status of the Scale player.
running?
mu cmd_runscale:running?
run_files
- Runs a Scale test for each .msl file in the specified directory (optionally, you can specify single .msl file). To include all .msl files in nested directories, use -r to perform a recursive directory search.
run_file -d
msl-directory
-r -i
interfaces,hosts
-p
pattern
mu cmd_runscale:run_file -d msl_file_directory -r -i a1,dell-9 -p 1-100:30
Options
-c/--csv csv-filename
Specify the filename of the .csv file that contains the test cases to run.
-d/--dir directory
Specify the directory that contains .msl files to run (required for run_dir). Does not include nested directories.
-f/--default_host default-host
Specify the default host. This host is used for all hosts in the scenario which have not been explicitly assigned.
-h/--help
Get help on command line options.
-i/--interfaces interfaces
Specify test interfaces as a comma-separated list. Example:
b1,b2
. When using an IP range, specify range and offset. Example:b1-1000:0,b2
.
-m/--mu_string user:password@mu-ip
Specify the user, password, and management IP of the appliance. Example:
admin:[email protected]
.
-o/--output filename
Specify the filename to which you want to output logs.
-p/--pattern con-start:dur,con-end:dur
Specify pattern as concurrency_start:duration,concurrency-end:duration. Duration is in seconds. Example:
1-10000:60,10000-1:30
.
-r/--recursive
Perform a recursive directory search. Use with run_dir and run_files to run Scale tests for all .msl files contained in nested directories.
-s/--scenario msl-filename
Specify the .msl filename (required for run_msl).
-t/--test
Run a verification check only.
-v/--verbose
Set the Logger::DEBUG level.
cmd_runverify
Use to load a Scenario and Test Set template (.xml files) and run a Test Set in Studio Verify. Supports command-line options for setting option values and for configuring the Test Bed with test interfaces and/or network hosts.
» see cmd_runverify options | » see documentation format | » back to top
help
- Gets help for all cmd_runverify commands.
help
mu cmd_runverify:help
run
- Runs the specified Test Set template for the specified Scenario.
run -s
scenario.xml
-t
test-set.xml
-i
interface,host
mu cmd_runverify:run -s my_scenario -t my_testset -i a1,my-server
Options
-c/--channels hosts
Specify channel hosts as a comma-separated list.
-d/--dir directory
Specify the directory with Scenario templates to run.
-h/--help
Get help on command line options.
-i/--interfaces interfaces
Specify test interfaces and network hosts as a comma-separated list. Example:
b1,b2
. When using an IP range, specify range/offset. Example:b1-1000:0,web-server
.
-m/--mu_string user:password@mu-ip
Specify the user, password, and management IP of the appliance. Example:
admin:[email protected]
.
-o/--output filename
Specify the filename to which you want to output logs.
-p/--options option:value
Specify option/value pairs as a comma-separated list. Example:
user:jane,email:[email protected]
.
-s/--scenario scenario-template
Specify the Scenario template to run (must be xml).
-t/--testset testset-template
Specify the Test Set template to run (must be xml).
-v/--verbose
Set the Logger::DEBUG level.
cmd_runscenario
Use to load and verify a Scenario template (.xml file). Supports command-line options for configuring the Test Bed with test interfaces and/or network hosts.
» see cmd_runscenario options | » see documentation format | » back to top
help
- Gets help for all cmd_runscenario commands
help
mu cmd_runscenario:help
run
- Runs the specified Scenario template.
run -s
scenario.xml
-i
interfaces,hosts
mu cmd_runscenario:run -s my_scenario -i a1,my-server
Options
-c/--channels hosts
Specify channel hosts as a comma-separated list.
-d/--dir directory
Specify the directory with Scenario templates to run.
-h/--help
Get help on command line options.
-i/--interfaces interfaces
Specify test interfaces and network hosts as a comma-separated list. Example:
b1, b2
. When using an IP range, specify range/offset. Example:b1-1000:0,web-server
.
-m/--mu_string user:password@mu-ip
Specify the user, password, and management IP of the appliance. Example:
admin:[email protected]
.
-o/--output filename
Specify the filename to which you want to output logs.
-s/--scenario scenario-template
Specify the Scenario template to run (must be xml).
-v/--verbose
Set the Logger::DEBUG level.
cmd_musl
Use to create .msl files from HTTP Archive (.har) files, which
capture web page loading information in JSON format. You can use the
from_har
command to transform a .har file into a Scenario (in .msl
format) suitable for import into Spirent Studio.
» see cmd_musl options | » see documentation format | » back to top
help
- Gets help for all cmd_musl commands.
help
mu cmd_musl:help
from_har
- Creates a .msl file from the specified .har file. If you omit the scenario filename, the output .msl file uses the har_filename.
from_har
options
-s
scenario_filename.msl har_filename.har
mu cmd_musl:from_har --ignore-images -s my_scenario.msl my_har_file.har
escape
- Escape special javascript characters ( $ , " , ' ) in the return payload of the .msl file.
escape -s
filename.msl
mu cmd_musl:escape -s my_scenario.msl -o escaped_characters.js
bin2hex
- Convert a binary file into a hex string that can be included in a Scenario response.
bin2hex -s
filename.msl
mu cmd_musl:bin2hex -s my_scenario.msl -o hex_string_file
Options
-h/--help
Get help on command line options.
--ignore-non-essentials
Ignore unknown application files, Javascript (js) files, Cascading Style Sheet (css) files, and all image files.
--ignore-images
Ignore image files.
--ignore-css
Ignore CSS files.
--ignore-js
Ignore Javascript (js) files.
--ignore-payload
Ignore the content payload.
--strip-large-content[size]
Replace large blocks of response content with a repeated field.
--skip-ssl-passthru[size]
Skip all SSL transport options and structure as TCP.
-o/--output filename
Specify the filename of the output file. For escape output, the output file is typically a .js file. For bin2hex output, you can assign the file extension of your choice.
-s/--scenario filename
Specify the name of the msl file. When this option is not used in the command, the system uses the har filename as the msl filename.
-v/--verbose
Set the Logger::DEBUG level.
Legacy API Commands
These commands provide access to legacy REST API commands supported by the appliance.
cmd_muapi
Use to access the legacy REST API for Test Runs (Protocol Mutation, Scenario Mutation, Denial-of-Service, and Published Vulnerability tests).
» see cmd_muapi options | » see documentation format | » back to top
help
- Gets help for all cmd_muapi commands.
help
mu cmd_muapi:help
archive
- Manage archives (reports) for Test Runs. The run command uses the uuid of the Test Run; the status and get commands require the job_id returned by the run command.
- To generate an archive:
archive -c run -u
uuid
mu cmdd_muapi:archive -c run -u 52add3cf-9040-42ce-b263-8233039931d5
- To get the status of the archive report:
archive -c status -u
job-id
mu cmd_muapi:archive -c status -u 1296064526931
- To download the archive report:
archive -c get -u
job-id
mu cmd_muapi:archive -c get -u 1296064526931
backup
- Manage system backup files. Supports
get
,run
, andstatus
commands. - To generate system backup:
backup -c run
mu cmd_muapi:backup -c run
- To get the status of the backup job:
backup -c status
mu cmd_muapi:backup -c status
- To download the backup file (requires a name):
backup -c get -n
filename
mu cmd_muapi:backup -c get -n my-backup
The appliance automatically appends the .dat extension to all backup files.
capture
- Manage packet captures recorded using the appliance. The
status
andget
commands require the job-id returned by therun
command. capture -c
command
-p
port-number
-u
job-id
- To start recording packets (this command returns the job-id):
capture -c run -p
port-number
mu cmd_muapi:capture -c run -p a1
- To get the status of the packet recording job:
capture -c status -p
port-number
-u
job-id
mu cmd_muapi:capture -c status -p a1 -u 1296064526931
- To download the recorded packet capture:
capture -c get -p
port-number
-u
job-id
mu cmd_muapi:capture -c get -p a1 -u 1296064526931
delete
- Delete the specified Test Run or template
delete -u
uuid
mu cmd_muapi:delete -u 52add3cf-9040-42ce-b263-8233039931d5
export_by_name
- Export the specified template.
export_by_name -n
name
-t
type
mu cmd_muapi:export_by_name -n my_monitor -t monitor
get_faults
- Get a list of faults (xml format) from a Test Run.
get_faults -u
uuid
-v
mu cmd_muapi:get_faults -u 52add3cf-9040-42ce-b263-8233039931d5 -v
get_name
- Get details for the specified Test Run or template.
get_name -u
uuid
mu cmd_muapi:get_name -u 52add3cf-9040-42ce-b263-8233039931d5
list
- Get a list of templates by type.
list -t
template-type
mu cmd_muapi:list -t monitor
list_by_status
- Get a list of Test Runs by status.
list_by_status -s
status
mu cmd_muapi:list_by_status -s finished
list_type
- Get a list of all template types.
list_types
mu cmd_muapi:list_types
pause
- Pause a Test Run.
pause -u
uuid
mu cmd_muapi:pause -u 52add3cf-9040-42ce-b263-8233039931d5
resume
- Resume a Test Run.
resume -u
uuid
mu cmd_muapi:pause -u 52add3cf-9040-42ce-b263-8233039931d5
run
- Start a Test Run (to rename, use the -b argument).
run -u
uuid
[
-b
new-name
]
mu cmd_muapi:run -u 52add3cf-9040-42ce-b263-8233039931d5 -b true
status
- Get the status of a Test Run.
status -u
uuid
mu cmd_muapi:status -u 52add3cf-9040-42ce-b263-8233039931d5
stop
- Stop a Test Run.
stop -u
uuid
mu cmd_muapi:stop -u 52add3cf-9040-42ce-b263-8233039931d5
Options
-b/--boolean value
Specify a boolean value (true or false).
-c/--command command
Specify the command to run (run, get, status, etc.)
-m/--mu_string user:password@mu-ip
Specify the user, password, and management IP of the appliance. Example:
admin:[email protected]
.
-n/--name name
Specify a Test Run or template name.
-o/--output filename
Specify the filename to which you want to output logs.
-p/--port port-number
Specify the port number.
-s/--status status
Specify the status filter (running, finished, aborted queued, or failed)
-t/--type template-type
Specify the type of template.
-u/--uuid uuid/job-id
Specify the UUID of the template to run. For archive, backup, and capture commands, this option takes a job-id value.
-v/--verbose
Set the Logger::DEBUG level.
cmd_netconfig
Use to access the legacy REST API for configuring test interfaces, network hosts, and routes.
» see cmd_netconfig options | » see documentation format | » back to top
help
- Gets help for all cmd_netconfig commands.
help
mu cmd_netconfig:help
clear_hosts
- Remove all network hosts configured in the appliance.
clear_hosts
mu cmd_netconfig:clear_hosts
clear_interface
- Clear settings for specified test interfaces.
clear_interface -i
interface,interface
mu cmd_netconfig:clear_interface -i b1,b2
clear_routes
- Remove all user-configured routes in the appliance.
clear_routes
mu cmd_netconfig:clear_routes
clear_vlans
- Remove all vlans for all test interfaces.
clear_vlans
mu cmd_netconfig:clear_vlans
create
- Create a network object such as a host or route.
create -j
object
-e
value
mu cmd_netconfig:create -j "{"default": false,"direct": false,"dst": "10.0.0.0","dst_pfx_len": 8,"gateway": "192.168.100.1","interface": "a1","interface_display_name": "A1","metric": 1,"readonly": false}" -e routes
delete
- Delete a network object such as host or route.
delete -e
value
mu cmd_netconfig:delete -e Web-Server
get
- Get details for a network object.
get -e
value
mu cmd_netconfig:get -e a1
modify
- Modify a network object such as a host or route.
modify -j
object
-e
value
mu cmd_netconfig:modify -j {"mac": "","name": "Web-Server","notes": "","v4_addr": "192.168.112.205", "v6_global_addr": "","v6_local_addr": ""} -e host
resolve_hosts
- Get IP address for specified network host.
resolve_hosts
host
mu cmd_netconfig:resolve_hosts Web-Server
restore
- Restore from specified file (to overwrite existing object, use the -b argument).
restore -f
filepath
[
-b
clear-existing
]
mu cmd_netconfig:restore -f my_muhosts/web-server.json true
save
- Save changes to the appliance.
save
mu cmd_netconfig:save
Options
-b/--boolean value
Specify a boolean value (true or false).
-e/--element value
Specify a value for the associated command. Example:
interfaces
orinterfaces/a1
.
-f/--filepath filepath
Specify the path to a file.
-h/--help
Get help on command line options.
-i/--interfaces interface-or-host
Specify test interfaces or network hosts as a comma-separated list. Example:
b1,web-server
.
-j/--json object
Specify a json object as a text string.
-m/--mu_string user:password@mu-ip
Specify a user, password, and management IP of the appliance. Example:
admin:[email protected]
.
-o/--output filename
Specify the filename to which you want to output logs.
-v/--verbose
Set the Logger::DEBUG level.
cmd_ddt
Use to access the legacy REST API for Test Sets (Studio Verify).
» see cmd_ddt options | » see documentation format | » back to top
display_results
- Displays results for the current Test Set.
display_results
mu cmd_ddt:display_results
new_session
- Create a new session.
new_session
mu cmd_ddt:new_session
load_scenario
- Load the specified Scenario template.
load_scenario -u
uuid
mu cmd_ddt:load_scenario -u 52add3cf-9040-42ce-b263-8233039931d5
get_hosts
- Get a list of hosts in the Test Bed.
get_hosts
mu cmd_ddt:get_hosts
set_hosts
- Configure the hosts in the Test Bed. Requires host role, host name, and type (network layer).
set_hosts -r
role,role
-n
name,name
-y
type
mu cmd_ddt:set_hosts -r HTTP_Client,HTTP_Server -n a1,Web-Server -y v4
get_channels
- Get a list of channels in the Test Bed.
get_channels
mu cmd_ddt:get_channels
set_channels
- Configure the channels in the Test Bed.
set_channels -r
role
-n
name
mu cmd_ddt:set_channels -r SSH_Channel -n Web-Server
get_options
- Get a list of options in the Test Set.
get_options
mu cmd_ddt:get_options
set_options
- Configure the option values for the Test Set.
set_options -n
name
-p
value
mu cmd_ddt:set_options -n username -p jsmith
get_sessions
- Get a list of all sessions.
get_sessions
mu cmd_ddt:get_sessions
setup_test
- Setup the Test Bed, reserving the test interfaces.
setup_test
mu cmd_ddt:setup_test
run
- Run a Test Set.
run
mu cmd_ddt:run
run_testset
- Run the specified Test Set.
run_testset -u
uuid
mu cmd_ddt:run_testset -u 04aa248a-0b9b-4bf6-97e1-aab691d0acf1
get_testset_results
- Get results for the current Test Set.
get_testset_results
mu cmd_ddt:get_testset_results
get_testset_status
- Get status for the current Test Set.
get_testset_status
mu cmd_ddt:get_testset_status
teardown_test
- Unsets the Test Bed selections, releasing the test interfaces.
teardown_test
mu cmd_ddt:teardown_test
close_session
- Closes the current session.
close_session
mu cmd_ddt:close_session
close_all_sessions
- Closes all existing sessions.
close_all_sessions
mu cmd_ddt:close_all_sessions
csv_export
- Exports a Test Set from the appliance to a csv file.
csv_export -u
uuid
mu cmd_ddt:csv_export -u 52add3cf-9040-42ce-b263-8233039931d5
csv_import
- Imports a .csv file to create a Test Set on the appliance.
csv_import -t
filename.csv
mu cmd_ddt:csv_import -t my-testset.csv
Options
-f/--filename filename
Specify the template name for saving an imported Test Set.
-h/--help
Get help on command line options.
-m/--mu_string user:password@mu-ip
Specify a user, password, and management IP address of the appliance. Example:
admin:[email protected]
.
-n/--names name-array
Specify host names or channel names in a comma-separated array. Example:
a1,Web-Server
.
-o/--output filename
Specify the filename to which you want to output logs.
-p/--option_values value-array
Specify values for Test Set options in a comma-separated array. Example:
bob,jane,mary,tom
.
-r/--roles role-array
Specify host roles in a comma-separated array. Example:
HTTP\_Client,HTTP\_Server
.
-t/--testset filename.csv
Specify the name of the .csv file to import.
-u/--uuid uuid
Specify the UUID of the Scenario or Test Set.
-v/--verbose
Set the Logger::DEBUG level.
-y/--type type
Specify network layer (v4, v6, l2) for all hosts in the Test Bed. Example:
v4
.
cmd_scale
Use to access the legacy REST API for Scale tests (Studio Scale).
» see cmd_scale options | » see documentation format | » back to top
about
- Lists information for the Scale Player and all active and inactive Scale Engines.
about
mu cmd_scale:about
configure
- Configure parameter values for any element of the scale json object.
configure -p
parameter
-pv
value
mu cmd_scale:configure -p json_element -pv json_element_value
data
- Gets chart data for the Scale test.
data -w
view
-z
zoom
-ps
position
-b
bot_id
mu cmd_scale:data -w TIMELINE -z 1 -ps 0 -b bots_10.10.6.200:1
delete_scale_engine
- Delete the specified Scale Engine.
delete_scale_engine -b
bot_id
mu cmd_scale:delete_scale_engine -b bots_10.10.6.200:1
help
- Gets help for all cmd_scale commands.
help
mu cmd_scale:help
list
- Returns the current Scale Player's UUID.
list
mu cmd_scale:list
pcap
- Gets a pcap from a specific Scale Engine.
pcap -b
bot_id
-f
filename
mu cmd_scale:pcap -b bots_10.10.6.200:1 -f bot_1_pcap
release
- Release the Scale Player.
release
mu cmd_scale:release
release_scale_engine
- Releases the specified Scale Engine.
release_scale_engine -b
bot_id
mu cmd_scale:release_scale_engine -b bots_10.10.6.200:1
reserve_scale_engine
- Reserves the specified Scale Engine.
reserve_scale_engine -b
bot_id
mu cmd_scale:reserve_scale_engine -b bots_10.10.6.200:1
session
- Create a new Scale Player session.
session
mu cmd_scale:session
start
- Start the Scale test.
start -c
scale-test
-m
user:pass@mu-ip
mu cmd_scale:start -c scale.json -m admin:[email protected]
status
- Gets information about the currently running Scale test.
status
mu cmd_scale:status
statuses
- Gets the status of all active and inactive Scale engines.
statuses
mu cmd_scale:statuses
stop
- Stops the Scale test.
stop
mu cmd_scale:stop
update
- Update the pattern dynamically (while the Scale test is running).
update -p
parameter
-pv
parameter-value
mu cmd_scale:update -p delay -pv 250 -p volume -pv 100000
verify
- Verifies a Scale test.
verify
mu cmd_scale:verify
Options
-b/--bot-id scale-engine-id
Specify a Scale Engine using its bot-id value.
-c/--config-file json-filename
Specify a .json file that contains the configuration data.
-f/--filename pcap-filename
Specify a name for the .pcap file.
-h/--help
Get help on command line options.
-m/--mu_string user:password@mu-ip
Specify a user, password, and management IP of the appliance. Example:
admin:[email protected]
.
-o/--output filename
Specify the filename to which you want to output logs.
-p/--params parameters
Specify parameters for initial configuration or for update. Supports delay and volume parameters.
-ps/--view_position value
Specify the position in the timeline view for which to return data. At this time, only position 0 is supported.
-pv/--param_value value
Specify a value for a parameter.
-v/--verbose
Set the Logger::DEBUG level.
-w/--view view
Specify the view (RUNTIME or CALLGRAPH) for which to return data.
-z/--zoom zoom-level
Specify the zoom level (0, .5, or 1) in the timeline view for which to return data. 1 returns data for 100% of the time range, 0.5 returns data for 50% of the time range, and 0 returns only the last minute of data.
cmd_homepage
Use to access information displayed on the appliance UI homepage, such as recent updates, backup status, or a list of latest test results.
» see cmd_homepage options | » see documentation format | » back to top
all
- Gets the complete set of information displayed on the appliance UI home page.
all
mu cmd_homepage:all
help
- Gets help for all cmd_homepage commands.
help
mu cmd_homepage:help
latest_test
- Gets an array of the latest test results.
latest_test
mu cmd_homepage:latest_test
queue_test
- Gets an array of tests in the Test Queue.
queue_test
mu cmd_homepage:queue_test
recent
- Gets the "What's New" section from the appliance UI homepage.
recent
mu cmd_homepage:recent
status
- Gets system status for licenses, backup, and updates.
status
mu cmd_homepage:status
Options
-h/--help
Get help on command line options.
-m/--mu_string user:password@mu-ip
Specify a user, password, and management IP address of the appliance. Example:
admin:[email protected]
.
-o/--output filename
Specify the filename to which you want to output logs.
-v/--verbose
Set the Logger::DEBUG level.
cmd_system
Use to restart system services or to get status details for the appliance.
» see cmd_system options | » see documentation format | » back to top
restart
- Restart Studio services (this does not reboot the appliance).
restart
mu cmd_system:restart
status
- Gets all information from the system status page.
status
mu cmd_system:status
status2
- Gets additional system information such as hard drive status, platform model, serial number.
status2
mu cmd_system:status2
Options
-h/--help
Get help on command line options.
-m/--mu_string user:password@mu-ip
Specify a user, password, and management IP address of the appliance. Example:
admin:[email protected]
.
-o/--output filename
Specify the filename to which you want to output logs.
-v/--verbose
Set the Logger::DEBUG level.
cmd_cli
Use to access the Mu CLI.
» see cmd_cli options | » see documentation format | » back to top
cli_help
- Get help for all cmd_cli commands.
cli_help
mu cmd_cli:cli_help
cli_history
- Display the command line history for the current session.
cli_help
mu cmd_cli:history
ping
- Ping the specified IP address from the appliance.
ping -a
ip-address
mu cmd_cli:ping -a 10.10.10.1
question
- Show the available CLI commands.
question
mu cmd_cli:question
traceroute
- Get the network route to a specified IP address from the appliance.
traceroute -a
ip-address
mu cmd_cli:traceroute -a 10.10.10.1
Options
-h/--help
Get help on command line options.
-m/--mu_string user:password@mu-ip
Specify a user, password, and management IP address of the appliance. Example:
admin:[email protected]
.
-o/--output filename
Specify the filename to which you want to output logs.
-v/--verbose
Set the Logger::DEBUG level.
Mu Gem Library Classes
These API library classes can be required and used within Ruby scripts (like most ruby gems).
muapi
require 'rubygems'
require 'mu'
api = Mu::Muapi.new(“*mu-ip*”,”*user*”,”*pass*”)
$log.level = Logger::INFO
api.list_by_status("running")
ddt
require 'rubygems'
require 'mu'
api = Mu::Ddt.new(“*mu-ip*”,”*user*”,”*pass*”)
$log.level = Logger::INFO
api.new_session
scale
require ‘rubygems’
require ‘mu’
api = Mu::Scale.new(“*mu-ip*”,”*user*”,”*pass*”)
$log.level=Logger::INFO
api.configure(musl, *scenario.msl*)
api.configure(csv, *testset.csv*)
api.configure(pattern, *pattern.json*)
For each file type (scenario.msl, testset.csv, pattern.json) you must pass the file contents encoded as a Ruby string. For example:
muslString = File.open(‘*scenario.msl*’, ‘r’, {|f| f.read}
api.configure(musl, muslString)
api.start
api.status
api.stop
api.release
netconfig
require 'rubygems'
require 'mu'
api = Mu::Netconfig.new(“*mu-ip*”,”*user*”,”*pass*”)
$log.level = Logger::INFO
api.get("hosts")
Copyright 2012 Spirent Communications plc, All Rights Reserved.