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.
helpmu cmd_appid:help
run_file
- Runs the specified .msl file.
run_file -smsl-filenamemu 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 -dmsl-directorymu 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
helpmu cmd_runscale:help
run_file
- Runs a Scale test for the specified .msl file
run_file -smsl-filename-iinterface,host-ppatternmu 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 -dmsl_directory-rmu 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 -dmsl-directory-r -iinterfaces,hosts-ppatternmu 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.
helpmu cmd_runverify:help
run
- Runs the specified Test Set template for the specified Scenario.
run -sscenario.xml-ttest-set.xml-iinterface,hostmu 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
helpmu cmd_runscenario:help
run
- Runs the specified Scenario template.
run -sscenario.xml-iinterfaces,hostsmu 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.
helpmu 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_haroptions-sscenario_filename.msl har_filename.harmu 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 -sfilename.mslmu 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 -sfilename.mslmu 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.
helpmu 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 -uuuidmu cmdd_muapi:archive -c run -u 52add3cf-9040-42ce-b263-8233039931d5
- To get the status of the archive report:
archive -c status -ujob-idmu cmd_muapi:archive -c status -u 1296064526931
- To download the archive report:
archive -c get -ujob-idmu cmd_muapi:archive -c get -u 1296064526931
backup
- Manage system backup files. Supports
get,run, andstatuscommands. - To generate system backup:
backup -c runmu cmd_muapi:backup -c run
- To get the status of the backup job:
backup -c statusmu cmd_muapi:backup -c status
- To download the backup file (requires a name):
backup -c get -nfilenamemu 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
statusandgetcommands require the job-id returned by theruncommand. capture -ccommand-pport-number-ujob-id- To start recording packets (this command returns the job-id):
capture -c run -pport-numbermu cmd_muapi:capture -c run -p a1
- To get the status of the packet recording job:
capture -c status -pport-number-ujob-idmu cmd_muapi:capture -c status -p a1 -u 1296064526931
- To download the recorded packet capture:
capture -c get -pport-number-ujob-idmu cmd_muapi:capture -c get -p a1 -u 1296064526931
delete
- Delete the specified Test Run or template
delete -uuuidmu cmd_muapi:delete -u 52add3cf-9040-42ce-b263-8233039931d5
export_by_name
- Export the specified template.
export_by_name -nname-ttypemu 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 -uuuid-vmu cmd_muapi:get_faults -u 52add3cf-9040-42ce-b263-8233039931d5 -v
get_name
- Get details for the specified Test Run or template.
get_name -uuuidmu cmd_muapi:get_name -u 52add3cf-9040-42ce-b263-8233039931d5
list
- Get a list of templates by type.
list -ttemplate-typemu cmd_muapi:list -t monitor
list_by_status
- Get a list of Test Runs by status.
list_by_status -sstatusmu cmd_muapi:list_by_status -s finished
list_type
- Get a list of all template types.
list_typesmu cmd_muapi:list_types
pause
- Pause a Test Run.
pause -uuuidmu cmd_muapi:pause -u 52add3cf-9040-42ce-b263-8233039931d5
resume
- Resume a Test Run.
resume -uuuidmu cmd_muapi:pause -u 52add3cf-9040-42ce-b263-8233039931d5
run
- Start a Test Run (to rename, use the -b argument).
run -uuuid[-bnew-name]mu cmd_muapi:run -u 52add3cf-9040-42ce-b263-8233039931d5 -b true
status
- Get the status of a Test Run.
status -uuuidmu cmd_muapi:status -u 52add3cf-9040-42ce-b263-8233039931d5
stop
- Stop a Test Run.
stop -uuuidmu 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.
helpmu cmd_netconfig:help
clear_hosts
- Remove all network hosts configured in the appliance.
clear_hostsmu cmd_netconfig:clear_hosts
clear_interface
- Clear settings for specified test interfaces.
clear_interface -iinterface,interfacemu cmd_netconfig:clear_interface -i b1,b2
clear_routes
- Remove all user-configured routes in the appliance.
clear_routesmu cmd_netconfig:clear_routes
clear_vlans
- Remove all vlans for all test interfaces.
clear_vlansmu cmd_netconfig:clear_vlans
create
- Create a network object such as a host or route.
create -jobject-evaluemu 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 -evaluemu cmd_netconfig:delete -e Web-Server
get
- Get details for a network object.
get -evaluemu cmd_netconfig:get -e a1
modify
- Modify a network object such as a host or route.
modify -jobject-evaluemu 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_hostshostmu cmd_netconfig:resolve_hosts Web-Server
restore
- Restore from specified file (to overwrite existing object, use the -b argument).
restore -ffilepath[-bclear-existing]mu cmd_netconfig:restore -f my_muhosts/web-server.json true
save
- Save changes to the appliance.
savemu 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:
interfacesorinterfaces/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_resultsmu cmd_ddt:display_results
new_session
- Create a new session.
new_sessionmu cmd_ddt:new_session
load_scenario
- Load the specified Scenario template.
load_scenario -uuuidmu cmd_ddt:load_scenario -u 52add3cf-9040-42ce-b263-8233039931d5
get_hosts
- Get a list of hosts in the Test Bed.
get_hostsmu cmd_ddt:get_hosts
set_hosts
- Configure the hosts in the Test Bed. Requires host role, host name, and type (network layer).
set_hosts -rrole,role-nname,name-ytypemu 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_channelsmu cmd_ddt:get_channels
set_channels
- Configure the channels in the Test Bed.
set_channels -rrole-nnamemu cmd_ddt:set_channels -r SSH_Channel -n Web-Server
get_options
- Get a list of options in the Test Set.
get_optionsmu cmd_ddt:get_options
set_options
- Configure the option values for the Test Set.
set_options -nname-pvaluemu cmd_ddt:set_options -n username -p jsmith
get_sessions
- Get a list of all sessions.
get_sessionsmu cmd_ddt:get_sessions
setup_test
- Setup the Test Bed, reserving the test interfaces.
setup_testmu cmd_ddt:setup_test
run
- Run a Test Set.
runmu cmd_ddt:run
run_testset
- Run the specified Test Set.
run_testset -uuuidmu cmd_ddt:run_testset -u 04aa248a-0b9b-4bf6-97e1-aab691d0acf1
get_testset_results
- Get results for the current Test Set.
get_testset_resultsmu cmd_ddt:get_testset_results
get_testset_status
- Get status for the current Test Set.
get_testset_statusmu cmd_ddt:get_testset_status
teardown_test
- Unsets the Test Bed selections, releasing the test interfaces.
teardown_testmu cmd_ddt:teardown_test
close_session
- Closes the current session.
close_sessionmu cmd_ddt:close_session
close_all_sessions
- Closes all existing sessions.
close_all_sessionsmu cmd_ddt:close_all_sessions
csv_export
- Exports a Test Set from the appliance to a csv file.
csv_export -uuuidmu 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 -tfilename.csvmu 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.
aboutmu cmd_scale:about
configure
- Configure parameter values for any element of the scale json object.
configure -pparameter-pvvaluemu cmd_scale:configure -p json_element -pv json_element_value
data
- Gets chart data for the Scale test.
data -wview-zzoom-psposition-bbot_idmu 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 -bbot_idmu cmd_scale:delete_scale_engine -b bots_10.10.6.200:1
help
- Gets help for all cmd_scale commands.
helpmu cmd_scale:help
list
- Returns the current Scale Player's UUID.
listmu cmd_scale:list
pcap
- Gets a pcap from a specific Scale Engine.
pcap -bbot_id-ffilenamemu cmd_scale:pcap -b bots_10.10.6.200:1 -f bot_1_pcap
release
- Release the Scale Player.
releasemu cmd_scale:release
release_scale_engine
- Releases the specified Scale Engine.
release_scale_engine -bbot_idmu cmd_scale:release_scale_engine -b bots_10.10.6.200:1
reserve_scale_engine
- Reserves the specified Scale Engine.
reserve_scale_engine -bbot_idmu cmd_scale:reserve_scale_engine -b bots_10.10.6.200:1
session
- Create a new Scale Player session.
sessionmu cmd_scale:session
start
- Start the Scale test.
start -cscale-test-muser:pass@mu-ipmu cmd_scale:start -c scale.json -m admin:[email protected]
status
- Gets information about the currently running Scale test.
statusmu cmd_scale:status
statuses
- Gets the status of all active and inactive Scale engines.
statusesmu cmd_scale:statuses
stop
- Stops the Scale test.
stopmu cmd_scale:stop
update
- Update the pattern dynamically (while the Scale test is running).
update -pparameter-pvparameter-valuemu cmd_scale:update -p delay -pv 250 -p volume -pv 100000
verify
- Verifies a Scale test.
verifymu 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.
allmu cmd_homepage:all
help
- Gets help for all cmd_homepage commands.
helpmu cmd_homepage:help
latest_test
- Gets an array of the latest test results.
latest_testmu cmd_homepage:latest_test
queue_test
- Gets an array of tests in the Test Queue.
queue_testmu cmd_homepage:queue_test
recent
- Gets the "What's New" section from the appliance UI homepage.
recentmu cmd_homepage:recent
status
- Gets system status for licenses, backup, and updates.
statusmu 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).
restartmu cmd_system:restart
status
- Gets all information from the system status page.
statusmu cmd_system:status
status2
- Gets additional system information such as hard drive status, platform model, serial number.
status2mu 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_helpmu cmd_cli:cli_help
cli_history
- Display the command line history for the current session.
cli_helpmu cmd_cli:history
ping
- Ping the specified IP address from the appliance.
ping -aip-addressmu cmd_cli:ping -a 10.10.10.1
question
- Show the available CLI commands.
questionmu cmd_cli:question
traceroute
- Get the network route to a specified IP address from the appliance.
traceroute -aip-addressmu 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.