Sha256: 55dd5483f3c0b4b0f6af32172d75d4909eb97349ded9e38285eda1571012c6b3
Contents?: true
Size: 1.1 KB
Versions: 15
Compression:
Stored size: 1.1 KB
Contents
class Ey::Core::Client class Real def create_backup(params={}) id = params["id"] url = params["url"] request( :method => :post, :path => "backups/#{id}", :url => url, :body => params, ) end end # Real class Mock def create_backup(params={}) resource_id = self.uuid cluster_id = if params["url"] # provided scope path_params(params["url"])["clusters"] elsif current_server path_params(current_server["cluster"])["clusters"] end find(:clusters, cluster_id) resource = params["backup"].dup resource.merge!( "id" => resource_id, "files" => url_for("/backups/#{resource_id}/files"), "cluster" => url_for("/clusters/#{cluster_id}"), "created_at" => Time.now, "updated_at" => Time.now, ) self.data[:backups][resource_id] = resource response( :body => {"backup" => resource}, :status => 201, ) end end # Mock end # Ey::Core::Client
Version data entries
15 entries across 15 versions & 1 rubygems