3.2.1 • Published 6 years ago

apiconnect-collective-controller-api v3.2.1

Weekly downloads
708
License
SEE LICENSE IN LI...
Repository
-
Last release
6 years ago

apiconnect-collective-controller-api

Deprecation Notice

Since the API Connect Collective Controller has been deprecated, this module is also deprecated. While it may work with Liberty Profile in the future, no guarantees are made about its functionality with those versions.

Overview

Provides a library of functions for deployment and control via a Collective Controller. The primary purpose of this library is to allow the API Connect Toolkit more direct control over a collective controller and its member applications.

This library is intended for internal use only, and is not meant for public consumption. Please refer to the API Reference for help with usage.

API Reference

Modules

Classes

apiconnect-collective-controller-api

Cluster

Kind: global class

new Cluster()

Operations for deploying a cluster of applications to a collective.

Cluster.listClusterNames(host, port, username, password)

List all clusters registered to controller.

Kind: static method of Cluster

ParamTypeDescription
hoststringHostname of controller.
portstringPort to get to controller.
usernamestringAdmin username for controller.
passwordstringAdmin password for controller. Returns array of members in the form host,userdir,servername

Cluster.listMembers(host, port, username, password, clusterName)

Lists all members of a cluster.

Kind: static method of Cluster

ParamTypeDescription
hoststringHostname of controller.
portstringPort to get to controller.
usernamestringAdmin username for controller.
passwordstringAdmin password for controller.
clusterNamestringName of cluster. Returns a simple array of strings with members registed to cluster in the form host,userdir,servername. Example: 'hostname,userdir,servername','hostname,userdir,servername2'.

Cluster.restartCluster(host, port, username, password, clusterName)

Restarts all members in a cluster.

Kind: static method of Cluster

ParamTypeDescription
hoststringHostname of controller.
portstringPort to get to controller.
usernamestringAdmin username for controller.
passwordstringAdmin password for controller.
clusterNamestringName of cluster. Returns array of clusters in the form ["cluster1","cluster2"].

Cluster.undeployCluster(host, port, username, password, clusterName)

Undeploys all members in a cluster.

Kind: static method of Cluster

ParamTypeDescription
hoststringHostname of controller.
portstringPort to get to controller.
usernamestringAdmin username for controller.
passwordstringAdmin password for controller.
clusterNamestringName of cluster. Returns err and array of objects consisting of undeploy status, stderr, stdout, and the serverName for the target member. The signature of the returned result: cb(err OR null, {"status":"FINISHED","serverName":"someName","stdout":"...", "stderr":""} {"status":"ERROR","serverName":"someName","stdout":"", "stderr":"..."} )

Cluster.parseMembers(data)

Internal function, exposed for unit tests.

Parses the results from listMembers() and returns an array of objects formatted with the member properties needed to do an undeploy

Kind: static method of Cluster

ParamTypeDescription
dataArray.<string>array of strings from listMembers() needing to be parsed. Returns array of objects consisting of undeploy memberHost, userDir, and serverName for the target member. The signature of the returned result: {memberHost: "something.com", userDir: "/foo/path/bar", serverName: "..."}

Cluster.undeployMembers(host, port, username, password, members)

Internal function, exposed for unit tests.

Undeploys all members, defined in an array.

Kind: static method of Cluster

ParamTypeDescription
hoststringHostname of controller.
portstringPort to get to controller.
usernamestringAdmin username for controller.
passwordstringAdmin password for controller.
membersobjectArray of objects consisting of memberHost, userDir, and serverName.

Properties

NameTypeDescription
memberHoststringThe member host name
userDirstringThe WLPN_USER_DIR where the member code lives.
serverNamestringThe name of the server/application instance.

Cluster.undeployMember(host, port, username, password, member)

Undeploys a member.

Kind: static method of Cluster

ParamTypeDescription
hoststringHostname of controller.
portstringPort to get to controller.
usernamestringAdmin username for controller.
passwordstringAdmin password for controller.
memberObject.<string, string>The member to undeploy, is an object consisting of memberHost, userDir, and serverName.

Cluster.disableScalingPolicy(host, port, username, password, clusterName)

Disables the scalingPolicy for a cluster. Used when undeploying so more members do not get deployed when existing ones go down.

Kind: static method of Cluster

ParamTypeDescription
hoststringHostname of controller.
portstringPort to get to controller.
usernamestringAdmin username for controller.
passwordstringAdmin password for controller.
clusterNamestringName of cluster.

Cluster.setScale(clusterName, host, instances, password, port, username)

Sets the Scaling Policy and overrides the file in the controller.

Kind: static method of Cluster

