Created
January 24, 2014 16:25
-
-
Save guilhem/8600683 to your computer and use it in GitHub Desktop.
Use pritunl API with ruby rest-client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auth = JSON.parse(RestClient.post "http://10.0.3.2:9700/auth/token", { 'username' => "admin", "password" => "admin"}.to_json, :content_type => :json, :accept => :json) | |
org = JSON.parse(RestClient.post "http://10.0.3.2:9700/organization", { 'name' => 'test'}.to_json , :auth_token => auth['auth_token'], :content_type => :json, :accept => :json) | |
JSON.parse(RestClient.get "http://10.0.3.2:9700/status", { :auth_token => auth['auth_token'], :content_type => :json}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/eterry1388/pritunl_api_client