Skip to content
hannsolo edited this page May 6, 2020 · 2 revisions

FSIServerClient class

This is the top-level class providing access to the promise based API and allows you to create an instance of the queue class to use the queue API.

const client = new FSIServerClient( host:string );

Examples

Example: Using the promise based client API
const FSIServerClient = require("@neptunelabs/fsi-server-api-client").FSIServerClient;
const client = new FSIServerClient('https://my.fsi-server.tld');

client.login("user", "password")
  .then( () => {
    client.logout()
    .catch(console.error);
})
.catch(console.error);
Example: Using the Queue API
const FSIServerClient = require("@neptunelabs/fsi-server-api-client").FSIServerClient;
const client = new FSIServerClient('https://my.fsi-server.tld');
client.setLogLevel(FSIServerClient.LogLevel.info)

const queue = client.createQueue({continueOnError:false});
queue.login("user", "password");
queue.logout();

// the following line actually starts the execution
queue.runWithResult();
Clone this wiki locally