Oneview
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) Create and Update
- Sms Sending (client.sms)
- 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:
Updating records
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
- Fork it ( https://github.com/coyosoftware/oneview/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request