Merge pull request #138 from jermowery/cleanupStyle
Fix style and imports
diff --git a/apiary.apib b/apiary.apib
new file mode 100644
index 0000000..43a81c7
--- /dev/null
+++ b/apiary.apib
@@ -0,0 +1,461 @@
+FORMAT: 1A
+
+# XOS
+
+
+# Group ONOS Services
+
+## ONOS Services Collection [/api/service/onos/]
+
+### List all ONOS Services [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "service_ONOS_vBNG",
+ "id": 5,
+ "rest_hostname": "",
+ "rest_port": "8181",
+ "no_container": false,
+ "node_key": ""
+ }
+ ]
+
+
+# Group vSG
+
+## vSG Collection [/api/service/vsg/]
+
+### List all vSGs [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "service_vsg",
+ "id": 2,
+ "wan_container_gateway_ip": "",
+ "wan_container_gateway_mac": "",
+ "dns_servers": "8.8.8.8",
+ "url_filter_kind": null,
+ "node_label": null
+ }
+ ]
+
+
+# Group Subscribers
+
+Resource related to the CORD Subscribers.
+
+## Subscribers Collection [/api/tenant/cord/subscriber/]
+
+### List All Subscribers [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "cordSubscriber-1",
+ "id": 1,
+ "features": {
+ "cdn": false,
+ "uplink_speed": 1000000000,
+ "downlink_speed": 1000000000,
+ "uverse": false,
+ "status": "enabled"
+ },
+ "identity": {
+ "account_num": "123",
+ "name": "My House"
+ },
+ "related": {
+ "instance_name": "mysite_vcpe",
+ "vsg_id": 4,
+ "compute_node_name": "node2.opencloud.us",
+ "c_tag": "432",
+ "instance_id": 1,
+ "wan_container_ip": null,
+ "volt_id": 3,
+ "s_tag": "222"
+ }
+ }
+ ]
+
+## Subscriber Detail [/api/tenant/cord/subscriber/{subscriber_id}/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+### View a Subscriber Detail [GET]
+
++ Response 200 (application/json)
+
+ {
+ "humanReadableName": "cordSubscriber-1",
+ "id": 1,
+ "features": {
+ "cdn": false,
+ "uplink_speed": 1000000000,
+ "downlink_speed": 1000000000,
+ "uverse": false,
+ "status": "enabled"
+ },
+ "identity": {
+ "account_num": "123",
+ "name": "My House"
+ },
+ "related": {
+ "instance_name": "mysite_vcpe",
+ "vsg_id": 4,
+ "compute_node_name": "node2.opencloud.us",
+ "c_tag": "432",
+ "instance_id": 1,
+ "wan_container_ip": null,
+ "volt_id": 3,
+ "s_tag": "222"
+ }
+ }
+
+### Delete a Subscriber [DELETE]
+
++ Response 204
+
+### Subscriber features [/api/tenant/cord/subscriber/{subscriber_id}/features/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+### View a Subscriber Features Detail [GET]
+
++ Response 200 (application/json)
+
+ {
+ "cdn": false,
+ "uplink_speed": 1000000000,
+ "downlink_speed": 1000000000,
+ "uverse": true,
+ "status": "enabled"
+ }
+
+#### Subscriber features uplink_speed [/api/tenant/cord/subscriber/{subscriber_id}/features/uplink_speed/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+#### Read Subscriber uplink_speed [GET]
+
++ Response 200 (application/json)
+
+ {
+ "uplink_speed": 1000000000
+ }
+
+#### Update Subscriber uplink_speed [PUT]
+
++ Request 200 (application/json)
+
+ {
+ "uplink_speed": 1000000000
+ }
+
++ Response 200 (application/json)
+
+ {
+ "uplink_speed": 1000000000
+ }
+
+#### Subscriber features downlink_speed [/api/tenant/cord/subscriber/{subscriber_id}/features/downlink_speed/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+#### Read Subscriber downlink_speed [GET]
+
++ Response 200 (application/json)
+
+ {
+ "downlink_speed": 1000000000
+ }
+
+#### Update Subscriber downlink_speed [PUT]
+
++ Request 200 (application/json)
+
+ {
+ "downlink_speed": 1000000000
+ }
+
++ Response 200 (application/json)
+
+ {
+ "downlink_speed": 1000000000
+ }
+
+#### Subscriber features cdn [/api/tenant/cord/subscriber/{subscriber_id}/features/cdn/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+#### Read Subscriber cdn [GET]
+
++ Response 200 (application/json)
+
+ {
+ "cdn": false
+ }
+
+#### Update Subscriber cdn [PUT]
+
++ Request 200 (application/json)
+
+ {
+ "cdn": false
+ }
+
++ Response 200 (application/json)
+
+ {
+ "cdn": false
+ }
+
+#### Subscriber features uverse [/api/tenant/cord/subscriber/{subscriber_id}/features/uverse/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+#### Read Subscriber uverse [GET]
+
++ Response 200 (application/json)
+
+ {
+ "uverse": false
+ }
+
+#### Update Subscriber uverse [PUT]
+
++ Request 200 (application/json)
+
+ {
+ "uverse": false
+ }
+
++ Response 200 (application/json)
+
+ {
+ "uverse": false
+ }
+
+#### Subscriber features status [/api/tenant/cord/subscriber/{subscriber_id}/features/status/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+#### Read Subscriber status [GET]
+
++ Response 200 (application/json)
+
+ {
+ "status": "enabled"
+ }
+
+#### Update Subscriber status [PUT]
+
++ Request 200 (application/json)
+
+ {
+ "status": "enabled"
+ }
+
++ Response 200 (application/json)
+
+ {
+ "status": "enabled"
+ }
+
+
+# Group Truckroll
+
+Virtual Truckroll, enable to perform basic test on user connectivity such as ping, traceroute and tcpdump.
+
+## Truckroll Collection [/api/tenant/truckroll/]
+
+### List all Truckroll [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "vTR-tenant-9",
+ "id": 9,
+ "provider_service": 6,
+ "target_id": 2,
+ "scope": "container",
+ "test": "ping",
+ "argument": "8.8.8.8",
+ "result": "",
+ "result_code": "",
+ "is_synced": false,
+ "backend_status": "2 - Exception('Unreachable results in ansible recipe',)"
+ }
+ ]
+
+### Create a Truckroll [POST]
+
++ Request (application/json)
+
+ {
+ "target_id": 2,
+ "scope": "container",
+ "test": "ping",
+ "argument": "8.8.8.8"
+ }
+
++ Response 201 (application/json)
+
+ {
+ "humanReadableName": "vTR-tenant-1",
+ "id": 1,
+ "provider_service": 6,
+ "target_id": 2,
+ "scope": "container",
+ "test": "ping",
+ "argument": "8.8.8.8",
+ "result": null,
+ "result_code": null,
+ "is_synced": false,
+ "backend_status": "0 - Provisioning in progress"
+ }
+
+## Truckroll Detail [/api/tenant/truckroll/{truckroll_id}/]
+
+A virtual truckroll is complete once is_synced equal true
+
++ Parameters
+ + truckroll_id: 1 (number) - ID of the Truckroll in the form of an integer
+
+### View a Truckroll Detail [GET]
+
++ Response 200 (application/json)
+
+ {
+ "humanReadableName": "vTR-tenant-10",
+ "id": 10,
+ "provider_service": 6,
+ "target_id": 2,
+ "scope": "container",
+ "test": "ping",
+ "argument": "8.8.8.8",
+ "result": null,
+ "result_code": null,
+ "is_synced": false,
+ "backend_status": "0 - Provisioning in progress"
+ }
+
+### Delete a Truckroll Detail [DELETE]
+
++ Response 204
+
+
+
+# Group vOLT
+
+OLT devices aggregate a set of subscriber connections
+
+## vOLT Collection [/api/tenant/cord/volt/]
+
+### List all vOLT [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "vOLT-tenant-1",
+ "id": 1,
+ "service_specific_id": "123",
+ "s_tag": "222",
+ "c_tag": "432",
+ "subscriber": 1,
+ "related": {
+ "instance_id": 1,
+ "instance_name": "mysite_vcpe",
+ "vsg_id": 4,
+ "wan_container_ip": null,
+ "compute_node_name": "node2.opencloud.us"
+ }
+ }
+ ]
+
+### Create a vOLT [POST]
+
++ Request (application/json)
+
+ {
+ "s_tag": "222",
+ "c_tag": "432",
+ "subscriber": 1
+ }
+
++ Response 201 (application/json)
+
+ {
+ "humanReadableName": "vOLT-tenant-1",
+ "id": 1,
+ "service_specific_id": "123",
+ "s_tag": "222",
+ "c_tag": "432",
+ "subscriber": 1,
+ "related": {
+ "instance_id": 1,
+ "instance_name": "mysite_vcpe",
+ "vsg_id": 4,
+ "wan_container_ip": null,
+ "compute_node_name": "node2.opencloud.us"
+ }
+ }
+
+## vOLT Detail [/api/tenant/cord/volt/{volt_id}/]
+
+A virtual volt is complete once is_synced equal true
+
++ Parameters
+ + volt_id: 1 (number) - ID of the vOLT in the form of an integer
+
+### View a vOLT Detail [GET]
+
++ Response 200 (application/json)
+
+ {
+ "humanReadableName": "vOLT-tenant-1",
+ "id": 1,
+ "service_specific_id": "123",
+ "s_tag": "222",
+ "c_tag": "432",
+ "subscriber": 1,
+ "related": {
+ "instance_id": 1,
+ "instance_name": "mysite_vcpe",
+ "vsg_id": 4,
+ "wan_container_ip": null,
+ "compute_node_name": "node2.opencloud.us"
+ }
+ }
+
+
+
+# Group ONOS Apps
+
+## app Collection [/api/tenant/onos/app/]
+
+### List all apps [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "onos-tenant-7",
+ "id": 7,
+ "name": "vBNG_ONOS_app",
+ "dependencies": "org.onosproject.proxyarp, org.onosproject.virtualbng, org.onosproject.openflow, org.onosproject.fwd"
+ }
+ ]
\ No newline at end of file
diff --git a/xos/configurations/cord/Dockerfile.cord b/xos/configurations/cord-deprecated/Dockerfile.cord
similarity index 100%
rename from xos/configurations/cord/Dockerfile.cord
rename to xos/configurations/cord-deprecated/Dockerfile.cord
diff --git a/xos/configurations/cord/Makefile b/xos/configurations/cord-deprecated/Makefile
similarity index 100%
rename from xos/configurations/cord/Makefile
rename to xos/configurations/cord-deprecated/Makefile
diff --git a/xos/configurations/cord/Makefile.inside b/xos/configurations/cord-deprecated/Makefile.inside
similarity index 100%
rename from xos/configurations/cord/Makefile.inside
rename to xos/configurations/cord-deprecated/Makefile.inside
diff --git a/xos/configurations/cord/README-VTN.md b/xos/configurations/cord-deprecated/README-VTN.md
similarity index 100%
rename from xos/configurations/cord/README-VTN.md
rename to xos/configurations/cord-deprecated/README-VTN.md
diff --git a/xos/configurations/cord/README.md b/xos/configurations/cord-deprecated/README.md
similarity index 100%
rename from xos/configurations/cord/README.md
rename to xos/configurations/cord-deprecated/README.md
diff --git a/xos/configurations/cord/ceilometer.yaml b/xos/configurations/cord-deprecated/ceilometer.yaml
similarity index 100%
rename from xos/configurations/cord/ceilometer.yaml
rename to xos/configurations/cord-deprecated/ceilometer.yaml
diff --git a/xos/configurations/cord/cord.yaml b/xos/configurations/cord-deprecated/cord.yaml
similarity index 100%
rename from xos/configurations/cord/cord.yaml
rename to xos/configurations/cord-deprecated/cord.yaml
diff --git a/xos/configurations/cord/dataplane/ansible.cfg b/xos/configurations/cord-deprecated/dataplane/ansible.cfg
similarity index 100%
rename from xos/configurations/cord/dataplane/ansible.cfg
rename to xos/configurations/cord-deprecated/dataplane/ansible.cfg
diff --git a/xos/configurations/cord/dataplane/change_controller.sh b/xos/configurations/cord-deprecated/dataplane/change_controller.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/change_controller.sh
rename to xos/configurations/cord-deprecated/dataplane/change_controller.sh
diff --git a/xos/configurations/cord/dataplane/cleanup.sh b/xos/configurations/cord-deprecated/dataplane/cleanup.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/cleanup.sh
rename to xos/configurations/cord-deprecated/dataplane/cleanup.sh
diff --git a/xos/configurations/cord/dataplane/dataplane-bm.yaml b/xos/configurations/cord-deprecated/dataplane/dataplane-bm.yaml
similarity index 100%
rename from xos/configurations/cord/dataplane/dataplane-bm.yaml
rename to xos/configurations/cord-deprecated/dataplane/dataplane-bm.yaml
diff --git a/xos/configurations/cord/dataplane/dataplane-vtn.yaml b/xos/configurations/cord-deprecated/dataplane/dataplane-vtn.yaml
similarity index 100%
rename from xos/configurations/cord/dataplane/dataplane-vtn.yaml
rename to xos/configurations/cord-deprecated/dataplane/dataplane-vtn.yaml
diff --git a/xos/configurations/cord/dataplane/dataplane.yaml b/xos/configurations/cord-deprecated/dataplane/dataplane.yaml
similarity index 100%
rename from xos/configurations/cord/dataplane/dataplane.yaml
rename to xos/configurations/cord-deprecated/dataplane/dataplane.yaml
diff --git a/xos/configurations/cord/dataplane/gen-etc-hosts.sh b/xos/configurations/cord-deprecated/dataplane/gen-etc-hosts.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/gen-etc-hosts.sh
rename to xos/configurations/cord-deprecated/dataplane/gen-etc-hosts.sh
diff --git a/xos/configurations/cord/dataplane/gen-inventory.sh b/xos/configurations/cord-deprecated/dataplane/gen-inventory.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/gen-inventory.sh
rename to xos/configurations/cord-deprecated/dataplane/gen-inventory.sh
diff --git a/xos/configurations/cord/dataplane/generate-bm.sh b/xos/configurations/cord-deprecated/dataplane/generate-bm.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/generate-bm.sh
rename to xos/configurations/cord-deprecated/dataplane/generate-bm.sh
diff --git a/xos/configurations/cord/dataplane/scripts/if_from_ip.py b/xos/configurations/cord-deprecated/dataplane/scripts/if_from_ip.py
similarity index 100%
rename from xos/configurations/cord/dataplane/scripts/if_from_ip.py
rename to xos/configurations/cord-deprecated/dataplane/scripts/if_from_ip.py
diff --git a/xos/configurations/cord/dataplane/scripts/restart-vcpes.sh b/xos/configurations/cord-deprecated/dataplane/scripts/restart-vcpes.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/scripts/restart-vcpes.sh
rename to xos/configurations/cord-deprecated/dataplane/scripts/restart-vcpes.sh
diff --git a/xos/configurations/cord/docker-compose.yml b/xos/configurations/cord-deprecated/docker-compose.yml
similarity index 100%
rename from xos/configurations/cord/docker-compose.yml
rename to xos/configurations/cord-deprecated/docker-compose.yml
diff --git a/xos/configurations/cord/make-virtualbng-json.sh b/xos/configurations/cord-deprecated/make-virtualbng-json.sh
similarity index 100%
rename from xos/configurations/cord/make-virtualbng-json.sh
rename to xos/configurations/cord-deprecated/make-virtualbng-json.sh
diff --git a/xos/configurations/cord/make-vtn-networkconfig-json.sh b/xos/configurations/cord-deprecated/make-vtn-networkconfig-json.sh
similarity index 100%
rename from xos/configurations/cord/make-vtn-networkconfig-json.sh
rename to xos/configurations/cord-deprecated/make-vtn-networkconfig-json.sh
diff --git a/xos/configurations/cord/xos_cord_config b/xos/configurations/cord-deprecated/xos_cord_config
similarity index 100%
copy from xos/configurations/cord/xos_cord_config
copy to xos/configurations/cord-deprecated/xos_cord_config
diff --git a/xos/configurations/cord-pod/README.md b/xos/configurations/cord-pod/README.md
index 3d7a60f..b47a915 100644
--- a/xos/configurations/cord-pod/README.md
+++ b/xos/configurations/cord-pod/README.md
@@ -28,9 +28,13 @@
### Install OpenStack
-Follow the instructions in the [README.md](https://github.com/open-cloud/openstack-cluster-setup/blob/master/README.md)
+To set up OpenStack, follow the instructions in the
+[README.md](https://github.com/open-cloud/openstack-cluster-setup/blob/master/README.md)
file of the [open-cloud/openstack-cluster-setup](https://github.com/open-cloud/openstack-cluster-setup/)
-repository.
+repository. If you're just getting started with CORD, it's probably best to begin with the
+single-node CORD test environment to familiarize yourself with the overall setup.
+
+**NOTE: In order to use the cord-pod configuration, you must set up OpenStack using the above recipe.**
### Set up ONOS VTN
@@ -99,9 +103,11 @@
3. Modify `cord-vtn-vsg.yml` and set these parameters to the
appropriate values for the fabric:
- * `public_addresses:properties:addresses` (IP address block of fabric)
- * `service_vsg:properties:wan_container_gateway_ip` (same as `publicGateway:gatewayIp` from VTN configuration)
- * `service_vsg:properties:wan_container_gateway_mac` (same as `publicGateway:gatewayMac` from VTN configuration)
+ * `addresses_vsg:properties:addresses` (IP address block of fabric)
+ * `addresses_vsg:properties:gateway_ip`
+ * `addresses_vsg:properties:gateway_mac`
+ * `service_vsg:properties:wan_container_gateway_ip` (same as `gateway_ip` above and same as `publicGateway:gatewayIp` from VTN configuration)
+ * `service_vsg:properties:wan_container_gateway_mac` (same as `gateway_mac` above and same as `publicGateway:gatewayMac` from VTN configuration)
* `service_vsg:properties:wan_container_netbits` (bits in fabric IP address block netmask)
diff --git a/xos/configurations/cord-pod/docker-compose.yml b/xos/configurations/cord-pod/docker-compose.yml
index cb7194f..234fd43 100644
--- a/xos/configurations/cord-pod/docker-compose.yml
+++ b/xos/configurations/cord-pod/docker-compose.yml
@@ -13,7 +13,7 @@
- xos_db
volumes:
- ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
- - ../cord//xos_cord_config:/opt/xos/xos_configuration/xos_cord_config:ro
+ - xos_cord_config:/opt/xos/xos_configuration/xos_cord_config:ro
- .:/root/setup:ro
- ../vtn/files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro
- ./images:/opt/xos/images:ro
@@ -96,7 +96,7 @@
volumes:
- .:/root/setup:ro
- ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
- - ../cord/xos_cord_config:/opt/xos/xos_configuration/xos_cord_config:ro
+ - xos_cord_config:/opt/xos/xos_configuration/xos_cord_config:ro
- ../vtn/files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro
- ./id_rsa.pub:/opt/xos/synchronizers/onos/onos_key.pub:ro
- ./id_rsa.pub:/opt/xos/synchronizers/vcpe/vcpe_public_key:ro
diff --git a/xos/configurations/cord/xos_cord_config b/xos/configurations/cord-pod/xos_cord_config
similarity index 100%
rename from xos/configurations/cord/xos_cord_config
rename to xos/configurations/cord-pod/xos_cord_config
diff --git a/xos/configurations/devel/README.md b/xos/configurations/devel/README.md
index df9f999..5dbad10 100644
--- a/xos/configurations/devel/README.md
+++ b/xos/configurations/devel/README.md
@@ -4,6 +4,9 @@
XOS in three Docker containers (development GUI, Synchronizer, database) and configures XOS
to talk to an OpenStack backend. *docker-compose* is used to manage the containers.
+**NOTE: If your goal is to create a development environment for [CORD](http://opencord.org/),
+this configuration is not what you want. Look at the [cord-pod](../cord-pod) configuration instead!**
+
## How to run it
The configuration can be either run on [CloudLab](http://cloudlab.us) (controlling
@@ -41,8 +44,6 @@
This setup has been run successfully in a VirtualBox VM with 2 CPUs and 4096 GB RAM.
However it is recommended to use a dedicated server with more resources.
-**NOTE: If your goal is to create a development environment for [CORD](http://opencord.org/),
-DevStack is not what you want. Look at the [cord-pod](../cord-pod) configuration instead!**
## What you get
diff --git a/xos/tests/api/apiary.apib b/xos/tests/api/apiary.apib
index 43a81c7..fb917bc 100644
--- a/xos/tests/api/apiary.apib
+++ b/xos/tests/api/apiary.apib
@@ -3,6 +3,23 @@
# XOS
+# Group Example
+
+## Example Services Collection [/api/service/exampleservice/]
+
+### List all Example Services [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "MyExample",
+ "id": 1,
+ "service_message": "This is the test message"
+ }
+ ]
+
+
# Group ONOS Services
## ONOS Services Collection [/api/service/onos/]
diff --git a/xos/tests/api/helpers/subscriber.py b/xos/tests/api/helpers/subscriber.py
index 0ff02c2..4ede030 100644
--- a/xos/tests/api/helpers/subscriber.py
+++ b/xos/tests/api/helpers/subscriber.py
@@ -60,6 +60,9 @@
for s in NetworkSlice.objects.all():
s.delete(purge=True)
+ for s in AddressPool.objects.all():
+ s.delete(purge=True)
+
print 'DB Cleaned'
@@ -79,6 +82,22 @@
subscriber = CordSubscriberRoot(name='Test Subscriber 1', id=1)
subscriber.save()
+ # vRouter service
+ vrouter_service = VRouterService()
+ vrouter_service.name = 'service_vrouter'
+ vrouter_service.save()
+
+ # address pools
+ ap_vsg = AddressPool()
+ ap_vsg.service = vrouter_service
+ ap_vsg.name = 'addresses_vsg'
+ ap_vsg.addresses = '10.168.0.0'
+ ap_vsg.gateway_ip = '10.168.0.1'
+ ap_vsg.gateway_mac = '02:42:0a:a8:00:01'
+ ap_vsg.save()
+
+ print 'vRouter created'
+
# Site
site = Site.objects.get(name='MySite')
@@ -102,6 +121,7 @@
volt_service.name = 'service_volt'
volt_service.save()
+
# vcpe slice
vcpe_slice = Slice()
vcpe_slice.name = site.login_base + "_testVcpe"
@@ -110,7 +130,7 @@
vcpe_slice.caller = user
vcpe_slice.save()
- print 'vcpe_slice created'
+ # print 'vcpe_slice created'
# create a lan network
lan_net = Network()
@@ -119,7 +139,7 @@
lan_net.template = private_template
lan_net.save()
- print 'lan_network created'
+ # print 'lan_network created'
# add relation between vcpe slice and lan network
vcpe_network = NetworkSlice()
@@ -127,14 +147,14 @@
vcpe_network.slice = vcpe_slice
vcpe_network.save()
- print 'vcpe network relation added'
+ # print 'vcpe network relation added'
# vbng service
vbng_service = VBNGService()
vbng_service.name = 'service_vbng'
vbng_service.save()
- print 'vbng_service creater'
+ # print 'vbng_service creater'
# volt tenant
vt = VOLTTenant(subscriber=subscriber.id, id=1)
diff --git a/xos/tests/api/hooks.py b/xos/tests/api/hooks.py
index 6779014..e327852 100644
--- a/xos/tests/api/hooks.py
+++ b/xos/tests/api/hooks.py
@@ -51,6 +51,9 @@
for s in NetworkSlice.objects.all():
s.delete(purge=True)
+ for s in AddressPool.objects.all():
+ s.delete(purge=True)
+
# print 'DB Cleaned'
@@ -70,6 +73,22 @@
subscriber = CordSubscriberRoot(name='Test Subscriber 1', id=1)
subscriber.save()
+ # vRouter service
+ vrouter_service = VRouterService()
+ vrouter_service.name = 'service_vrouter'
+ vrouter_service.save()
+
+ # address pools
+ ap_vsg = AddressPool()
+ ap_vsg.service = vrouter_service
+ ap_vsg.name = 'addresses_vsg'
+ ap_vsg.addresses = '10.168.0.0'
+ ap_vsg.gateway_ip = '10.168.0.1'
+ ap_vsg.gateway_mac = '02:42:0a:a8:00:01'
+ ap_vsg.save()
+
+ # print 'vRouter created'
+
# Site
site = Site.objects.get(name='MySite')
@@ -164,6 +183,7 @@
@hooks.before_each
def my_before_each_hook(transaction):
# print "-------------------------------- Before Each Hook --------------------------------"
+ # print transaction['name']
auth = doLogin('padmin@vicci.org', 'letmein')
transaction['request']['headers']['X-CSRFToken'] = auth['token']
transaction['request']['headers']['Cookie'] = "xossessionid=%s; xoscsrftoken=%s" % (auth['sessionid'], auth['token'])
@@ -192,3 +212,8 @@
def test4(transaction):
# transaction['skip'] = True
VOLTTenant.objects.get(kind='vOLT').delete()
+
+
+@hooks.before("Example > Example Services Collection > List all Example Services")
+def exampleTest(transaction):
+ transaction['skip'] = True
diff --git a/xos/tests/api/source/service/exampleservice.md b/xos/tests/api/source/service/exampleservice.md
new file mode 100644
index 0000000..96a19c7
--- /dev/null
+++ b/xos/tests/api/source/service/exampleservice.md
@@ -0,0 +1,15 @@
+# Group Example
+
+## Example Services Collection [/api/service/exampleservice/]
+
+### List all Example Services [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "MyExample",
+ "id": 1,
+ "service_message": "This is the test message"
+ }
+ ]
\ No newline at end of file