A Ruby library for accessing the OpenVNet WebAPI. All this library does is call Ruby's built in
Net::HTTP. No further external libraries required.
The JSON responses from the API are returned as Ruby hashes.
gem install vnet_api_client
require 'rubygems' require 'vnet_api_client' # This is the default value. If your OpenVNet WebAPI is located at localhost # port 9090, you don't have to include this line. .uri = 'http://localhost:9090' # Creates a new network ::.create(display_name: 'my_network', ipv4_network: '192.168.3.0', ipv4_prefix: 24) # Enables routing and changes display name for an interface ::.update('i-abcdefg', enable_routing: true, display_name: 'my new name') # Retrieves all datapaths ::.index # Retrieves one interface ::.show('i-abcdefg') # Deletes one ip lease ::.delete('il-begone') # Adds an interface to a security group ::.add_interface('sg-enter', 'i-getin') # Shows all networks in a datapath ::.show_networks('dp-mypath') # Deletes a static address from a translation ::.('tr-xxxxx')
The version number of this gem follows the version of OpenVNet. Each number has the following meaning:
[OpenVNet major version].[OpenVNet minor version].[OpenVNet hotix].[vnet_api_client gem release]
The vnet_api_client gem release number is added because it can some times be necessary to release hotfixes for the gem before a new version of OpenVNet is released.
Do note that OpenVNet's versioning scheme ommits the hotfix number if it is zero. For example if you are using OpenVNet 0.8, then you should use vnet_api_client version 0.8.0.x.