broadview-collector/broadview_collector/serializers/broadviewserializerbase.py
Vitaliy Kharechko 2287e165aa Add BroadView agent IP address to generated metrics
Change-Id: I0b7ec0da67adc4c1de8c03b587424f127f95797f
2016-05-12 14:28:55 +03:00

32 lines
1008 B
Python

# (C) Copyright Broadcom Corporation 2016
#
# 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.
class BroadViewSerializerBase(object):
def __init__(self):
pass
def serialize(self, host, data):
'''
return a 2-tuple (ret, jsonret)
where coderet is True for success and False for failure,
jsonret is a json string that holds the serialized data.
For example, on success:
return (True, "{\"foo\": \"bar\"}")
'''
raise NotImplementedError