rick / linode Goto Github PK
View Code? Open in Web Editor NEWRuby wrapper for the Linode automation API
Home Page: http://www.linode.com/api/
License: MIT License
Ruby wrapper for the Linode automation API
Home Page: http://www.linode.com/api/
License: MIT License
The README only shows queries. Can you please provide an example of creating a Linode instance?
I'm having some issues. e.g. I tried linode.linode.create(region: '...', label: '...', type: 1, private_ip: true
) and got back Error #6 - DATACENTERID is required but was not passed in. (Please consult https://www.linode.com/api/linode/linode.create)
, but the referenced page doesn't mention DATACENTERID.
There's a bit missing...
linode.rb:30: has_namespace :test, :avail, :user, :domain, :linode, <<< :stackscript >>>
John
When using vagrant-linode, I encountered this error on several machines:
An unexpected error occurred when executing the action on the
'osd28' machine. Please report this as a bug:
API threw HTTP error code 503
/home/pdonnell/.vagrant.d/gems/gems/linodeapi-1.0.1/lib/linodeapi/raw.rb:77:in `error_check'
/home/pdonnell/.vagrant.d/gems/gems/linodeapi-1.0.1/lib/linodeapi/raw.rb:72:in `call'
/home/pdonnell/.vagrant.d/gems/gems/linodeapi-1.0.1/lib/linodeapi/raw.rb:62:in `block in make_call'
/home/pdonnell/.vagrant.d/gems/gems/linodeapi-1.0.1/lib/linodeapi/raw.rb:63:in `make_call'
/home/pdonnell/.vagrant.d/gems/gems/linodeapi-1.0.1/lib/linodeapi/raw.rb:44:in `method_missing'
/home/pdonnell/.vagrant.d/gems/gems/vagrant-linode-0.2.7/lib/vagrant-linode/actions/create.rb:50:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/home/pdonnell/.vagrant.d/gems/gems/vagrant-linode-0.2.7/lib/vagrant-linode/actions/connect_linode.rb:31:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/home/pdonnell/.vagrant.d/gems/gems/vagrant-linode-0.2.7/lib/vagrant-linode/actions/message_not_created.rb:11:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/synced_folders.rb:87:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/provision.rb:80:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/call.rb:53:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:225:in `action_raw'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:200:in `block in action'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:561:in `lock'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:186:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:186:in `action'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
Perhaps related to throttling? I guess the API call function should be retrying after a timed wait?
I looked around but couldn't find any info about the nodebalancer api?
The following fails:
> l.avail.distributions
Psych::SyntaxError: (<unknown>): couldn't parse YAML at line 0 column 170
from /Users/kenn/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:154:in `parse'
The following makes the problem go away:
require 'yaml'
YAML::ENGINE.yamler = 'syck'
But it seems far from ideal.
I'd suggest we use the json gem instead of crack.
The image namespace is not loaded into the Linode class. This causes a no method error whenever trying to use the image API. The workaround at the moment is to monkey patch Linode and call "has_namespace :image".
The GitHub project description is: "Ruby wrapper for the Linode automation API
http://www.linode.com/api/autodoc.cfm"
autodoc.cfm should be removed from the url.
It looks like RSpec is out of date - at least I had to update a few things to get tests running.
I tried to connect using api_key several times, but always authentication failed.
Then when I try using :username and :password, it worked.
Think that the api_key way is broken coz it tries to send the request with http
instead of https
It would be nice to be able to start with a username/password login.
This gem doesn't require a SSL certificate does it? This error means nothing to me, and a Google search only suggested using a workaround certificate for a different looking issue (which I tried for kicks and giggles, then removed).
Error:
D:/Program Files/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
from D:/Program Files/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in `block in connect'
from D:/Program Files/Ruby22-x64/lib/ruby/2.2.0/timeout.rb:73:in `timeout'
from D:/Program Files/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in `connect'
from D:/Program Files/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
from D:/Program Files/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:852:in `start'
from D:/Program Files/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:1375:in `request'
from D:/Program Files/Ruby22-x64/lib/ruby/gems/2.2.0/gems/httparty-0.13.7/lib/httparty/request.rb:117:in `perform'
from D:/Program Files/Ruby22-x64/lib/ruby/gems/2.2.0/gems/httparty-0.13.7/lib/httparty.rb:545:in `perform_request'
from D:/Program Files/Ruby22-x64/lib/ruby/gems/2.2.0/gems/httparty-0.13.7/lib/httparty.rb:492:in `post'
from D:/Program Files/Ruby22-x64/lib/ruby/gems/2.2.0/gems/httparty-0.13.7/lib/httparty.rb:587:in `post'
from D:/Program Files/Ruby22-x64/lib/ruby/gems/2.2.0/gems/linode-0.9.0/lib/linode.rb:96:in `post'
from D:/Program Files/Ruby22-x64/lib/ruby/gems/2.2.0/gems/linode-0.9.0/lib/linode.rb:81:in `send_request'
from D:/Program Files/Ruby22-x64/lib/ruby/gems/2.2.0/gems/linode-0.9.0/lib/linode.rb:15:in `block (2 levels) in has_method'
from linode.rb:6:in `<main>'
Code:
require 'rubygems'
require 'linode'
api_key = "My API Key that I am not gonna put in here"
l = Linode.new(:api_key => api_key)
puts l.test.echo(:foo => 'bar', :baz => 'xyzzy')
Windows 10, Ruby 2.2.3p173 (2015-08-18 revision 51636) [x64-mingw32], Gem 2.5.1, Linode 0.9.0
Version 0.7.5 available on gemcutter.org seems to be depended on the gem crack, but that gem wasn't installed at runtime. I had to manually install crack and also require 'crack' in order to get the irb example to run past the Linode object creation.
I noticed using linode-python
that list returns the numeric LINODEID property, so would be useful if that was included here.
Hey Linode team, et. al.,
I wouldn't normally report an issue with a pre-release version of Ruby, but the JSON gem problem affects every version of Ruby since 1.9.x, it just manifests in weirder, more subtle ways. I've been hacking around it since the 2.0 time period. My production stack is 2.3 stable (vs. an unreleased 2.4), and the 'json' dependency works there, but still creates some quirky situations.
The version of 'json' that has shipped with Ruby since 1.9 is a vendored copy of flori/json, and has since diverged enough with compatibility changes that it looks like a fork. The gem on Rubygems is the (still-maintained) work in flori/json.
The end result of an explicit dependency on "json" is:
I don't know what the linode gem's Ruby version policy is, which could be the constraining factor (1.8 still?), but I believe @mperham summed up the solution that has the best chance of working at the most places:
So many gems declare a dependency on json, oj, multi_json, or yajl-ruby. There’s so many ossified layers of cruft around JSON processing that only one course of action makes sense: remove it all. JSON has been in the stdlib since 1.9, you don’t need to declare any dependencies at all. Just require 'json' and let Ruby deal with it.
Rails did it, so can you!
The good thing is: linode
appears to work just fine with the dependency removed, and all tests pass. This would've been a one-line PR instead of a novel, but the issues are subtle (more so than "let's break out-of-the-box behavior with 1.8.7!") and I wanted to get some feedback about it.
Thanks
Some of the names seem a bit unusual for typical ruby:
e.g.
avail
vs available
getlinodeid
vs get_linode_id
For people who English is not a native language, this can be hard to read/understand.
Hi, issue #32 is breaking our Chef infrastructure. Would you mind releasing a new version of the gem for 0.9.1? In the meantime, we'll set an explicit Git SHA in our Gemfile. It'll be a bit messy. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.