Sha256: 98549df641b5bae74577394310f1b1ccf5d0e94d1325cab89b413ca4fb6f59d6
Contents?: true
Size: 1.19 KB
Versions: 2
Compression:
Stored size: 1.19 KB
Contents
module Fog module Compute class OneAndOne class Real ## # Returns a list of all servers on your account # URL: [https://cloudpanel-api.1and1.com/documentation/1and1/v1/en/documentation.html#servers_get] ## def list_servers(page: nil, per_page: nil, sort: nil, q: nil, fields: nil) # Build hash for query parameters keyword_args = { :page => page, :per_page => per_page, :sort => sort, :q => q, :fields => fields } # Clean out null query parameters query = clean_hash(keyword_args) # Request params = { 'method' => :get, 'endpoint' => '/servers', 'params' => query } request(params) end end # Real class Mock def list_servers(page: nil, per_page: nil, sort: nil, q: nil, fields: nil) response = Excon::Response.new response.status = 200 response.body = self.data[:servers] response end end # Mock end # OneAndOne end # Compute end # Fog
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fog-oneandone-1.2 | lib/oneandone/requests/compute/list_servers.rb |
fog-oneandone-1.0 | lib/oneandone/requests/compute/list_servers.rb |