cloudfoundry-cli
Node.js library for interfacing with the Cloud Foundry command line interface (cf
).
cf
must be installed and configured on the system for this module to work. Refer to https://docs.cloudfoundry.org/cf-cli/install-go-cli.html for installation on the system of your interest.
If you don't want to install cf
, you can use a module like cf-nodejs-client.
The advantage of cloudfoundry-cli
over cf-nodejs-client
is that, cloudfoundry-cli
does not need to know any authentication
details, since it relies on the underlying cf
for it.
Quick examples
Listing services:
const cf = var services = cfconsole // list of provisioned services
Provisioning a service:
const cf = cf
Usage
NOTE: Complete interface support to cf
is still a work in progress, only completed interfaces are documented.
Instantiation
const cf = ;
All further code samples will refer to the variable cf
instantiated above.
Apps
.pushApp([dir], [callback])
.pushAppSync([dir])
.getApps([filters], [callback])
filters
is defined in the querystring format.
cf
.getAppsSync([filters])
var apps = cfconsole
.deleteApp(<name>, [callback])
.deleteAppSync(<name>)
Services
.getServices([filters], [callback])
cf
.getServicesSync([filters])
var services = cfconsole
.createService(<details>, [callback])
details
object can have the following following properties:
name
: Name of the servicetype
: Service typeplan
: Plan type of the service
cf
.createServiceSync(<details>)
details
object can have the following following properties:
name
: Name of the servicetype
: Service typeplan
: Plan type of the service
var service = cfconsole
.deleteService(<name>, [callback])
name
: Name of the servicecallback
: Callback function
.deleteServiceSync(<name>)
name
: Name of the service