Get host data

To get an Alignak host data, GET on the host endpoint:

 $ curl --request GET \
   --url http://demo.alignak.net:8888/host \
   --header 'authorization: Basic MTQ4NDU1ODM2NjkyMi1iY2Y3Y2NmMS03MjM4LTQ4N2ItYWJkOS0zMGNlZDdlNDI2ZmI6' \
   --header 'cache-control: no-cache' \
   --header 'content-type: application/json' \
   --data '
   {
     "name": "passive-01",
   }'

 OR:
 $ curl --request GET \
   --url http://demo.alignak.net:8888/host/passive-01 \
   --header 'authorization: Basic MTQ4NDU1ODM2NjkyMi1iY2Y3Y2NmMS03MjM4LTQ4N2ItYWJkOS0zMGNlZDdlNDI2ZmI6' \
   --header 'cache-control: no-cache' \
   --header 'content-type: application/json'


# JSON result
{"_status": "OK", "_result": [{"ls_grafana": true, "business_impact_modulations": [], "_template_fields": [], "action_url": "", "low_flap_threshold": 25, "process_perf_data": true, "icon_image": "", "ls_last_time_down": 1506319207, "_realm": {"_updated": "Fri, 22 Sep 2017 10:20:52 GMT", "_level": 1, "_id": "59c4e40435d17b8e0c6acc61", "global_warning_threshold": 3, "name": "North", "definition_order": 100, "_children": [], "default": false, "notes": "", "hosts_critical_threshold": 5, "_all_children": [], "_parent": "59c4e38535d17b8dcb0bed42", "alias": "North country", "services_warning_threshold": 3, "global_critical_threshold": 5, "_created": "Fri, 22 Sep 2017 10:20:52 GMT", "hosts_warning_threshold": 3, "_tree_parents": ["59c4e38535d17b8dcb0bed42"], "services_critical_threshold": 5, "_etag": "8d97a350faef5d2da957c3adf00ff7bb04d96e57", "imported_from": "alignak-backend-import"}, "display_name": "", "notification_interval": 1440, "ls_execution_time": 0.0, "retry_interval": 0, "snapshot_enabled": false, "event_handler_enabled": false, "3d_coords": "", "parents": [], "location": {"type": "Point", "coordinates": [48.858293, 2.294601]}, "labels": [], "snapshot_period": {"_updated": "Fri, 22 Sep 2017 10:18:45 GMT", "name": "Never", "definition_order": 100, "_sub_realm": true, "notes": "", "is_active": true, "dateranges": [], "alias": "No time is a good time", "imported_from": "unknown", "exclude": [], "_created": "Fri, 22 Sep 2017 10:18:45 GMT", "_id": "59c4e38535d17b8dcb0bed47", "_etag": "6dad1d7c31fbaaa87188dc08ed3b2cb4c63c0077", "_realm": "59c4e38535d17b8dcb0bed42"}, "notifications_enabled": true, "address6": "", "freshness_threshold": 14400, "alias": "Passive host 1", "time_to_orphanage": 300, "name": "passive-01", "notes": "", "ls_last_notification": 0, "custom_views": [], "active_checks_enabled": false, "_templates": [{"ls_grafana": false, "business_impact_modulations": [], "labels": [], "action_url": "", "low_flap_threshold": 25, "process_perf_data": true, "business_rule_downtime_as_ack": false, "ls_last_time_down": 0, "_realm": "59c4e40435d17b8e0c6acc61", "display_name": "", "notification_interval": 1440, "ls_execution_time": 0.0, "retry_interval": 0, "snapshot_enabled": false, "event_handler_enabled": false, "3d_coords": "", "parents": [], "ls_acknowledged": false, "_template_fields": [], "snapshot_period": "59c4e38535d17b8dcb0bed47", "notifications_enabled": true, "address6": "", "freshness_threshold": 14400, "time_to_orphanage": 300, "name": "north-host", "notes": "", "ls_last_notification": 0, "high_flap_threshold": 50, "custom_views": [], "active_checks_enabled": false, "_templates": ["59c4e40535d17b8e0c6acca9"], "service_includes": [], "reactionner_tag": "", "notes_url": "", "ls_last_state": "UNREACHABLE", "ls_last_time_unknown": 0, "usergroups": ["59c4e40535d17b8e0c6acca4"], "notification_period": "59c4e40435d17b8e096acc62", "resultmodulations": [], "icon_image": "", "stalking_options": [], "_sub_realm": true, "ls_long_output": "", "macromodulations": [], "ls_state_id": 3, "business_rule_host_notification_options": ["d", "u", "r", "f", "s"], "ls_impact": false, "_is_template": true, "definition_order": 100, "tags": [], "snapshot_criteria": ["d", "x"], "vrml_image": "", "ls_latency": 0.0, "ls_downtimed": false, "ls_current_attempt": 0, "2d_coords": "", "ls_grafana_panelid": 0, "icon_set": "", "business_impact": 2, "max_check_attempts": 1, "business_rule_service_notification_options": ["w", "u", "c", "r", "f", "s"], "statusmap_image": "", "address": "", "escalations": [], "ls_next_check": 0, "check_period": "59c4e40435d17b8e096acc62", "_templates_with_services": true, "flap_detection_options": ["o", "d", "x"], "ls_last_check": 0, "_overall_state_id": 3, "ls_last_hard_state_changed": 0, "initial_state": "x", "first_notification_delay": 0, "ls_max_attempts": 0, "notification_options": ["d", "x", "r", "f"], "location": {"type": "Point", "coordinates": [48.858293, 2.294601]}, "event_handler_args": "", "event_handler": null, "check_command_args": "", "ls_last_state_changed": 0, "service_excludes": ["nsca_uptime"], "imported_from": "alignak-backend-import", "trigger_broker_raise_enabled": false, "ls_state": "UNREACHABLE", "check_command": "59c4e3a935d17b8de6a70325", "passive_checks_enabled": true, "check_interval": 5, "_created": "Fri, 22 Sep 2017 10:20:53 GMT", "_etag": "db5afdc522f7e085561b0de2eb3fdeab33b2d0c2", "check_freshness": true, "snapshot_interval": 5, "icon_image_alt": "", "ls_output": "", "ls_last_time_up": 0, "ls_passive_check": false, "ls_last_state_type": "HARD", "service_overrides": [], "maintenance_period": "59c4e38535d17b8dcb0bed47", "ls_perf_data": "", "alias": "north-host", "freshness_state": "d", "trending_policies": [], "flap_detection_enabled": true, "users": ["59c4e40535d17b8e096acc66"], "business_rule_smart_notifications": false, "ls_acknowledgement_type": 1, "customs": {"_OS": "Windows"}, "ls_attempt": 0, "trigger_name": "", "_updated": "Fri, 22 Sep 2017 10:20:55 GMT", "checkmodulations": [], "poller_tag": "", "ls_last_time_unreachable": 0, "ls_state_type": "HARD", "_id": "59c4e40535d17b8e096acc6e", "business_rule_output_template": ""}], "service_includes": [], "reactionner_tag": "None", "notes_url": "", "ls_last_state": "UNREACHABLE", "ls_last_time_unknown": 0, "usergroups": [{"_updated": "Fri, 22 Sep 2017 10:20:53 GMT", "_level": 1, "usergroups": [], "users": ["59c4e40535d17b8e096acc66"], "definition_order": 100, "_sub_realm": true, "notes": "", "_parent": "59c4e38535d17b8dcb0bed43", "alias": "North contacts", "_realm": "59c4e38535d17b8dcb0bed42", "_tree_parents": ["59c4e38535d17b8dcb0bed43"], "_created": "Fri, 22 Sep 2017 10:20:53 GMT", "_id": "59c4e40535d17b8e0c6acca4", "_etag": "1c06ca329d68b7f2b399f97671e4d84316f6466a", "imported_from": "alignak-backend-import", "name": "north"}], "notification_period": {"_updated": "Fri, 22 Sep 2017 10:20:52 GMT", "name": "north_hours", "definition_order": 100, "_sub_realm": true, "notes": "", "is_active": false, "dateranges": [{"monday": "08:00-20:00"}, {"tuesday": "08:00-20:00"}, {"friday": "08:00-20:00"}, {"wednesday": "08:00-20:00"}, {"thursday": "08:00-20:00"}], "alias": "North hours", "imported_from": "alignak-backend-import", "_created": "Fri, 22 Sep 2017 10:20:52 GMT", "exclude": [], "_id": "59c4e40435d17b8e096acc62", "_etag": "7c3be7bca3039c2ddd1ffe63612fa3fdfbfbfa9f", "_realm": "59c4e38535d17b8dcb0bed42"}, "resultmodulations": [], "business_rule_downtime_as_ack": false, "stalking_options": [], "_sub_realm": true, "ls_long_output": "", "macromodulations": [], "ls_state_id": 1, "business_rule_host_notification_options": [], "ls_impact": false, "_is_template": false, "definition_order": 100, "tags": [], "snapshot_criteria": ["d", "x"], "vrml_image": "", "ls_latency": 0.0, "ls_downtimed": false, "ls_current_attempt": 0, "2d_coords": "", "ls_grafana_panelid": 1, "icon_set": "", "business_impact": 2, "max_check_attempts": 1, "business_rule_service_notification_options": [], "statusmap_image": "", "address": "0.0.0.0", "escalations": [], "ls_next_check": 0, "check_period": {"_updated": "Fri, 22 Sep 2017 10:20:52 GMT", "name": "north_hours", "definition_order": 100, "_sub_realm": true, "notes": "", "is_active": false, "dateranges": [{"monday": "08:00-20:00"}, {"tuesday": "08:00-20:00"}, {"friday": "08:00-20:00"}, {"wednesday": "08:00-20:00"}, {"thursday": "08:00-20:00"}], "alias": "North hours", "imported_from": "alignak-backend-import", "_created": "Fri, 22 Sep 2017 10:20:52 GMT", "exclude": [], "_id": "59c4e40435d17b8e096acc62", "_etag": "7c3be7bca3039c2ddd1ffe63612fa3fdfbfbfa9f", "_realm": "59c4e38535d17b8dcb0bed42"}, "_templates_with_services": true, "flap_detection_options": ["o", "d", "x"], "ls_last_check": 0, "_overall_state_id": 3, "ls_last_hard_state_changed": 0, "_links": {"self": {"href": "host/59c4e40635d17b8e0c6accbc", "title": "Host"}}, "initial_state": "o", "first_notification_delay": 0, "ls_max_attempts": 0, "notification_options": ["d", "x", "r", "f"], "ls_acknowledged": false, "event_handler_args": "", "event_handler": null, "check_command_args": "", "ls_last_state_changed": 1506319207, "service_excludes": [], "imported_from": "alignak-backend-import", "trigger_broker_raise_enabled": false, "ls_state": "DOWN", "check_command": {"_updated": "Fri, 22 Sep 2017 10:19:21 GMT", "name": "_internal_host_up", "definition_order": 100, "poller_tag": "", "notes": "", "command_line": "_internal_host_up", "_sub_realm": true, "reactionner_tag": "", "alias": "Host/service is always UP/OK", "module_type": "fork", "imported_from": "unknown", "timeout": -1, "_created": "Fri, 22 Sep 2017 10:19:21 GMT", "_id": "59c4e3a935d17b8de6a70325", "enable_environment_macros": false, "_etag": "9c26b51b61dfe0e085f5479f3a028188cfd9a125", "_realm": "59c4e38535d17b8dcb0bed42"}, "high_flap_threshold": 50, "check_interval": 5, "_created": "Fri, 22 Sep 2017 10:20:54 GMT", "_etag": "65d521a5473711eec7c136507e0dc5ed660adeb4", "check_freshness": true, "snapshot_interval": 5, "icon_image_alt": "", "ls_output": "Freshness period expired: 2017-09-25 08:00:07 CEST", "ls_last_time_up": 0, "ls_passive_check": false, "ls_last_state_type": "HARD", "service_overrides": [], "maintenance_period": {"_updated": "Fri, 22 Sep 2017 10:18:45 GMT", "name": "Never", "definition_order": 100, "_sub_realm": true, "notes": "", "is_active": true, "dateranges": [], "alias": "No time is a good time", "imported_from": "unknown", "exclude": [], "_created": "Fri, 22 Sep 2017 10:18:45 GMT", "_id": "59c4e38535d17b8dcb0bed47", "_etag": "6dad1d7c31fbaaa87188dc08ed3b2cb4c63c0077", "_realm": "59c4e38535d17b8dcb0bed42"}, "ls_perf_data": "", "passive_checks_enabled": true, "freshness_state": "d", "trending_policies": [], "flap_detection_enabled": true, "users": [{"_templates": ["59c4e40435d17b8e0a6acc77"], "_template_fields": [], "service_notifications_enabled": true, "can_submit_commands": true, "_realm": "59c4e40435d17b8e0c6acc61", "service_notification_commands": ["59c4e40435d17b8e0c6acc95"], "address2": "none", "_sub_realm": true, "can_update_livestate": false, "email": "north.administrator@alignak.net", "_is_template": false, "definition_order": 100, "tags": [], "address1": "none", "service_notification_options": ["c", "w", "r"], "address3": "none", "address4": "none", "address5": "none", "address6": "North", "customs": {}, "is_admin": false, "skill_level": 0, "back_role_super_admin": false, "password": "pbkdf2:sha1:1000$1umJRMm9$6e8274d1c1ee8afa761b73d1ae75ee7538bae286", "pager": "0600000000", "imported_from": "alignak-backend-import", "notificationways": [], "_updated": "Fri, 22 Sep 2017 10:20:53 GMT", "host_notification_period": "59c4e38535d17b8dcb0bed46", "name": "northman", "host_notifications_enabled": true, "notes": "", "host_notification_commands": ["59c4e40435d17b8e0c6acc79"], "service_notification_period": "59c4e38535d17b8dcb0bed46", "min_business_impact": 0, "alias": "North administrator", "token": "1506075653145-4d3f8e92-1e7b-4031-93bd-4c6c02dbd175", "ui_preferences": {}, "_created": "Fri, 22 Sep 2017 10:20:53 GMT", "_id": "59c4e40535d17b8e096acc66", "_etag": "064f7a9a21b7256b59a5512d8d6bebc0eed6b7ba", "host_notification_options": ["d", "u", "r", "f", "s"]}], "business_rule_smart_notifications": false, "ls_acknowledgement_type": 1, "customs": {"_DISPLAY_NAME": "passive-01", "_OS": "Windows"}, "ls_attempt": 1, "trigger_name": "", "_updated": "Fri, 22 Sep 2017 10:20:55 GMT", "checkmodulations": [], "poller_tag": "None", "ls_last_time_unreachable": 0, "ls_state_type": "SOFT", "_id": "59c4e40635d17b8e0c6accbc", "business_rule_output_template": ""}]}

The result is a JSON object containing a _status property that should be ‘OK’ and a _result property that contain the list of the hosts fetched from the backend. Each item in this array has the properties defined in the Alignak backend for an host and it also contains the related objects (e.g. check_command, …) as thery are also defined in the backend.