Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Last login: Wed Mar 22 13:32:23 on ttys015
- l% π π π β apigateway git:(master) β ls
- CONTRIBUTING.md Makefile conf.d init.sh tests
- Dockerfile README.md doc naxsi_core.rules tools
- LICENSE.txt api-gateway.conf html scripts
- π π π β apigateway git:(master) β docker ps
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- 4f8fbe048201 openwhisk/apigateway:latest "/etc/init-contain..." 40 seconds ago Up 39 seconds 0.0.0.0:80->80/tcp, 0.0.0.0:9000->9000/tcp, 8423/tcp, 0.0.0.0:32776->8080/tcp apigateway
- ba7e1d51a06f redis "docker-entrypoint..." About an hour ago Up About an hour 0.0.0.0:6379->6379/tcp trusting_bardeen
- π π π β apigateway git:(master) β docker ps
- π π π β apigateway git:(master) β ls
- CONTRIBUTING.md Makefile conf.d init.sh tests
- Dockerfile README.md doc naxsi_core.rules tools
- LICENSE.txt api-gateway.conf html scripts
- π π π β apigateway git:(master) β git commit -m "fix broken ratelimiting" -a
- [master 18985bc] fix broken ratelimiting
- Committer: Taylor King <taylor@taylors-mbp.raleigh.ibm.com>
- Your name and email address were configured automatically based
- on your username and hostname. Please check that they are accurate.
- You can suppress this message by setting them explicitly:
- git config --global user.name "Your Name"
- git config --global user.email you@example.com
- After doing this, you may fix the identity used for this commit with:
- git commit --amend --reset-author
- 1 file changed, 1 deletion(-)
- π π π β apigateway git:(master) β git rebase HEAD~2 -i
- [detached HEAD 19b7817] fix broken ratelimiting
- Date: Wed Mar 22 13:32:39 2017 -0400
- Committer: Taylor King <taylor@taylors-mbp.raleigh.ibm.com>
- Your name and email address were configured automatically based
- on your username and hostname. Please check that they are accurate.
- You can suppress this message by setting them explicitly:
- git config --global user.name "Your Name"
- git config --global user.email you@example.com
- After doing this, you may fix the identity used for this commit with:
- git commit --amend --reset-author
- 2 files changed, 9 insertions(+), 4 deletions(-)
- ls
- Successfully rebased and updated refs/heads/master.
- π π π β apigateway git:(master) β ls
- CONTRIBUTING.md Makefile conf.d init.sh tests
- Dockerfile README.md doc naxsi_core.rules tools
- LICENSE.txt api-gateway.conf html scripts
- π π π β apigateway git:(master) β cd ..
- π π π β projects git:(master) β ls
- Architecture html5up-big-picture-8728
- GbaByteFiddle html5up-prologue-8725
- LuaJIT-2.0.4 ipfs
- LuaJIT-2.0.4.tar.gz jepsen
- Makefile jinglesbot
- Nightcode juhu
- OpenRCT2 juhu2
- PrologExercises kafka
- SmartSim kompose
- TSH linux-stable
- a.out lua-5.3.3
- a.out.dSYM lua-5.3.3.tar.gz
- a8ctl lua-resty-string
- angular luaffi
- apic-auto-deploy luarocks-2.4.1
- apic-tract-client luarocks-2.4.1.tar.gz
- apigateway macemu
- apigateway-datastore mangodb
- apigateway-examples merge.C
- apigateway-test mesos-infrastructure-master.zip
- apim microgateway
- apim-ui ms
- apimesh msutil
- apisman msutil-master.zip
- bhendi new
- bluemix-service-broker node-v4.5.0
- bob node-v4.5.0.tar.gz
- btc node-vim-debugger
- build node_modules
- c11 nomouse
- cassandra npm-debug.log
- certs old
- check old2
- checkedc openwhisk
- checkedc-clang out
- checkedc-llvm overflow
- cljsplayground passwordCrack.class
- clojurescript passwordCrack.java
- clsh pearpc
- cookies.txt prolog-bot
- crow quicksort.c
- csim quicksort.o
- cucked repl
- curl rubber-docker
- d2 run.sh
- devops sample-api
- devportal simple-node
- devportal_large_files t
- dotfiles taylor
- dragos tea
- dtc test.beam
- eddie-final test.c
- emoji-prompt test.erl
- example.js test.go
- fakeredis test.js
- fivewords test.o
- gateway-director test.sh
- gateway-director-apigateway test_dummy.C
- gateway-director-bluemix testms
- gateway-director-interface testproject
- gateway-director-interface2 timg
- gateway-director-management-interface tinycljwm
- gateway-director-management-interface-legacy tora
- gateway-director-test tora.wiki
- gateway-service-gw-controller tract
- gd-bluemix2 tset.c
- generator tt1
- git tush
- gosh vim
- gotest vim-misc
- gprolog web
- gprolog-1.4.4.tar.gz web.tar.gz
- hpapi xterm.js
- π π π β projects git:(master) β cd gateway-director-bluemix
- π π π β gateway-director-bluemix git:(master) β ls
- Dockerfile _deploy-config environments package.json server
- Jenkinsfile common node_modules runctl utils
- π π π β gateway-director-bluemix git:(master) β git log
- π π π β gateway-director-bluemix git:(master) β ls
- Dockerfile _deploy-config environments package.json server
- Jenkinsfile common node_modules runctl utils
- π π π β gateway-director-bluemix git:(master) β git branch --list
- develop
- * logging
- logging2
- test
- π π π β gateway-director-bluemix git:(master) β ls
- Dockerfile _deploy-config environments package.json server
- Jenkinsfile common node_modules runctl utils
- π π π β gateway-director-bluemix git:(master) β cd ..
- π π π β projects git:(master) β ls
- Architecture html5up-big-picture-8728
- GbaByteFiddle html5up-prologue-8725
- LuaJIT-2.0.4 ipfs
- LuaJIT-2.0.4.tar.gz jepsen
- Makefile jinglesbot
- Nightcode juhu
- OpenRCT2 juhu2
- PrologExercises kafka
- SmartSim kompose
- TSH linux-stable
- a.out lua-5.3.3
- a.out.dSYM lua-5.3.3.tar.gz
- a8ctl lua-resty-string
- angular luaffi
- apic-auto-deploy luarocks-2.4.1
- apic-tract-client luarocks-2.4.1.tar.gz
- apigateway macemu
- apigateway-datastore mangodb
- apigateway-examples merge.C
- apigateway-test mesos-infrastructure-master.zip
- apim microgateway
- apim-ui ms
- apimesh msutil
- apisman msutil-master.zip
- bhendi new
- bluemix-service-broker node-v4.5.0
- bob node-v4.5.0.tar.gz
- btc node-vim-debugger
- build node_modules
- c11 nomouse
- cassandra npm-debug.log
- certs old
- check old2
- checkedc openwhisk
- checkedc-clang out
- checkedc-llvm overflow
- cljsplayground passwordCrack.class
- clojurescript passwordCrack.java
- clsh pearpc
- cookies.txt prolog-bot
- crow quicksort.c
- csim quicksort.o
- cucked repl
- curl rubber-docker
- d2 run.sh
- devops sample-api
- devportal simple-node
- devportal_large_files t
- dotfiles taylor
- dragos tea
- dtc test.beam
- eddie-final test.c
- emoji-prompt test.erl
- example.js test.go
- fakeredis test.js
- fivewords test.o
- gateway-director test.sh
- gateway-director-apigateway test_dummy.C
- gateway-director-bluemix testms
- gateway-director-interface testproject
- gateway-director-interface2 timg
- gateway-director-management-interface tinycljwm
- gateway-director-management-interface-legacy tora
- gateway-director-test tora.wiki
- gateway-service-gw-controller tract
- gd-bluemix2 tset.c
- generator tt1
- git tush
- gosh vim
- gotest vim-misc
- gprolog web
- gprolog-1.4.4.tar.gz web.tar.gz
- hpapi xterm.js
- π π π β projects git:(master) β cd ..
- π π π β ~ git:(master) β cd projects
- π π π β projects git:(master) β ls
- Architecture html5up-big-picture-8728
- GbaByteFiddle html5up-prologue-8725
- LuaJIT-2.0.4 ipfs
- LuaJIT-2.0.4.tar.gz jepsen
- Makefile jinglesbot
- Nightcode juhu
- OpenRCT2 juhu2
- PrologExercises kafka
- SmartSim kompose
- TSH linux-stable
- a.out lua-5.3.3
- a.out.dSYM lua-5.3.3.tar.gz
- a8ctl lua-resty-string
- angular luaffi
- apic-auto-deploy luarocks-2.4.1
- apic-tract-client luarocks-2.4.1.tar.gz
- apigateway macemu
- apigateway-datastore mangodb
- apigateway-examples merge.C
- apigateway-test mesos-infrastructure-master.zip
- apim microgateway
- apim-ui ms
- apimesh msutil
- apisman msutil-master.zip
- bhendi new
- bluemix-service-broker node-v4.5.0
- bob node-v4.5.0.tar.gz
- btc node-vim-debugger
- build node_modules
- c11 nomouse
- cassandra npm-debug.log
- certs old
- check old2
- checkedc openwhisk
- checkedc-clang out
- checkedc-llvm overflow
- cljsplayground passwordCrack.class
- clojurescript passwordCrack.java
- clsh pearpc
- cookies.txt prolog-bot
- crow quicksort.c
- csim quicksort.o
- cucked repl
- curl rubber-docker
- d2 run.sh
- devops sample-api
- devportal simple-node
- devportal_large_files t
- dotfiles taylor
- dragos tea
- dtc test.beam
- eddie-final test.c
- emoji-prompt test.erl
- example.js test.go
- fakeredis test.js
- fivewords test.o
- gateway-director test.sh
- gateway-director-apigateway test_dummy.C
- gateway-director-bluemix testms
- gateway-director-interface testproject
- gateway-director-interface2 timg
- gateway-director-management-interface tinycljwm
- gateway-director-management-interface-legacy tora
- gateway-director-test tora.wiki
- gateway-service-gw-controller tract
- gd-bluemix2 tset.c
- generator tt1
- git tush
- gosh vim
- gotest vim-misc
- gprolog web
- gprolog-1.4.4.tar.gz web.tar.gz
- hpapi xterm.js
- π π π β projects git:(master) β cd gateway-director-test
- π π π β gateway-director-test git:(master) β ls
- README.md id_rsa.pub scenario2 scenario7
- certs manipulateCatalogs scenario3 scenario8
- deleteCatalogs package.json scenario4 scenario9
- deleteSubs scenario0 scenario5 sendCatalogs
- gateway-director-apigateway scenario1 scenario6 testcases
- π π π β gateway-director-test git:(master) β cd scenario9
- π π π β scenario9 git:(master) β ls
- cassandra gateway-director-bluemix gateway-director-swagger
- docker-compose.yml gateway-director-interface install.sh
- gateway-director-apigateway gateway-director-redis openwhisk-apigateway
- π π π β scenario9 git:(master) β cd gateway-director-bluemix
- π π π β gateway-director-bluemix git:(master) β ls
- Dockerfile _deploy-config environments package.json utils
- Jenkinsfile common node_modules server
- π π π β gateway-director-bluemix git:(master) β git log
- π π π β gateway-director-bluemix git:(master) β git remote -v
- origin git@github.ibm.com:apimesh/gateway-director-bluemix.git (fetch)
- origin git@github.ibm.com:apimesh/gateway-director-bluemix.git (push)
- taylor git@github.ibm.com:taylor-king1/gateway-director-bluemix (fetch)
- taylor git@github.ibm.com:taylor-king1/gateway-director-bluemix (push)
- π π π β gateway-director-bluemix git:(master) β ls
- Dockerfile _deploy-config environments package.json utils
- Jenkinsfile common node_modules server
- π π π β gateway-director-bluemix git:(master) β git push -u origin
- Enter passphrase for key '/Users/taylor/.ssh/id_rsa':
- π π π β gateway-director-bluemix git:(master) β git push -u taylor
- Enter passphrase for key '/Users/taylor/.ssh/id_rsa':
- Enter passphrase for key '/Users/taylor/.ssh/id_rsa':
- Total 0 (delta 0), reused 0 (delta 0)
- To github.ibm.com:taylor-king1/gateway-director-bluemix
- ca7679d..06b140c kafka -> kafka
- Branch kafka set up to track remote branch kafka from taylor.
- π π π β gateway-director-bluemix git:(master) β ls
- Dockerfile _deploy-config environments package.json utils
- Jenkinsfile common node_modules server
- π π π β gateway-director-bluemix git:(master) β cd ..
- π π π β scenario9 git:(master) β ls
- cassandra gateway-director-bluemix gateway-director-swagger
- docker-compose.yml gateway-director-interface install.sh
- gateway-director-apigateway gateway-director-redis openwhisk-apigateway
- π π π β scenario9 git:(master) β cd gateway-director-interface
- π π π β gateway-director-interface git:(master) β ls
- Dockerfile README.md common definitions node_modules server
- Jenkinsfile _deploy-config configs environments package.json utils
- π π π β gateway-director-interface git:(master) β cd common
- π π π β common git:(master) β ls
- models
- π π π β common git:(master) β cd models
- π π π β models git:(master) β ls
- health.js health.json package.js package.json product.js product.json
- π π π β models git:(master) β vi package.js
- 'use strict';
- var logger = require('../../utils/logger')
- .child({ loc: 'models:package' });
- var _ = require('lodash');
- var db = require('../../utils/persistence');
- var Promise = require('bluebird');
- var apiGateway = require('../../utils/api-gateway');
- var uuidV4 = require('uuid/v4');
- var requestQueue = require('../../utils/queue');
- //var requestQueue = [];
- var requestStillProcessing = false;
- + const ZOOKEEPER_HOST = process.env['ZOOKEEPER_HOST'] || process.env['DC_HOST'];
- + const ZOOKEEPER_PORT = process.env['ZOOKEEPER_PORT'] || 2181
- + const ZOOKEEPER_CONNSTRING = ZOOKEEPER_HOST + ":" + ZOOKEEPER_PORT;
- +
- + const INPUT_TOPIC = 'input_topic';
- +
- + const kafka = require('kafka-node')
- + var client = new kafka.Client(ZOOKEEPER_CONNSTRING), var consumer = new kafka.Consumer(client, [{topic: INPUT_TOPI C, offset:0}]);
- +
- + consumer.on('message', (message) => {
- + logger.info("recieved kafka message! " + message);
- + });
- +
- + consumer.on('error', (error) => {
- + logger.error('encountered a kafka error: ' + error);
- + })
- +
- module.exports = function(Package) {
- //start the init array
- setInterval(function () {
- if(db.isDatabaseUp()){
- processRequest();
- }
- }, 1000);
- +
- Package.countAllPackages = () => {
- return db.countAllPackages()
- .then((countResult) => {
- return Promise.resolve(countResult.count);
- }).catch((err) =>{
- logger.error(err);
- throw err;
- });
- };
- Package.countPackagesByOrgAndCatalog = (orgid, catalogid) => {
- return db.countPackagesByOrgAndCatalog(orgid, catalogid)
- .then((countResult) => {
- return Promise.resolve(countResult.count);
- }).catch((err) =>{
- logger.error(err);
- throw err;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement