VersionOne SDK - A Ruby SDK for the VersionOne REST API
Synopsis
This is a VersionOne SDK for Ruby that accesses the VersionOne REST API.
VersionOne currently provides official SDKs for Java, .NET, Python and JavaScript, but not for Ruby and other languages. VersionOne describes the use case for SDKs as the following: "All access to VersionOne is provided by the API endpoints. The most common use is to manipulate data in VersionOne. Doing so with the rest-1.v1/Data endpoint requires manipulation of XML, which can be tedious. Therefore, there are a number of API wrappers that abstract the details of HTTP and VersionOne's XML serialization: SDK.Java, SDK.NET, SDK.Python, SDK.JavaScript."
A primary goal of this project is to convert VersionOne REST API XML responses to JSON.
Installing
Download and install versionone_sdk with the following:
gem install versionone_sdk
Examples
require 'versionone_sdk'
dParams = {
:hostname => 'www1.v1host.com',
:instance => 'myinstance',
:username => 'myusername',
:password => 'mypassword',
:port => 443,
:protocol => 'https'
}
v1client = VersiononeSdk::Client.new(dParams)
# Retrieve an array of JsonDoc::Document objects
assets = oClient.getAssets('Scope')
assets.each do |asset|
assetHash = asset.asHash
end
Documentation
This gem is 100% documented with YARD, an exceptional documentation library. To see documentation for this, and all the gems installed on your system use:
$ gem install yard
$ yard server -g
Notes
- Nil/Null Values and Empty Strings
The VersionOne JavaScript API provides empty strings when no value is present. This SDK uses Ruby nil values and JSON null values for empty strings. The primary reason for this is to support easy indexing using Elasticsearch.
- Tracking Properties
In addition to the standard VersionOne properties, this modules adds the following generic properties for tracking: :idsObjectDomain, :idsObjectType, :idiObjectId, :idsObjectUrl. The object domain is set to 'Versionone', while object type and object id correspond to VersionOne Asset types and ids. The URL is the full URL for the resource including protocol, host and port.
Change Log
- 2014-03-16: 0.0.1
- Initial release
Links
VersionOne API Documentation
http://community.versionone.com/Developers/Developer-Library/Documentation/API
Copyright and License
Elastirad © 2014 by John Wang.
Elastirad is licensed under the MIT license. Please see the LICENSE document for more information.
Warranty
This software is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.