Skip to content

Instantly share code, notes, and snippets.

@toopay
toopay / kongfig-api.md
Last active June 18, 2018 14:07
Kongfig API (via Kong Publisher)

Overview

Kong Publisher exposes a public APIs. Here are the base endpoint of Kong Publisher API, on each environment accordingly.

Environment Base Endpoint
develop https://dev-kong-publisher.command-api.kw.com/api
qa https://qa-kong-publisher.command-api.kw.com/api
production https://kong-publisher.command-api.kw.com/api
@toopay
toopay / config.yml
Last active June 27, 2018 11:49
Connect API Kongfig
# Mandatory Consumer
consumers:
- acls: []
credentials: []
custom_id: "0"
username: anonymous
apis:
# Main Endpoint
- attributes:
methods:
'create_user' => '24b3cb9f-635c-11e8-aa57-d8cb8a18931c',
'remove_user' => '7702d2b2-a56b-11e8-8430-00155d731728',
'create_user_flow' => '978b16b9-6368-11e8-aa57-d8cb8a18931c',
'edit_user_flow' => '3d832d6e-6369-11e8-aa57-d8cb8a18931c',
'get_user_flows' => 'b0d7074f-636b-11e8-aa57-d8cb8a18931c',
'get_user_flow_by_id' => 'ae332308-9105-11e8-842f-00155d731728',
'get_contact_flows' => '9c81eeb5-7bb0-11e8-842e-00155d731728',
'activate_user_flow' => 'dd3138ff-7bfe-11e8-842e-00155d731728',
'deactivate_user_flow' => '69c237f0-7bff-11e8-842e-00155d731728',
'get_flow_contacts' => '5ab62ab1-7bb2-11e8-842e-00155d731728',
@toopay
toopay / newman-reporter-curl.js
Created October 22, 2018 14:22
newman-reporter-curl.js
var CurlReporter;
/**
* Simple reporter that generates a curl statement
*
* @param {Object} newman - A run object with event handler specification methods.
* @param {Function} newman.on - An event setter method that provides hooks for reporting collection run progress.
* @param {Object} reporterOptions - A set of reporter specific run options.
* @param {Object} options - A set of generic collection run options.
* @returns {*}
@toopay
toopay / drain.sh
Last active October 1, 2019 14:40
drain.sh
#!/bin/bash
concurrency_count=2
# Ensure to have correct current-context on your kubeconfig
KUBECONFIG=~/.kube/config
nodes_draining(){
ps -ef |grep "[k]ubectl drain"
return $?
}
@toopay
toopay / new-table.sql
Created January 8, 2021 20:15
connect-new-table
DROP TABLE IF EXISTS `email_template`;
CREATE TABLE IF NOT EXISTS `email_template` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`template_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`category` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`can_aggregate` tinyint(1) NOT NULL DEFAULT '0',