def make_public(options = {:ttl => 86400})
raise Exception::CDNNotAvailable unless cdn_available?
if options.is_a?(Fixnum)
print "DEPRECATED: make_public takes a hash of options now, instead of a TTL number"
ttl = options
options = {:ttl => ttl}
end
response = self.connection.cfreq("PUT", @cdnmgmthost, @cdnmgmtpath, @cdnmgmtport, @cdnmgmtscheme)
raise CloudFiles::Exception::NoSuchContainer, "Container #{@name} does not exist" unless (response.code == "201" || response.code == "202")
headers = { "X-TTL" => options[:ttl].to_s , "X-CDN-Enabled" => "True" }
headers["X-User-Agent-ACL"] = options[:user_agent_acl] if options[:user_agent_acl]
headers["X-Referrer-ACL"] = options[:referrer_acl] if options[:referrer_acl]
response = self.connection.cfreq("POST", @cdnmgmthost, @cdnmgmtpath, @cdnmgmtport, @cdnmgmtscheme, headers)
raise CloudFiles::Exception::NoSuchContainer, "Container #{@name} does not exist" unless (response.code == "201" || response.code == "202")
refresh
true
end