Problem with api

Hi

I'm trying to write a script which lists our current linodes using the API.

I've configured the API Key on the account and have installed linode ruby gem.

I've written a script, substituting Key with the API key

class LinodeApi
require 'linode'
LINODE_API_KEY = Key
def initialize
  @l = Linode.new(api_key: LINODE_API_KEY)
end

def list
    @l.linode.list
end
end

but when I run the script by doing

ruby list.rb

it does nothing. What am I doing wrong?

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct