Sha256: 7b27b0507f66e53ad923f36c5b9e6e159b92cc5f8269b41346b85db785176d68
Contents?: true
Size: 1.52 KB
Versions: 2
Compression:
Stored size: 1.52 KB
Contents
module Fog module Compute class OneAndOne class Real ## # Returns information about a server attached to a shared storage # URL: [https://cloudpanel-api.1and1.com/documentation/1and1/v1/en/documentation.html#shared_storages__shared_storage_id__servers__server_id__get] ## def get_shared_storage_server(shared_storage_id: nil, server_id: nil) params = { 'method' => :get, 'endpoint' => "/shared_storages/#{shared_storage_id}/servers/#{server_id}" } request(params) end end # Real class Mock def get_shared_storage_server(shared_storage_id: nil, server_id: nil) # Search for shared storage if shared_storage = self.data[:shared_storages].find { |hash| hash['id'] == shared_storage_id } else raise Fog::Errors::NotFound.new('The requested resource could not be found.') end # Search for server to return if server = shared_storage['servers'].find { |index| index['id'] == server_id } else raise Fog::Errors::NotFound.new('The requested server could not be found.') end # Return Response Object to User response = Excon::Response.new response.status = 202 response.body = server 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/get_shared_storage_server.rb |
fog-oneandone-1.0 | lib/oneandone/requests/compute/get_shared_storage_server.rb |