]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/controllers/health.py
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / controllers / health.py
index 35e7b07b216e7a136be14971beaf42ec2dd5ce8f..0ae0a5bf08b17d875dc6bece78ed819fbf488a9b 100644 (file)
@@ -3,8 +3,6 @@ from __future__ import absolute_import
 
 import json
 
-from . import ApiController, Endpoint, BaseController
-
 from .. import mgr
 from ..rest_client import RequestException
 from ..security import Permission, Scope
@@ -12,8 +10,105 @@ from ..services.ceph_service import CephService
 from ..services.iscsi_cli import IscsiGatewaysConfig
 from ..services.iscsi_client import IscsiClient
 from ..tools import partial_dict
+from . import ApiController, BaseController, ControllerDoc, Endpoint, EndpointDoc
 from .host import get_hosts
 
+HEALTH_MINIMAL_SCHEMA = ({
+    'client_perf': ({
+        'read_bytes_sec': (int, ''),
+        'read_op_per_sec': (int, ''),
+        'recovering_bytes_per_sec': (int, ''),
+        'write_bytes_sec': (int, ''),
+        'write_op_per_sec': (int, ''),
+    }, ''),
+    'df': ({
+        'stats': ({
+            'total_avail_bytes': (int, ''),
+            'total_bytes': (int, ''),
+            'total_used_raw_bytes': (int, ''),
+        }, '')
+    }, ''),
+    'fs_map': ({
+        'filesystems': ([{
+            'mdsmap': ({
+                'session_autoclose': (int, ''),
+                'balancer': (str, ''),
+                'up': (str, ''),
+                'last_failure_osd_epoch': (int, ''),
+                'in': ([int], ''),
+                'last_failure': (int, ''),
+                'max_file_size': (int, ''),
+                'explicitly_allowed_features': (int, ''),
+                'damaged': ([int], ''),
+                'tableserver': (int, ''),
+                'failed': ([int], ''),
+                'metadata_pool': (int, ''),
+                'epoch': (int, ''),
+                'stopped': ([int], ''),
+                'max_mds': (int, ''),
+                'compat': ({
+                    'compat': (str, ''),
+                    'ro_compat': (str, ''),
+                    'incompat': (str, ''),
+                }, ''),
+                'required_client_features': (str, ''),
+                'data_pools': ([int], ''),
+                'info': (str, ''),
+                'fs_name': (str, ''),
+                'created': (str, ''),
+                'standby_count_wanted': (int, ''),
+                'enabled': (bool, ''),
+                'modified': (str, ''),
+                'session_timeout': (int, ''),
+                'flags': (int, ''),
+                'ever_allowed_features': (int, ''),
+                'root': (int, ''),
+            }, ''),
+            'standbys': (str, ''),
+        }], ''),
+    }, ''),
+    'health': ({
+        'checks': (str, ''),
+        'mutes': (str, ''),
+        'status': (str, ''),
+    }, ''),
+    'hosts': (int, ''),
+    'iscsi_daemons': ({
+        'up': (int, ''),
+        'down': (int, '')
+    }, ''),
+    'mgr_map': ({
+        'active_name': (str, ''),
+        'standbys': (str, '')
+    }, ''),
+    'mon_status': ({
+        'monmap': ({
+            'mons': (str, ''),
+        }, ''),
+        'quorum': ([int], '')
+    }, ''),
+    'osd_map': ({
+        'osds': ([{
+            'in': (int, ''),
+            'up': (int, ''),
+        }], '')
+    }, ''),
+    'pg_info': ({
+        'object_stats': ({
+            'num_objects': (int, ''),
+            'num_object_copies': (int, ''),
+            'num_objects_degraded': (int, ''),
+            'num_objects_misplaced': (int, ''),
+            'num_objects_unfound': (int, ''),
+        }, ''),
+        'pgs_per_osd': (int, ''),
+        'statuses': (str, '')
+    }, ''),
+    'pools': (str, ''),
+    'rgw': (int, ''),
+    'scrub_status': (str, '')
+})
+
 
 class HealthData(object):
     """
@@ -181,6 +276,7 @@ class HealthData(object):
 
 
 @ApiController('/health')
+@ControllerDoc("Display Detailed Cluster health Status", "Health")
 class Health(BaseController):
     def __init__(self):
         super(Health, self).__init__()
@@ -192,5 +288,7 @@ class Health(BaseController):
         return self.health_full.all_health()
 
     @Endpoint()
+    @EndpointDoc("Get Cluster's minimal health report",
+                 responses={200: HEALTH_MINIMAL_SCHEMA})
     def minimal(self):
         return self.health_minimal.all_health()