Skip to content

Latest commit

 

History

History
554 lines (440 loc) · 18.4 KB

api-package.md

File metadata and controls

554 lines (440 loc) · 18.4 KB

Functions

addAgent(agentInfo, callback)

Adds a new agent to a knowhow server. If no login or password is specified it will attempt to scan for an already running agent on the specified host. If no port is specified the port 3141 is used. Plain text passwords may be used, but is discouraged. Use passowrddEnc to pass encrypted passwords that are descryped using the server's encrytion key

addAgentSync(agentInfo)

Synchronous version of addAgent call

updateAgent(agentInfo, callback)

Updates agent info with values specified in agentInfo

deleteAgent(agentInfo, callback)

deletes an agent on a knowhow server

deleteAgentSync(agentInfo)

deletes an agent on a knowhow server

resetAgent(agentInfo, callback)

resets an agent on a knowhow server by stopping and restarting.

resetAgentSync(agentInfo)

Synchronous version of addAgent call

getAgentInfo(agentInfo, callback)

retrives agent info base on _id.

getAgentLogs(agentInfo, callback)

retrives agent info base on _id.

getAgentList(callback)

retrieves a list of all agents on a knowhow server

executeJob(agent, job, callback)

Executes a job on a knowhow server

executeJobSync(agentInfo, job)

Synchronous version of addAgent call

cancelJob(agent, job, callback)

Cancels a running job on a knowhow server

getRunningJobsList(agent, callback)

Retreives a list of currently executing jobs on a knowhow server

KHJob(serverURL, EventHandler)

Factory method for KHJob

listRepositories(serverURL, callback)

Lists all repositories on a server

loadRepoFromName(repoName, callback)

loads a populated repo json object based on a name

addRepo(newRepo)

Adds a new repository to a knowhow server specified by param serverUDL

updateRepo(serverURL, existingRepo, callback)

Modifies an existing repo obejct on a knowhow server with the values specified in the repo object

deleteRepo(repo, callback)

Deletes a repository on a knowhow server

loadRepo(repo, subDir, callback)

Returns a directory tree structure starting at a specified subDir- used to load a tree widget

addFile(path, newFile, content, isDirectory, callback)

Adds a file to specified repository

deleteFile(filePath, force, callback)

Deletes specified file from a repository

saveFile(filePath, fileContent, callback)

saves a file in the specified filePAth on a knowhow server

loadURL(URL)

retrieves an environment object from a knowhow URL

importFileRepositoryFromGit(repo, gitURL, gitUser, gitPAssword, callback)

Imports a repository from a git server Url into a new file repository.

importFileRepositoryFromTarBall(repo, tarBallFile, callback)

Imports a repository from a tarball(.tar.gz) file

importFileRepositoryFromServer(repoToCreate, KHHostRepoName, KHServerURL, callback)

Imports a repository from a a knowhow server

downloadRepoAsTarBall(repo, savePath)

Downloads a knowhow repository as a tarball. This tarball may be reimport as a new repository on any knowhow server.

KHRepository(serverURL, EventHandler)

Factory method for KHJob

loadAgentsForEnvironment(environment)

loads all agents on an environment. Returns with the agent data fully populated

connectEnvironmentAgents(environment)

Ensures that all agents for an environment are running. IF a defined agent does not exist an attempt is made to add it.

executeWorkflow(environment, workflow, callback)

Executes a workflow on a knowhow server

executeWorkflowSync(environment, workflow)

Synchronous version of addWorkflow call

cancelWorkflow(environment, workflow, callback)

Cancels a running workflow on a knowhow server

getRunningWorkflowsList(callback)

Retreives a list of currently executing workflows on a knowhow server

KHWorkflow(serverURL, khEventHandler, the, khClient)

Factory method for KHWorkflow

## Typedefs
loadFile : function

Loads a File from the specified repository

## addAgent(agentInfo, callback) Adds a new agent to a knowhow server. If no login or password is specified it will attempt to scan for an already running agent on the specified host. If no port is specified the port 3141 is used. Plain text passwords may be used, but is discouraged. Use passowrddEnc to pass encrypted passwords that are descryped using the server's encrytion key

Kind: global function