ParamTypeDescription
clusterNamestringis required.
hoststringHostname of controller to the collective.
instancesstringnumber of instances to set for cluster scaling.
passwordstringAdmin password for controller.
portstringPort to get to controller. not provided, the other parameters must be passed into the function call
usernamestringAdmin username for controller. member.

Cluster.getScale(host, password, port, username)

Gets the Scaling Policy from controller configDropins/overrides folder.

Kind: static method of Cluster

ParamTypeDescription
hoststringHostname of controller to the collective.
passwordstringAdmin password for controller.
portstringPort to get to controller. not provided, the other parameters must be passed into the function call
usernamestringAdmin username for controller. member.

FileService

Kind: global class

new FileService()

Module for handling file uploads and member server deployment with uploaded packages.

FileService.upload(appDir, host, password, port, srcFile, username)

Upload to controller.

Kind: static method of FileService

ParamTypeDescription
appDirstringApplication directory on controller to place file.
hoststringHostname of controller.
passwordstringAdmin password for controller.
portstringPort to get to controller.
srcFilestringlocal file you are uploading.
usernamestringAdmin username for controller.

FileService.deploy(appDir, appPackage, clusterName, host, instances, keystorePassword, password, port, serverName, srcFile, username)

Deploy to member (creates new member), must have package already uploaded.

Kind: static method of FileService

ParamTypeDescription
appDirstringApplication directory on controller to place file.
appPackagestringThe name of the package being deployed. Should already be on the server in the specified appDir.
clusterNamestringThe name of the deployed cluster to affect, also used for file naming for file being uploaded. If no clusterName is specified, will take the filename from package srcFile (if specified) or appPackage, if that is used instead.
hoststringHostname of controller.
instancesstringnumber of instances to set for cluster scaling (both min and max). If not specified, will default to 1.
keystorePasswordstringKeystore Password for joining new member to the collective.
passwordstringAdmin password for controller.
portstringPort to get to controller.
serverNamestringName of new member.
srcFilestringlocal file to upload before deploy. If this is not provided, the appPackage must be passed into the function call.
usernamestringAdmin username for controller.

FileService.undeploy(host, port, username, password, memberHost, userDir, serverName)

Undeploy to member (stops and removes).

Kind: static method of FileService

ParamTypeDescription
hoststringHostname of controller.
portstringPort to get to controller.
usernamestringAdmin username for controller.
passwordstringAdmin password for controller.
memberHoststringhostname of member host where member was deployed.
userDirstringuserDir that member was deployed on member host.
serverNamestringName of member to undeploy.

FileService.uploadPackage(host, password, port, srcFile, username)

Upload Package to controller stackGroup location.

Kind: static method of FileService

ParamTypeDescription
hoststringHostname of controller.
passwordstringAdmin password for controller.
portstringPort to get to controller.
srcFilestringlocal file to upload before deploy. If this is not provided, the other parameters must be passed into the function call
usernamestringAdmin username for controller. member.

FileService.uploadDeployRules(appPackage, clusterName, host, instances, keystorePassword, password, port, serverName, username)

Upload deploy.xml to controller to stackGroup location. This file is used to feed data into the controller's deployRule.xml.

Kind: static method of FileService

ParamTypeDescription
appPackagestringThe name of the package being deployed. Should already be on the server in the specified appDir. If an appPackage is not specified, will use clusterName if specified. If clusterName is specified, will overwrite appPackage for file naming. One or the other is required.
clusterNamestringThe name of the deployed cluster to affect, also used for file naming for file being uploaded. scaling policy for. If this is not specified, it will use
hoststringHostname of controller.
instancesstringnumber of instances to set for cluster scaling (both min and max). If not specified, will default to 1.
keystorePasswordstringKeystore Password for joining new member to the collective.
passwordstringAdmin password for controller.
portstringPort to get to controller.
serverNamestringName of new member.
usernamestringAdmin username for controller. member.

FileService.uploadScalingPolicy(appPackage, clusterName, host, instances, password, port, username)

Upload Scaling Policy to controller configDropins/overrides folder.

Kind: static method of FileService

ParamTypeDescription
appPackagestringThe name of the package being deployed. Should already be on the server in the specified appDir. If an appPackage is not specified, will use clusterName if specified. One or the other is required.
clusterNamestringThe name of the deployed cluster to affect, also used for file naming for file being uploaded.
hoststringHostname of controller. to the collective.
instancesstringnumber of instances to set for cluster scaling.
passwordstringAdmin password for controller.
portstringPort to get to controller. not provided, the other parameters must be passed into the function call
usernamestringAdmin username for controller. member.

ServerCommand

Kind: global class

new ServerCommand()

Provides commands to directly control server/application instances via a collective controller.

ServerCommand.start(options)

Implements the server start commands.

