Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
cloudfoundry-client
Advanced tools
Supports interaction with Cloudfoundry.
Install:
npm install cloudfoundry-client
Current endpoint support includes:
Interaction is accomplished via client.<endpoint>.<method>
. (see examples below)
Authentication can be done via either token or login. If, however, the token expires, the login info will be used to acquire a new token. Hence, long running processes should consider the use of email/password.
var Client = require('cloudfoundry-client');
var client = new Client({
host: 'pivotal.io',
protocol: 'https:',
token: 'XYZ', // optional if email/password is provided
email: 'my email' // optional if token is provided
password: 'password' // optional if token is provided
});
Paging is accomplished automatically. For example, a request for apps
will
return all apps, not just those returned on the first page.
For example, to get all apps:
client.apps.get(function (err, apps) {
console.log('your apps are:', apps);
});
var guid = < app guid >;
client.apps.get(guid, function (err, app) {
console.log(util.format('app by %s is %s', guid, app));
});
There are two ways to do this. The first is to get the object, then call the method corresponding to its nested collection:
client.apps.get(guid, function (err, app) {
// handle err
app.summary.get(function (err, summary) {
console.log(util.format('summary for app %s is %s', guid, summary));
});
});
The drawback is that this requires 2 round trips to the server: first to get the app, then to get the summary via the summary endpoint.
This can be bypassed by omitting the callback on the first get
:
client.apps.get(guid).summary.get(function (err, summary) {
console.log(util.format('summary for app %s is %s', guid, summary));
});
This simply executes the call to the summary endpoint using the app's guid
. The result from the apps.get
, however, has no app data: only methods allowing the user to get nested collections.
The nested attributes convert the CF endpoints to camel. For example, service_instances
is accessed in the client via serviceInstances
:
client.apps.get(guid).serviceInstances.get(function (err, serviceInstances) {
console.log(util.format('summary for app %s is %s', guid, summary));
});
Get logs:
client.apps.get(guid).instances.get(0).logs.get(function (err, logs) { // check err .. console.log('logs for instance 0 are:', log); });
See issues.
FAQs
Cloudfoundry client
The npm package cloudfoundry-client receives a total of 3 weekly downloads. As such, cloudfoundry-client popularity was classified as not popular.
We found that cloudfoundry-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.