Git Product home page Git Product logo

redisearchqueryclient's Introduction

Endpoints

OpenAPI redisearchQueryClient

  • GET /
  • GET /health
  • POST /h3/aggregate/devices/count
  • POST /h3/fetch/shapes/h3polygon
  • POST /h3/fetch/shapes/polygon
  • POST /h3/search/shapes/list
  • POST /radius/search/devices/list

WebSocket to subscribe to devices' updates

const ws = new WebSocket("ws://$lt;server$gt;:3132");
// Stream name is made from -> STREAMDEV:<DeviceId>:<Topic>:<StreamKey>
var payload = {'type': 'subscriptionRequest', 'streams': ['STREAMDEV:test-001:lafleet/devices/location/+/streaming:1']};
//var payload = {'type': 'subscriptionToAllRequest'};
ws.send(str); 

Sample javascript client

Playing with docker locally

docker build --tag redisearch-query-js:v0.02 .
sudo docker run -it -p 3131:3131 redisearch-query-js:v0.02

Playing around

curl -X POST -H "Content-Type: application/json" -d '{"h3resolution":"0","h3indices":["802bfffffffffff","8023fffffffffff"]}' http://localhost:3131/h3/aggregate/devices/count
curl -s --raw --show-error --verbose -X POST -H "Content-Type: application/json"  -H "Accept: application/json" -d '{"h3resolution":"0","h3indices":["801dfffffffffff","802bfffffffffff","8003fffffffffff"]}' http://localhost:3131/h3/aggregate/devices/count
curl -X POST -H "Content-Type: application/json" -d '{"longitude": -73.561668,"latitude":45.508888,"distance": 100.0, "distanceUnit": "km"' http://localhost:3131/radius/search/devices/list

curl -s --raw --show-error --verbose -X POST -H "Content-Type: application/json"  -H "Accept: application/json" -d '{"shapeIds":["47db1f7b-5c0f-4f85-88d7-2bc3f83eaaf4"]}' http://localhost:3131/h3/fetch/shapes/polygon
curl -s --raw --show-error --verbose -X POST -H "Content-Type: application/json"  -H "Accept: application/json" -d '{"shapeIds":["47db1f7b-5c0f-4f85-88d7-2bc3f83eaaf4"]}' http://localhost:3131/h3/fetch/shapes/h3polygon

curl -s --raw --show-error --verbose -L -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{"h3resolution":"0","h3indices":["802bfffffffffff","8023fffffffffff"]}' https://<random>.cloudfront.net/query/h3/aggregate/devices/count
/h3/aggregate/devices/count
curl -s --raw --show-error --verbose -L -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{"h3resolution":"0","h3indices":["802bfffffffffff","8023fffffffffff"]}' https://<ELB>/h3/aggregate/devices/count
/h3/aggregate/devices/count
curl -s --raw --show-error --verbose -L -X GET https://d29ksk98fzh8z0.cloudfront.net/query/health
curl -s --raw --show-error --verbose -L -X GET https://d29ksk98fzh8z0.cloudfront.net/query/
const posts : Post[] = [ { h3resolution: 0, h3indices: ["802bfffffffffff", "8023fffffffffff"] } ];
curl -X POST -H "Content-Type: application/json" -d '{"shapeType":"LIMIT","status":"ACTIVE","h3indices":["812bbffffffffff"]}' http://localhost:3131/h3/search/shapes/list

Play with redis locally

sudo docker run --name redis-service -d -p 6379:6379 redislabs/redisearch:latest
redis-cli

sudo docker run -it -p 6379:6379 redis bash
sudo docker exec -it redis-service bash
root@72c388dc2cb8:/data# redis-cli

Test websocket

curl --no-buffer --include --raw --show-error --verbose -i -N -L -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Origin: http://localhost" -H "Host: <DIST_SUBDOMAIN>.cloudfront.net" -H "Sec-Websocket-Version: 13" -H "Sec-WebSocket-Key: 123" https://<DIST_SUBDOMAIN>.cloudfront.net/query/ wscat -L -c ws://<DIST_SUBDOMAIN>.cloudfront.net/query/

redisearchqueryclient's People

Contributors

ducharme avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.