AXL: Ruby Bindings for the Cisco Administrative XML (AXL) API
Installation
Install from rubygems.org
gem install axl
...or Install locally
- Clone this repo
cd
to this repo's top dirrm *.gem
gem build axl.gemspec
gem install axl
Download the Cisco AXL Toolkit
Due to copyright restrictions, this gem does not come with the Cisco AXL WSDL files. Download the Cisco AXL Toolkit by following these instructions.
- Browse to your CUCM web interface
- Click on Cisco Unified Communications Manager and log in
- Click Application > Plugins
- Click the Find button
- You should see a "Cisco AXL Toolkit" entry in the results
- Click Download on that result
- Extract the contents to the home directory of the user that the axl gem will run as. If you are going to run the gem directly, extract it to your home directory as axlsqltoolkit
- You should end up with the following directory structure:
<USER_HOMEDIR>
└── axlsqltoolkit
├── README.txt
├── classes/
├── client/
├── lib/
├── sample.xml
├── schema/
│ ├── 10.0/
│ ├── 10.5/
│ ├── 8.0/
│ ├── 8.5/
│ ├── 9.0/
│ ├── 9.1/
│ └── current/
└── src/
The gem will assume the above directory structure exists and will use that assumption to get to the correct WSDL files in the schema/ directory.
Schema Reference
You will need to consult the appropriate schema reference when developing. To download a copy of the appropriate reference document, visit:
https://developer.cisco.com/site/axl/documents/previous-versions/index.gsp
Usage
require 'axl'
# If you don't supply a version, it will default to '10.5'
client = Axl::Client.new(endpoint: 'https://192.168.10.11:8443/axl/',
api_version: '10.5',
username: 'myusername',
password: 'mypassword')
# Print the available operations
puts client.operations
# Call an operation
= {
search_criteria: {
name: 'test'
}
}
response = client.call(:list_line_group, message: )
puts response.success?
puts response.header
puts response.body
puts response.hash
See the appropriate schema reference for the API version you're working with for more information about the operation arguments.
Development Setup
Requirements
- RVM. Not a hard requirement but will make your life easier
- Ruby MRI ruby-2.0.0-p598
- Bundler (
gem install bundler
)
Set Stuff Up!
- If you're using RVM, copy .ruby-version.example to .ruby-version and
modify the contents to indicate the Ruby version you need to use during
development. Once done
cd
out andcd
back in. - Run
bundle install
- What are you still doing here? You're done!
Running the Tests Manually
- Run
rake
Fix bugs. Rinse. Repeat.
Running the Tests Automatically
- Run
guard
Guard will watch for changes under the lib/ directory and execute the associated test(s) automatically. Also, if any tests in the test/ directory change, that test will automatically get executed. To see how Guard determines which test to execute given a file changed, see Guardfile.
Code Coverage
After running the tests (either via rake
or guard
), the coverage report
will be saved to coverage/index.html. Note that triggerring a single test
case via guard will produce an incomplete coverage report since it will
only exercise a limited set of the code. To ensure complete code coverage
reports, press rake
manually.