1.2.4 • Published 4 years ago

kubegrid-sdk-node v1.2.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

KubeGrid Node.js Library

Version Build Status Coverage Status Downloads

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...

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago