lib/cfoundry/v2/base.rb in cfoundry-0.3.19 vs lib/cfoundry/v2/base.rb in cfoundry-0.3.20
- old
+ new
@@ -76,9 +76,30 @@
define_method(plural) do |*args|
get("v2", plural, nil => :json, :params => params_from(args))
end
end
+ def resource_match(fingerprints)
+ post(fingerprints, "v2", "resource_match", :json => :json)
+ end
+
+ def upload_app(guid, zipfile, resources = [])
+ payload = {
+ :resources => resources.to_json,
+ :multipart => true,
+ :application =>
+ if zipfile.is_a? File
+ zipfile
+ elsif zipfile.is_a? String
+ File.new(zipfile, "rb")
+ end
+ }
+
+ put(payload, "v2", "apps", guid, "bits")
+ rescue RestClient::ServerBrokeConnection
+ retry
+ end
+
def params_from(args)
depth, query = args
depth ||= 1