Let foundUser = await user.findUserByUsername(orgId, usernameToFind) Let foundOrg = await organization.findOrganizationByName("TooCool4SkewlOrg") You can have multiple users with the same username in an organization so please make sure you either don't create multiple users with the same name or check to make sure you've got the right one with this function.Ĭonst Pritunl = require('pritunl-api-wrapper') This returns the first occurrence of the user based on username.=> Outputs an array of existing organization objects Listing all Organizations const Pritunl = require('pritunl-api-wrapper') Ĭonst organization = priapi.Organization() Ĭonst organizationArr = await organization.listOrganizations() You'll find more examples in the /examples directory.Below are a few example uses for this API wrapper.SelfSignedCaPath: "./cacert/yourCaCert.pem" pem const Pritunl = require('pritunl-api-wrapper') If you are using a default installation without having manually generated any certs you can retrieve the cert found on the web GUI Settings -> Advanced -> Server SSL Certificate and paste it into a new file and give it the extension. Set your path to the CA cert during object instantiation on the selfSignedCaPath property This module supports the use of self-signed certificates. Using Pritunl API Wrapper with a Self-Signed Certificate Please make sure you understand the differences between the files referenced above before setting your credentials there.Exports will not persist unless you put them in your ~/.bash_profile, ~/.bashrc or /etc/environment.Set up your credentials using environment variables Set up your credentials during Pritunl object instantiation const Pritunl = require('pritunl-api-wrapper'). Setting your credentials Using parameters on Pritunl object See examples in the /examples directory for basic usage.Set the credentials during Pritunl object instantiation.Set up your credentials using one of the following options:.This API wrapper contains utility functions for working with the PritunlVPN API.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |