[autotest] Save host labels information to metaDB

Add a utility to save all host labels to metaDB. Will need to setup a daily
cron job to run the script.

The script also supports a query action to search for hosts and labels.

BUG=chromium:419043
TEST=run the tool to collect host labels, and query it:
./site_utils/host_labels_utils.py collect
./site_utils/host_labels_utils.py query -n 172.27.213.193 -l peppy

TODO: After this is in production, ES mapping needs to be updated to stop
indexing hostname and labels. refer to the end of document:
https://docs.google.com/a/google.com/document/d/1GpTe9TwMRc5lQFrFWXfB5eyCgaYIkSSjPS2fyLcP8yQ/edit#

Change-Id: I294466e5033cfe207ab072297edbb64dfd07771a
Reviewed-on: https://chromium-review.googlesource.com/221520
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
2 files changed