openshift-node
v0.0.46
Published
NodeJs library for Openshift origin v3
Downloads
12
Readme
openshift-node
NodeJs library for Openshift origin v3
Install
npm install --save openshift-node
Usage
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" ... }
...
}
Functions
Resources
- resource.getAll(namespace, resourceKind)
- resource.get(namespace, resourceObject)
- resource.add(namespace, resourceObject)
- resource.update(namespace, resourceObject)
- resource.remove(namespace, resourceObject)
Projects
- projects.get(namespace)
- projects.add(project) - Project object
- projects.remove(namespace)
RoleBindings
- rolebindings.get(namespace)
- rolebindings.add(project) - Rolebinding object
- rolebindings.update(project) - Rolebinding object
- rolebindings.remove(namespace, rolebindingName)
Limits
- limits.add(project) - Limit object
- limits.update(project) - Limit object
- limits.remove(namespace, limitName)
Quotas
- quotas.add(project) - Quota object
- quotas.update(project) - Quota object
- quotas.remove(namespace, quotaName)
Pods
- pods.get(namespace)
- pods.scale(project) - Scale object
Templates
- template.process(templateObject)
Project object
{
"name": "-",
"description": "-",
"displayName": "-"
}
Rolebinding object
{
"name": "-",
"userNames": [],
"subjects": [],
"rolRefName": "-"
}
Limit object
{
"name": "-",
"specs": {}
}
Quota object
{
"name": "-",
"specs": {}
}
Scale object
{
"deployment": "-",
"namespace": "-",
"replicas": 0
}
License
See the LICENSE file for license rights and limitations (MIT).
Contributing
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.