Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

So I’m in the process of implementing the droplet_kit gem within my Ruby on Rails application and I’m having issues just performing very basic commands.
I’m following the instructions here for getting started: https://github.com/digitalocean/droplet_kit
According to the “Usage” section, you just simply need to generate an access token at that URL, which I have done. Now, when I try to access some of the methods like client.firewalls.all(), I don’t get anything useful back.
For example:
[2] pry(#<DigitalOcean>)> @client.firewalls.all()
=> #<DropletKit::PaginatedResource:0x000056478a6ad5b0
@action=
#<ResourceKit::Action:0x000056478a9a5358
@handlers=
{:any=>#<Proc:0x000056478a9a6410@/usr/local/rvm/gems/ruby-2.5.8/gems/droplet_kit-3.8.0/lib/droplet_kit/error_handling_resourcable.rb:4>,
200=>#<Proc:0x000056478a9a5128@/usr/local/rvm/gems/ruby-2.5.8/gems/droplet_kit-3.8.0/lib/droplet_kit/resources/firewall_resource.rb:24>},
@name=:all,
@path="/v2/firewalls",
@query_keys=[:per_page, :page],
@verb=:get>,
@args=[],
@collection=[],
@current_page=0,
@options={},
@resource=
#<DropletKit::FirewallResource:0x000056478a8a6ab0
@connection=
#<Faraday::Connection:0x000056478a8b5600
@builder=#<Faraday::RackBuilder:0x000056478a8b5088 @adapter=Faraday::Adapter::NetHttp, @handlers=[]>,
@default_parallel_manager=nil,
@headers={"Content-Type"=>"application/json", "Authorization"=>"Bearer [redacted]", "User-Agent"=>"DropletKit/3.8.0 Faraday/1.0.1"},
@manual_proxy=false,
@options=#<struct Faraday::RequestOptions params_encoder=nil, proxy=nil, bind=nil, timeout=120, open_timeout=60, read_timeout=nil, write_timeout=nil, boundary=nil, oauth=nil, context=nil, on_data=nil>,
@parallel_manager=nil,
@params={},
@proxy=nil,
@ssl=
#<struct Faraday::SSLOptions
verify=nil,
ca_file=nil,
ca_path=nil,
verify_mode=nil,
cert_store=nil,
client_cert=nil,
client_key=nil,
certificate=nil,
private_key=nil,
verify_depth=nil,
version=nil,
min_version=nil,
max_version=nil>,
@url_prefix=#<URI::HTTPS https://api.digitalocean.com/>>,
@scope=nil>,
@total=nil>
Here’s how I’m establishing the @client variable:
class DigitalOcean
def initialize
token = Rails.application.credentials.digital_ocean
@client = DropletKit::Client.new(access_token: token)
@firewalls = list_firewalls
end
def list_firewalls
binding.pry
end
def add_whitelist(ip)
end
def remove_whitelist(ip)
end
end
I have verified that my token is accessible and is the same access token generated by DigitalOcean, but yet I can’t see anything.
Any help would be greatly appreciated.
samiam
abeen .
Jota Russo
Wouter van Ooijen
SwimmingTealDolphin
699c9bc0a2c34f248e792cb8d2c6ab
e6317acc26184445891017fc7a2d90
87c210597c394f9ebe6ed063a4a6c7
jbopko
saferugdev
DriftingNavyStarfish