@pixul/node-kong-api
v1.0.2
Published
Kong Api Client in NodeJS
Downloads
6
Keywords
Readme
Kong Node Client
A Node Kong Api Client using Promises
Installation
npm i -s node-kong-api
Usage
const Kong = require('javascript-kong-api');
let kong = new Kong({
url: 'http://10.42.79.233:8001'
});
kong.listApis({}).then(data => {
// do Something with the data
}).catch(err => {
// do something with the error
});
Available methods
kong.getjavascriptInformation()
kong.getjavascriptStatus()
kong.addApi(api)
kong.getApi(nameOrId)
kong.listApis(query)
kong.updateApi(nameOrId, api)
kong.updateOrCreateApi(api)
kong.deleteApi(nameOrId)
kong.addConsumer(consumer)
kong.getConsumer(nameOrId)
kong.listConsumers(query)
kong.updateConsumer(usernameOrId, consumer)
kong.updateOrCreateConsumer(consumer)
kong.deleteConsumer(usernameOrId)
kong.addPluginToApi(apiNameOrId, plugin)
kong.addPluginToAllApis(plugin)
kong.getPlugin(id)
kong.listPlugins(query)
kong.listPluginsForApi(nameOrId, query)
kong.updatePlugin(apiNameOrId, pluginNameOrId, plugin)
kong.updateOrCreatePlugin(apiNameOrId, plugin)
kong.deletePlugin(apiNameOrId, pluginNameOrId)
kong.getEnabledPlugins()
kong.getPluginSchema(pluginName)
kong.addCertificate(certificate)
kong.getCertificate(sniOrId)
kong.listCertificates()
kong.updateCertificate(sniOrId, certificate)
kong.updateOrCreateCertificate(certificate)
kong.deleteCertificate(sniOrId)
kong.addSNI(sni)
kong.getSNI(name)
kong.listSNIs()
kong.updateSNI(name, sni)
kong.updateOrCreateSNI(sni)
kong.deleteSNI(name)
kong.addUpstream(upstream)
kong.getUpstream(nameOrId)
kong.listUpstreams(query)
kong.updateUpstream(nameOrId, upstream)
kong.updateOrCreateUpstream(upstream)
kong.deleteUpstream(nameOrId)
kong.addTarget(upstreamNameOrId, target)
kong.listTargets(upstreamNameOrId, query)
kong.listActiveTargets(upstreamNameOrId)
kong.deleteTarget(upstreamNameOrId, targetOrId)