NodeJs library for Openshift origin v3
npm install --save openshift-node
You need a secret token from some service account with cluster privileges.
const Openshift = require('openshift-node');
const api = new Openshift('OPENSHIFT_HOST', 'OPENSHIFT_API_TOKEN');
...
const project = await api.projects.get('edd');
console.log(project.body); // { "kind": "Project", "apiVersion": "v1" ... }
...
}
- resource.getAll(namespace, resourceKind)
- resource.get(namespace, resourceObject)
- resource.add(namespace, resourceObject)
- resource.update(namespace, resourceObject)
- resource.remove(namespace, resourceObject)
- projects.get(namespace)
- projects.add(project) - Project object
- projects.remove(namespace)
- rolebindings.get(namespace)
- rolebindings.add(project) - Rolebinding object
- rolebindings.update(project) - Rolebinding object
- rolebindings.remove(namespace, rolebindingName)
- limits.add(project) - Limit object
- limits.update(project) - Limit object
- limits.remove(namespace, limitName)
- quotas.add(project) - Quota object
- quotas.update(project) - Quota object
- quotas.remove(namespace, quotaName)
- pods.get(namespace)
- pods.scale(project) - Scale object
- template.process(templateObject)
{
"name": "-",
"description": "-",
"displayName": "-"
}
{
"name": "-",
"userNames": [],
"subjects": [],
"rolRefName": "-"
}
{
"name": "-",
"specs": {}
}
{
"name": "-",
"specs": {}
}
{
"deployment": "-",
"namespace": "-",
"replicas": 0
}
See the LICENSE file for license rights and limitations (MIT).
If you'd like to suggest an improvement, please raise an issue to discuss it before making your pull request. Pull requests for bugs are more than welcome - please explain the bug you're trying to fix in the message.