Param Description
agentInfo agentInfo only host is requred - ex: {"host": "myHost", "port": 3141, "user": "MyUSer", "passwordEnc": "DSAF@#R##EASDSAS@#"}
callback callback function with parameters (error, agentInfo)

addAgentSync(agentInfo)

Synchronous version of addAgent call

Kind: global function

Param Description
agentInfo json representaion of the agent to add

updateAgent(agentInfo, callback)

Updates agent info with values specified in agentInfo

Kind: global function

Param Description
agentInfo agentInfo must specify _id - ex: {"_id": "1234:", "host": "myHost", "port": 3141, "user": "MyUser", "passwordEnc": "DSAF@#R##EASDSAS@#"}
callback callback function with parameters (error, agentInfo)

deleteAgent(agentInfo, callback)

deletes an agent on a knowhow server

Kind: global function

Param Description
agentInfo agentInfo must specify _id - ex: {"_id": "1234"}
callback callback function with parameters (error, agentInfo)

deleteAgentSync(agentInfo) ⇒

deletes an agent on a knowhow server

Kind: global function
Returns: agent or undefined if it didn't work

Param Description
agentInfo agentInfo must specify _id - ex: {"_id": "1234"}

resetAgent(agentInfo, callback)

resets an agent on a knowhow server by stopping and restarting.

Kind: global function

Param Description
agentInfo agentInfo only host is requred - ex: {"host": "myHost", "port": 3141, "user": "MyUSer", "passwordEnc": "DSAF@#R##EASDSAS@#"}
callback callback function with parameters (error, agentInfo)

resetAgentSync(agentInfo)

Synchronous version of addAgent call

Kind: global function

Param Description
agentInfo json representaion of the agent to add

getAgentInfo(agentInfo, callback)

retrives agent info base on _id.

Kind: global function

Param Description
agentInfo agentInfo must specify _id - ex: _id: "1234"
callback callback function with parameters (error, agentInfo)

getAgentLogs(agentInfo, callback)

retrives agent info base on _id.

Kind: global function

Param Description
agentInfo agentInfo must specify _id - ex: 1234
callback callback function with parameters (error, agentInfo)

getAgentList(callback)

retrieves a list of all agents on a knowhow server

Kind: global function

Param Description
callback callback function with parameters (error, agentInfo)

executeJob(agent, job, callback)

Executes a job on a knowhow server

Kind: global function

Param Description
agent agentInfo _id is required is requred - ex: {_id: "1234"}
job a json job to execute
callback callback function with parameters (error, agentInfo)

executeJobSync(agentInfo, job)

Synchronous version of addAgent call

Kind: global function

Param Description
agentInfo json representaion of the agent to add
job to run

cancelJob(agent, job, callback)

Cancels a running job on a knowhow server

Kind: global function

Param Description
agent agentInfo _id is required is requred - ex: {_id: "1234"}
job a json job to execute
callback callback function with parameters (error, agentInfo)

getRunningJobsList(agent, callback)

Retreives a list of currently executing jobs on a knowhow server

Kind: global function

Param Description
agent agentInfo _id is required is requred - ex: {_id: "1234"}
callback callback function with parameters (error, runningJobList)

KHJob(serverURL, EventHandler)

Factory method for KHJob

Kind: global function

Param Description
serverURL the url of the server
EventHandler

listRepositories(serverURL, callback)

Lists all repositories on a server

Kind: global function

Param Description
serverURL
callback function to call when done with parameters (error, repoList)

loadRepoFromName(repoName, callback)

loads a populated repo json object based on a name

Kind: global function

Param Description
repoName the name of the repositry
callback callback function to execute when complete with parameters (error, repoObject)

addRepo(newRepo)

Adds a new repository to a knowhow server specified by param serverUDL

Kind: global function

Param Description
newRepo A json object describing the new repository with parameters (error, repoObject)

updateRepo(serverURL, existingRepo, callback)

Modifies an existing repo obejct on a knowhow server with the values specified in the repo object

Kind: global function

Param Description
serverURL the URL of the knowhow server ex :http://localhost:3001
existingRepo a json object describing a repository - _id must be specified
callback callback functions with parameters (error, modifiedRepoObject)

deleteRepo(repo, callback)

Deletes a repository on a knowhow server

Kind: global function

