Untitled
unknown
python
2 years ago
756 B
9
Indexable
def save_data(self, route_table_statuses):
try:
[self.connection.write_points(
StatusRepositoryPoint(
status.environment(),
status.state().value
)
) for status in route_table_statuses]
class StatusRepositoryPoint:
def __init__(self, environment, state):
self.__environment = environment
self.__state = state
def __repr__(self):
return self.__str__()
def __str__(self):
return {
"measurement": "master-route-table",
"tags": {
"environment": self.__environment
},
"fields": {
"status": self.__state
}
}Editor is loading...