[SEBA-191] Updating the OLT app API
Change-Id: Ic5bb43e072104cf167642f0f57d98d909b2fa73a
diff --git a/xos/synchronizer/steps/sync_volt_service_instance.py b/xos/synchronizer/steps/sync_volt_service_instance.py
index 10091cf..11675a4 100644
--- a/xos/synchronizer/steps/sync_volt_service_instance.py
+++ b/xos/synchronizer/steps/sync_volt_service_instance.py
@@ -36,16 +36,10 @@
if o.policy_code != 1:
raise DeferredException("Waiting for ModelPolicy to complete")
-
volt_service = VOLTService.objects.get(id=o.owner_id)
- si = ServiceInstance.objects.get(id=o.id)
-
log.info("Synching OLTServiceInstance", object=str(o), **o.tologdict())
- c_tag = si.get_westbound_service_instance_properties("c_tag")
- s_tag = si.get_westbound_service_instance_properties("s_tag")
-
olt_device = o.onu_device.pon_port.olt_device
try:
@@ -59,27 +53,19 @@
raise DeferredException("Waiting for OLTDevice %s to be synchronized" % olt_device.name)
log.debug("Adding subscriber with info",
- c_tag = c_tag,
- s_tag = s_tag,
uni_port_id = uni_port_id,
- dp_id = olt_device.dp_id)
+ dp_id = olt_device.dp_id
+ )
# Send request to ONOS
onos_voltha = Helpers.get_onos_voltha_info(volt_service)
onos_voltha_basic_auth = HTTPBasicAuth(onos_voltha['user'], onos_voltha['pass'])
- full_url = "%s:%d/onos/olt/oltapp/subscribers" % (onos_voltha['url'], onos_voltha['port'])
+ full_url = "%s:%d/onos/olt/oltapp/%s/%s" % (onos_voltha['url'], onos_voltha['port'], olt_device.dp_id, uni_port_id)
- data = {
- "deviceId" : olt_device.dp_id,
- "port" : uni_port_id,
- "sVlan" : s_tag,
- "cVlan" : c_tag
- }
+ log.info("Sending request to onos-voltha", url=full_url)
- log.info("Sending request to onos-voltha", url=full_url, data=data)
-
- request = requests.post(full_url, auth=onos_voltha_basic_auth, json=data)
+ request = requests.post(full_url, auth=onos_voltha_basic_auth)
if request.status_code != 200:
raise Exception("Failed to add subscriber in onos-voltha: %s" % request.text)