def _json_body_(cls):
        """Return the JSON body of given datapoints.

        :return: JSON body of these datapoints.
        """
        json = []
        for series_name, data in six.iteritems(cls._datapoints):
            for point in data:
                json_point = {
                    "measurement": series_name,
                    "fields": {},
                    "tags": {},
                    "time": getattr(point, "time")
                }

                for field in cls._fields:
                    value = getattr(point, field)
                    if value is not None:
                        json_point['fields'][field] = value

                for tag in cls._tags:
                    json_point['tags'][tag] = getattr(point, tag)

                json.append(json_point)
        return json
def _json_body_ ( cls ) : json = [ ] for series_name , data in six . iteritems ( cls . _datapoints ) : for point in data : json_point = { "measurement" : series_name , "fields" : { } , "tags" : { } , "time" : getattr ( point , "time" ) } for field in cls . _fields : value = getattr ( point , field ) if value is not None : json_point [ 'fields' ] [ field ] = value for tag in cls . _tags : json_point [ 'tags' ] [ tag ] = getattr ( point , tag ) json . append ( json_point ) return json
Return the JSON body of given datapoints.

        :return: JSON body of these datapoints.