Skip to content

Instantly share code, notes, and snippets.

@guilhem
Created January 24, 2014 16:25
Show Gist options
  • Save guilhem/8600683 to your computer and use it in GitHub Desktop.
Save guilhem/8600683 to your computer and use it in GitHub Desktop.
Use pritunl API with ruby rest-client
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})
@eterry1388
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment