SEBA-422 Remove dead code

Change-Id: I67c00b8dc15d0722a741d9dd4a69cc72a2fa39b3
diff --git a/VERSION b/VERSION
index 18d3400..9cc792d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1,2 @@
-2.1.33
+2.1.34
+
diff --git a/containers/chameleon/Dockerfile.chameleon b/containers/chameleon/Dockerfile.chameleon
index 861a1aa..1c9b130 100644
--- a/containers/chameleon/Dockerfile.chameleon
+++ b/containers/chameleon/Dockerfile.chameleon
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/chameleon
-FROM xosproject/xos-base:2.1.33
+FROM xosproject/xos-base:2.1.34
 
 # xos-base already has protoc and dependencies installed
 
diff --git a/containers/xos/Dockerfile.client b/containers/xos/Dockerfile.client
index f950968..7ee9bae 100644
--- a/containers/xos/Dockerfile.client
+++ b/containers/xos/Dockerfile.client
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/xos-client
-FROM xosproject/xos-libraries:2.1.33
+FROM xosproject/xos-libraries:2.1.34
 
 # Install XOS client
 COPY lib/xos-api /tmp/xos-api
diff --git a/containers/xos/Dockerfile.libraries b/containers/xos/Dockerfile.libraries
index 105bc97..3a8a6a0 100644
--- a/containers/xos/Dockerfile.libraries
+++ b/containers/xos/Dockerfile.libraries
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/xos-libraries
-FROM xosproject/xos-base:2.1.33
+FROM xosproject/xos-base:2.1.34
 
 # Add libraries
 COPY lib /opt/xos/lib
diff --git a/containers/xos/Dockerfile.synchronizer-base b/containers/xos/Dockerfile.synchronizer-base
index 6fd81f5..1458e7e 100644
--- a/containers/xos/Dockerfile.synchronizer-base
+++ b/containers/xos/Dockerfile.synchronizer-base
@@ -13,11 +13,10 @@
 # limitations under the License.
 
 # xosproject/xos-synchronizer-base
-FROM xosproject/xos-client:2.1.33
+FROM xosproject/xos-client:2.1.34
 
 COPY xos/synchronizers/new_base /opt/xos/synchronizers/new_base
 COPY xos/xos/logger.py /opt/xos/xos/logger.py
-COPY xos/xos/xml_util.py /opt/xos/xos/xml_util.py
 COPY xos/xos/__init__.py /opt/xos/xos/__init__.py
 COPY xos/synchronizers/__init__.py /opt/xos/synchronizers/__init__.py
 
diff --git a/containers/xos/Dockerfile.xos-core b/containers/xos/Dockerfile.xos-core
index d3935db..8326199 100644
--- a/containers/xos/Dockerfile.xos-core
+++ b/containers/xos/Dockerfile.xos-core
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 # xosproject/xos-core
-FROM xosproject/xos-libraries:2.1.33
+FROM xosproject/xos-libraries:2.1.34
 
 # Install XOS
 ADD xos /opt/xos
