lib/vagrant-subutai/rest/subutai_console.rb in vagrant-subutai-1.1.4 vs lib/vagrant-subutai/rest/subutai_console.rb in vagrant-subutai-1.1.5

- old
+ new

@@ -51,9 +51,21 @@ request.set_form_data({'email' => email, 'password' => password, 'peerName' => peer_name, 'peerScope' => peer_scope}) https.request(request) end + def self.deregister(token, url) + uri = URI.parse(url + Configs::SubutaiConsoleAPI::V1::DE_REGISTER_HUB + token) + https = Net::HTTP.new(uri.host, uri.port) + https.use_ssl = true + https.verify_mode = OpenSSL::SSL::VERIFY_NONE + https.read_timeout = 3600 # an hour + + request = Net::HTTP::Delete.new(uri.request_uri) + + https.request(request) + end + # Approves Resource Host def self.approve(token, url, id) uri = URI.parse(url + Configs::SubutaiConsoleAPI::V1::APPROVE + "/#{id}/approve?sptoken?=" + token) https = Net::HTTP.new(uri.host, uri.port) https.use_ssl = true \ No newline at end of file