Feature 8681: Add VCA HA capabilities

- juju watcher: fix exception handling when websocket is closed
- libjuju.py:
  - Get vca endpoints from database (if exists)
  - Update vca endpoints in database
  - Get controller per operation (remove controller from class attribute)
  - Add health check: Every 5 minutes the connection to the controller will be tested.
- Dockerfile: update it to 18.04

Change-Id: Ifa0a3a705d48fd736a9634b0722bdc914003b497
Signed-off-by: David Garcia <david.garcia@canonical.com>
diff --git a/n2vc/utils.py b/n2vc/utils.py
index 990575d..62892eb 100644
--- a/n2vc/utils.py
+++ b/n2vc/utils.py
@@ -92,6 +92,7 @@
         "active": N2VCDeploymentStatus.COMPLETED,
     },
     EntityType.ACTION: {
+        "pending": N2VCDeploymentStatus.PENDING,
         "running": N2VCDeploymentStatus.RUNNING,
         "completed": N2VCDeploymentStatus.COMPLETED,
     },
@@ -103,3 +104,11 @@
         "active": N2VCDeploymentStatus.COMPLETED,
     },
 }
+
+DB_DATA = Dict(
+    {
+        "api_endpoints": Dict(
+            {"table": "admin", "filter": {"_id": "juju"}, "key": "api_endpoints"}
+        )
+    }
+)