Kind: static method of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.hostNamestringThe host on which the server is running.
options.wlpnUserDirstringThe user directory in which the server is set up.
options.serverNamestringThe server name identifying a server.
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password.
options.autoAcceptCertificatesstringAn option to accept the certificate of the controller.

ServerCommand.stop(options)

Implements the server stop commands.

Kind: static method of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.hostNamestringThe host on which the server is running.
options.wlpnUserDirstringThe user directory in which the server is set up.
options.serverNamestringThe server name identifying a server.
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password.
options.autoAcceptCertificatesstringAn option to accept the certificate of the controller.

ServerCommand.status(options)

Implements the server status commands.

Kind: static method of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.hostNamestringThe host on which the server is running.
options.wlpnUserDirstringThe user directory in which the server is set up.
options.serverNamestringThe server name identifying a server.
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password.
options.autoAcceptCertificatesstringAn option to accept the certificate of the controller.

ServerCommand.list(options)

Implements the server list commands.

Kind: static method of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password.
options.autoAcceptCertificatesstringAn option to accept the certificate of the controller.

ServerCommand.getData(options)

Retrieve a key-value pair from the Collective Repository.

Kind: static method of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.pathstringThe registry path to get the data stored in a particular path. The data could be an environmental variable formatted as 'key=value'.
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password.
options.autoAcceptCertificatesstringAn option to accept the certificate of the controller.

ServerCommand.deleteNode(options)

Delete a node in Collective Repository.

Kind: static method of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.pathstringThe registry path to get the data stored in a particular path. The data could be an environmental variable formatted as 'key=value'.
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password.
options.autoAcceptCertificatesstringAn option to accept the certificate of the controller.

ServerCommand.setData(options)

Sets the data (a key-value pair) in the Repository.

Kind: static method of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.pathstringThe registry path to set the data.
options.datastringThe data to be stored in the path specified above. The data could be an environmental variable formatted as 'key=value'.
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password.
options.autoAcceptCertificatesstringAn option to accept the certificate of the controller.

ServerCommand.createNode(options)

Creates a node in the Repository.

Kind: static method of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.pathstringThe registry path to set the data.
options.datastringThe data to be stored in the path specified above. The data could be an environmental variable formatted as 'key=value'.
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password.
options.autoAcceptCertificatesstringAn option to accept the certificate of the controller.

ServerCommand.listClusterData(options)

Retrieve a key-value pair from the Collective Repository.

Kind: static method of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.pathstringThe registry path to get the data stored in a particular path. The data could be an environmental variable formatted as 'key=value'.
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password.
options.autoAcceptCertificatesstringAn option to accept the certificate of the controller.

ServerCommand.getClusterData(options)

Retrieve a key-value pair from the Collective Repository.

Kind: static method of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.clusterNamestringThe name of the cluster to get from.
options.keystringThe registry path to get the data stored in a particular path. The data could be an environmental variable formatted as 'key=value'. FIXME not 'could be', is
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password.
options.autoAcceptCertificatesstringAn option to accept the certificate of the controller.

ServerCommand.setClusterData(options)

Sets the data (a key-value pair) in the Repository.

Kind: static method of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.clusterNamestringThe name of the cluster to store data.
options.keystringThe name of the variable to set the data.
options.datastringThe data to be stored in the variable

ServerCommand.setIhsInfo()

Sets a IHS IP/name to a port.

Kind: static method of ServerCommand

ParamTypeDescription
options.ihsIpstringThe IP of the IHS server.
options.ihsPortstringThe port of the IHS server.
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password.

ServerCommand.listIhsInfo()

Gets the IHS IP/name to port mappings

Kind: static method of ServerCommand

ParamTypeDescription
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's password. Return looks like { '1.2.3.4': '8080', ... }

ServerCommand.getHosts()

Gets a list of hosts registered to the controller.

Kind: static method of ServerCommand

ParamTypeDescription
options.hoststringThe host on which controller is running.
options.portstringThe https port assigned to the controller.
options.userstringThe controller's admin user name.
options.passwordstringThe controller's admin password. Returned data looks like: { allServersRunning: 1, allServersStopped: 0, allServersUnknown: 0, someServersRunning: 0, noServers: 0, type: 'hosts', ids: 'hostname1', 'hostname2' }

ServerCommand.deleteClusterData

Deletes the data (a key-value pair) in the Repository.

Kind: static typedef of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.clusterNamestringThe name of the cluster to remove data from.
options.keystringThe name of the variable to delete.
callback

ServerCommand.clearClusterData

Deletes all of data (the key-value pairs) for a cluster in the Repository.

Kind: static typedef of ServerCommand

ParamTypeDescription
optionsobjectThe options object.
options.clusterNamestringThe name of the cluster to clear data from.
callback