kubegrid-sdk-node v1.2.4
KubeGrid Node.js Library
The KubeGrid library provides access to the KubeGrid API from application written in Node.js
Documentation
See the kubegrid-sdk-node
API Docs for Node.js at https://api-docs.kubegrid.com/
Installation
Install the package with:
npm install kubegrid-sdk-node --save
# or
yarn add kubegrid-sdk-node
Usage
The package needs to be configured with your account's API Key which is available in your KubeGrid dashboard https://manager.kubegrid.com
const kgApiKey = process.env.KG_API_KEY;
const kubegrid = require('kubegrid-sdk-node')(kgApiKey);
kubegrid.cluster.list().then(clusters => {
console.log(clusters)
}).catch(err => {
console.error(err)
})
Or using ES module and async
/ await
import KubeGrid from 'kubegrid-sdk-node'
const kubegrid = require('kubegrid')(kgApiKey);
(async() => {
const clusters = await kubegrid.cluster.list()
console.log(clusters)
})();
KubeGrid on-premise integration
Just pass the host
attribute when initializing kubegrid object:
const kgApiKey = process.env.KG_API_KEY;
const kubegrid = require('kubegrid-sdk-node')(kgApiKey, {
host: 'api.yourhostname.com'
});
kubegrid.setProtocol('http');
kubegrid.setTimeout(20000);
Also don't forget to take the new API Key from your host instead of KubeGrid server.
Development
Run all tests, please note you have to export your credentials by export KG_TEST_API_KEY=<your-KubeGrid-API-key
first
yarn install
yarn test
If you don't have yarn
installed, get it with npm install --global yarn
License
Updating...
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago