-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from orchestracities/dev
The Orion sidecar tale of woe
- Loading branch information
Showing
13 changed files
with
380 additions
and
68 deletions.
There are no files selected for viewing
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}') | ||
set -e | ||
|
||
export INGRESS_HOST=$(minikube ip) | ||
export INGRESS_PORT=$(kubectl -n istio-system \ | ||
get service istio-ingressgateway \ | ||
-o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}') | ||
|
||
export BASE_URL="http://${INGRESS_HOST}:${INGRESS_PORT}" | ||
|
||
export ORION_INGRESS_PORT=$(kubectl \ | ||
-n istio-system get service istio-ingressgateway \ | ||
-o jsonpath='{.spec.ports[?(@.name=="orion")].nodePort}') | ||
export ORION_BASE_URL="http://${INGRESS_HOST}:${ORION_INGRESS_PORT}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
|
||
if [[ -z "${HEADER_VALUE// }" ]]; | ||
then | ||
echo ">>> HEADER_VALUE env var not set properly" | ||
echo ">>> set HEADER_VALUE as explained in README" | ||
exit 1 | ||
fi | ||
|
||
|
||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
ROOTDIR="$(dirname "$SCRIPTPATH")" | ||
SCRIPTSDIR="${ROOTDIR}/scripts" | ||
|
||
source "${SCRIPTSDIR}/cluster-url.sh" | ||
|
||
|
||
curl -v "${ORION_BASE_URL}/v2/entities" \ | ||
-H "header: ${HEADER_VALUE}" -H 'Content-Type: application/json' \ | ||
-d @- <<EOF | ||
{ | ||
"id": "Room1", | ||
"type": "Room", | ||
"temperature": { | ||
"value": 23, | ||
"type": "Float" | ||
}, | ||
"pressure": { | ||
"value": 720, | ||
"type": "Integer" | ||
} | ||
} | ||
EOF |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
|
||
if [[ -z "${HEADER_VALUE// }" ]]; | ||
then | ||
echo ">>> HEADER_VALUE env var not set properly" | ||
echo ">>> set HEADER_VALUE as explained in README" | ||
exit 1 | ||
fi | ||
|
||
|
||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
ROOTDIR="$(dirname "$SCRIPTPATH")" | ||
SCRIPTSDIR="${ROOTDIR}/scripts" | ||
|
||
source "${SCRIPTSDIR}/cluster-url.sh" | ||
|
||
|
||
curl -v "${ORION_BASE_URL}/v2/subscriptions" \ | ||
-H "header: ${HEADER_VALUE}" -H 'Content-Type: application/json' \ | ||
-d @- <<EOF | ||
{ | ||
"description": "A subscription to get info about Room1", | ||
"subject": { | ||
"entities": [ | ||
{ | ||
"id": "Room1", | ||
"type": "Room" | ||
} | ||
], | ||
"condition": { | ||
"attrs": [ | ||
"pressure" | ||
] | ||
} | ||
}, | ||
"notification": { | ||
"http": { | ||
"url": "http://httpbin.org/post" | ||
}, | ||
"attrs": [ | ||
"temperature" | ||
] | ||
}, | ||
"expires": "2040-01-01T14:00:00.00Z", | ||
"throttling": 5 | ||
} | ||
EOF |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
|
||
if [[ -z "${HEADER_VALUE// }" ]]; | ||
then | ||
echo ">>> HEADER_VALUE env var not set properly" | ||
echo ">>> set HEADER_VALUE as explained in README" | ||
exit 1 | ||
fi | ||
|
||
|
||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
ROOTDIR="$(dirname "$SCRIPTPATH")" | ||
SCRIPTSDIR="${ROOTDIR}/scripts" | ||
|
||
source "${SCRIPTSDIR}/cluster-url.sh" | ||
|
||
|
||
curl -v "${ORION_BASE_URL}/v2/entities/Room1/attrs" \ | ||
-H "header: ${HEADER_VALUE}" -H 'Content-Type: application/json' \ | ||
-X PATCH -d @- <<EOF | ||
{ | ||
"temperature": { | ||
"value": 21.5, | ||
"type": "Float" | ||
}, | ||
"pressure": { | ||
"value": 703, | ||
"type": "Float" | ||
} | ||
} | ||
EOF |
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
Oops, something went wrong.