Skip to content

Commit

Permalink
To handles UVE key that include "/", we need to re-organize the bottl…
Browse files Browse the repository at this point in the history
…e match rules.

bottle matches rules according to a priority order.

As part of re-organizing these rules, url that have "/analytics/<uve-type" are
being deprecated in favour of "/analytics/uves/<uve-type"

Change-Id: I13fc2ce57ba73d71d9ac9e13a95c8c0fa1aeccc2
Partial-Bug: 1484464
  • Loading branch information
anishmehta committed Aug 18, 2015
1 parent 5fdf980 commit b53b9ee
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tcutils/collector/opserver_introspect_utils.py
Expand Up @@ -23,7 +23,7 @@ def __init__(self, ip, port=8081, logger=LOG):
def get_ops_generator(self, generator=None,
moduleid=None, node_type=None,
instanceid='0'):
'''http://nodea29:8081/analytics/generator\
'''http://nodea29:8081/analytics/uves/generator\
/nodea18:Control:Contrail-Control:0?flat'''
if (generator == None):
generator = socket.gethostname()
Expand All @@ -38,7 +38,7 @@ def get_ops_generator(self, generator=None,
res = None
try:
generator_dict = self.dict_get(
'analytics/generator/' + generator + \
'analytics/uves/generator/' + generator + \
':' + node_type + ':' + moduleid + ':' \
+ instanceid + '?flat')
res = OpGeneratorResult(generator_dict)
Expand Down Expand Up @@ -77,7 +77,7 @@ def get_ops_vn(self, vn_fq_name='default-virtual-network'):
res = None
try:
vn_dict = self.dict_get(
'analytics/virtual-network/' + vn_fq_name + '?flat')
'analytics/uves/virtual-network/' + vn_fq_name + '?flat')
res = OpVNResult(vn_dict)
except Exception as e:
print e
Expand All @@ -88,7 +88,7 @@ def get_ops_vm(self, vm='default-virtual-machine'):
res = None
try:
vm_dict = self.dict_get(
'analytics/virtual-machine/' + vm + '?flat')
'analytics/uves/virtual-machine/' + vm + '?flat')
res = OpVMResult(vm_dict)
except Exception as e:
print e
Expand All @@ -102,7 +102,7 @@ def get_ops_svc_instance(self, project='admin',
res = None
try:
si_dict = self.dict_get(
'analytics/service-instance/' + svc_instance + '?flat')
'analytics/uves/service-instance/' + svc_instance + '?flat')
res = OpSIResult(si_dict)
except Exception as e:
print e
Expand All @@ -118,7 +118,7 @@ def get_ops_svc_template(self,
res = None
try:
st_dict = self.dict_get(
'analytics/service-chain/sc:' + left_vn + \
'analytics/uves/service-chain/sc:' + left_vn + \
':' + right_vn + '?flat')
res = OpSTResult(st_dict)
except Exception as e:
Expand All @@ -141,7 +141,7 @@ def get_hrefs_to_all_UVEs_of_a_given_UVE_type(self, uveType=None):

def get_hrefs_to_all_tables(self, uveType=None):
'''Get all hrefs for a uve type'''
dct = self.dict_get('analytics/' + uveType)
dct = self.dict_get('analytics/uves/' + uveType)
ret_value = []
for elem in dct:
self.tme = OpHrefTableResult(elem)
Expand Down Expand Up @@ -258,7 +258,7 @@ def get_ops_sc_uve(self):
res = None
try:
c_dict = self.dict_get(
'analytics/service-chain/*')
'analytics/uves/service-chain/*')
res = OpServiceChainResult(c_dict)
except Exception as e:
print e
Expand Down

0 comments on commit b53b9ee

Please sign in to comment.