Param Description
repo a json object representing the repo to delete - _id must be specified
callback callback function with parameters (error, deletedRepo)

loadRepo(repo, subDir, callback)

Returns a directory tree structure starting at a specified subDir- used to load a tree widget

Kind: global function

Param Description
repo a json object representing a repository to use
subDir the point in the repository to start - ex: /jobs
callback callback function with params (error, repoTree)

addFile(path, newFile, content, isDirectory, callback)

Adds a file to specified repository

Kind: global function

Param Description
path the repository path of the file - ex: /jobs/myJob.json
newFile new file name
content text content of the file to add
isDirectory flag for whether of not file is a directory
callback callback function with parameters (error, newFile)

deleteFile(filePath, force, callback)

Deletes specified file from a repository

Kind: global function

Param Description
filePath the absolute directory structure of the file to delete ex /myRepo/job/myJob.json
force
callback callback function with parameters (error, deletedFile)

saveFile(filePath, fileContent, callback)

saves a file in the specified filePAth on a knowhow server

Kind: global function

Param Description
filePath the absolute directory path of a specified file on the knowhow server host
fileContent the text content of the file
callback callbacj function with params (error, file)

loadURL(URL)

retrieves an environment object from a knowhow URL

Kind: global function

Param Description
URL the knowhow URL we are attempting to load

importFileRepositoryFromGit(repo, gitURL, gitUser, gitPAssword, callback)

Imports a repository from a git server Url into a new file repository.

Kind: global function

Param Description
repo a json object with the expected repo values: name and path
gitURL URL of the git repository
gitUser if supplied will attempt to use as part of the url
gitPAssword use only if server requires password authentication
callback to execute when finished

importFileRepositoryFromTarBall(repo, tarBallFile, callback)

Imports a repository from a tarball(.tar.gz) file

Kind: global function

Param Description
repo a json object with the expected repo values: name and path
tarBallFile the file path of the tarball file
callback to execute when finished

importFileRepositoryFromServer(repoToCreate, KHHostRepoName, KHServerURL, callback)

Imports a repository from a a knowhow server

Kind: global function

Param Description
repoToCreate a json object with the expected repo values: name and path
KHHostRepoName the name of the repo on the knowhow server we are importing from
KHServerURL the url of the knowhow server
callback to execute when finished

downloadRepoAsTarBall(repo, savePath)

Downloads a knowhow repository as a tarball. This tarball may be reimport as a new repository on any knowhow server.

Kind: global function

Param Description
repo the knowhow repository to download
savePath where to save the tarball

KHRepository(serverURL, EventHandler)

Factory method for KHJob

Kind: global function

Param Description
serverURL the url of the server
EventHandler

loadAgentsForEnvironment(environment)

loads all agents on an environment. Returns with the agent data fully populated

Kind: global function

Param Description
environment the environment to load

connectEnvironmentAgents(environment)

Ensures that all agents for an environment are running. IF a defined agent does not exist an attempt is made to add it.

Kind: global function

Param Description
environment an environment json object

executeWorkflow(environment, workflow, callback)

Executes a workflow on a knowhow server

Kind: global function

Param Description
environment json environment representation (i.e. collection of knowhow agents that represent the environment)
workflow a json workflow to execute
callback callback function with parameters (error, agentInfo)

executeWorkflowSync(environment, workflow)

Synchronous version of addWorkflow call

Kind: global function

Param Description
environment json representaion of the workflow's environment
workflow to run

cancelWorkflow(environment, workflow, callback)

Cancels a running workflow on a knowhow server

Kind: global function

Param Description
environment environment to cancel
workflow a json workflow to execute
callback callback function with parameters (error, agentInfo)

getRunningWorkflowsList(callback)

Retreives a list of currently executing workflows on a knowhow server

Kind: global function

Param Description
callback callback function with parameters (error, runningJobList)

KHWorkflow(serverURL, khEventHandler, the, khClient)

Factory method for KHWorkflow

Kind: global function

Param Description
serverURL the url of the server
khEventHandler EventHandler
the khJob object for this workflow engine
khClient

loadFile : function

Loads a File from the specified repository

Kind: global typedef

Param Description
serverURL the URL of the knowhow server ex :http://localhost:3001
repo a json object representing a repository to use
path the repository path of the file - ex: /jobs/myJob.json