New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-kong-admin

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-kong-admin

A Kong Admin API Client for NodeJS

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Support the project

If you find Kong Admin helpful, you can show your support and help me continue maintaining the project by buying me a coffee.

Buy Me A Coffee

Node Kong Admin

This library is on development stage, so be careful when using it on production environment.

The current version from May 2019 covers all methods listed on https://docs.konghq.com/1.1.x/admin-api/.

Installing

npm install node-kong-admin --save

Using

const KongLib = require('node-kong-admin');
const KongClient = new KongLib({ url: 'http://kong.docker:8001' });

let createData = {
    name: 'FirstService',
    host: 'localhost'
};

KongClient.service.create(createData, function(err, done) {
    
    if(err) throw new Error(err);
    
    console.log('Created: ', done);
    // Do whatever you have todo here

});

We are currently covering the following modules:

Node

MethodExampleDoc
infoKongClient.node.info(callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-node-information
statusKongClient.node.status(callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-node-status

Config

MethodExampleDoc
dblessKongClient.config.dbless(filePath, callback);https://docs.konghq.com/1.1.x/admin-api/#update-db-less-config

Tags

MethodExampleDoc
listKongClient.tag.list(offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-all-tags
listByTagKongClient.tag.listByTags(tags, offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-entity-ids-by-tag

Service

MethodExampleDoc
createKongClient.service.create(data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-service
updateKongClient.service.update(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-service
updateByRouteKongClient.service.updateByRoute(routeNameOrId, data, callback);
updateByPluginKongClient.service.updateByPlugin(pluginId, data, callback);
updateOrCreateKongClient.service.updateOrCreate(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-or-create-service
updateOrCreateByRouteKongClient.service.updateOrCreateByRoute(routeNameOrId, data, callback);
updateOrCreateByPluginKongClient.service.updateOrCreateByPlugin(pluginId, data, callback);
getKongClient.service.get(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-service
listKongClient.service.list(offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-services
deleteKongClient.service.delete(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#delete-service
deleteByRouteKongClient.service.deleteByRoute(routeNameOrId, callback);

Route

MethodExampleDoc
createKongClient.route.create(data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-route
createByServiceKongClient.route.createByService(serviceNameOrId, data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-route
updateKongClient.route.update(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-route
updateByPluginKongClient.route.updateByPlugin(pluginId, data, callback);
updateOrCreateKongClient.route.updateOrCreate(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-or-create-route
updateOrCreateByPluginKongClient.route.updateOrCreateByPlugin(pluginId, data, callback);
getKongClient.route.get(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-route
getByPluginKongClient.route.getByPlugin(pluginId, callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-route
listKongClient.route.list(offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-routes
listByServiceKongClient.route.listByService(serviceNameOrId, offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-routes
deleteKongClient.route.delete(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#delete-route

Consumer

MethodExampleDoc
createKongClient.consumer.create(data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-consumer
updateKongClient.consumer.update(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-consumer
updateByPluginKongClient.consumer.updateByPlugin(pluginId, data, callback);
updateOrCreateKongClient.consumer.updateOrCreate(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-or-create-consumer
updateOrCreateByPluginKongClient.consumer.updateOrCreateByPlugin(pluginId, data, callback);
getKongClient.consumer.get(usernameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-consumer
getByPluginKongClient.consumer.getByPlugin(pluginId, callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-consumer
listKongClient.consumer.list(offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-consumers
deleteKongClient.consumer.delete(usernameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#delete-consumer

Plugin

MethodExampleDoc
createKongClient.plugin.create(data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-plugin
createByRouteKongClient.plugin.createByRoute(routeId, data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-plugin
createByServiceKongClient.plugin.createByService(sericeId, data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-plugin
createConsumerKongClient.plugin.createByConsumer(consumerId, data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-plugin
updateKongClient.plugin.update(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-plugin
updateOrCreateKongClient.plugin.updateOrCreate(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-or-create-plugin
getKongClient.plugin.get(pluginId, callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-plugin
listKongClient.plugin.list(offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-plugins
listByRouteKongClient.plugin.listByRoute(routeId, offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-plugins
listByServiceKongClient.plugin.listByService(serviceId, offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-plugins
listByConsumerKongClient.plugin.listByConsumer(consumerId, offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-plugins
deleteKongClient.plugin.delete(pluginId, callback);https://docs.konghq.com/1.1.x/admin-api/#delete-plugin

Certificate

MethodExampleDoc
createKongClient.certificate.create(data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-certificate
updateKongClient.certificate.update(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-certificate
updateOrCreateKongClient.certificate.updateOrCreate(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-or-create-certificate
getKongClient.certificate.get(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-certificate
listKongClient.certificate.list(offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-certificates
deleteKongClient.certificate.delete(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#delete-certificate

SNI

MethodExampleDoc
createKongClient.sni.create(data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-sni
createByCertificateKongClient.sni.createByCertificate(certificateNameOrId, data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-sni
updateKongClient.sni.update(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-sni
updateOrCreateKongClient.sni.updateOrCreate(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-or-create-sni
getKongClient.sni.get(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-sni
listKongClient.sni.list(offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-snis
listByCertificateKongClient.sni.listByCertificate(certificateNameOrId, offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-snis
deleteKongClient.sni.delete(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#delete-sni

Upstream

MethodExampleDoc
createKongClient.upstream.create(data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-upstream
updateKongClient.upstream.update(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-upstream
updateByTargetKongClient.upstream.updateByTarget(targetHostAndPortOrId, data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-upstream
updateOrCreateKongClient.upstream.updateOrCreate(data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-or-create-upstream
updateOrCreateByTargetKongClient.upstream.updateOrCreateByTarget(targetHostAndPortOrId, data, callback);https://docs.konghq.com/1.1.x/admin-api/#update-or-create-upstream
getKongClient.upstream.get(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-upstream
getByTargetKongClient.upstream.getByTarget(targetHostAndPortOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-upstream
listKongClient.upstream.list(offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-upstreams
deleteKongClient.upstream.delete(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#delete-upstream
deleteByTargetKongClient.upstream.deleteByTarget(targetHostAndPortOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#delete-upstream
healthKongClient.upstream.health(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#show-upstream-health-for-node

Target

MethodExampleDoc
createKongClient.target.create(data, callback);https://docs.konghq.com/1.1.x/admin-api/#add-target
getKongClient.target.get(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#retrieve-target
listKongClient.target.list(upstreamHostAndPortOrId, offset, callback);https://docs.konghq.com/1.1.x/admin-api/#list-targets
listAllKongClient.target.listAll(upstreamNameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#list-all-targets
deleteKongClient.target.delete(nameOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#delete-target
setHealthyKongClient.target.setHealthy(upstreamNameOrId, targetHostAndPortOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#set-target-as-healthy
setUnhealthyKongClient.target.setHealthy(upstreamNameOrId, targetHostAndPortOrId, callback);https://docs.konghq.com/1.1.x/admin-api/#set-target-as-unhealthy

Keywords

NodeJS

FAQs

Package last updated on 01 Apr 2021

Did you know?

Socket

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.

Install

Related posts