diff --git a/xos/api/README.md b/xos/api/README.md
deleted file mode 100644
index eb2bd28..0000000
--- a/xos/api/README.md
+++ /dev/null
@@ -1,24 +0,0 @@
-## XOS REST API
-
-Source for the XOS REST API lives in directory `xos/api`. An importer
-tool, `import_methods.py`, auto-generates the REST API by searching
-this directory (and sub-directories) for valid API methods. These
-methods are descendents of the Django View class. This should include
-django_rest_framework based Views and Viewsets.
-
-We establish a convention for locating API methods within the XOS
-hierarchy. The root of the api is automatically `/api/`. Under that
-are the following paths:
-
-* `/api/service` ... API endpoints that are service-wide
-* `/api/tenant` ... API endpoints that are relative to a tenant within a service
-
-For example, `/api/tenant/cord/subscriber/` contains the Subscriber
-API for the CORD service.
-
-The API importer automatically constructs REST paths based on
-where files are placed within the directory hierarchy. For example,
-the files in `xos/api/tenant/cord/` will automatically appear at the
-API endpoint `http://server_name/api/tenant/cord/`.  The directory
-`examples` contains examples that demonstrate using the API from the
-Linux command line.
diff --git a/xos/api/__init__.py b/xos/api/__init__.py
deleted file mode 100644
index b0fb0b2..0000000
--- a/xos/api/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
diff --git a/xos/api/examples/README.md b/xos/api/examples/README.md
deleted file mode 100644
index 0ec7b73..0000000
--- a/xos/api/examples/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-## XOS REST API Examples
-
-This directory contains examples that demonstrate using the XOS REST API using the `curl` command-line tool.
-
-To get started, edit `config.sh` so that it points to a valid XOS server.
-
-We recommend running the following examples in order:
-
- * `add_subscriber.sh` ... add a cord subscriber using account number 1238
- * `update_subscriber.sh` ... update the subscriber's upstream_bandwidth feature
- * `add_volt_to_subscriber.sh` ... add a vOLT to the subscriber with s-tag 33 and c-tag 133
- * `get_subscriber.sh` ... get an entire subscriber object
- * `get_subscriber_features.sh` ... get the features of a subscriber
- * `delete_volt_from_subscriber.sh` ... remove the vOLT from the subscriber
- * `delete_subscriber.sh` ... delete the subscriber that has account number 1238
diff --git a/xos/api/examples/config.sh b/xos/api/examples/config.sh
deleted file mode 100644
index d60dba0..0000000
--- a/xos/api/examples/config.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#HOST=apt187.apt.emulab.net:9999
-HOST=clnode076.clemson.cloudlab.us:9999
-
-AUTH=padmin@vicci.org:letmein
diff --git a/xos/api/examples/cord/add_device_to_subscriber.sh b/xos/api/examples/cord/add_device_to_subscriber.sh
deleted file mode 100755
index 0b55c6f..0000000
--- a/xos/api/examples/cord/add_device_to_subscriber.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-ACCOUNT_NUM=1238
-MAC="19:28:37:46:55"
-
-SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-DATA=$(cat <<EOF
-{"mac": "$MAC"}
-EOF
-)
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X POST -d "$DATA" $HOST/api/tenant/cord/subscriber/$SUBSCRIBER_ID/devices/
diff --git a/xos/api/examples/cord/add_subscriber.sh b/xos/api/examples/cord/add_subscriber.sh
deleted file mode 100755
index 8720469..0000000
--- a/xos/api/examples/cord/add_subscriber.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-
-ACCOUNT_NUM=1238
-
-DATA=$(cat <<EOF
-{"identity": {"account_num": "$ACCOUNT_NUM", "name": "test-subscriber"},
- "features": {"uplink_speed": 2000000000}}
-EOF
-)
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X POST -d "$DATA" $HOST/api/tenant/cord/subscriber/   
diff --git a/xos/api/examples/cord/add_volt_to_subscriber.sh b/xos/api/examples/cord/add_volt_to_subscriber.sh
deleted file mode 100755
index 66fdac4..0000000
--- a/xos/api/examples/cord/add_volt_to_subscriber.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/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/cord/all.sh b/xos/api/examples/cord/all.sh
deleted file mode 100644
index c3a9f2f..0000000
--- a/xos/api/examples/cord/all.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-echo add_subscriber
-./add_subscriber.sh
-echo -e "\n update_subscriber"
-./update_subscriber.sh
-echo -e "\n add_volt_to_subscriber"
-./add_volt_to_subscriber.sh
-echo -e "\n get_subscriber"
-./get_subscriber.sh
-echo -e "\n delete_volt_from_subscriber"
-./delete_volt_from_subscriber.sh
-echo -e "\n add_device_to_subscriber"
-./add_device_to_subscriber.sh
-echo -e "\n set_subscriber_device_feature"
-./set_subscriber_device_feature.sh
-echo -e "\n set_subscriber_device_identity"
-./set_subscriber_device_identity.sh
-echo -e "\n get_subscriber_device_feature"
-./get_subscriber_device_feature.sh
-echo -e "\n get_subscriber_device_identity"
-./get_subscriber_device_identity.sh
-echo -e "\n get_subscriber"
-./get_subscriber.sh
-echo -e "\n list_subscriber_devices"
-./list_subscriber_devices.sh
-echo -e "\n delete_subscriber_device"
-./delete_subscriber_device.sh
-echo -e "\n delete_subscriber"
-./delete_subscriber.sh
diff --git a/xos/api/examples/cord/config.sh b/xos/api/examples/cord/config.sh
deleted file mode 100644
index 12d857c..0000000
--- a/xos/api/examples/cord/config.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# see config.sh in the parent directory
-source ../config.sh
diff --git a/xos/api/examples/cord/delete_subscriber.sh b/xos/api/examples/cord/delete_subscriber.sh
deleted file mode 100755
index 604ad88..0000000
--- a/xos/api/examples/cord/delete_subscriber.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-ACCOUNT_NUM=1238
-
-SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-curl -u $AUTH -X DELETE $HOST/api/tenant/cord/subscriber/$SUBSCRIBER_ID/
diff --git a/xos/api/examples/cord/delete_subscriber_device.sh b/xos/api/examples/cord/delete_subscriber_device.sh
deleted file mode 100755
index 08c59b6..0000000
--- a/xos/api/examples/cord/delete_subscriber_device.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-ACCOUNT_NUM=1238
-MAC="19:28:37:46:55"
-
-SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X DELETE $HOST/api/tenant/cord/subscriber/$SUBSCRIBER_ID/devices/$MAC/
diff --git a/xos/api/examples/cord/delete_volt_from_subscriber.sh b/xos/api/examples/cord/delete_volt_from_subscriber.sh
deleted file mode 100755
index 1ac99c0..0000000
--- a/xos/api/examples/cord/delete_volt_from_subscriber.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/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/cord/get_subscriber.sh b/xos/api/examples/cord/get_subscriber.sh
deleted file mode 100755
index 73cc7fe..0000000
--- a/xos/api/examples/cord/get_subscriber.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-ACCOUNT_NUM=1238
-
-SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-curl -H "Accept: application/json; indent=4" -u $AUTH -X GET $HOST/api/tenant/cord/subscriber/$SUBSCRIBER_ID/
diff --git a/xos/api/examples/cord/get_subscriber_device_feature.sh b/xos/api/examples/cord/get_subscriber_device_feature.sh
deleted file mode 100755
index 3da9dbf..0000000
--- a/xos/api/examples/cord/get_subscriber_device_feature.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-ACCOUNT_NUM=1238
-MAC="19:28:37:46:55"
-
-SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X GET $HOST/api/tenant/cord/subscriber/$SUBSCRIBER_ID/devices/$MAC/features/uplink_speed/
diff --git a/xos/api/examples/cord/get_subscriber_device_identity.sh b/xos/api/examples/cord/get_subscriber_device_identity.sh
deleted file mode 100755
index 4596c50..0000000
--- a/xos/api/examples/cord/get_subscriber_device_identity.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-ACCOUNT_NUM=1238
-MAC="19:28:37:46:55"
-
-SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X GET $HOST/api/tenant/cord/subscriber/$SUBSCRIBER_ID/devices/$MAC/identity/name/
diff --git a/xos/api/examples/cord/get_subscriber_features.sh b/xos/api/examples/cord/get_subscriber_features.sh
deleted file mode 100755
index 0374398..0000000
--- a/xos/api/examples/cord/get_subscriber_features.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-ACCOUNT_NUM=1238
-
-SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-curl -H "Accept: application/json; indent=4" -u $AUTH -X GET $HOST/api/tenant/cord/subscriber/$SUBSCRIBER_ID/features/
diff --git a/xos/api/examples/cord/set_subscriber_device_feature.sh b/xos/api/examples/cord/set_subscriber_device_feature.sh
deleted file mode 100755
index 6f7b117..0000000
--- a/xos/api/examples/cord/set_subscriber_device_feature.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-ACCOUNT_NUM=1238
-MAC="19:28:37:46:55"
-
-SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-DATA=$(cat <<EOF
-{"uplink_speed": 111111}
-EOF
-)
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X PUT -d "$DATA" $HOST/api/tenant/cord/subscriber/$SUBSCRIBER_ID/devices/$MAC/features/uplink_speed/
diff --git a/xos/api/examples/cord/set_subscriber_device_identity.sh b/xos/api/examples/cord/set_subscriber_device_identity.sh
deleted file mode 100755
index 8950d89..0000000
--- a/xos/api/examples/cord/set_subscriber_device_identity.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-ACCOUNT_NUM=1238
-MAC="19:28:37:46:55"
-
-SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-DATA=$(cat <<EOF
-{"name": "foo"}
-EOF
-)
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X PUT -d "$DATA" $HOST/api/tenant/cord/subscriber/$SUBSCRIBER_ID/devices/$MAC/identity/name/
diff --git a/xos/api/examples/cord/update_subscriber.sh b/xos/api/examples/cord/update_subscriber.sh
deleted file mode 100755
index b2e0506..0000000
--- a/xos/api/examples/cord/update_subscriber.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-ACCOUNT_NUM=1238
-
-SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-DATA=$(cat <<EOF
-{"features": {"uplink_speed": 4000000000}}
-EOF
-)
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X PUT -d "$DATA" $HOST/api/tenant/cord/subscriber/$SUBSCRIBER_ID/
diff --git a/xos/api/examples/cord/util.sh b/xos/api/examples/cord/util.sh
deleted file mode 100644
index eecd614..0000000
--- a/xos/api/examples/cord/util.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-source ../util.sh
diff --git a/xos/api/examples/exampleservice/add_exampletenant.sh b/xos/api/examples/exampleservice/add_exampletenant.sh
deleted file mode 100755
index 380dd19..0000000
--- a/xos/api/examples/exampleservice/add_exampletenant.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-
-DATA=$(cat <<EOF
-{"tenant_message": "This is a test"}
-EOF
-)
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X POST -d "$DATA" $HOST/api/tenant/exampletenant/   
diff --git a/xos/api/examples/exampleservice/config.sh b/xos/api/examples/exampleservice/config.sh
deleted file mode 100644
index 12d857c..0000000
--- a/xos/api/examples/exampleservice/config.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# see config.sh in the parent directory
-source ../config.sh
diff --git a/xos/api/examples/exampleservice/delete_exampletenant.sh b/xos/api/examples/exampleservice/delete_exampletenant.sh
deleted file mode 100755
index ccba996..0000000
--- a/xos/api/examples/exampleservice/delete_exampletenant.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-
-if [[ "$#" -ne 1 ]]; then
-    echo "Syntax: delete_exampletenant.sh <id>"
-    exit -1
-fi
-
-ID=$1
-
-curl -H "Accept: application/json; indent=4" -u $AUTH -X DELETE $HOST/api/tenant/exampletenant/$ID/
diff --git a/xos/api/examples/exampleservice/get_exampletenant_message.sh b/xos/api/examples/exampleservice/get_exampletenant_message.sh
deleted file mode 100755
index 7407df2..0000000
--- a/xos/api/examples/exampleservice/get_exampletenant_message.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-# this example illustrates using a custom REST API endpoint
-
-source ./config.sh
-
-if [[ "$#" -ne 1 ]]; then
-    echo "Syntax: get_exampletenant_message.sh <id>"
-    exit -1
-fi
-
-ID=$1
-
-curl -H "Accept: application/json; indent=4" -u $AUTH -X GET $HOST/api/tenant/exampletenant/$ID/message/
diff --git a/xos/api/examples/exampleservice/list_exampleservices.sh b/xos/api/examples/exampleservice/list_exampleservices.sh
deleted file mode 100755
index 6edaddd..0000000
--- a/xos/api/examples/exampleservice/list_exampleservices.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-
-curl -H "Accept: application/json; indent=4" -u $AUTH -X GET $HOST/api/service/exampleservice/
diff --git a/xos/api/examples/exampleservice/list_exampletenants.sh b/xos/api/examples/exampleservice/list_exampletenants.sh
deleted file mode 100755
index 061dfdc..0000000
--- a/xos/api/examples/exampleservice/list_exampletenants.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-
-curl -H "Accept: application/json; indent=4" -u $AUTH -X GET $HOST/api/tenant/exampletenant/   
diff --git a/xos/api/examples/exampleservice/put_exampletenant_message.sh b/xos/api/examples/exampleservice/put_exampletenant_message.sh
deleted file mode 100755
index d5398bb..0000000
--- a/xos/api/examples/exampleservice/put_exampletenant_message.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-# this example illustrates using a custom REST API endpoint  
-
-source ./config.sh
-
-if [[ "$#" -ne 2 ]]; then
-    echo "Syntax: put_exampletenant_message.sh <id> <message>"
-    exit -1
-fi
-
-ID=$1
-NEW_MESSAGE=$2
-
-DATA=$(cat <<EOF
-{"tenant_message": "$NEW_MESSAGE"}
-EOF
-)
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X PUT -d "$DATA" $HOST/api/tenant/exampletenant/$ID/message/
diff --git a/xos/api/examples/exampleservice/update_exampletenant.sh b/xos/api/examples/exampleservice/update_exampletenant.sh
deleted file mode 100755
index 537476b..0000000
--- a/xos/api/examples/exampleservice/update_exampletenant.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-
-if [[ "$#" -ne 2 ]]; then
-    echo "Syntax: delete_exampletenant.sh <id> <message>"
-    exit -1
-fi
-
-ID=$1
-NEW_MESSAGE=$2
-
-DATA=$(cat <<EOF
-{"tenant_message": "$NEW_MESSAGE"}
-EOF
-)
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X PUT -d "$DATA" $HOST/api/tenant/exampletenant/$ID/
diff --git a/xos/api/examples/misc/add_slice.sh b/xos/api/examples/misc/add_slice.sh
deleted file mode 100755
index 1d2ab1b..0000000
--- a/xos/api/examples/misc/add_slice.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-
-SITE_ID=1
-USER_ID=1
-
-DATA=$(cat <<EOF
-{"name": "mysite_test1",
- "site": $SITE_ID,
- "creator": $USER_ID
-}
-EOF
-)
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X POST -d "$DATA" $HOST/xos/slices/?no_hyperlinks=1
diff --git a/xos/api/examples/misc/config.sh b/xos/api/examples/misc/config.sh
deleted file mode 100644
index 12d857c..0000000
--- a/xos/api/examples/misc/config.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# see config.sh in the parent directory
-source ../config.sh
diff --git a/xos/api/examples/misc/delete_slice.sh b/xos/api/examples/misc/delete_slice.sh
deleted file mode 100755
index da3491c..0000000
--- a/xos/api/examples/misc/delete_slice.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-SLICE_NAME=mysite_test1
-
-SLICE_ID=$(lookup_slice_id $SLICE_NAME)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-curl -u $AUTH -X DELETE $HOST/xos/slices/$SLICE_ID/
diff --git a/xos/api/examples/misc/get_sshkeys.sh b/xos/api/examples/misc/get_sshkeys.sh
deleted file mode 100755
index cb5e5b1..0000000
--- a/xos/api/examples/misc/get_sshkeys.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-curl -H "Accept: application/json; indent=4" -u $AUTH -X GET $HOST/api/utility/sshkeys/
diff --git a/xos/api/examples/misc/update_slice.sh b/xos/api/examples/misc/update_slice.sh
deleted file mode 100755
index 3c6ffad..0000000
--- a/xos/api/examples/misc/update_slice.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-SLICE_NAME=mysite_test1
-
-SLICE_ID=$(lookup_slice_id $SLICE_NAME)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-DATA=$(cat <<EOF
-{"description": "foo"}
-EOF
-)
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X PATCH -d "$DATA" $HOST/xos/slices/$SLICE_ID/
diff --git a/xos/api/examples/misc/util.sh b/xos/api/examples/misc/util.sh
deleted file mode 100644
index eecd614..0000000
--- a/xos/api/examples/misc/util.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-source ../util.sh
diff --git a/xos/api/examples/util.sh b/xos/api/examples/util.sh
deleted file mode 100644
index f3ddd15..0000000
--- a/xos/api/examples/util.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-source ./config.sh
-
-function lookup_account_num {
-    ID=`curl -f -s -u $AUTH -X GET $HOST/api/tenant/cord/account_num_lookup/$1/`
-    if [[ $? != 0 ]]; then
-        echo "function lookup_account_num with arguments $1 failed" >&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
-    # echo "(mapped account_num $1 to id $ID)" >&2
-    echo $ID
-}
-
-function lookup_slice_id {
-    JSON=`curl -f -s -u $AUTH -X GET $HOST/xos/slices/?name=$1`
-    if [[ $? != 0 ]]; then
-        echo "function lookup_slice_id with arguments $1 failed" >&2
-        echo "See CURL output below:" >&2
-        curl -s -u $AUTH -X GET $HOST/xos/slices/?name=$1 >&2
-        exit -1
-    fi
-    ID=`echo $JSON | python -c "import json,sys; print json.load(sys.stdin)[0].get('id','')"`
-    #echo "(mapped slice_name 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
-}
-
-function lookup_subscriber_vsg {
-    JSON=`curl -f -s -u $AUTH -X GET $HOST/api/tenant/cord/subscriber/$1/`
-    if [[ $? != 0 ]]; then
-        echo "function lookup_subscriber_vsg 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('vsg_id','')"`
-    if [[ $ID == "" ]]; then
-        echo "there is no vsg for this subscriber" >&2
-        exit -1
-    fi
-
-    # echo "(found vsg id %1)" >&2
-
-    echo $ID
-}
-
diff --git a/xos/api/examples/vtr/add_truckroll_for_subscriber.sh b/xos/api/examples/vtr/add_truckroll_for_subscriber.sh
deleted file mode 100755
index 538f324..0000000
--- a/xos/api/examples/vtr/add_truckroll_for_subscriber.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-source ./util.sh
-
-ACCOUNT_NUM=1238
-
-SUBSCRIBER_ID=$(lookup_account_num $ACCOUNT_NUM)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-VSG_ID=$(lookup_subscriber_vsg $SUBSCRIBER_ID)
-if [[ $? != 0 ]]; then
-    exit -1
-fi
-
-DATA=$(cat <<EOF
-{"target_id": $SUBSCRIBER_ID,
- "scope": "container",
- "test": "ping",
- "argument": "8.8.8.8"}
-EOF
-)
-
-curl -H "Accept: application/json; indent=4" -H "Content-Type: application/json" -u $AUTH -X POST -d "$DATA" $HOST/api/tenant/truckroll/
diff --git a/xos/api/examples/vtr/config.sh b/xos/api/examples/vtr/config.sh
deleted file mode 100644
index 12d857c..0000000
--- a/xos/api/examples/vtr/config.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# see config.sh in the parent directory
-source ../config.sh
diff --git a/xos/api/examples/vtr/delete_truckroll.sh b/xos/api/examples/vtr/delete_truckroll.sh
deleted file mode 100755
index 22c41af..0000000
--- a/xos/api/examples/vtr/delete_truckroll.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-
-if [[ "$#" -ne 1 ]]; then
-    echo "Syntax: delete_truckroll.sh <id>"
-    exit -1
-fi
-
-ID=$1
-
-curl -H "Accept: application/json; indent=4" -u $AUTH -X DELETE $HOST/api/tenant/truckroll/$ID/
diff --git a/xos/api/examples/vtr/list_truckrolls.sh b/xos/api/examples/vtr/list_truckrolls.sh
deleted file mode 100755
index 9ba9cf2..0000000
--- a/xos/api/examples/vtr/list_truckrolls.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/bin/bash
-
-source ./config.sh
-
-curl -H "Accept: application/json; indent=4" -u $AUTH -X GET $HOST/api/tenant/truckroll/
diff --git a/xos/api/examples/vtr/util.sh b/xos/api/examples/vtr/util.sh
deleted file mode 100644
index eecd614..0000000
--- a/xos/api/examples/vtr/util.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-source ../util.sh
diff --git a/xos/api/import_methods.py b/xos/api/import_methods.py
deleted file mode 100644
index e610a31..0000000
--- a/xos/api/import_methods.py
+++ /dev/null
@@ -1,153 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from __future__ import print_function
-from django.views.generic import View
-from django.conf.urls import url
-from xosapi_helpers import XOSIndexViewSet
-import os
-import sys
-import inspect
-
-urlpatterns = []
-
-
-def import_module_from_filename(dirname, fn):
-    print("importing", dirname, fn)
-    sys_path_save = sys.path
-    try:
-        # __import__() and importlib.import_module() both import modules from
-        # sys.path. So we make sure that the path where we can find the views is
-        # the first thing in sys.path.
-        sys.path = [dirname] + sys.path
-
-        module = __import__(fn[:-3])
-    finally:
-        sys.path = sys_path_save
-
-    return module
-
-
-def import_module_by_dotted_name(name):
-    print("import", name)
-    try:
-        module = __import__(name)
-    except BaseException:
-        # django will eat the exception, and then fail later with
-        #  'conflicting models in application'
-        # when it tries to import the module a second time.
-        print("exception in import_model_by_dotted_name")
-        import traceback
-
-        traceback.print_exc()
-        raise
-    for part in name.split(".")[1:]:
-        module = getattr(module, part)
-    return module
-
-
-def import_api_methods(dirname=None, api_path="api", api_module="api"):
-    has_index_view = False
-    subdirs = []
-    urlpatterns = []
-
-    if not dirname:
-        dirname = os.path.dirname(os.path.abspath(__file__))
-
-    view_urls = []
-    for fn in os.listdir(dirname):
-        pathname = os.path.join(dirname, fn)
-        if (
-            os.path.isfile(pathname)
-            and fn.endswith(".py")
-            and (fn != "__init__.py")
-            and (fn != "import_methods.py")
-        ):
-            # module = import_module_from_filename(dirname, fn)
-            module = import_module_by_dotted_name(api_module + "." + fn[:-3])
-            for classname in dir(module):
-                #                print "  ",classname
-                c = getattr(module, classname, None)
-
-                if (
-                    inspect.isclass(c)
-                    and issubclass(c, View)
-                    and (classname not in globals())
-                ):
-                    globals()[classname] = c
-
-                    method_kind = getattr(c, "method_kind", None)
-                    method_name = getattr(c, "method_name", None)
-                    if method_kind:
-                        if method_name:
-                            method_name = os.path.join(api_path, method_name)
-                        else:
-                            method_name = api_path
-                            has_index_view = True
-                        view_urls.append((method_kind, method_name, classname, c))
-
-        elif os.path.isdir(pathname):
-            urlpatterns.extend(
-                import_api_methods(
-                    pathname, os.path.join(api_path, fn), api_module + "." + fn
-                )
-            )
-            subdirs.append(fn)
-
-    for view_url in view_urls:
-        if view_url[0] == "list":
-            urlpatterns.append(
-                url(
-                    r"^" + view_url[1] + "/$",
-                    view_url[3].as_view(),
-                    name=view_url[1] + "list",
-                )
-            )
-        elif view_url[0] == "detail":
-            urlpatterns.append(
-                url(
-                    r"^" + view_url[1] + r"/(?P<pk>[a-zA-Z0-9\-]+)/$",
-                    view_url[3].as_view(),
-                    name=view_url[1] + "detail",
-                )
-            )
-        elif view_url[0] == "viewset":
-            viewset = view_url[3]
-            urlpatterns.extend(viewset.get_urlpatterns(api_path="^" + api_path + "/"))
-
-    # Only add an index_view if 1) the is not already an index view, and
-    # 2) we have found some methods in this directory.
-    if (not has_index_view) and (urlpatterns):
-        # The browseable API uses the classname as the breadcrumb and page
-        # title, so try to create index views with descriptive classnames
-        viewset = type(
-            "IndexOf" + api_path.split("/")[-1].title(), (XOSIndexViewSet,), {}
-        )
-        urlpatterns.append(
-            url(
-                "^" + api_path + "/$",
-                viewset.as_view(
-                    {"get": "list"},
-                    view_urls=view_urls,
-                    subdirs=subdirs,
-                    api_path=api_path,
-                ),
-                name=api_path + "_index",
-            )
-        )
-
-    return urlpatterns
-
-
-urlpatterns = import_api_methods()
diff --git a/xos/api/service/__init__.py b/xos/api/service/__init__.py
deleted file mode 100644
index b0fb0b2..0000000
--- a/xos/api/service/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
diff --git a/xos/api/tenant/__init__.py b/xos/api/tenant/__init__.py
deleted file mode 100644
index b0fb0b2..0000000
--- a/xos/api/tenant/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
diff --git a/xos/api/utility/__init__.py b/xos/api/utility/__init__.py
deleted file mode 100644
index b0fb0b2..0000000
--- a/xos/api/utility/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
diff --git a/xos/api/utility/toscaapi.py b/xos/api/utility/toscaapi.py
deleted file mode 100644
index 7e66103..0000000
--- a/xos/api/utility/toscaapi.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import os
-import sys
-import traceback
-
-# The Tosca engine expects to be run from /opt/xos/tosca/ or equivalent. It
-# needs some sys.path fixing up.
-import inspect
-
-currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
-toscadir = os.path.join(currentdir, "../../tosca")
-
-
-class ToscaViewSet(XOSViewSet):
-    base_name = "tosca"
-    method_name = "tosca"
-    method_kind = "viewset"
-
-    @classmethod
-    def get_urlpatterns(self, api_path="^"):
-        patterns = []
-
-        patterns.append(self.list_url("run/$", {"post": "post_run"}, "tosca_run"))
-
-        return patterns
-
-    def post_run(self, request):
-
-        recipe = request.data.get("recipe", None)
-
-        sys_path_save = sys.path
-        try:
-            sys.path.append(toscadir)
-            from tosca.engine import XOSTosca
-
-            xt = XOSTosca(recipe, parent_dir=toscadir, log_to_console=False)
-            xt.execute(request.user)
-        except BaseException:
-            return Response({"error_text": traceback.format_exc()}, status=500)
-        finally:
-            sys.path = sys_path_save
-
-        return Response({"log_msgs": xt.log_msgs})
diff --git a/xos/api/xosapi_helpers.py b/xos/api/xosapi_helpers.py
deleted file mode 100644
index b01d637..0000000
--- a/xos/api/xosapi_helpers.py
+++ /dev/null
@@ -1,258 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from rest_framework import serializers, viewsets
-from rest_framework.response import Response
-from django.conf.urls import url
-from xos.exceptions import XOSPermissionDenied
-from django.core.urlresolvers import get_script_prefix, resolve, Resolver404
-
-# rest_framework 3.x
-ReadOnlyField = serializers.ReadOnlyField
-
-ICON_URLS = {
-    "success": "/static/admin/img/icon_success.gif",
-    "clock": "/static/admin/img/icon_clock.gif",
-    "error": "/static/admin/img/icon_error.gif",
-}
-
-
-class PlusObjectMixin:
-    def getBackendIcon(self):
-        (icon, tooltip) = self.get_backend_icon()
-        icon_url = ICON_URLS.get(icon, "unknown")
-        return icon_url
-
-    def getBackendHtml(self):
-        (icon, tooltip) = self.get_backend_icon()
-        icon_url = ICON_URLS.get(icon, "unknown")
-
-        if tooltip:
-            return '<span title="%s"><img src="%s"></span>' % (tooltip, icon_url)
-        else:
-            return '<img src="%s">' % icon_url
-
-
-""" PlusSerializerMixin
-
-    Implements Serializer fields that are common to all OpenCloud objects. For
-    example, stuff related to backend fields.
-"""
-
-
-class PlusModelSerializer(serializers.ModelSerializer):
-    backendIcon = serializers.SerializerMethodField("getBackendIcon")
-    backendHtml = serializers.SerializerMethodField("getBackendHtml")
-
-    # This will cause a descendant class to pull in the methods defined
-    # above. See rest_framework/serializers.py: _get_declared_fields().
-    base_fields = {"backendIcon": backendIcon, "backendHtml": backendHtml}
-    # Rest_framework 3.0 uses _declared_fields instead of base_fields
-    _declared_fields = {"backendIcon": backendIcon, "backendHtml": backendHtml}
-
-    def getBackendIcon(self, obj):
-        return obj.getBackendIcon()
-
-    def getBackendHtml(self, obj):
-        return obj.getBackendHtml()
-
-    def create(self, validated_data):
-        property_fields = getattr(self, "property_fields", [])
-        create_fields = {}
-        for k in validated_data:
-            if k not in property_fields:
-                create_fields[k] = validated_data[k]
-        instance = self.Meta.model(**create_fields)
-
-        if (
-            instance
-            and hasattr(instance, "can_update")
-            and self.context.get("request", None)
-        ):
-            user = self.context["request"].user
-            if user.__class__.__name__ == "AnonymousUser":
-                raise XOSPermissionDenied()
-
-        for k in validated_data:
-            if k in property_fields:
-                setattr(instance, k, validated_data[k])
-
-        instance.caller = self.context["request"].user
-        instance.save()
-        return instance
-
-    def update(self, instance, validated_data):
-        nested_fields = getattr(self, "nested_fields", [])
-        for k in validated_data.keys():
-            v = validated_data[k]
-            if k in nested_fields:
-                d = getattr(instance, k)
-                d.update(v)
-                setattr(instance, k, d)
-            else:
-                setattr(instance, k, v)
-        instance.caller = self.context["request"].user
-        instance.save()
-        return instance
-
-
-class XOSViewSet(viewsets.ModelViewSet):
-    api_path = ""
-    read_only = False
-
-    @classmethod
-    def get_api_method_path(self):
-        if self.method_name:
-            return self.api_path + self.method_name + "/"
-        else:
-            return self.api_path
-
-    @classmethod
-    def detail_url(self, pattern, viewdict, name):
-        return url(
-            self.get_api_method_path() + r"(?P<pk>[a-zA-Z0-9\-_]+)/" + pattern,
-            self.as_view(viewdict),
-            name=self.base_name + "_" + name,
-        )
-
-    @classmethod
-    def list_url(self, pattern, viewdict, name):
-        return url(
-            self.get_api_method_path() + pattern,
-            self.as_view(viewdict),
-            name=self.base_name + "_" + name,
-        )
-
-    @classmethod
-    def get_urlpatterns(self, api_path="^"):
-        self.api_path = api_path
-
-        patterns = []
-
-        if self.read_only:
-            patterns.append(
-                url(
-                    self.get_api_method_path() + "$",
-                    self.as_view({"get": "list"}),
-                    name=self.base_name + "_list",
-                )
-            )
-            patterns.append(
-                url(
-                    self.get_api_method_path() + r"(?P<pk>[a-zA-Z0-9\-_]+)/$",
-                    self.as_view({"get": "retrieve"}),
-                    name=self.base_name + "_detail",
-                )
-            )
-        else:
-            patterns.append(
-                url(
-                    self.get_api_method_path() + "$",
-                    self.as_view({"get": "list", "post": "create"}),
-                    name=self.base_name + "_list",
-                )
-            )
-            patterns.append(
-                url(
-                    self.get_api_method_path() + r"(?P<pk>[a-zA-Z0-9\-_]+)/$",
-                    self.as_view(
-                        {
-                            "get": "retrieve",
-                            "put": "update",
-                            "post": "update",
-                            "delete": "destroy",
-                            "patch": "partial_update",
-                        }
-                    ),
-                    name=self.base_name + "_detail",
-                )
-            )
-
-        return patterns
-
-    def get_serializer_class(self):
-        if (
-            hasattr(self, "custom_serializers")
-            and hasattr(self, "action")
-            and (self.action in self.custom_serializers)
-        ):
-            return self.custom_serializers[self.action]
-        else:
-            return super(XOSViewSet, self).get_serializer_class()
-
-    def get_object(self):
-        obj = super(XOSViewSet, self).get_object()
-
-        if (
-            self.action == "update"
-            or self.action == "destroy"
-            or self.action.startswith("set_")
-        ):
-            if obj and hasattr(obj, "can_update"):
-                user = self.request.user
-                if user.__class__.__name__ == "AnonymousUser":
-                    raise XOSPermissionDenied()
-
-        return obj
-
-
-class XOSIndexViewSet(viewsets.ViewSet):
-    view_urls = []
-    subdirs = []
-    api_path = None
-
-    def __init__(self, view_urls, subdirs, api_path):
-        self.view_urls = view_urls
-        self.subdirs = subdirs
-        self.api_path = api_path
-        super(XOSIndexViewSet, self).__init__()
-
-    def list(self, request):
-        endpoints = {}
-
-        # If it is the root, add core
-        if self.api_path == "api":
-            endpoints["core"] = (
-                "http://"
-                + request.get_host()
-                + get_script_prefix()
-                + self.api_path
-                + "/core"
-            )
-
-        for view_url in self.view_urls:
-            method_name = view_url[1].split("/")[-1]
-            method_url = (
-                "http://"
-                + request.get_host()
-                + get_script_prefix()
-                + self.api_path
-                + "/"
-                + method_name
-            )
-            endpoints[method_name] = method_url
-
-        for subdir in self.subdirs:
-            method_name = subdir
-            method_url = get_script_prefix() + self.api_path + "/" + subdir + "/"
-            # Check to make sure that an endpoint exists at this method_url. This
-            # prunes out subdirs that don't have any methods (like examples/)
-            try:
-                resolve(method_url)
-            except Resolver404:
-                continue
-            method_url = "http://" + request.get_host() + method_url
-            endpoints[method_name] = method_url
-
-        return Response(endpoints)
diff --git a/xos/core/serializers.py b/xos/core/serializers.py
deleted file mode 100644
index b5143f2d..0000000
--- a/xos/core/serializers.py
+++ /dev/null
@@ -1,300 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from django.forms import widgets
-from rest_framework import serializers
-from core.models import *
-
-
-class DeploymentSerializer(serializers.HyperlinkedModelSerializer):
-
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-    sites = serializers.HyperlinkedRelatedField(view_name="site-detail")
-
-    class Meta:
-        model = Deployment
-        fields = ("id", "url", "name", "sites")
-
-
-class ImageSerializer(serializers.HyperlinkedModelSerializer):
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-
-    class Meta:
-        model = Image
-        fields = ("id", "url", "image_id", "name", "disk_format", "container_format")
-
-
-class NodeSerializer(serializers.HyperlinkedModelSerializer):
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-
-    class Meta:
-        model = Node
-        fields = ("id", "url", "name")
-
-
-class ProjectSerializer(serializers.HyperlinkedModelSerializer):
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-
-    class Meta:
-        model = Project
-        fields = ("id", "url", "name")
-
-
-class ReservationSerializer(serializers.HyperlinkedModelSerializer):
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-
-    class Meta:
-        model = Reservation
-        fields = ("id", "url", "startTime", "slice", "duration", "endTime")
-
-
-class RoleSerializer(serializers.HyperlinkedModelSerializer):
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-
-    class Meta:
-        model = Role
-        fields = ("id", "url", "role", "role_type")
-
-
-class ServiceClassSerializer(serializers.HyperlinkedModelSerializer):
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-
-    class Meta:
-        model = ServiceClass
-        fields = (
-            "id",
-            "url",
-            "name",
-            "description",
-            "commitment",
-            "membershipFee",
-            "membershipFeeMonths",
-            "upgradeRequiresApproval",
-            "upgradeFrom",
-        )
-
-
-class ServiceResourceSerializer(serializers.HyperlinkedModelSerializer):
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-    serviceClass = serializers.HyperlinkedRelatedField(view_name="serviceclass-detail")
-
-    class Meta:
-        model = ServiceResource
-        fields = (
-            "id",
-            "url",
-            "name",
-            "serviceClass",
-            "maxUnitsDeployment",
-            "maxUnitsNode",
-            "maxDuration",
-            "bucketInRate",
-            "bucketMaxSize",
-            "cost",
-            "calendarReservable",
-        )
-
-
-class SliceSerializer(serializers.HyperlinkedModelSerializer):
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-    site = serializers.HyperlinkedRelatedField(view_name="site-detail")
-    instances = serializers.HyperlinkedRelatedField(view_name="instance-detail")
-
-    class Meta:
-        model = Slice
-        fields = (
-            "id",
-            "url",
-            "tenant_id",
-            "enabled",
-            "name",
-            "url",
-            "omf_friendly",
-            "description",
-            "slice_url",
-            "network_id",
-            "router_id",
-            "subnet_id",
-            "imagePreference",
-            "network",
-            "mountDataSets",
-            "site",
-            "instances",
-            "updated",
-            "created",
-        )
-
-
-class SlicePrivilegeSerializer(serializers.HyperlinkedModelSerializer):
-    id = serializers.Field()
-    slice = serializers.HyperlinkedRelatedField(view_name="slice-detail")
-    user = serializers.HyperlinkedRelatedField(view_name="user-detail")
-    role = serializers.HyperlinkedRelatedField(view_name="role-detail")
-
-    class Meta:
-        model = SlicePrivilege
-        fields = ("id", "url", "user", "slice", "role")
-
-
-class SiteSerializer(serializers.HyperlinkedModelSerializer):
-
-    # Experimenting with whether to use ids, hyperlinks, or nested includes
-    # slices = serializers.PrimaryKeyRelatedField(many=True, read_only=True)
-    # slices = serializers.RelatedField(many=True, read_only=True)
-    # slices = SliceSerializer(many=True)
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-    slices = serializers.HyperlinkedRelatedField(
-        many=True, read_only=True, view_name="slice-detail"
-    )
-
-    class Meta:
-        model = Site
-        fields = (
-            "id",
-            "url",
-            "name",
-            "slices",
-            "site_url",
-            "enabled",
-            "longitude",
-            "latitude",
-            "login_base",
-            "tenant_id",
-            "is_public",
-            "abbreviated_name",
-            "updated",
-            "created",
-        )
-
-
-class SitePrivilegeSerializer(serializers.HyperlinkedModelSerializer):
-    id = serializers.Field()
-    site = serializers.HyperlinkedRelatedField(view_name="site-detail")
-    user = serializers.HyperlinkedRelatedField(view_name="user-detail")
-    role = serializers.HyperlinkedRelatedField(view_name="role-detail")
-
-    class Meta:
-        model = SitePrivilege
-        fields = ("id", "url", "user", "site", "role")
-
-
-class InstanceSerializer(serializers.HyperlinkedModelSerializer):
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-    image = serializers.HyperlinkedRelatedField(view_name="image-detail")
-    slice = serializers.HyperlinkedRelatedField(view_name="slice-detail")
-    deploymentNetwork = serializers.HyperlinkedRelatedField(
-        view_name="deployment-detail"
-    )
-    node = serializers.HyperlinkedRelatedField(view_name="node-detail")
-
-    # slice = serializers.PrimaryKeyRelatedField(read_only=True)
-
-    class Meta:
-        model = Instance
-        fields = (
-            "id",
-            "url",
-            "instance_id",
-            "name",
-            "instance_name",
-            "ip",
-            "image",
-            "slice",
-            "deploymentNetwork",
-            "node",
-        )
-
-
-class UserSerializer(serializers.HyperlinkedModelSerializer):
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-    site = serializers.HyperlinkedRelatedField(view_name="site-detail")
-    slice_privileges = serializers.HyperlinkedRelatedField(
-        view_name="sliceprivilege-detail"
-    )
-    site_privileges = serializers.HyperlinkedRelatedField(
-        view_name="siteprivilege-detail"
-    )
-
-    class Meta:
-        model = User
-        fields = (
-            "id",
-            "url",
-            "kuser_id",
-            "firstname",
-            "lastname",
-            "email",
-            "password",
-            "phone",
-            "public_key",
-            "user_url",
-            "is_admin",
-            "slice_privileges",
-            "site_privileges",
-        )
-
-
-class TagSerializer(serializers.HyperlinkedModelSerializer):
-    # HyperlinkedModelSerializer doesn't include the id by default
-    id = serializers.Field()
-    project = serializers.HyperlinkedRelatedField(view_name="project-detail")
-    # content_type = serializers.PrimaryKeyRelatedField(read_only=True)
-    content_type = serializers.RelatedField(source="content_type")
-    content_object = serializers.RelatedField(source="content_object")
-
-    class Meta:
-        model = Tag
-        fields = (
-            "id",
-            "url",
-            "project",
-            "value",
-            "content_type",
-            "object_id",
-            "content_object",
-            "name",
-        )
-
-
-serializerLookUp = {
-    Deployment: DeploymentSerializer,
-    Image: ImageSerializer,
-    Node: NodeSerializer,
-    Project: ProjectSerializer,
-    Reservation: ReservationSerializer,
-    Role: RoleSerializer,
-    ServiceClass: ServiceClassSerializer,
-    ServiceResource: ServiceResourceSerializer,
-    Site: SiteSerializer,
-    SitePrivilege: SitePrivilegeSerializer,
-    Slice: SliceSerializer,
-    SlicePrivilege: SlicePrivilegeSerializer,
-    Instance: InstanceSerializer,
-    Tag: TagSerializer,
-    User: UserSerializer,
-    None: None,
-}
diff --git a/xos/coreapi/orm.py b/xos/coreapi/orm.py
deleted file mode 100644
index 5fae722..0000000
--- a/xos/coreapi/orm.py
+++ /dev/null
@@ -1,244 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from google.protobuf import symbol_database as _symbol_database
-from google.protobuf.empty_pb2 import Empty
-
-"""
-Django-like ORM layer for gRPC
-
-Usage:
-    api = ORMStub(stub)
-
-    api.Slices.all() ... list all slices
-
-    someSlice = api.Slices.get(id=1) ... get slice #1
-
-    someSlice.site ... automatically resolves site_id into a site object
-    someSlice.instances ... automatically resolves instances_ids into instance objects
-    someSlice.save() ... saves the slice object
-"""
-
-"""
-import grpc_client, orm
-c=grpc_client.SecureClient("xos-core.cord.lab", username="padmin@vicci.org", password="letmein")
-u=c.xos_orm.User.objects.get(id=1)
-"""
-
-
-_sym_db = _symbol_database.Default()
-
-
-class ORMWrapper(object):
-    """ Wraps a protobuf object to provide ORM features """
-
-    def __init__(self, wrapped_class, stub, is_new=False):
-        super(ORMWrapper, self).__setattr__("_wrapped_class", wrapped_class)
-        super(ORMWrapper, self).__setattr__("stub", stub)
-        super(ORMWrapper, self).__setattr__("cache", {})
-        super(ORMWrapper, self).__setattr__("synchronizer_step", None)
-        super(ORMWrapper, self).__setattr__("dependent", None)
-        super(ORMWrapper, self).__setattr__("reverse_cache", {})
-        super(ORMWrapper, self).__setattr__("is_new", is_new)
-        fkmap = self.gen_fkmap()
-        super(ORMWrapper, self).__setattr__("_fkmap", fkmap)
-        reverse_fkmap = self.gen_reverse_fkmap()
-        super(ORMWrapper, self).__setattr__("_reverse_fkmap", reverse_fkmap)
-
-    def gen_fkmap(self):
-        fkmap = {}
-
-        for (name, field) in self._wrapped_class.DESCRIPTOR.fields_by_name.items():
-            if name.endswith("_id"):
-                foreignKey = field.GetOptions().Extensions._FindExtensionByName(
-                    "xos.foreignKey"
-                )
-                fk = field.GetOptions().Extensions[foreignKey]
-                if fk:
-                    fkmap[name[:-3]] = {
-                        "src_fieldName": name,
-                        "modelName": fk.modelName,
-                    }
-
-        return fkmap
-
-    def gen_reverse_fkmap(self):
-        reverse_fkmap = {}
-
-        for (name, field) in self._wrapped_class.DESCRIPTOR.fields_by_name.items():
-            if name.endswith("_ids"):
-                reverseForeignKey = field.GetOptions().Extensions._FindExtensionByName(
-                    "xos.reverseForeignKey"
-                )
-                fk = field.GetOptions().Extensions[reverseForeignKey]
-                if fk:
-                    reverse_fkmap[name[:-4]] = {
-                        "src_fieldName": name,
-                        "modelName": fk.modelName,
-                    }
-
-        return reverse_fkmap
-
-    def fk_resolve(self, name):
-        if name in self.cache:
-            return ORMWrapper(self.cache[name], self.stub)
-
-        fk_entry = self._fkmap[name]
-        id = self.stub.make_ID(id=getattr(self, fk_entry["src_fieldName"]))
-        dest_model = self.stub.invoke("Get%s" % fk_entry["modelName"], id)
-
-        self.cache[name] = dest_model
-
-        return ORMWrapper(dest_model, self.stub)
-
-    def reverse_fk_resolve(self, name):
-        if name not in self.reverse_cache:
-            fk_entry = self._reverse_fkmap[name]
-            self.cache[name] = ORMLocalObjectManager(
-                self.stub,
-                fk_entry["modelName"],
-                getattr(self, fk_entry["src_fieldName"]),
-            )
-
-        return self.cache[name]
-
-    def __getattr__(self, name, *args, **kwargs):
-        # note: getattr is only called for attributes that do not exist in
-        #       self.__dict__
-
-        if name in self._fkmap.keys():
-            return self.fk_resolve(name)
-
-        if name in self._reverse_fkmap.keys():
-            return self.reverse_fk_resolve(name)
-
-        return getattr(self._wrapped_class, name, *args, **kwargs)
-
-    def __setattr__(self, name, value):
-        if name in self.__dict__:
-            super(ORMWrapper, self).__setattr__(name, value)
-        else:
-            setattr(self._wrapped_class, name, value)
-
-    def __repr__(self):
-        return self._wrapped_class.__repr__()
-
-    def save(self):
-        if self.is_new:
-            new_class = self.stub.invoke(
-                "Create%s" % self._wrapped_class.__class__.__name__, self._wrapped_class
-            )
-            self._wrapped_class = new_class
-            self.is_new = False
-        else:
-            self.stub.invoke(
-                "Update%s" % self._wrapped_class.__class__.__name__, self._wrapped_class
-            )
-
-    def delete(self):
-        id = self.stub.make_ID(id=self._wrapped_class.id)
-        self.stub.invoke("Delete%s" % self._wrapped_class.__class__.__name__, id)
-
-
-class ORMLocalObjectManager(object):
-    """ Manages a local list of objects """
-
-    def __init__(self, stub, modelName, idList):
-        self._stub = stub
-        self._modelName = modelName
-        self._idList = idList
-        self._cache = None
-
-    def resolve_queryset(self):
-        if self._cache is not None:
-            return self._cache
-
-        models = []
-        for id in self._idList:
-            models.append(
-                self._stub.invoke("Get%s" % self._modelName, self._stub.make_ID(id=id))
-            )
-
-        self._cache = models
-
-        return models
-
-    def all(self):
-        models = self.resolve_queryset()
-        return [ORMWrapper(x, self._stub) for x in models]
-
-
-class ORMObjectManager(object):
-    """ Manages a remote list of objects """
-
-    def __init__(self, stub, modelName, packageName):
-        self._stub = stub
-        self._modelName = modelName
-        self._packageName = packageName
-
-    def wrap_single(self, obj):
-        return ORMWrapper(obj, self._stub)
-
-    def wrap_list(self, obj):
-        result = []
-        for item in obj.items:
-            result.append(ORMWrapper(item, self._stub))
-        return result
-
-    def all(self):
-        return self.wrap_list(self._stub.invoke("List%s" % self._modelName, Empty()))
-
-    def get(self, id):
-        return self.wrap_single(
-            self._stub.invoke("Get%s" % self._modelName, self._stub.make_ID(id=id))
-        )
-
-    def new(self, **kwargs):
-        full_model_name = "%s.%s" % (self._packageName, self._modelName)
-        cls = _sym_db._classes[full_model_name]
-        return ORMWrapper(cls(), self._stub, is_new=True)
-
-
-class ORMModelClass(object):
-    def __init__(self, stub, model_name, package_name):
-        self.objects = ORMObjectManager(stub, model_name, package_name)
-
-
-class ORMStub(object):
-    def __init__(self, stub, package_name):
-        self.grpc_stub = stub
-
-        for name in dir(stub):
-            if name.startswith("Get"):
-                model_name = name[3:]
-                setattr(self, model_name, ORMModelClass(self, model_name, package_name))
-
-    def invoke(self, name, request):
-        method = getattr(self.grpc_stub, name)
-        return method(request)
-
-    def make_ID(self, id):
-        return _sym_db._classes["xos.ID"](id=id)
-
-
-# def wrap_get(*args, **kwargs):
-#    stub=kwargs.pop("stub")
-#    getmethod=kwargs.pop("getmethod")
-#    result = getmethod(*args, **kwargs)
-#    return ORMWrapper(result)
-#
-# def wrap_stub(stub):
-#    for name in dir(stub):
-#        if name.startswith("Get"):
-#            setattr(stub, name, functools.partial(wrap_get, stub=stub, getmethod=getattr(stub,name)))
diff --git a/xos/synchronizers/new_base/deleter.py b/xos/synchronizers/new_base/deleter.py
deleted file mode 100644
index 894164a..0000000
--- a/xos/synchronizers/new_base/deleter.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# NOTE this appear not to be used, can we delete it?
-
-
-class Deleter:
-    model = None  # Must be overridden
-
-    def __init__(self, *args, **kwargs):
-        pass
-
-    def call(self, pk, model_dict):
-        # Fetch object from XOS db and delete it
-        pass
-
-    def __call__(self, *args, **kwargs):
-        return self.call(*args, **kwargs)
diff --git a/xos/tests/permissiontest.py b/xos/tests/permissiontest.py
deleted file mode 100644
index 110171d..0000000
--- a/xos/tests/permissiontest.py
+++ /dev/null
@@ -1,224 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-import unittest
-from core.models import *
-
-
-class TestPermission(unittest.TestCase):
-    def setUp(self):
-        self.test_objects = []
-        # deployment
-        self.deployment = Deployment(name="TestDeployment")
-        self.deployment.save()
-        self.test_objects.append(self.deployment)
-        # site
-        self.site = Site(name="TestSite")
-        self.site.save()
-        self.test_objects.append(self.site)
-        # site deployment
-        self.site_deployment = SiteDeployment(
-            site=self.site, deployment=self.deployment
-        )
-        self.site_deployment.save()
-        self.test_objects.append(self.site_deployment)
-        # node
-        self.node = Node(name="TestNode", site_deployment=self.site_deployment)
-        self.node.save()
-        self.test_objects.append(self.node)
-        # slice
-        self.slice = Slice(name="TestSlice", site=self.site)
-        self.slice.save()
-        self.test_objects.appen(slice.slice)
-        # admin user
-        self.user_admin = User(
-            email="user_admin@test.com",
-            first_name="Test",
-            last_name="Test",
-            is_admin=True,
-        )
-        self.user_admin.site = self.site
-        self.user_admin.save()
-        self.test_objects.append(self.user_admin)
-        # read only user
-        self.user_read_only = User(
-            email="user_read_only@test.com", first_name="Test", last_name="Test"
-        )
-        self.user_read_only.site = self.site
-        self.user_read_only.save()
-        self.test_objects.append(self.user_read_only)
-        # default user
-        self.user_default = User(
-            email="user_default@test.com", first_name="Test", last_name="Test"
-        )
-        self.user_default.site = self.site
-        self.user_default.save()
-        self.test_objects.append(self.user_default)
-
-        # deployment admin
-        self.user_deployment_admin = User(
-            email="user_deployment_admin@test.com", first_name="Test", last_name="Test"
-        )
-        self.user_deployment_admin.site = self.site
-        self.user_deployment_admin.save()
-        self.test_objects.append(self.user_deployment_admin)
-        deployment_privilege = DeploymentPrivilege(
-            user=self.user_deployment_admin, deployment=self.deployment, role="admin"
-        )
-        deployment_privilege.save()
-        self.test_objects.append(deployment_privilege)
-        # site admin
-        self.user_site_admin = User(
-            email="user_site_admin@test.com", first_name="Test", last_name="Test"
-        )
-        self.user_site_admin = self.site
-        self.user_site_admin.save()
-        self.test_objects.append(self.user_site_admin)
-        site_admin_privilege = SitePrivilege(
-            user=self.user_site_admin, site=self.site, role="admin"
-        )
-        site_admin_privilege.save()
-        self.test_objects.append(site_admin_privilege)
-        # site pi
-        self.user_site_pi = User(
-            email="user_site_pi@test.com", first_name="Test", last_name="Test"
-        )
-        self.user_site_pi = self.site
-        self.user_site_pi.save()
-        self.test_objects.append(self.user_site_pi)
-        site_pi_privilege = SitePrivilege(
-            user=self.user_site_pi, site=self.site, role="pi"
-        )
-        site_pi_privilege.save()
-        self.test_objects.append(site_pi_privilege)
-        # site tech
-        self.user_site_tech = User(
-            email="user_site_tech@test.com", first_name="Test", last_name="Test"
-        )
-        self.user_site_tech = self.site
-        self.user_site_tech.save()
-        self.test_objects.append(self.user_site_tech)
-        site_tech_privilege = SitePrivilege(
-            user=self.user_site_tech, site=self.site, role="tech"
-        )
-        site_tech_privilege.save()
-        self.test_objects.append(site_tech_privilege)
-        # slice admin
-        self.user_slice_admin = User(
-            email="user_slice_admin@test.com", first_name="Test", last_name="Test"
-        )
-        self.user_slice_admin = self.site
-        self.user_slice_admin.save()
-        self.test_objects.append(self.user_slice_admin)
-        slice_admin_privilege = SlicePrivilege(
-            user=self.user_slice_admin, slice=self.slice, role="admin"
-        )
-        slice_admin_privilege.save()
-        self.test_objects.append(slice_admin_privilege)
-        # slice access
-        self.user_slice_access = User(
-            email="user_slice_access@test.com", first_name="Test", last_name="Test"
-        )
-        self.user_slice_access = self.site
-        self.user_slice_access.save()
-        self.test_objects.append(self.user_slice_access)
-        slice_access_privilege = SlicePrivilege(
-            user=self.user_slice_access, slice=self.slice, role="access"
-        )
-        slice_access_privilege.save()
-        self.test_objects.append(slice_access_privilege)
-
-    def test_deployment(self):
-        for user in [self.user_admin, self.user_deployment_admin]:
-            self.assertEqual(self.deployment.save(), None)
-        for user in [
-            self.user_read_only,
-            self.user_default,
-            self.user_site_admin,
-            self.user_site_pi,
-            self.user_site_tech,
-            self.user_slice_admin,
-            self.user_slice_access,
-        ]:
-            self.assertRaises(PermissionDenied, self.deployment.save_by_user(user))
-
-    def test_site(self):
-        for user in [self.user_admin, self.user_site_admin, self.user_site_pi]:
-            self.assertEqual(self.site.save_by_user(user), None)
-        for user in [
-            self.user_read_only,
-            self.user_default,
-            self.user_deployment_admin,
-            self.user_site_tech,
-            self.user_slice_admin,
-            self.user_slice_access,
-        ]:
-            self.assertRaises(PermissionDenied, self.site.save_by_user(user))
-
-    def test_node(self):
-        for user in [self.user_admin, self.user_site_admin, self.user_site_tech]:
-            self.assertEqual(self.node.save_by_user(user), None)
-        for user in [
-            self.user_read_only,
-            self.user_default,
-            self.user_deployment_admin,
-            self.user_site_pi,
-            self.user_slice_admin,
-            self.user_slice_access,
-        ]:
-            self.assertRaises(PermissionDenied, self.node.save_by_user(user))
-
-    def test_slice(self):
-        for user in [
-            self.user_admin,
-            self.user_site_admin,
-            self.user_site_pi,
-            self.user_slice_admin,
-        ]:
-            self.assertEqual(self.slice.save_by_user(user), None)
-        for user in [
-            self.user_read_only,
-            self.user_default,
-            self.user_deployment_admin,
-            self.user_site_tech,
-            self.user_slice_access,
-        ]:
-            self.assertRaises(PermissionDenied, self.slice.save_by_user(user))
-
-    def test_user(self):
-        for user in [
-            self.user_admin,
-            self.user_site_admin,
-            self.user_deployment_admin,
-            self.user_site_pi,
-            self.user_default,
-        ]:
-            self.assertEqual(self.user_default.save_by_user(user), None)
-        for user in [
-            self.user_read_only,
-            self.user_deployment_admin,
-            self.user_site_tech,
-            self.user_slice_admin,
-            self.user_slice_access,
-        ]:
-            self.assertRaises(PermissionDenied, self.user_default.save_by_user(user))
-
-    def tearDown(self):
-        for obj in self.test_objects:
-            obj.delete()
-
-
-if __name__ == "__main__":
-    unittest.main()
diff --git a/xos/tests/rest_useraccesstest.py b/xos/tests/rest_useraccesstest.py
deleted file mode 100644
index c83648a..0000000
--- a/xos/tests/rest_useraccesstest.py
+++ /dev/null
@@ -1,298 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-""" useraccesstest.py
-
-    This is a basic REST API permission test. Call it with a username and a
-    password, and it will try to read and update some user and slice object,
-    and report if something is broken.
-
-    This is not an exhaustive test.
-"""
-
-
-from __future__ import print_function
-import inspect
-import json
-import os
-import requests
-import sys
-import time
-from urllib import urlencode
-
-from operator import itemgetter, attrgetter
-
-if len(sys.argv) != 6:
-    print(
-        "syntax: usertest <hostname> <username> <password> <admin_username> <admin_password>"
-    )
-    sys.exit(-1)
-
-hostname = sys.argv[1]
-username = sys.argv[2]
-password = sys.argv[3]
-
-opencloud_auth = (username, password)
-admin_auth = (sys.argv[4], sys.argv[5])
-
-REST_API = "http://%s:8000/xos/" % hostname
-USERS_API = REST_API + "users/"
-SLICES_API = REST_API + "slices/"
-SITES_API = REST_API + "sites/"
-SITEPRIV_API = REST_API + "siteprivileges/"
-SLICEPRIV_API = REST_API + "slice_privileges/"
-SITEROLE_API = REST_API + "site_roles/"
-SLICEROLE_API = REST_API + "slice_roles/"
-
-TEST_USER_EMAIL = (
-    "test" + str(time.time()) + "@test.com"
-)  # in case observer not running, objects won't be purged, so use unique email
-
-
-def fail_unless(x, msg):
-    if not x:
-        (
-            frame,
-            filename,
-            line_number,
-            function_name,
-            lines,
-            index,
-        ) = inspect.getouterframes(inspect.currentframe())[1]
-        print("FAIL (%s:%d)" % (function_name, line_number), msg)
-
-
-print("downloading objects using admin")
-r = requests.get(USERS_API + "?no_hyperlinks=1", auth=admin_auth)
-fail_unless(r.status_code == 200, "failed to get users")
-allUsers = r.json()
-r = requests.get(SLICES_API + "?no_hyperlinks=1", auth=admin_auth)
-fail_unless(r.status_code == 200, "failed to get slices")
-allSlices = r.json()
-r = requests.get(SITES_API + "?no_hyperlinks=1", auth=admin_auth)
-allSites = r.json()
-r = requests.get(SITEPRIV_API + "?no_hyperlinks=1", auth=admin_auth)
-allSitePriv = r.json()
-r = requests.get(SLICEPRIV_API + "?no_hyperlinks=1", auth=admin_auth)
-allSlicePriv = r.json()
-r = requests.get(SITEROLE_API + "?no_hyperlinks=1", auth=admin_auth)
-allSiteRole = r.json()
-r = requests.get(SLICEROLE_API + "?no_hyperlinks=1", auth=admin_auth)
-allSliceRole = r.json()
-
-
-def should_see_user(myself, otherUser):
-    if myself["is_admin"]:
-        return True
-    if myself["id"] == otherUser["id"]:
-        return True
-    for sitePriv in allSitePriv:
-        if (sitePriv["user"] == myself["id"]) and (
-            sitePriv["site"] == otherUser["site"]
-        ):
-            for role in allSiteRole:
-                if role["role"] == "pi" and role["id"] == sitePriv["role"]:
-                    return True
-    return False
-
-
-def should_see_slice(myself, slice):
-    if myself["is_admin"]:
-        return True
-    for sitePriv in allSitePriv:
-        if (sitePriv["user"] == myself["id"]) and (sitePriv["site"] == slice["site"]):
-            for role in allSiteRole:
-                if role["role"] == "pi" and role["id"] == sitePriv["role"]:
-                    return True
-    for slicePriv in allSlicePriv:
-        if (slicePriv["user"] == myself["id"]) and (sitePriv["slice"] == slice["id"]):
-            for role in allSliceRole:
-                if role["role"] == "pi" and role["id"] == slicePriv["role"]:
-                    return True
-    return False
-
-
-def flip_phone(user):
-    if user["phone"] == "123":
-        user["phone"] = "456"
-    else:
-        user["phone"] = "123"
-
-
-def flip_desc(slice):
-    if slice["description"] == "some_description":
-        slice["description"] = "some_other_description"
-    else:
-        slice["description"] = "some_description"
-
-
-def delete_user_if_exists(email):
-    r = requests.get(USERS_API + "?email=%s" % email, auth=admin_auth)
-    if r.status_code == 200:
-        user = r.json()
-        if len(user) > 0:
-            user = user[0]
-            r = requests.delete(USERS_API + str(user["id"]) + "/", auth=admin_auth)
-            fail_unless(r.status_code == 200, "failed to delete the test user")
-
-
-print(
-    "  loaded user:%d slice:%d, site:%d, site_priv:%d slice_priv:%d"
-    % (
-        len(allUsers),
-        len(allSlices),
-        len(allSites),
-        len(allSitePriv),
-        len(allSlicePriv),
-    )
-)
-
-# get our own user record
-
-r = requests.get(
-    USERS_API + "?" + urlencode({"email": username, "no_hyperlinks": "1"}),
-    auth=opencloud_auth,
-)
-fail_unless(r.status_code == 200, "failed to get user %s" % username)
-myself = r.json()
-fail_unless(len(myself) == 1, "wrong number of results when getting user %s" % username)
-myself = myself[0]
-
-# check to see that we see the users we should be able to
-
-r = requests.get(USERS_API, auth=opencloud_auth)
-myUsers = r.json()
-for user in myUsers:
-    fail_unless(
-        should_see_user(myself, user),
-        "saw user %s but we shouldn't have" % user["email"],
-    )
-myUsersIds = [r["id"] for r in myUsers]
-for user in allUsers:
-    if should_see_user(myself, user):
-        fail_unless(
-            user["id"] in myUsersIds,
-            "should have seen user %s but didnt" % user["email"],
-        )
-
-# toggle the phone number on the users we should be able to
-
-"""
-for user in allUsers:
-    user = requests.get(USERS_API + str(user["id"]) + "/", auth=admin_auth).json()
-    flip_phone(user)
-    r = requests.put(USERS_API + str(user["id"]) +"/", data=user, auth=opencloud_auth)
-    if should_see_user(myself, user):
-        fail_unless(r.status_code==200, "failed to change phone number on %s" % user["email"])
-    else:
-        # XXX: this is failing, but for the wrong reason
-        fail_unless(r.status_code!=200, "was able to change phone number on %s but shouldn't have" % user["email"])
-
-# try changing is_staff. We should be able to do it if we're an admin, but not
-# otherwise.
-
-for user in allUsers:
-    user = requests.get(USERS_API + str(user["id"]) + "/", auth=admin_auth).json()
-    user["is_staff"] = not user["is_staff"]
-    r = requests.put(USERS_API + str(user["id"]) +"/", data=user, auth=opencloud_auth)
-    if myself["is_admin"]:
-        fail_unless(r.status_code==200, "failed to change is_staff on %s" % user["email"])
-    else:
-        # XXX: this is failing, but for the wrong reason
-        fail_unless(r.status_code!=200, "was able to change is_staff on %s but shouldn't have" % user["email"])
-
-    # put it back to false, in case we successfully changed it...
-    user["is_staff"] = False
-    r = requests.put(USERS_API + str(user["id"]) +"/", data=user, auth=opencloud_auth)
-"""
-
-# delete the TEST_USER_EMAIL if it exists
-delete_user_if_exists(TEST_USER_EMAIL)
-
-# XXX - enacted and policed should not be required
-
-newUser = {
-    "firstname": "test",
-    "lastname": "1234",
-    "email": TEST_USER_EMAIL,
-    "password": "letmein",
-    "site": allSites[0]["id"],
-    "enacted": "2015-01-01T00:00",
-    "policed": "2015-01-01T00:00",
-}
-r = requests.post(USERS_API + "?no_hyperlinks=1", data=newUser, auth=opencloud_auth)
-if myself["is_admin"]:
-    fail_unless(r.status_code == 200, "failed to create %s" % TEST_USER_EMAIL)
-else:
-    fail_unless(
-        r.status_code != 200,
-        "created %s but we shouldn't have been able to" % TEST_USER_EMAIL,
-    )
-
-delete_user_if_exists(TEST_USER_EMAIL)
-
-# now create it as admin
-r = requests.post(USERS_API + "?no_hyperlinks=1", data=newUser, auth=admin_auth)
-if r.status_code != 201:
-    print(r.text)
-fail_unless(r.status_code == 201, "failed to create %s as admin" % TEST_USER_EMAIL)
-
-r = requests.get(
-    USERS_API + "?" + urlencode({"email": TEST_USER_EMAIL}), auth=admin_auth
-)
-fail_unless(r.status_code == 200, "failed to get user %s" % TEST_USER_EMAIL)
-user = r.json()[0]
-r = requests.delete(USERS_API + str(user["id"]) + "/", auth=opencloud_auth)
-if myself["is_admin"]:
-    fail_unless(r.status_code == 200, "failed to delete %s" % TEST_USER_EMAIL)
-else:
-    fail_unless(
-        r.status_code != 200,
-        "deleted %s but we shouldn't have been able to" % TEST_USER_EMAIL,
-    )
-
-# slice tests
-
-r = requests.get(SLICES_API, auth=opencloud_auth)
-mySlices = r.json()
-
-for slice in mySlices:
-    fail_unless(
-        should_see_slice(myself, slice),
-        "saw slice %s but we shouldn't have" % slice["name"],
-    )
-mySlicesIds = [r["id"] for r in mySlices]
-for slice in allSlices:
-    if should_see_slice(myself, slice):
-        fail_unless(
-            slice["id"] in mySliceIds,
-            "should have seen slice %s but didnt" % slice["name"],
-        )
-
-for slice in allSlices:
-    slice = requests.get(SLICES_API + str(slice["id"]) + "/", auth=admin_auth).json()
-    flip_desc(slice)
-    r = requests.put(
-        SLICES_API + str(slice["id"]) + "/", data=slice, auth=opencloud_auth
-    )
-    if should_see_slice(myself, slice):
-        fail_unless(r.status_code == 200, "failed to change desc on %s" % slice["name"])
-    else:
-        fail_unless(
-            r.status_code != 200,
-            "was able to change desc on %s but shouldn't have" % slice["name"],
-        )
-
-print("Done.")
diff --git a/xos/tests/rest_usertest.py b/xos/tests/rest_usertest.py
deleted file mode 100644
index 894111b..0000000
--- a/xos/tests/rest_usertest.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-"""
-     UserTest - tests whether a user is able to fetch his own user record,
-                and modify fields.
-
-                All users should be able to set their phone number.
-                Only admins should be able to set their is_admin bit
-"""
-
-from __future__ import print_function
-import json
-import os
-import requests
-import sys
-from urllib import urlencode
-
-from operator import itemgetter, attrgetter
-
-if len(sys.argv) != 6:
-    print(
-        "syntax: usertest <hostname> <username> <password> <admin_username> <admin_password>"
-    )
-    sys.exit(-1)
-
-hostname = sys.argv[1]
-username = sys.argv[2]
-password = sys.argv[3]
-
-opencloud_auth = (username, password)
-admin_auth = (sys.argv[4], sys.argv[5])
-
-REST_API = "http://%s:8000/xos/" % hostname
-USERS_API = REST_API + "users/"
-
-print("fetching user record for %s:" % username)
-r = requests.get(USERS_API + "?" + urlencode({"email": username}), auth=opencloud_auth)
-for user in r.json():
-    print("  ", user["email"])
-
-myself = r.json()[0]
-
-if myself["phone"] == "123":
-    myself["phone"] = "456"
-else:
-    myself["phone"] = "123"
-
-r = requests.put(USERS_API + str(myself["id"]) + "/", data=myself, auth=opencloud_auth)
-if r.status_code == 200:
-    print("I updated my phone to", myself["phone"])
-else:
-    print("I failed to update my phone")
-
-if myself["is_admin"]:
-    myself["is_admin"] = False
-else:
-    myself["is_admin"] = True
-
-r = requests.put(USERS_API + str(myself["id"]) + "/", data=myself, auth=opencloud_auth)
-if r.status_code == 200:
-    print("I updated my is_admin to", myself["is_admin"])
-else:
-    print("I failed to update my is_admin")
-
-r = requests.get(USERS_API + "?email=jhh@cs.arizona.edu", auth=opencloud_auth)
-if len(r.json()) > 0:
-    print("I was able to read jhh@cs.arizona.edu")
-else:
-    print("I was not able to read jhh@cs.arizona.edu")
-
-# get john's record using admin, so we can try to update it
-r = requests.get(USERS_API + "?email=jhh@cs.arizona.edu", auth=admin_auth)
-if len(r.json()) > 0:
-    print("Admin was able to read jhh@cs.arizona.edu")
-    jhh = r.json()[0]
-else:
-    print("Admin was not able to read jhh@cs.arizona.edu")
-    jhh = None
-
-if jhh:
-    # try to update john's user record
-    r = requests.put(USERS_API + str(jhh["id"]) + "/", data=jhh, auth=opencloud_auth)
-    if r.status_code == 200:
-        print("I was able to update user", str(jhh["id"]))
-    else:
-        print("I was not able to update user", str(jhh["id"]))
diff --git a/xos/xos/admin_customize/README.md b/xos/xos/admin_customize/README.md
deleted file mode 100644
index ecc4520..0000000
--- a/xos/xos/admin_customize/README.md
+++ /dev/null
@@ -1 +0,0 @@
-admin_customize contains django UI elements (such as templatetags) that are common to all django apps within XOS.
diff --git a/xos/xos/admin_customize/__init__.py b/xos/xos/admin_customize/__init__.py
deleted file mode 100644
index b0fb0b2..0000000
--- a/xos/xos/admin_customize/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
diff --git a/xos/xos/admin_customize/templatetags/__init__.py b/xos/xos/admin_customize/templatetags/__init__.py
deleted file mode 100644
index b0fb0b2..0000000
--- a/xos/xos/admin_customize/templatetags/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
diff --git a/xos/xos/admin_customize/templatetags/admin_modify.py b/xos/xos/admin_customize/templatetags/admin_modify.py
deleted file mode 100644
index f685cc6..0000000
--- a/xos/xos/admin_customize/templatetags/admin_modify.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from django.contrib.admin.templatetags.admin_modify import *
-from django.contrib.admin.templatetags.admin_modify import (
-    submit_row as original_submit_row,
-)
-from django.conf import settings
-import random
-
-
-@register.inclusion_tag("admin/submit_line.html", takes_context=True)
-def submit_row(context):
-    ctx = original_submit_row(context)
-    ctx.update(
-        {
-            "show_save": context.get("show_save", ctx["show_save"]),
-            "show_save_and_add_another": context.get(
-                "show_save_and_add_another", ctx["show_save_and_add_another"]
-            ),
-            "show_save_and_continue": context.get(
-                "show_save_and_continue", ctx["show_save_and_continue"]
-            ),
-            "custom_delete_url": context.get("custom_delete_url", None),
-        }
-    )
-    return ctx
-
-
-@register.simple_tag
-def random_str(a):
-    a = [
-        "You are now signed out. Thank you and have a great day",
-        "Thanks for spending some quality time with the Web site today.",
-        "Thanks for using "
-        + settings.XOS_BRANDING_NAME
-        + " to manage your network today.",
-        "You have successfully logged out, Thanks for spending some quality time",
-        "The "
-        + settings.XOS_BRANDING_NAME
-        + " team is glad that you used our product to get your work done.",
-    ]
-    return a[random.randint(0, 4)]
diff --git a/xos/xos/apibase.py b/xos/xos/apibase.py
deleted file mode 100644
index c5344e4..0000000
--- a/xos/xos/apibase.py
+++ /dev/null
@@ -1,120 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from rest_framework.response import Response
-from rest_framework import serializers
-from rest_framework import generics
-from rest_framework import status
-from rest_framework.exceptions import APIException
-from rest_framework.exceptions import PermissionDenied as RestFrameworkPermissionDenied
-from django.core.exceptions import PermissionDenied as DjangoPermissionDenied
-from django.core.exceptions import ValidationError as DjangoValidationError
-from xos.exceptions import *
-
-
-class XOSRetrieveUpdateDestroyAPIView(generics.RetrieveUpdateDestroyAPIView):
-
-    # To handle fine-grained field permissions, we have to check can_update
-    # the object has been updated but before it has been saved.
-
-    def update(self, request, *args, **kwargs):
-        partial = kwargs.pop("partial", False)
-        self.object = self.get_object()
-
-        if self.object is None:
-            raise XOSProgrammingError("Use the List API for creating objects")
-
-        serializer = self.get_serializer(
-            self.object, data=request.data, partial=partial
-        )
-
-        if not serializer.is_valid():
-            raise XOSValidationError("Invalid serializer", fields=serializer._errors)
-
-        # Do the XOS perm check
-
-        assert serializer.instance is not None
-        obj = serializer.instance
-        for attr, value in serializer.validated_data.items():
-            setattr(obj, attr, value)
-        obj.caller = request.user
-
-        self.perform_update(serializer)
-
-        return Response(serializer.data, status=status.HTTP_200_OK)
-
-    def destroy(self, request, *args, **kwargs):
-        obj = self.get_object()
-        obj.caller = request.user
-        self.perform_destroy(obj)
-        return Response(status=status.HTTP_204_NO_CONTENT)
-
-    def handle_exception(self, exc):
-        # REST API drops the string attached to Django's PermissionDenied
-        # exception, and replaces it with a generic "Permission Denied"
-        if isinstance(exc, DjangoPermissionDenied):
-            response = Response(
-                {
-                    "detail": {
-                        "error": "PermissionDenied",
-                        "specific_error": str(exc),
-                        "fields": {},
-                    }
-                },
-                status=status.HTTP_403_FORBIDDEN,
-            )
-            response.exception = True
-            return response
-        else:
-            return super(XOSRetrieveUpdateDestroyAPIView, self).handle_exception(exc)
-
-
-class XOSListCreateAPIView(generics.ListCreateAPIView):
-    def create(self, request, *args, **kwargs):
-        serializer = self.get_serializer(data=request.data)
-
-        # In rest_framework 3.x: we can pass raise_exception=True instead of
-        # raising the exception ourselves
-        if not serializer.is_valid():
-            raise XOSValidationError("Invalid serializer", fields=serializer._errors)
-
-        # now do XOS can_update permission checking
-        obj = serializer.Meta.model(**serializer.validated_data)
-        obj.caller = request.user
-        self.perform_create(serializer)
-
-        headers = self.get_success_headers(serializer.data)
-        return Response(
-            serializer.data, status=status.HTTP_201_CREATED, headers=headers
-        )
-
-    def handle_exception(self, exc):
-        # REST API drops the string attached to Django's PermissionDenied
-        # exception, and replaces it with a generic "Permission Denied"
-        if isinstance(exc, DjangoPermissionDenied):
-            response = Response(
-                {
-                    "detail": {
-                        "error": "PermissionDenied",
-                        "specific_error": str(exc),
-                        "fields": {},
-                    }
-                },
-                status=status.HTTP_403_FORBIDDEN,
-            )
-            response.exception = True
-            return response
-        else:
-            return super(XOSListCreateAPIView, self).handle_exception(exc)
diff --git a/xos/xos/xml_util.py b/xos/xos/xml_util.py
deleted file mode 100644
index d1c90a9..0000000
--- a/xos/xos/xml_util.py
+++ /dev/null
@@ -1,366 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#!/usr/bin/env python
-from types import StringTypes
-from lxml import etree
-from StringIO import StringIO
-
-# helper functions to help build xpaths
-
-
-class XpathFilter:
-    @staticmethod
-    def filter_value(key, value):
-        xpath = ""
-        if isinstance(value, str):
-            if "*" in value:
-                value = value.replace("*", "")
-                xpath = 'contains(%s, "%s")' % (key, value)
-            else:
-                xpath = '%s="%s"' % (key, value)
-        return xpath
-
-    @staticmethod
-    def xpath(filter={}):
-        xpath = ""
-        if filter:
-            filter_list = []
-            for (key, value) in filter.items():
-                if key == "text":
-                    key = "text()"
-                else:
-                    key = "@" + key
-                if isinstance(value, str):
-                    filter_list.append(XpathFilter.filter_value(key, value))
-                elif isinstance(value, list):
-                    stmt = " or ".join(
-                        [XpathFilter.filter_value(key, str(val)) for val in value]
-                    )
-                    filter_list.append(stmt)
-            if filter_list:
-                xpath = " and ".join(filter_list)
-                xpath = "[" + xpath + "]"
-        return xpath
-
-
-# a wrapper class around lxml.etree._Element
-# the reason why we need this one is because of the limitations
-# we've found in xpath to address documents with multiple namespaces defined
-# in a nutshell, we deal with xml documents that have
-# a default namespace defined (xmlns="http://default.com/") and specific prefixes defined
-# (xmlns:foo="http://foo.com")
-# according to the documentation instead of writing
-# element.xpath ( "//node/foo:subnode" )
-# we'd then need to write xpaths like
-# element.xpath ( "//{http://default.com/}node/{http://foo.com}subnode" )
-# which is a real pain..
-# So just so we can keep some reasonable programming style we need to manage the
-# namespace map that goes with the _Element (its internal .nsmap being unmutable)
-class XmlElement:
-    def __init__(self, element, namespaces):
-        self.element = element
-        self.namespaces = namespaces
-
-    # redefine as few methods as possible
-    def xpath(self, xpath, namespaces=None):
-        if not namespaces:
-            namespaces = self.namespaces
-        elems = self.element.xpath(xpath, namespaces=namespaces)
-        return [XmlElement(elem, namespaces) for elem in elems]
-
-    def add_element(self, tagname, **kwds):
-        element = etree.SubElement(self.element, tagname, **kwds)
-        return XmlElement(element, self.namespaces)
-
-    def append(self, elem):
-        if isinstance(elem, XmlElement):
-            self.element.append(elem.element)
-        else:
-            self.element.append(elem)
-
-    def getparent(self):
-        return XmlElement(self.element.getparent(), self.namespaces)
-
-    def get_instance(self, instance_class=None, fields=[]):
-        """
-        Returns an instance (dict) of this xml element. The instance
-        holds a reference to this xml element.
-        """
-        if not instance_class:
-            instance_class = Object
-        if not fields and hasattr(instance_class, "fields"):
-            fields = instance_class.fields
-
-        if not fields:
-            instance = instance_class(self.attrib, self)
-        else:
-            instance = instance_class({}, self)
-            for field in fields:
-                if field in self.attrib:
-                    instance[field] = self.attrib[field]
-        return instance
-
-    def add_instance(self, name, instance, fields=[]):
-        """
-        Adds the specifed instance(s) as a child element of this xml
-        element.
-        """
-        if not fields and hasattr(instance, "keys"):
-            fields = instance.keys()
-        elem = self.add_element(name)
-        for field in fields:
-            if field in instance and instance[field]:
-                elem.set(field, unicode(instance[field]))
-        return elem
-
-    def remove_elements(self, name):
-        """
-        Removes all occurences of an element from the tree. Start at
-        specified root_node if specified, otherwise start at tree's root.
-        """
-
-        if not name.startswith("//"):
-            name = "//" + name
-        elements = self.element.xpath("%s " % name, namespaces=self.namespaces)
-        for element in elements:
-            parent = element.getparent()
-            parent.remove(element)
-
-    def delete(self):
-        parent = self.getparent()
-        parent.remove(self)
-
-    def remove(self, element):
-        if isinstance(element, XmlElement):
-            self.element.remove(element.element)
-        else:
-            self.element.remove(element)
-
-    def set_text(self, text):
-        self.element.text = text
-
-    # Element does not have unset ?!?
-    def unset(self, key):
-        del self.element.attrib[key]
-
-    def toxml(self):
-        return etree.tostring(self.element, encoding="UTF-8", pretty_print=True)
-
-    def __str__(self):
-        return self.toxml()
-
-    # are redirected on self.element
-    def __getattr__(self, name):
-        if not hasattr(self.element, name):
-            raise AttributeError(name)
-        return getattr(self.element, name)
-
-
-class Xml:
-    def __init__(self, xml=None, namespaces=None):
-        self.root = None
-        self.namespaces = namespaces
-        self.default_namespace = None
-        self.schema = None
-        if isinstance(xml, basestring):
-            self.parse_xml(xml)
-        if isinstance(xml, XmlElement):
-            self.root = xml
-            self.namespaces = xml.namespaces
-        elif isinstance(xml, etree._ElementTree) or isinstance(xml, etree._Element):
-            self.parse_xml(etree.tostring(xml))
-
-    def parse_xml(self, xml):
-        """
-        parse rspec into etree
-        """
-        parser = etree.XMLParser(remove_blank_text=True)
-        try:
-            tree = etree.parse(xml, parser)
-        except IOError:
-            # 'rspec' file doesnt exist. 'rspec' is proably an xml string
-            try:
-                tree = etree.parse(StringIO(xml), parser)
-            except Exception as e:
-                raise Exception(str(e))
-        root = tree.getroot()
-        self.namespaces = dict(root.nsmap)
-        # set namespaces map
-        if "default" not in self.namespaces and None in self.namespaces:
-            # If the 'None' exist, then it's pointing to the default namespace. This makes
-            # it hard for us to write xpath queries for the default naemspace because lxml
-            # wont understand a None prefix. We will just associate the default namespeace
-            # with a key named 'default'.
-            self.namespaces["default"] = self.namespaces.pop(None)
-
-        else:
-            self.namespaces["default"] = "default"
-
-        self.root = XmlElement(root, self.namespaces)
-        # set schema
-        for key in self.root.attrib.keys():
-            if key.endswith("schemaLocation"):
-                # schemaLocation should be at the end of the list.
-                # Use list comprehension to filter out empty strings
-                schema_parts = [x for x in self.root.attrib[key].split(" ") if x]
-                self.schema = schema_parts[1]
-                namespace, schema = schema_parts[0], schema_parts[1]
-                break
-
-    def parse_dict(self, d, root_tag_name="xml", element=None):
-        if element is None:
-            if self.root is None:
-                self.parse_xml("<%s/>" % root_tag_name)
-            element = self.root.element
-
-        if "text" in d:
-            text = d.pop("text")
-            element.text = text
-
-        # handle repeating fields
-        for (key, value) in d.items():
-            if isinstance(value, list):
-                value = d.pop(key)
-                for val in value:
-                    if isinstance(val, dict):
-                        child_element = etree.SubElement(element, key)
-                        self.parse_dict(val, key, child_element)
-                    elif isinstance(val, basestring):
-                        child_element = etree.SubElement(element, key).text = val
-
-            elif isinstance(value, int):
-                d[key] = unicode(d[key])
-            elif value is None:
-                d.pop(key)
-
-        # element.attrib.update will explode if DateTimes are in the
-        # dcitionary.
-        d = d.copy()
-        # looks like iteritems won't stand side-effects
-        for k in d.keys():
-            if not isinstance(d[k], StringTypes):
-                del d[k]
-
-        element.attrib.update(d)
-
-    def validate(self, schema):
-        """
-        Validate against rng schema
-        """
-        relaxng_doc = etree.parse(schema)
-        relaxng = etree.RelaxNG(relaxng_doc)
-        if not relaxng(self.root):
-            error = relaxng.error_log.last_error
-            message = "%s (line %s)" % (error.message, error.line)
-            raise Exception(message)
-        return True
-
-    def xpath(self, xpath, namespaces=None):
-        if not namespaces:
-            namespaces = self.namespaces
-        return self.root.xpath(xpath, namespaces=namespaces)
-
-    def set(self, key, value):
-        return self.root.set(key, value)
-
-    def remove_attribute(self, name, element=None):
-        if not element:
-            element = self.root
-        element.remove_attribute(name)
-
-    def add_element(self, *args, **kwds):
-        """
-        Wrapper around etree.SubElement(). Adds an element to
-        specified parent node. Adds element to root node is parent is
-        not specified.
-        """
-        return self.root.add_element(*args, **kwds)
-
-    def remove_elements(self, name, element=None):
-        """
-        Removes all occurences of an element from the tree. Start at
-        specified root_node if specified, otherwise start at tree's root.
-        """
-        if not element:
-            element = self.root
-
-        element.remove_elements(name)
-
-    def add_instance(self, *args, **kwds):
-        return self.root.add_instance(*args, **kwds)
-
-    def get_instance(self, *args, **kwds):
-        return self.root.get_instnace(*args, **kwds)
-
-    def get_element_attributes(self, elem=None, depth=0):
-        if elem is None:
-            elem = self.root
-        if not hasattr(elem, "attrib"):
-            # this is probably not an element node with attribute. could be just and an
-            # attribute, return it
-            return elem
-        attrs = dict(elem.attrib)
-        attrs["text"] = str(elem.text).strip()
-        attrs["parent"] = elem.getparent()
-        if isinstance(depth, int) and depth > 0:
-            for child_elem in list(elem):
-                key = str(child_elem.tag)
-                if key not in attrs:
-                    attrs[key] = [self.get_element_attributes(child_elem, depth - 1)]
-                else:
-                    attrs[key].append(
-                        self.get_element_attributes(child_elem, depth - 1)
-                    )
-        else:
-            attrs["child_nodes"] = list(elem)
-        return attrs
-
-    def append(self, elem):
-        return self.root.append(elem)
-
-    def iterchildren(self):
-        return self.root.iterchildren()
-
-    def merge(self, in_xml):
-        pass
-
-    def __str__(self):
-        return self.toxml()
-
-    def toxml(self):
-        return etree.tostring(self.root.element, encoding="UTF-8", pretty_print=True)
-
-    # XXX smbaker, for record.load_from_string
-    def todict(self, elem=None):
-        if elem is None:
-            elem = self.root
-        d = {}
-        d.update(elem.attrib)
-        d["text"] = elem.text
-        for child in elem.iterchildren():
-            if child.tag not in d:
-                d[child.tag] = []
-            d[child.tag].append(self.todict(child))
-
-        if len(d) == 1 and ("text" in d):
-            d = d["text"]
-
-        return d
-
-    def save(self, filename):
-        f = open(filename, "w")
-        f.write(self.toxml())
-        f.close()