coap-hooks-router

command module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 3 Imported by: 0

README

CoAP Webhooks Router

To Run

  • generate your ADMIN_BEARER (openssl rand -base64 27 can do it) and export ADMIN_BEARER="generatedbearertokenvalue" in your shell
  • mkdir -f dbdata && make dev for local run
  • make docker-run for local docker run (functionally the same as the previous)
  • make docker-build to build the docker image
  • the Admin Hooks API runs on 8081, and the CoAP server runs on 5683

Using the Hooks API

Create a new hook
  • curl -v -d '{"owner":"{OWNER_NAME}","name":"{HOOK_NAME}","destination":"{HTTPS_ADDRESS}"}' -H "Content-Type:application/json" -H "Authorization: Bearer $ADMIN_BEARER" http://localhost:8081/api/hooks
List all hooks for an owner
  • curl -v -H "Accept:application/json" -H "Authorization: Bearer $ADMIN_BEARER" http://localhost:8081/api/hooks/{OWNER_NAME}
List all hooks existing in the system
  • curl -v -H "Accept:application/json" -H "Authorization: Bearer $ADMIN_BEARER" http://localhost:8081/api/hooks
Delete an existing hook by name
  • curl -v -X DELETE -H "Content-Type:application/json" -H "Authorization: Bearer $ADMIN_BEARER" http://localhost:8081/api/hooks/{OWNER_NAME}/{HOOK_NAME}
Delete all hooks for an owner
  • curl -v -X DELETE -H "Content-Type:application/json" -H "Authorization: Bearer $ADMIN_BEARER" http://localhost:8081/api/hooks/{OWNER_NAME}

Making CoAP requests

Only CoAP POST requests are currently supported

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL