request-response

command
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

README

request-response

request-response is an example go-parodus client that manages an interanal map of Information. While the code itself is boring the end2end with XMiDT is awesome

Running

prereqs

  • Have an XMiDT cluster up and running
  • Start parodus running on tcp://127.0.0.1:6666 and connected to the XMiDT cluster with the mac address of de:ad:be:ef:ca:fe
  • run the example go run .

testing

# set a value in the local map
curl -X POST \
 https://scytale.example.com/api/v2/device \
 -H 'Accept: application/json' \
 -H 'Content-Type: application/json' \
 -H 'X-Webpa-Device-Name: mac:deadbeefcafe/config' \
 -H 'X-Xmidt-Message-Type: 3' \
 -H 'X-Xmidt-Source: dns:foo.bar' \
 -H 'X-Xmidt-Transaction-Uuid: 1234' \
 -d '{
   "command": "SET",
   "parameters": [
       {
           "name": "message",
           "value": "Hello World!",
           "dataType": 0
       }
   ]
}'

#  wrp.message decodedpayload:
#  {"statusCode":200,"message":"Success"}


# get value out of the local map
curl -X POST \
 https://scytale.example.com/api/v2/device \
 -H 'Accept: application/json' \
 -H 'Content-Type: application/json' \
 -H 'X-Webpa-Device-Name: mac:deadbeefcafe/config' \
 -H 'X-Xmidt-Message-Type: 3' \
 -H 'X-Xmidt-Source: dns:foo.bar' \
 -H 'X-Xmidt-Transaction-Uuid: 1234' \
 -d '{
   "command": "GET",
   "names": [
     "message"
   ]
}'

#  wrp.message decodedpayload:
#  {"statusCode":200,"parameters":[{"name":"message","value":"Hello World!","message":"Success"}],"message":"Success"}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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