volt samples
diff --git a/xos/api/examples/add_volt_to_subscriber.sh b/xos/api/examples/add_volt_to_subscriber.sh
new file mode 100755
index 0000000..377ad65
--- /dev/null
+++ b/xos/api/examples/add_volt_to_subscriber.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+source ./config.sh
+source ./util.sh
+
+ACCOUNT_NUM=1238
+S_TAG=34
+C_TAG=134
+
+SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
+if [[ $? != 0 ]]; then
+ exit -1
+fi
+
+DATA=$(cat <<EOF
+{"s_tag": $S_TAG,
+ "c_tag": $C_TAG,
+ "subscriber": $SUBSCRIBER_ID}
+EOF
+)
+
+curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X POST -d "$DATA" $HOST/api/tenant/cord/volt/
diff --git a/xos/api/examples/delete_volt_from_subscriber.sh b/xos/api/examples/delete_volt_from_subscriber.sh
new file mode 100755
index 0000000..c3acd2e
--- /dev/null
+++ b/xos/api/examples/delete_volt_from_subscriber.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+source ./config.sh
+source ./util.sh
+
+ACCOUNT_NUM=1238
+
+SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
+if [[ $? != 0 ]]; then
+ exit -1
+fi
+
+VOLT_ID=$(lookup_subscriber_volt $SUBSCRIBER_ID)
+if [[ $? != 0 ]]; then
+ exit -1
+fi
+
+curl -u $AUTH -X DELETE $HOST/api/tenant/cord/volt/$VOLT_ID/
diff --git a/xos/api/examples/util.sh b/xos/api/examples/util.sh
index f412e88..8373498 100644
--- a/xos/api/examples/util.sh
+++ b/xos/api/examples/util.sh
@@ -11,3 +11,22 @@
# echo "(mapped account_num $1 to id $ID)" >&2
echo $ID
}
+
+function lookup_subscriber_volt {
+ JSON=`curl -f -s -u $AUTH -X GET $HOST/api/tenant/cord/subscriber/$1/`
+ if [[ $? != 0 ]]; then
+ echo "function lookup_subscriber_volt failed to read subscriber with arg $1" >&2
+ echo "See CURL output below:" >&2
+ curl -s -u $AUTH -X GET $HOST/api/tenant/cord/account_num_lookup/$1/ >&2
+ exit -1
+ fi
+ ID=`echo $JSON | python -c "import json,sys; print json.load(sys.stdin)['related'].get('volt_id','')"`
+ if [[ $ID == "" ]]; then
+ echo "there is no volt for this subscriber" >&2
+ exit -1
+ fi
+
+ # echo "(found volt id %1)" >&2
+
+ echo $ID
+}
\ No newline at end of file