Oneview

Build Status Gem Version Test Coverage Code Climate

This gem simplifies the usage of Oneview API

For more information regarding the API, visit the documentation

Installation

Add this line to your application's Gemfile:

gem 'oneview'

And then execute:

$ bundle

Or install it yourself as:

$ gem install oneview

Usage

Create a new instance of Oneview class passing your access token:

    client = Oneview.new(YOUR_ACCESS_TOKEN)

With the client instance, you can access the following resources:

  • Contacts (client.contacts) Only creation
  • Sms Sending (client.sms) Not Implemented Yet
  • Email Sending (client.email)

Using the resources

Creating new records

All resources implement a create method.

It can accept a hash with the parameters as described in the API documentation or an Entity object that reflects the API fields.

Currently the following entities are implemented:

Reading the response

All methods return an Oneview::Client::Response object. This objects contains the following attributes:

    response = Oneview.new(YOUR_ACCESS_TOKEN).contacts.create(contact_entity)

    response.status         # Contains the status code of the request
    response.payload        # Contains the return data (JSON) of the request
    response.raw_response   # Contains the HTTParty response object

Contributing

  1. Fork it ( https://github.com/coyosoftware/oneview/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request