pritunl
Node.js Pritunl API
Install
$ npm install --save pritunl
Usage
To start a new Pritunl instance:
var Pritunl = ; var pritunl = baseurl: <PRITUNL_SERVER_BASE_URL> api_token: <API_TOKEN> api_secret: <API_SECRET>;
API
request()
Method In Pritunl, all API requests must be signed with the API token
and secret
.
The API token
and secret
can be found in the Settings dialog, Pritunl admin page.
Read more: Pritunl API - Authentication
Global
Helper object pritunl.global.log
Returns a list of server log entries sorted by time.
pritunlglobal;
Read more: Pritunl API - GET /log
pritunl.global.ping
Server healthcheck.
pritunlglobal;
Read more: Pritunl API - GET /ping
pritunl.global.status
Returns general information about the pritunl server.
pritunlglobalstatus;
Read more: Pritunl API - GET /status
Organization
Helper object pritunl.organization.list
Returns a list of organizations on the server sorted by name.
pritunlorganization;
Read more: Pritunl API - GET /organization
pritunl.organization.get
Returns an organization.
var org_id = '<change_your_organization_id>';pritunlorganization;
Read more: Pritunl API - GET /organization/:org_id
pritunl.organization.create
Create a new organization.
Promise;
Read more: Pritunl API - POST /organization
pritunl.organization.update
Rename an existing organization.
Read more: Pritunl API - PUT /organization
pritunl.organization.delete
Delete an existing organization.
Promise;
Read more: Pritunl API - DELETE /organization/:organization_id
User
Helper object pritunl.user.list
Returns a list of users in an organization sorted by name.
var org_id = '<your_organization_id>';pritunluser;
Read more: Pritunl API - GET /user/:organization_id
pritunl.user.get
Returns a user from an organization.
var org_id = '<your_organization_id>';var user_id = '<your_user_id>';pritunluser;
Read more: Pritunl API - GET /user/:organization_id
pritunl.user.create
Create a new user in an organization. An array of users can be sent for bulk adding users.
Promise;
Read more: Pritunl API - POST /user/:organization_id
pritunl.user.update
Rename or disabled an existing user in an organization. Disabling will also disconnect the user.
Read more: Pritunl API - PUT /user/:organization_id/:user_id
pritunl.user.delete
Delete an existing user in an organization, this will disconnect the user.
pritunluser;
Read more: Pritunl API - DELETE /user/:organization_id/:user_id