AXL: Ruby Bindings for the Cisco Administrative XML (AXL) API

Installation

Install from rubygems.org

  1. gem install axl

...or Install locally

  1. Clone this repo
  2. cd to this repo's top dir
  3. rm *.gem
  4. gem build axl.gemspec
  5. 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.

  1. Browse to your CUCM web interface
  2. Click on Cisco Unified Communications Manager and log in
  3. Click Application > Plugins
  4. Click the Find button
  5. You should see a "Cisco AXL Toolkit" entry in the results
  6. Click Download on that result
  7. 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
  8. 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
message = {
  search_criteria: {
    name: 'test'
  }
}
response = client.call(:list_line_group, message: 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

  1. RVM. Not a hard requirement but will make your life easier
  2. Ruby MRI ruby-2.0.0-p598
  3. Bundler (gem install bundler)

Set Stuff Up!

  1. 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 and cd back in.
  2. Run bundle install
  3. What are you still doing here? You're done!

Running the Tests Manually

  1. Run rake

Fix bugs. Rinse. Repeat.

Running the Tests Automatically

  1. 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 in the guard prompt or just run rake manually.