This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def log(msg) { | |
log.debug(msg) | |
if (useLogstash) { | |
def dateNow = new Date() | |
def isoDateNow = dateNow.format("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") | |
def json = "{" | |
json += "\"date\":\"${dateNow}\"," | |
json += "\"isoDate\":\"${isoDateNow}\"," | |
json += "\"name\":\"log\"," | |
json += "\"message\":\"${msg}\"," |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
THIS WORKS: | |
------------------ | |
curl -X POST -H 'Accept: */*' -H 'Content-type: text/xml; charset=utf-8' -H 'SOAPAction: "urn:Belkin:service:deviceevent:1#SetAttributes"' -d '<?xml version="1.0" encoding="utf-8"?> | |
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> | |
<s:Body> | |
<u:SetAttributes xmlns:u="urn:Belkin:service:deviceevent:1"> | |
<attributeList><attribute><name>FanMode</name><value>2</value></attribute><attribute><name>DesiredHumidity</name><value>NULL</value></attribute><attribute><name>CurrentHumidity</name><value>NULL</value></attribute><attribute><name>WaterAdvise</name><value>NULL</value></attribute><attribute><name>NoWater</name><value>NULL</value></attribute><attribute><name>FilterLife</name><value>NULL</value></at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stash(msg) { | |
log.debug(msg) | |
def dateNow = new Date() | |
// def isoDateNow = dateNow.format("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", location.timeZone) | |
def isoDateNow = dateNow.format("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") | |
def json = "{" | |
json += "\"date\":\"${dateNow}\"," | |
json += "\"isoDate\":\"${isoDateNow}\"," | |
json += "\"name\":\"log\"," | |
json += "\"message\":\"${msg}\"," |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mappings { | |
path("/stamp") { | |
action: [ | |
GET: "checkStamp", | |
] | |
} | |
path("/reschedule") { | |
action: [ | |
GET: "reschedule", | |
] |