From 0066aa36586680b584e86a9b47407b57dcc47b97 Mon Sep 17 00:00:00 2001 From: Stephan Fuhrmann Date: Thu, 16 Nov 2023 11:17:14 +0100 Subject: [PATCH] Add 2.1.0p17 api --- openapi-doc.yaml | 53535 +++++++++++++++++---------------------------- 1 file changed, 19866 insertions(+), 33669 deletions(-) diff --git a/openapi-doc.yaml b/openapi-doc.yaml index 35d1bff..e327359 100644 --- a/openapi-doc.yaml +++ b/openapi-doc.yaml @@ -1,24203 +1,496 @@ -info: - description: "# Introduction\n\nWith the Checkmk REST-API you can transfer and execute\ - \ the tasks you normally perform\nmanually in Checkmk's GUI to the Checkmk server\ - \ via command or script.\n\nREST stands for REpresentational State Transfer and\ - \ describes an architecture for the exchange of\ndata on distributed systems -\ - \ especially for Web services. The implementation of this REST-API is\ndone via\ - \ the HTTP/1.1 protocol, where resources are addressed via URIs and accessed with\ - \ HTTP\nmethods (GET, POST, PUT, DELETE).\n\nThe API is documented in a machine-readable\ - \ schema and a human-readable format in English, with all\nresources, their input\ - \ and output parameters and the associated value ranges. The API is created\n\ - with the OpenAPI specification 3.x, an API description format especially for REST\ - \ APIs.\n\nThe API documentation created with this specification is displayed\ - \ to you with ReDoc (a\nresponsive Web design for an OpenAPI document) or with\ - \ Swagger UI (an OpenAPI document\nvisualization for direct interaction with the\ - \ API's resources).\n\n\n# Prerequisites\n\n* You know Checkmk and its principles\ - \ of setup and configuration.\n* You are experienced in using an API, preferably\ - \ a REST-API.\n* You are familiar with at least one of the applications for which\ - \ sample code is available.\n* It helps if you have already worked with ReDoc\ - \ and/or Swagger UI.\n\n# Responses\n\nAs specified by the `Content-Type` of `application/json`,\ - \ the response payload is serialized with\nJSON and encoded in UTF-8.\n\n## JSON\ - \ envelope attributes for objects\n\nAll objects are wrapped in a JSON structure\ - \ called a \"Domain Object\" which take the following\nform:\n\n {\n \ - \ \"domainType\": ,\n \"instanceId\": ,\n \"title\": ,\n \ - \ \"links\": [, ...],\n \"extensions\": {\n \ - \ : ,\n ...\n },\n \ - \ \"members\": {\n : ,\n \ - \ ...\n }\n }\n\nThe collections `members`, `extensions` and `links`\ - \ are defined as such:\n\n * domainType - The type of object this refers to, e.g.\ - \ `host`, and `service`.\n * instanceId - The globally unique identifier for this\ - \ particular object.\n * title - A human readable string which is only relevant\ - \ for user interfaces.\n * links - A collection of links to other resources or\ - \ actions.\n * extensions - The data container for all direct attributes of the\ - \ object.\n * members - The container for external resources, like linked foreign\ - \ objects or actions.\n\n### Note\n\nPreviously, an attribute called `members`\ - \ has been used in these objects, but it will no longer be\nused. All relations\ - \ to other objects will be listed in the `links` attribute.\n\n## JSON envelope\ - \ for collections\n\nFor collections, the JSON envelope looks slightly different.\n\ - \n {\n \"domainType\": ,\n \"instanceId\": ,\n \"title\": ,\n\ - \ \"links\": [, ...],\n \"extensions\": {\n \ - \ : ,\n ...\n },\n \ - \ \"value\": [, , ...],\n }\n\n## Link\ - \ relations\n\nEvery response comes with a collection of `links` to inform the\ - \ API client on possible\nfollow-up actions. For example, a folder response can\ - \ have links to resources for updating,\ndeleting and moving the folder. The client\ - \ does not have to know about the URL structure, it\njust needs to follow the\ - \ link. In this sense, the API is quasi self-documenting.\nThis provision of additional\ - \ information as a REST-API principle is also called\n[HATEOAS](https://en.wikipedia.org/wiki/HATEOAS).\ - \ In this context,\na `rel` specifies the type of relationship of the concerning\ - \ resource to the resource that generated\nthis representation. The rel attribute\ - \ is only of informational nature for the client.\n\nObjects may have these possible\ - \ generic link relations:\n\n * self - The API location of the current object\n\ - \ * help - Documentation for the currently requested endpoint\n * collection -\ - \ The API location for a list of object of the current objects' type\n * edit\ - \ - The API location to update the current object\n * edit-form - The GUI location\ - \ to edit the current object\n * delete - The API location to delete the current\ - \ object\n\nMembers of collections have also:\n\n * item - The API location of\ - \ a member of the current collection\n\nPlease note that these (except for self)\ - \ are completely optional and may or may not be available on\ncertain endpoints.\ - \ More specialized link relations are also available:\n\n * invoke - The API location\ - \ to invoke an action\n * start - The API location to start a long running process,\ - \ which the current object represents\n * cancel - The API location to abort the\ - \ long running process, which the current object represents\n * download - The\ - \ URL to download the object described by the current endpoint\n * move - The\ - \ API location to move the current object to another destination\n\nEndpoint specific\ - \ link relations are also possible.\n\n# Updating values\n\nWhen an object is\ - \ updated by multiple requests at the same time, it can happen that the second\n\ - request will overwrite important values from the first request. This is known\ - \ as the \"lost update\nproblem\" and can be prevented by a locking scheme. The\ - \ scheme that Checkmk uses for this is called\nan \"optimistic lock\" and allows\ - \ read access even when writes are happening. It works as follows:\n\n1. The user\ - \ fetches the object to be modified.\n2. The server responds with the data and\ - \ an HTTP `ETag` header containing a value which is something\n like the \"\ - checksum\" of the object.\n3. In order to modify the object, the user sends an\ - \ update request with an HTTP `If-Match` header\n which contains the value of\ - \ the previously fetched `ETag`. This ensures that the writer has seen\n the\ - \ object to be modified. If any modifications by someone else were to happen between\ - \ the\n request (1) and the update (3) these values would not match and the\ - \ update would fail.\n4. If you are sure you are not updating objects simultaneously\ - \ and want to avoid first fetching the\n object in order to obtain its ETag\ - \ value, you can bypass this step by providing a \"*\" for the\n the 'If-Match'\ - \ header like so. `\"If-Match\": \"*\"`\n\nThis scheme is used for most `PUT`\ - \ requests throughout the REST API and always works the same way.\nDetailed documentation\ - \ of the various involved fields as well as the possible error messages can\n\ - be found on the documentation of each affected endpoint.\n\n# Querying Status\ - \ Data\n\nThe endpoints in the category \"Monitoring\" support arbitrary Livestatus\ - \ expressions (including And,\nOr combinators) and all columns of some specific\ - \ tables can be queried.\n\n### Note\n\nYou can find an introduction to basic\ - \ monitoring principles including host and service status in the\n[Checkmk guide](https://docs.checkmk.com/latest/en/monitoring_basics.html).\n\ - \n## Filter expressions\n\nA *filter expression* is a recursively defined structure\ - \ containing *binary expression nodes*,\n*negation nodes* or *combination nodes*.\ - \ With *filter expressions*, very complex Livestatus queries\ncan be constructed.\n\ - \n## Binary expression node\n\nA *binary expression node* represents one condition\ - \ on which to filter. `left` is always a\nLivestatus column name, `right` is always\ - \ a value.\n\n### Definition\n\n {'op': , 'left': , 'right': }\n\n### Operators\n\nA list of all list of all possible\n\ - [Livestatus filter operators](https://docs.checkmk.com/latest/en/livestatus_references.html#heading_filter),\n\ - can be found in the Checkmk documentation.\n\n### Example\n\nThis example filters\ - \ for an entry where the host_name equals to \"example.com\".\n\n {'op': '=',\ - \ 'left': 'host_name', 'right': 'example.com'}\n\n### Note\n\nFor the specific\ - \ table used, please consult the endpoint documentation.\n\n## Negation node\n\ - \nThere is only one negation node, the `not` expression, which logically negates\ - \ a *filter\nexpression*. `expr` is a valid *filter expression*, so any *binary\ - \ expression node*, *negation\nnode* or *combination node* may be used here.\n\ - \n### Definition\n\n {'op': 'not', 'expr': }\n\n### Example\n\ - \nThis example filters for hosts which **do not** have the host_name \"example.com\"\ - .\n\n {'op': 'not', 'expr': {'op': '=', 'left': 'host_name', 'right': 'example.com'}}\n\ - \nThis is equivalent to\n\n {'op': '!=', 'left': 'host_name', 'right': 'example.com'}\n\ - \n## Combination nodes\n\n`and` and `or` combinators are supported. They can be\ - \ nested arbitrarily. `expr` is a list of\nvalid *filter expressions*, so any\ - \ number of *binary nodes*, *negation nodes* or *combination nodes*\nmay be used\ - \ there. These expression do not have to all be of the same type, so a mix of\ - \ *binary\nexpression nodes*, *negation nodes* and *combination nodes* is also\ - \ possible.\n\n### Definition\n\nThis results in a *filter expression* in which\ - \ all the contained expression must be true:\n\n {'op': 'and', 'expr': [, ...]}\n\nThis results in a *filter expression* in which only one\ - \ of the contained expression needs to\nbe true:\n\n {'op': 'or', 'expr': [, ...]}\n\n### Example\n\nThis example filters for the host \"example.com\"\ - \ only when the `state` column is set to `0`, which\nmeans the state is OK.\n\n\ - \ {'op': 'and', 'expr': [{'op': '=', 'left': 'host_name', 'right': 'example.com'},\n\ - \ {'op': '=', 'left': 'state', 'right': 0}]}\n\n# Table\ - \ definitions\n\nThe following Livestatus tables can be queried through the REST-API.\ - \ Which table is being used\nin a particular endpoint can be seen in the endpoint\ - \ documentation.\n\n## Downtimes Table\n\n### Columns:\n\n| Column name | Type\ - \ | Description |\n| - | - | - |\n|author | string | The contact that scheduled\ - \ the downtime |\n|comment | string | A comment text |\n|duration | int | The\ - \ duration of the downtime in seconds |\n|end_time | time | The end time of the\ - \ downtime as UNIX timestamp |\n|entry_time | time | The time the entry was made\ - \ as UNIX timestamp |\n|fixed | int | A 1 if the downtime is fixed, a 0 if it\ - \ is flexible |\n|id | int | The id of the downtime |\n|is_pending | int | 1 if\ - \ the downtime is currently pending **(not active)**, 0 if it is active |\n|is_service\ - \ | int | 0, if this entry is for a host, 1 if it is for a service |\n|origin\ - \ | int | A 0 if the downtime has been set by a command, a 1 if it has been configured\ - \ by a rule |\n|recurring | int | For recurring downtimes: 1: hourly, 2: daily,\ - \ 3: weekly, 4: two-weekly, 5: four-weekly. Otherwise 0 |\n|start_time | time\ - \ | The start time of the downtime as UNIX timestamp |\n|triggered_by | int |\ - \ The ID of the downtime triggering this downtime or 0 if there is none |\n|type\ - \ | int | 1 for a service downtime, 2 for a host downtime |\n\n### Adjacent columns:\n\ - \n| Column name | Type | Description |\n| - | - | - |\n|host_accept_passive_checks\ - \ | int | Whether passive host checks are accepted **(0/1)** |\n|host_acknowledged\ - \ | int | Whether the current problem has been acknowledged **(0/1)** |\n|host_acknowledgement_type\ - \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|host_action_url\ - \ | string | An optional URL to custom actions or information about this host\ - \ |\n|host_action_url_expanded | string | The same as action_url, but with the\ - \ most important macros expanded |\n|host_active_checks_enabled | int | Whether\ - \ active checks of the object are enabled **(0/1)** |\n|host_address | string\ - \ | IP address |\n|host_alias | string | An alias name for the host |\n|host_check_command\ - \ | string | Logical command name for active checks |\n|host_check_command_expanded\ - \ | string | Logical command name for active checks, with macros expanded |\n\ - |host_check_flapping_recovery_notification | int | Whether to check to send a\ - \ recovery notification when flapping stops **(0/1)** |\n|host_check_freshness\ - \ | int | Whether freshness checks are enabled **(0/1)** |\n|host_check_interval\ - \ | float | Number of basic interval lengths between two scheduled checks |\n\ - |host_check_options | int | The current check option, forced, normal, freshness\ - \ **(0-2)** |\n|host_check_period | string | Time period in which this object\ - \ will be checked. If empty then the check will always be executed. |\n|host_check_type\ - \ | int | Type of check **(0: active, 1: passive)** |\n|host_checks_enabled |\ - \ int | Whether checks of the object are enabled **(0/1)** |\n|host_childs | list\ - \ | A list of all direct children of the host |\n|host_comments | list | A list\ - \ of the ids of all comments |\n|host_comments_with_extra_info | list | A list\ - \ of all comments with id, author, comment, entry type and entry time |\n|host_comments_with_info\ - \ | list | A list of all comments with id, author and comment |\n|host_contact_groups\ - \ | list | A list of all contact groups this object is in |\n|host_contacts |\ - \ list | A list of all contacts of this object |\n|host_current_attempt | int\ - \ | Number of the current check attempts |\n|host_current_notification_number\ - \ | int | Number of the current notification |\n|host_custom_variable_names |\ - \ list | A list of the names of the custom variables |\n|host_custom_variable_values\ - \ | list | A list of the values of the custom variables |\n|host_custom_variables\ - \ | dict | A dictionary of the custom variables |\n|host_display_name | string\ - \ | Optional display name |\n|host_downtimes | list | A list of the ids of all\ - \ scheduled downtimes of this object |\n|host_downtimes_with_extra_info | list\ - \ | A list of the scheduled downtimes with id, author, comment, origin, entry_time,\ - \ start_time, end_time, fixed, duration, recurring and is_pending |\n|host_downtimes_with_info\ - \ | list | A list of the scheduled downtimes with id, author and comment |\n|host_event_handler\ - \ | string | Command used as event handler |\n|host_event_handler_enabled | int\ - \ | Whether event handling is enabled **(0/1)** |\n|host_execution_time | float\ - \ | Time the check needed for execution |\n|host_filename | string | The value\ - \ of the custom variable FILENAME |\n|host_first_notification_delay | float |\ - \ Delay before the first notification |\n|host_flap_detection_enabled | int |\ - \ Whether flap detection is enabled **(0/1)** |\n|host_flappiness | float | The\ - \ current level of flappiness, this corresponds with the recent frequency of state\ - \ changes |\n|host_groups | list | A list of all host groups this object is in\ - \ |\n|host_hard_state | int | The effective hard state of this object |\n|host_has_been_checked\ - \ | int | Whether a check has already been executed **(0/1)** |\n|host_high_flap_threshold\ - \ | float | High threshold of flap detection |\n|host_icon_image | string | The\ - \ name of an image file to be used in the web pages |\n|host_icon_image_alt |\ - \ string | Alternative text for the icon_image |\n|host_icon_image_expanded |\ - \ string | The same as icon_image, but with the most important macros expanded\ - \ |\n|host_in_check_period | int | Whether this object is currently in its check\ - \ period **(0/1)** |\n|host_in_notification_period | int | Whether this object\ - \ is currently in its notification period **(0/1)** |\n|host_in_service_period\ - \ | int | Whether this object is currently in its service period **(0/1)** |\n\ - |host_initial_state | int | Initial state |\n|host_is_executing | int | is there\ - \ a check currently running **(0/1)** |\n|host_is_flapping | int | Whether the\ - \ state is flapping **(0/1)** |\n|host_label_names | list | A list of the names\ - \ of the labels |\n|host_label_source_names | list | A list of the names of the\ - \ label sources |\n|host_label_source_values | list | A list of the values of\ - \ the label sources |\n|host_label_sources | dict | A dictionary of the label\ - \ sources |\n|host_label_values | list | A list of the values of the labels |\n\ - |host_labels | dict | A dictionary of the labels |\n|host_last_check | time |\ - \ Time of the last check **(Unix timestamp)** |\n|host_last_hard_state | int |\ - \ Last hard state |\n|host_last_hard_state_change | time | Time of the last hard\ - \ state change - soft or hard **(Unix timestamp)** |\n|host_last_notification\ - \ | time | Time of the last notification **(Unix timestamp)** |\n|host_last_state\ - \ | int | State before last state change |\n|host_last_state_change | time | Time\ - \ of the last state change - soft or hard **(Unix timestamp)** |\n|host_last_time_down\ - \ | time | The last time the host was DOWN **(Unix timestamp)** |\n|host_last_time_unreachable\ - \ | time | The last time the host was UNREACHABLE **(Unix timestamp)** |\n|host_last_time_up\ - \ | time | The last time the host was UP **(Unix timestamp)** |\n|host_latency\ - \ | float | Time difference between scheduled check time and actual check time\ - \ |\n|host_long_plugin_output | string | Long **(extra)** output of the last check\ - \ |\n|host_low_flap_threshold | float | Low threshold of flap detection |\n|host_max_check_attempts\ - \ | int | Maximum attempts for active checks before a hard state |\n|host_metrics\ - \ | list | A list of all metrics of this object that historically existed |\n\ - |host_mk_inventory | blob | The file content of the Check_MK HW/SW-Inventory |\n\ - |host_mk_inventory_gz | blob | The gzipped file content of the Check_MK HW/SW-Inventory\ - \ |\n|host_mk_inventory_last | time | The timestamp of the last Check_MK HW/SW-Inventory\ - \ for this host. 0 means that no inventory data is present |\n|host_mk_logwatch_files\ - \ | list | This list of logfiles with problems fetched via mk_logwatch |\n|host_modified_attributes\ - \ | int | A bitmask specifying which attributes have been modified |\n|host_modified_attributes_list\ - \ | list | A list of all modified attributes |\n|host_name | string | Host name\ - \ |\n|host_next_check | time | Scheduled time for the next check **(Unix timestamp)**\ - \ |\n|host_next_notification | time | Time of the next notification **(Unix timestamp)**\ - \ |\n|host_no_more_notifications | int | Whether to stop sending notifications\ - \ **(0/1)** |\n|host_notes | string | Optional notes for this object, with macros\ - \ not expanded |\n|host_notes_expanded | string | The same as notes, but with\ - \ the most important macros expanded |\n|host_notes_url | string | An optional\ - \ URL with further information about the object |\n|host_notes_url_expanded |\ - \ string | Same es notes_url, but with the most important macros expanded |\n\ - |host_notification_interval | float | Interval of periodic notification in minutes\ - \ or 0 if its off |\n|host_notification_period | string | Time period in which\ - \ problems of this object will be notified. If empty then notification will be\ - \ always |\n|host_notification_postponement_reason | string | reason for postponing\ - \ the pending notification, empty if nothing is postponed |\n|host_notifications_enabled\ - \ | int | Whether notifications of the host are enabled **(0/1)** |\n|host_num_services\ - \ | int | The total number of services of the host |\n|host_num_services_crit\ - \ | int | The number of the host's services with the soft state CRIT |\n|host_num_services_handled_problems\ - \ | int | The number of the host's services which have handled problems |\n|host_num_services_hard_crit\ - \ | int | The number of the host's services with the hard state CRIT |\n|host_num_services_hard_ok\ - \ | int | The number of the host's services with the hard state OK |\n|host_num_services_hard_unknown\ - \ | int | The number of the host's services with the hard state UNKNOWN |\n|host_num_services_hard_warn\ - \ | int | The number of the host's services with the hard state WARN |\n|host_num_services_ok\ - \ | int | The number of the host's services with the soft state OK |\n|host_num_services_pending\ - \ | int | The number of the host's services which have not been checked yet **(pending)**\ - \ |\n|host_num_services_unhandled_problems | int | The number of the host's services\ - \ which have unhandled problems |\n|host_num_services_unknown | int | The number\ - \ of the host's services with the soft state UNKNOWN |\n|host_num_services_warn\ - \ | int | The number of the host's services with the soft state WARN |\n|host_obsess_over_host\ - \ | int | The current obsess_over_host setting **(0/1)** |\n|host_parents | list\ - \ | A list of all direct parents of the host |\n|host_pending_flex_downtime |\ - \ int | Number of pending flexible downtimes |\n|host_percent_state_change | float\ - \ | Percent state change |\n|host_perf_data | string | Optional performance data\ - \ of the last check |\n|host_plugin_output | string | Output of the last check\ - \ |\n|host_pnpgraph_present | int | Whether there is a PNP4Nagios graph present\ - \ for this object **(-1/0/1)** |\n|host_previous_hard_state | int | Previous hard\ - \ state **(that hard state before the current/last hard state)** |\n|host_process_performance_data\ - \ | int | Whether processing of performance data is enabled **(0/1)** |\n|host_retry_interval\ - \ | float | Number of basic interval lengths between checks when retrying after\ - \ a soft error |\n|host_scheduled_downtime_depth | int | The number of downtimes\ - \ this object is currently in |\n|host_service_period | string | Time period during\ - \ which the object is expected to be available |\n|host_services | list | A list\ - \ of all services of the host |\n|host_services_with_fullstate | list | A list\ - \ of all services including full state information. The list of entries can grow\ - \ in future versions. |\n|host_services_with_info | list | A list of all services\ - \ including detailed information about each service |\n|host_services_with_state\ - \ | list | A list of all services of the host together with state and has_been_checked\ - \ |\n|host_smartping_timeout | int | Maximum expected time between two received\ - \ packets in ms |\n|host_staleness | float | The staleness of this object |\n\ - |host_state | int | The current state of the object, for hosts: 0/1/2 for UP/DOWN/UNREACH,\ - \ for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN |\n|host_state_type | int | Type\ - \ of the current state **(0: soft, 1: hard)** |\n|host_statusmap_image | string\ - \ | The name of in image file for the status map |\n|host_structured_status |\ - \ blob | The file content of the structured status of the Check_MK HW/SW-Inventory\ - \ |\n|host_tag_names | list | A list of the names of the tags |\n|host_tag_values\ - \ | list | A list of the values of the tags |\n|host_tags | dict | A dictionary\ - \ of the tags |\n|host_total_services | int | The total number of services of\ - \ the host |\n|host_worst_service_hard_state | int | The worst hard state of all\ - \ of the host's services **(OK <= WARN <= UNKNOWN <= CRIT)** |\n|host_worst_service_state\ - \ | int | The worst soft state of all of the host's services **(OK <= WARN <=\ - \ UNKNOWN <= CRIT)** |\n|host_x_3d | float | 3D-Coordinates: X |\n|host_y_3d |\ - \ float | 3D-Coordinates: Y |\n|host_z_3d | float | 3D-Coordinates: Z |\n|service_accept_passive_checks\ - \ | int | Whether passive host checks are accepted **(0/1)** |\n|service_acknowledged\ - \ | int | Whether the current problem has been acknowledged **(0/1)** |\n|service_acknowledgement_type\ - \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|service_action_url\ - \ | string | An optional URL to custom actions or information about this host\ - \ |\n|service_action_url_expanded | string | The same as action_url, but with\ - \ the most important macros expanded |\n|service_active_checks_enabled | int |\ - \ Whether active checks of the object are enabled **(0/1)** |\n|service_cache_interval\ - \ | int | For checks that base on cached agent data the interval in that this\ - \ cache is recreated. 0 for other services. |\n|service_cached_at | time | For\ - \ checks that base on cached agent data the time when this data was created. 0\ - \ for other services. |\n|service_check_command | string | Logical command name\ - \ for active checks |\n|service_check_command_expanded | string | Logical command\ - \ name for active checks, with macros expanded |\n|service_check_flapping_recovery_notification\ - \ | int | Whether to check to send a recovery notification when flapping stops\ - \ **(0/1)** |\n|service_check_freshness | int | Whether freshness checks are enabled\ - \ **(0/1)** |\n|service_check_interval | float | Number of basic interval lengths\ - \ between two scheduled checks |\n|service_check_options | int | The current check\ - \ option, forced, normal, freshness **(0-2)** |\n|service_check_period | string\ - \ | Time period in which this object will be checked. If empty then the check\ - \ will always be executed. |\n|service_check_type | int | Type of check **(0:\ - \ active, 1: passive)** |\n|service_checks_enabled | int | Whether checks of the\ - \ object are enabled **(0/1)** |\n|service_comments | list | A list of the ids\ - \ of all comments |\n|service_comments_with_extra_info | list | A list of all\ - \ comments with id, author, comment, entry type and entry time |\n|service_comments_with_info\ - \ | list | A list of all comments with id, author and comment |\n|service_contact_groups\ - \ | list | A list of all contact groups this object is in |\n|service_contacts\ - \ | list | A list of all contacts of this object |\n|service_current_attempt |\ - \ int | Number of the current check attempts |\n|service_current_notification_number\ - \ | int | Number of the current notification |\n|service_custom_variable_names\ - \ | list | A list of the names of the custom variables |\n|service_custom_variable_values\ - \ | list | A list of the values of the custom variables |\n|service_custom_variables\ - \ | dict | A dictionary of the custom variables |\n|service_description | string\ - \ | Service description |\n|service_display_name | string | Optional display name\ - \ |\n|service_downtimes | list | A list of the ids of all scheduled downtimes\ - \ of this object |\n|service_downtimes_with_extra_info | list | A list of the\ - \ scheduled downtimes with id, author, comment, origin, entry_time, start_time,\ - \ end_time, fixed, duration, recurring and is_pending |\n|service_downtimes_with_info\ - \ | list | A list of the scheduled downtimes with id, author and comment |\n|service_event_handler\ - \ | string | Command used as event handler |\n|service_event_handler_enabled |\ - \ int | Whether event handling is enabled **(0/1)** |\n|service_execution_time\ - \ | float | Time the check needed for execution |\n|service_first_notification_delay\ - \ | float | Delay before the first notification |\n|service_flap_detection_enabled\ - \ | int | Whether flap detection is enabled **(0/1)** |\n|service_flappiness |\ - \ float | The current level of flappiness, this corresponds with the recent frequency\ - \ of state changes |\n|service_groups | list | A list of all service groups this\ - \ object is in |\n|service_hard_state | int | The effective hard state of this\ - \ object |\n|service_has_been_checked | int | Whether a check has already been\ - \ executed **(0/1)** |\n|service_high_flap_threshold | float | High threshold\ - \ of flap detection |\n|service_icon_image | string | The name of an image file\ - \ to be used in the web pages |\n|service_icon_image_alt | string | Alternative\ - \ text for the icon_image |\n|service_icon_image_expanded | string | The same\ - \ as icon_image, but with the most important macros expanded |\n|service_in_check_period\ - \ | int | Whether this object is currently in its check period **(0/1)** |\n|service_in_notification_period\ - \ | int | Whether this object is currently in its notification period **(0/1)**\ - \ |\n|service_in_passive_check_period | int | Whether this service is currently\ - \ in its passive check period **(0/1)** |\n|service_in_service_period | int |\ - \ Whether this object is currently in its service period **(0/1)** |\n|service_initial_state\ - \ | int | Initial state |\n|service_is_executing | int | is there a check currently\ - \ running **(0/1)** |\n|service_is_flapping | int | Whether the state is flapping\ - \ **(0/1)** |\n|service_label_names | list | A list of the names of the labels\ - \ |\n|service_label_source_names | list | A list of the names of the label sources\ - \ |\n|service_label_source_values | list | A list of the values of the label sources\ - \ |\n|service_label_sources | dict | A dictionary of the label sources |\n|service_label_values\ - \ | list | A list of the values of the labels |\n|service_labels | dict | A dictionary\ - \ of the labels |\n|service_last_check | time | Time of the last check **(Unix\ - \ timestamp)** |\n|service_last_hard_state | int | Last hard state |\n|service_last_hard_state_change\ - \ | time | Time of the last hard state change - soft or hard **(Unix timestamp)**\ - \ |\n|service_last_notification | time | Time of the last notification **(Unix\ - \ timestamp)** |\n|service_last_state | int | State before last state change |\n\ - |service_last_state_change | time | Time of the last state change - soft or hard\ - \ **(Unix timestamp)** |\n|service_last_time_critical | time | The last time the\ - \ service was CRIT **(Unix timestamp)** |\n|service_last_time_ok | time | The\ - \ last time the service was OK **(Unix timestamp)** |\n|service_last_time_unknown\ - \ | time | The last time the service was UNKNOWN **(Unix timestamp)** |\n|service_last_time_warning\ - \ | time | The last time the service was WARN **(Unix timestamp)** |\n|service_latency\ - \ | float | Time difference between scheduled check time and actual check time\ - \ |\n|service_long_plugin_output | string | Long **(extra)** output of the last\ - \ check |\n|service_low_flap_threshold | float | Low threshold of flap detection\ - \ |\n|service_max_check_attempts | int | Maximum attempts for active checks before\ - \ a hard state |\n|service_metrics | list | A list of all metrics of this object\ - \ that historically existed |\n|service_modified_attributes | int | A bitmask\ - \ specifying which attributes have been modified |\n|service_modified_attributes_list\ - \ | list | A list of all modified attributes |\n|service_next_check | time | Scheduled\ - \ time for the next check **(Unix timestamp)** |\n|service_next_notification |\ - \ time | Time of the next notification **(Unix timestamp)** |\n|service_no_more_notifications\ - \ | int | Whether to stop sending notifications **(0/1)** |\n|service_notes |\ - \ string | Optional notes for this object, with macros not expanded |\n|service_notes_expanded\ - \ | string | The same as notes, but with the most important macros expanded |\n\ - |service_notes_url | string | An optional URL with further information about the\ - \ object |\n|service_notes_url_expanded | string | Same es notes_url, but with\ - \ the most important macros expanded |\n|service_notification_interval | float\ - \ | Interval of periodic notification in minutes or 0 if its off |\n|service_notification_period\ - \ | string | Time period in which problems of this object will be notified. If\ - \ empty then notification will be always |\n|service_notification_postponement_reason\ - \ | string | reason for postponing the pending notification, empty if nothing\ - \ is postponed |\n|service_notifications_enabled | int | Whether notifications\ - \ of the host are enabled **(0/1)** |\n|service_obsess_over_service | int | The\ - \ current obsess_over_service setting **(0/1)** |\n|service_passive_check_period\ - \ | string | Time period in which this **(passive)** service will be checked.\ - \ |\n|service_pending_flex_downtime | int | Number of pending flexible downtimes\ - \ |\n|service_percent_state_change | float | Percent state change |\n|service_perf_data\ - \ | string | Optional performance data of the last check |\n|service_plugin_output\ - \ | string | Output of the last check |\n|service_pnpgraph_present | int | Whether\ - \ there is a PNP4Nagios graph present for this object **(-1/0/1)** |\n|service_previous_hard_state\ - \ | int | Previous hard state **(that hard state before the current/last hard\ - \ state)** |\n|service_process_performance_data | int | Whether processing of\ - \ performance data is enabled **(0/1)** |\n|service_retry_interval | float | Number\ - \ of basic interval lengths between checks when retrying after a soft error |\n\ - |service_robotmk_last_error_log | blob | The file content of the Robotmk error\ - \ log |\n|service_robotmk_last_error_log_gz | blob | The gzipped file content\ - \ of the Robotmk error log |\n|service_robotmk_last_log | blob | The file content\ - \ of the Robotmk log |\n|service_robotmk_last_log_gz | blob | The gzipped file\ - \ content of the Robotmk log |\n|service_scheduled_downtime_depth | int | The\ - \ number of downtimes this object is currently in |\n|service_service_period |\ - \ string | Time period during which the object is expected to be available |\n\ - |service_staleness | float | The staleness of this object |\n|service_state |\ - \ int | The current state of the object, for hosts: 0/1/2 for UP/DOWN/UNREACH,\ - \ for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN |\n|service_state_type | int\ - \ | Type of the current state **(0: soft, 1: hard)** |\n|service_tag_names | list\ - \ | A list of the names of the tags |\n|service_tag_values | list | A list of\ - \ the values of the tags |\n|service_tags | dict | A dictionary of the tags |\n\ - \n## Hostgroups Table\n\n### Columns:\n\n| Column name | Type | Description |\n\ - | - | - | - |\n|action_url | string | An optional URL to custom notes or actions\ - \ on the host group |\n|alias | string | An alias of the hostgroup |\n|members\ - \ | list | A list of all host names that are members of the hostgroup |\n|members_with_state\ - \ | list | A list of all host names that are members of the hostgroup together\ - \ with state and has_been_checked |\n|name | string | Name of the hostgroup |\n\ - |notes | string | Optional additional notes about the host group |\n|notes_url\ - \ | string | An optional URL to further notes on the host group |\n|num_hosts\ - \ | int | The total number of hosts in the group |\n|num_hosts_down | int | The\ - \ number of hosts in the group that are down |\n|num_hosts_handled_problems |\ - \ int | The total number of hosts in this group with handled problems |\n|num_hosts_pending\ - \ | int | The number of hosts in the group that are pending |\n|num_hosts_unhandled_problems\ - \ | int | The total number of hosts in this group with unhandled problems |\n\ - |num_hosts_unreach | int | The number of hosts in the group that are unreachable\ - \ |\n|num_hosts_up | int | The number of hosts in the group that are up |\n|num_services\ - \ | int | The total number of services of hosts in this group |\n|num_services_crit\ - \ | int | The total number of services with the state CRIT of hosts in this group\ - \ |\n|num_services_handled_problems | int | The total number of services of hosts\ - \ in this group with handled problems |\n|num_services_hard_crit | int | The total\ - \ number of services with the state CRIT of hosts in this group |\n|num_services_hard_ok\ - \ | int | The total number of services with the state OK of hosts in this group\ - \ |\n|num_services_hard_unknown | int | The total number of services with the\ - \ state UNKNOWN of hosts in this group |\n|num_services_hard_warn | int | The\ - \ total number of services with the state WARN of hosts in this group |\n|num_services_ok\ - \ | int | The total number of services with the state OK of hosts in this group\ - \ |\n|num_services_pending | int | The total number of services with the state\ - \ Pending of hosts in this group |\n|num_services_unhandled_problems | int | The\ - \ total number of services of hosts in this group with unhandled problems |\n\ - |num_services_unknown | int | The total number of services with the state UNKNOWN\ - \ of hosts in this group |\n|num_services_warn | int | The total number of services\ - \ with the state WARN of hosts in this group |\n|worst_host_state | int | The\ - \ worst state of all of the groups' hosts **(UP <= UNREACHABLE <= DOWN)** |\n\ - |worst_service_hard_state | int | The worst state of all services that belong\ - \ to a host of this group **(OK <= WARN <= UNKNOWN <= CRIT)** |\n|worst_service_state\ - \ | int | The worst state of all services that belong to a host of this group\ - \ **(OK <= WARN <= UNKNOWN <= CRIT)** |\n\n## Hosts Table\n\n### Columns:\n\n\ - | Column name | Type | Description |\n| - | - | - |\n|accept_passive_checks |\ - \ int | Whether passive host checks are accepted **(0/1)** |\n|acknowledged |\ - \ int | Whether the current problem has been acknowledged **(0/1)** |\n|acknowledgement_type\ - \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|action_url\ - \ | string | An optional URL to custom actions or information about this host\ - \ |\n|action_url_expanded | string | The same as action_url, but with the most\ - \ important macros expanded |\n|active_checks_enabled | int | Whether active checks\ - \ of the object are enabled **(0/1)** |\n|address | string | IP address |\n|alias\ - \ | string | An alias name for the host |\n|check_command | string | Logical command\ - \ name for active checks |\n|check_command_expanded | string | Logical command\ - \ name for active checks, with macros expanded |\n|check_flapping_recovery_notification\ - \ | int | Whether to check to send a recovery notification when flapping stops\ - \ **(0/1)** |\n|check_freshness | int | Whether freshness checks are enabled **(0/1)**\ - \ |\n|check_interval | float | Number of basic interval lengths between two scheduled\ - \ checks |\n|check_options | int | The current check option, forced, normal, freshness\ - \ **(0-2)** |\n|check_period | string | Time period in which this object will\ - \ be checked. If empty then the check will always be executed. |\n|check_type\ - \ | int | Type of check **(0: active, 1: passive)** |\n|checks_enabled | int |\ - \ Whether checks of the object are enabled **(0/1)** |\n|childs | list | A list\ - \ of all direct children of the host |\n|comments | list | A list of the ids of\ - \ all comments |\n|comments_with_extra_info | list | A list of all comments with\ - \ id, author, comment, entry type and entry time |\n|comments_with_info | list\ - \ | A list of all comments with id, author and comment |\n|contact_groups | list\ - \ | A list of all contact groups this object is in |\n|contacts | list | A list\ - \ of all contacts of this object |\n|current_attempt | int | Number of the current\ - \ check attempts |\n|current_notification_number | int | Number of the current\ - \ notification |\n|custom_variable_names | list | A list of the names of the custom\ - \ variables |\n|custom_variable_values | list | A list of the values of the custom\ - \ variables |\n|custom_variables | dict | A dictionary of the custom variables\ - \ |\n|display_name | string | Optional display name |\n|downtimes | list | A list\ - \ of the ids of all scheduled downtimes of this object |\n|downtimes_with_extra_info\ - \ | list | A list of the scheduled downtimes with id, author, comment, origin,\ - \ entry_time, start_time, end_time, fixed, duration, recurring and is_pending\ - \ |\n|downtimes_with_info | list | A list of the scheduled downtimes with id,\ - \ author and comment |\n|event_handler | string | Command used as event handler\ - \ |\n|event_handler_enabled | int | Whether event handling is enabled **(0/1)**\ - \ |\n|execution_time | float | Time the check needed for execution |\n|filename\ - \ | string | The value of the custom variable FILENAME |\n|first_notification_delay\ - \ | float | Delay before the first notification |\n|flap_detection_enabled | int\ - \ | Whether flap detection is enabled **(0/1)** |\n|flappiness | float | The current\ - \ level of flappiness, this corresponds with the recent frequency of state changes\ - \ |\n|groups | list | A list of all host groups this object is in |\n|hard_state\ - \ | int | The effective hard state of this object |\n|has_been_checked | int |\ - \ Whether a check has already been executed **(0/1)** |\n|high_flap_threshold\ - \ | float | High threshold of flap detection |\n|icon_image | string | The name\ - \ of an image file to be used in the web pages |\n|icon_image_alt | string | Alternative\ - \ text for the icon_image |\n|icon_image_expanded | string | The same as icon_image,\ - \ but with the most important macros expanded |\n|in_check_period | int | Whether\ - \ this object is currently in its check period **(0/1)** |\n|in_notification_period\ - \ | int | Whether this object is currently in its notification period **(0/1)**\ - \ |\n|in_service_period | int | Whether this object is currently in its service\ - \ period **(0/1)** |\n|initial_state | int | Initial state |\n|is_executing |\ - \ int | is there a check currently running **(0/1)** |\n|is_flapping | int | Whether\ - \ the state is flapping **(0/1)** |\n|label_names | list | A list of the names\ - \ of the labels |\n|label_source_names | list | A list of the names of the label\ - \ sources |\n|label_source_values | list | A list of the values of the label sources\ - \ |\n|label_sources | dict | A dictionary of the label sources |\n|label_values\ - \ | list | A list of the values of the labels |\n|labels | dict | A dictionary\ - \ of the labels |\n|last_check | time | Time of the last check **(Unix timestamp)**\ - \ |\n|last_hard_state | int | Last hard state |\n|last_hard_state_change | time\ - \ | Time of the last hard state change - soft or hard **(Unix timestamp)** |\n\ - |last_notification | time | Time of the last notification **(Unix timestamp)**\ - \ |\n|last_state | int | State before last state change |\n|last_state_change\ - \ | time | Time of the last state change - soft or hard **(Unix timestamp)** |\n\ - |last_time_down | time | The last time the host was DOWN **(Unix timestamp)**\ - \ |\n|last_time_unreachable | time | The last time the host was UNREACHABLE **(Unix\ - \ timestamp)** |\n|last_time_up | time | The last time the host was UP **(Unix\ - \ timestamp)** |\n|latency | float | Time difference between scheduled check time\ - \ and actual check time |\n|long_plugin_output | string | Long **(extra)** output\ - \ of the last check |\n|low_flap_threshold | float | Low threshold of flap detection\ - \ |\n|max_check_attempts | int | Maximum attempts for active checks before a hard\ - \ state |\n|metrics | list | A list of all metrics of this object that historically\ - \ existed |\n|mk_inventory | blob | The file content of the Check_MK HW/SW-Inventory\ - \ |\n|mk_inventory_gz | blob | The gzipped file content of the Check_MK HW/SW-Inventory\ - \ |\n|mk_inventory_last | time | The timestamp of the last Check_MK HW/SW-Inventory\ - \ for this host. 0 means that no inventory data is present |\n|mk_logwatch_files\ - \ | list | This list of logfiles with problems fetched via mk_logwatch |\n|modified_attributes\ - \ | int | A bitmask specifying which attributes have been modified |\n|modified_attributes_list\ - \ | list | A list of all modified attributes |\n|name | string | Host name |\n\ - |next_check | time | Scheduled time for the next check **(Unix timestamp)** |\n\ - |next_notification | time | Time of the next notification **(Unix timestamp)**\ - \ |\n|no_more_notifications | int | Whether to stop sending notifications **(0/1)**\ - \ |\n|notes | string | Optional notes for this object, with macros not expanded\ - \ |\n|notes_expanded | string | The same as notes, but with the most important\ - \ macros expanded |\n|notes_url | string | An optional URL with further information\ - \ about the object |\n|notes_url_expanded | string | Same es notes_url, but with\ - \ the most important macros expanded |\n|notification_interval | float | Interval\ - \ of periodic notification in minutes or 0 if its off |\n|notification_period\ - \ | string | Time period in which problems of this object will be notified. If\ - \ empty then notification will be always |\n|notification_postponement_reason\ - \ | string | reason for postponing the pending notification, empty if nothing\ - \ is postponed |\n|notifications_enabled | int | Whether notifications of the\ - \ host are enabled **(0/1)** |\n|num_services | int | The total number of services\ - \ of the host |\n|num_services_crit | int | The number of the host's services\ - \ with the soft state CRIT |\n|num_services_handled_problems | int | The number\ - \ of the host's services which have handled problems |\n|num_services_hard_crit\ - \ | int | The number of the host's services with the hard state CRIT |\n|num_services_hard_ok\ - \ | int | The number of the host's services with the hard state OK |\n|num_services_hard_unknown\ - \ | int | The number of the host's services with the hard state UNKNOWN |\n|num_services_hard_warn\ - \ | int | The number of the host's services with the hard state WARN |\n|num_services_ok\ - \ | int | The number of the host's services with the soft state OK |\n|num_services_pending\ - \ | int | The number of the host's services which have not been checked yet **(pending)**\ - \ |\n|num_services_unhandled_problems | int | The number of the host's services\ - \ which have unhandled problems |\n|num_services_unknown | int | The number of\ - \ the host's services with the soft state UNKNOWN |\n|num_services_warn | int\ - \ | The number of the host's services with the soft state WARN |\n|obsess_over_host\ - \ | int | The current obsess_over_host setting **(0/1)** |\n|parents | list |\ - \ A list of all direct parents of the host |\n|pending_flex_downtime | int | Number\ - \ of pending flexible downtimes |\n|percent_state_change | float | Percent state\ - \ change |\n|perf_data | string | Optional performance data of the last check\ - \ |\n|plugin_output | string | Output of the last check |\n|pnpgraph_present |\ - \ int | Whether there is a PNP4Nagios graph present for this object **(-1/0/1)**\ - \ |\n|previous_hard_state | int | Previous hard state **(that hard state before\ - \ the current/last hard state)** |\n|process_performance_data | int | Whether\ - \ processing of performance data is enabled **(0/1)** |\n|retry_interval | float\ - \ | Number of basic interval lengths between checks when retrying after a soft\ - \ error |\n|scheduled_downtime_depth | int | The number of downtimes this object\ - \ is currently in |\n|service_period | string | Time period during which the object\ - \ is expected to be available |\n|services | list | A list of all services of\ - \ the host |\n|services_with_fullstate | list | A list of all services including\ - \ full state information. The list of entries can grow in future versions. |\n\ - |services_with_info | list | A list of all services including detailed information\ - \ about each service |\n|services_with_state | list | A list of all services of\ - \ the host together with state and has_been_checked |\n|smartping_timeout | int\ - \ | Maximum expected time between two received packets in ms |\n|staleness | float\ - \ | The staleness of this object |\n|state | int | The current state of the object,\ - \ for hosts: 0/1/2 for UP/DOWN/UNREACH, for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN\ - \ |\n|state_type | int | Type of the current state **(0: soft, 1: hard)** |\n\ - |statusmap_image | string | The name of in image file for the status map |\n|structured_status\ - \ | blob | The file content of the structured status of the Check_MK HW/SW-Inventory\ - \ |\n|tag_names | list | A list of the names of the tags |\n|tag_values | list\ - \ | A list of the values of the tags |\n|tags | dict | A dictionary of the tags\ - \ |\n|total_services | int | The total number of services of the host |\n|worst_service_hard_state\ - \ | int | The worst hard state of all of the host's services **(OK <= WARN <=\ - \ UNKNOWN <= CRIT)** |\n|worst_service_state | int | The worst soft state of all\ - \ of the host's services **(OK <= WARN <= UNKNOWN <= CRIT)** |\n|x_3d | float\ - \ | 3D-Coordinates: X |\n|y_3d | float | 3D-Coordinates: Y |\n|z_3d | float |\ - \ 3D-Coordinates: Z |\n\n## Servicegroups Table\n\n### Columns:\n\n| Column name\ - \ | Type | Description |\n| - | - | - |\n|action_url | string | An optional URL\ - \ to custom notes or actions on the service group |\n|alias | string | An alias\ - \ of the servicegroup |\n|members | list | A list of all members of the service\ - \ group as host/service pairs |\n|members_with_state | list | A list of all members\ - \ of the service group with state and has_been_checked |\n|name | string | Name\ - \ of the servicegroup |\n|notes | string | Optional additional notes about the\ - \ service group |\n|notes_url | string | An optional URL to further notes on the\ - \ service group |\n|num_services | int | The total number of services in the group\ - \ |\n|num_services_crit | int | The number of services in the group that are CRIT\ - \ |\n|num_services_handled_problems | int | The number of services in the group\ - \ that have handled problems |\n|num_services_hard_crit | int | The number of\ - \ services in the group that are CRIT |\n|num_services_hard_ok | int | The number\ - \ of services in the group that are OK |\n|num_services_hard_unknown | int | The\ - \ number of services in the group that are UNKNOWN |\n|num_services_hard_warn\ - \ | int | The number of services in the group that are WARN |\n|num_services_ok\ - \ | int | The number of services in the group that are OK |\n|num_services_pending\ - \ | int | The number of services in the group that are PENDING |\n|num_services_unhandled_problems\ - \ | int | The number of services in the group that have unhandled problems |\n\ - |num_services_unknown | int | The number of services in the group that are UNKNOWN\ - \ |\n|num_services_warn | int | The number of services in the group that are WARN\ - \ |\n|worst_service_state | int | The worst soft state of all of the groups services\ - \ **(OK <= WARN <= UNKNOWN <= CRIT)** |\n\n## Services Table\n\n### Columns:\n\ - \n| Column name | Type | Description |\n| - | - | - |\n|accept_passive_checks\ - \ | int | Whether passive host checks are accepted **(0/1)** |\n|acknowledged\ - \ | int | Whether the current problem has been acknowledged **(0/1)** |\n|acknowledgement_type\ - \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|action_url\ - \ | string | An optional URL to custom actions or information about this host\ - \ |\n|action_url_expanded | string | The same as action_url, but with the most\ - \ important macros expanded |\n|active_checks_enabled | int | Whether active checks\ - \ of the object are enabled **(0/1)** |\n|cache_interval | int | For checks that\ - \ base on cached agent data the interval in that this cache is recreated. 0 for\ - \ other services. |\n|cached_at | time | For checks that base on cached agent\ - \ data the time when this data was created. 0 for other services. |\n|check_command\ - \ | string | Logical command name for active checks |\n|check_command_expanded\ - \ | string | Logical command name for active checks, with macros expanded |\n\ - |check_flapping_recovery_notification | int | Whether to check to send a recovery\ - \ notification when flapping stops **(0/1)** |\n|check_freshness | int | Whether\ - \ freshness checks are enabled **(0/1)** |\n|check_interval | float | Number of\ - \ basic interval lengths between two scheduled checks |\n|check_options | int\ - \ | The current check option, forced, normal, freshness **(0-2)** |\n|check_period\ - \ | string | Time period in which this object will be checked. If empty then the\ - \ check will always be executed. |\n|check_type | int | Type of check **(0: active,\ - \ 1: passive)** |\n|checks_enabled | int | Whether checks of the object are enabled\ - \ **(0/1)** |\n|comments | list | A list of the ids of all comments |\n|comments_with_extra_info\ - \ | list | A list of all comments with id, author, comment, entry type and entry\ - \ time |\n|comments_with_info | list | A list of all comments with id, author\ - \ and comment |\n|contact_groups | list | A list of all contact groups this object\ - \ is in |\n|contacts | list | A list of all contacts of this object |\n|current_attempt\ - \ | int | Number of the current check attempts |\n|current_notification_number\ - \ | int | Number of the current notification |\n|custom_variable_names | list\ - \ | A list of the names of the custom variables |\n|custom_variable_values | list\ - \ | A list of the values of the custom variables |\n|custom_variables | dict |\ - \ A dictionary of the custom variables |\n|description | string | Service description\ - \ |\n|display_name | string | Optional display name |\n|downtimes | list | A list\ - \ of the ids of all scheduled downtimes of this object |\n|downtimes_with_extra_info\ - \ | list | A list of the scheduled downtimes with id, author, comment, origin,\ - \ entry_time, start_time, end_time, fixed, duration, recurring and is_pending\ - \ |\n|downtimes_with_info | list | A list of the scheduled downtimes with id,\ - \ author and comment |\n|event_handler | string | Command used as event handler\ - \ |\n|event_handler_enabled | int | Whether event handling is enabled **(0/1)**\ - \ |\n|execution_time | float | Time the check needed for execution |\n|first_notification_delay\ - \ | float | Delay before the first notification |\n|flap_detection_enabled | int\ - \ | Whether flap detection is enabled **(0/1)** |\n|flappiness | float | The current\ - \ level of flappiness, this corresponds with the recent frequency of state changes\ - \ |\n|groups | list | A list of all service groups this object is in |\n|hard_state\ - \ | int | The effective hard state of this object |\n|has_been_checked | int |\ - \ Whether a check has already been executed **(0/1)** |\n|high_flap_threshold\ - \ | float | High threshold of flap detection |\n|icon_image | string | The name\ - \ of an image file to be used in the web pages |\n|icon_image_alt | string | Alternative\ - \ text for the icon_image |\n|icon_image_expanded | string | The same as icon_image,\ - \ but with the most important macros expanded |\n|in_check_period | int | Whether\ - \ this object is currently in its check period **(0/1)** |\n|in_notification_period\ - \ | int | Whether this object is currently in its notification period **(0/1)**\ - \ |\n|in_passive_check_period | int | Whether this service is currently in its\ - \ passive check period **(0/1)** |\n|in_service_period | int | Whether this object\ - \ is currently in its service period **(0/1)** |\n|initial_state | int | Initial\ - \ state |\n|is_executing | int | is there a check currently running **(0/1)**\ - \ |\n|is_flapping | int | Whether the state is flapping **(0/1)** |\n|label_names\ - \ | list | A list of the names of the labels |\n|label_source_names | list | A\ - \ list of the names of the label sources |\n|label_source_values | list | A list\ - \ of the values of the label sources |\n|label_sources | dict | A dictionary of\ - \ the label sources |\n|label_values | list | A list of the values of the labels\ - \ |\n|labels | dict | A dictionary of the labels |\n|last_check | time | Time\ - \ of the last check **(Unix timestamp)** |\n|last_hard_state | int | Last hard\ - \ state |\n|last_hard_state_change | time | Time of the last hard state change\ - \ - soft or hard **(Unix timestamp)** |\n|last_notification | time | Time of the\ - \ last notification **(Unix timestamp)** |\n|last_state | int | State before last\ - \ state change |\n|last_state_change | time | Time of the last state change -\ - \ soft or hard **(Unix timestamp)** |\n|last_time_critical | time | The last time\ - \ the service was CRIT **(Unix timestamp)** |\n|last_time_ok | time | The last\ - \ time the service was OK **(Unix timestamp)** |\n|last_time_unknown | time |\ - \ The last time the service was UNKNOWN **(Unix timestamp)** |\n|last_time_warning\ - \ | time | The last time the service was WARN **(Unix timestamp)** |\n|latency\ - \ | float | Time difference between scheduled check time and actual check time\ - \ |\n|long_plugin_output | string | Long **(extra)** output of the last check\ - \ |\n|low_flap_threshold | float | Low threshold of flap detection |\n|max_check_attempts\ - \ | int | Maximum attempts for active checks before a hard state |\n|metrics |\ - \ list | A list of all metrics of this object that historically existed |\n|modified_attributes\ - \ | int | A bitmask specifying which attributes have been modified |\n|modified_attributes_list\ - \ | list | A list of all modified attributes |\n|next_check | time | Scheduled\ - \ time for the next check **(Unix timestamp)** |\n|next_notification | time |\ - \ Time of the next notification **(Unix timestamp)** |\n|no_more_notifications\ - \ | int | Whether to stop sending notifications **(0/1)** |\n|notes | string |\ - \ Optional notes for this object, with macros not expanded |\n|notes_expanded\ - \ | string | The same as notes, but with the most important macros expanded |\n\ - |notes_url | string | An optional URL with further information about the object\ - \ |\n|notes_url_expanded | string | Same es notes_url, but with the most important\ - \ macros expanded |\n|notification_interval | float | Interval of periodic notification\ - \ in minutes or 0 if its off |\n|notification_period | string | Time period in\ - \ which problems of this object will be notified. If empty then notification will\ - \ be always |\n|notification_postponement_reason | string | reason for postponing\ - \ the pending notification, empty if nothing is postponed |\n|notifications_enabled\ - \ | int | Whether notifications of the host are enabled **(0/1)** |\n|obsess_over_service\ - \ | int | The current obsess_over_service setting **(0/1)** |\n|passive_check_period\ - \ | string | Time period in which this **(passive)** service will be checked.\ - \ |\n|pending_flex_downtime | int | Number of pending flexible downtimes |\n|percent_state_change\ - \ | float | Percent state change |\n|perf_data | string | Optional performance\ - \ data of the last check |\n|plugin_output | string | Output of the last check\ - \ |\n|pnpgraph_present | int | Whether there is a PNP4Nagios graph present for\ - \ this object **(-1/0/1)** |\n|previous_hard_state | int | Previous hard state\ - \ **(that hard state before the current/last hard state)** |\n|process_performance_data\ - \ | int | Whether processing of performance data is enabled **(0/1)** |\n|retry_interval\ - \ | float | Number of basic interval lengths between checks when retrying after\ - \ a soft error |\n|robotmk_last_error_log | blob | The file content of the Robotmk\ - \ error log |\n|robotmk_last_error_log_gz | blob | The gzipped file content of\ - \ the Robotmk error log |\n|robotmk_last_log | blob | The file content of the\ - \ Robotmk log |\n|robotmk_last_log_gz | blob | The gzipped file content of the\ - \ Robotmk log |\n|scheduled_downtime_depth | int | The number of downtimes this\ - \ object is currently in |\n|service_period | string | Time period during which\ - \ the object is expected to be available |\n|staleness | float | The staleness\ - \ of this object |\n|state | int | The current state of the object, for hosts:\ - \ 0/1/2 for UP/DOWN/UNREACH, for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN |\n\ - |state_type | int | Type of the current state **(0: soft, 1: hard)** |\n|tag_names\ - \ | list | A list of the names of the tags |\n|tag_values | list | A list of the\ - \ values of the tags |\n|tags | dict | A dictionary of the tags |\n\n### Adjacent\ - \ columns:\n\n| Column name | Type | Description |\n| - | - | - |\n|host_accept_passive_checks\ - \ | int | Whether passive host checks are accepted **(0/1)** |\n|host_acknowledged\ - \ | int | Whether the current problem has been acknowledged **(0/1)** |\n|host_acknowledgement_type\ - \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|host_action_url\ - \ | string | An optional URL to custom actions or information about this host\ - \ |\n|host_action_url_expanded | string | The same as action_url, but with the\ - \ most important macros expanded |\n|host_active_checks_enabled | int | Whether\ - \ active checks of the object are enabled **(0/1)** |\n|host_address | string\ - \ | IP address |\n|host_alias | string | An alias name for the host |\n|host_check_command\ - \ | string | Logical command name for active checks |\n|host_check_command_expanded\ - \ | string | Logical command name for active checks, with macros expanded |\n\ - |host_check_flapping_recovery_notification | int | Whether to check to send a\ - \ recovery notification when flapping stops **(0/1)** |\n|host_check_freshness\ - \ | int | Whether freshness checks are enabled **(0/1)** |\n|host_check_interval\ - \ | float | Number of basic interval lengths between two scheduled checks |\n\ - |host_check_options | int | The current check option, forced, normal, freshness\ - \ **(0-2)** |\n|host_check_period | string | Time period in which this object\ - \ will be checked. If empty then the check will always be executed. |\n|host_check_type\ - \ | int | Type of check **(0: active, 1: passive)** |\n|host_checks_enabled |\ - \ int | Whether checks of the object are enabled **(0/1)** |\n|host_childs | list\ - \ | A list of all direct children of the host |\n|host_comments | list | A list\ - \ of the ids of all comments |\n|host_comments_with_extra_info | list | A list\ - \ of all comments with id, author, comment, entry type and entry time |\n|host_comments_with_info\ - \ | list | A list of all comments with id, author and comment |\n|host_contact_groups\ - \ | list | A list of all contact groups this object is in |\n|host_contacts |\ - \ list | A list of all contacts of this object |\n|host_current_attempt | int\ - \ | Number of the current check attempts |\n|host_current_notification_number\ - \ | int | Number of the current notification |\n|host_custom_variable_names |\ - \ list | A list of the names of the custom variables |\n|host_custom_variable_values\ - \ | list | A list of the values of the custom variables |\n|host_custom_variables\ - \ | dict | A dictionary of the custom variables |\n|host_display_name | string\ - \ | Optional display name |\n|host_downtimes | list | A list of the ids of all\ - \ scheduled downtimes of this object |\n|host_downtimes_with_extra_info | list\ - \ | A list of the scheduled downtimes with id, author, comment, origin, entry_time,\ - \ start_time, end_time, fixed, duration, recurring and is_pending |\n|host_downtimes_with_info\ - \ | list | A list of the scheduled downtimes with id, author and comment |\n|host_event_handler\ - \ | string | Command used as event handler |\n|host_event_handler_enabled | int\ - \ | Whether event handling is enabled **(0/1)** |\n|host_execution_time | float\ - \ | Time the check needed for execution |\n|host_filename | string | The value\ - \ of the custom variable FILENAME |\n|host_first_notification_delay | float |\ - \ Delay before the first notification |\n|host_flap_detection_enabled | int |\ - \ Whether flap detection is enabled **(0/1)** |\n|host_flappiness | float | The\ - \ current level of flappiness, this corresponds with the recent frequency of state\ - \ changes |\n|host_groups | list | A list of all host groups this object is in\ - \ |\n|host_hard_state | int | The effective hard state of this object |\n|host_has_been_checked\ - \ | int | Whether a check has already been executed **(0/1)** |\n|host_high_flap_threshold\ - \ | float | High threshold of flap detection |\n|host_icon_image | string | The\ - \ name of an image file to be used in the web pages |\n|host_icon_image_alt |\ - \ string | Alternative text for the icon_image |\n|host_icon_image_expanded |\ - \ string | The same as icon_image, but with the most important macros expanded\ - \ |\n|host_in_check_period | int | Whether this object is currently in its check\ - \ period **(0/1)** |\n|host_in_notification_period | int | Whether this object\ - \ is currently in its notification period **(0/1)** |\n|host_in_service_period\ - \ | int | Whether this object is currently in its service period **(0/1)** |\n\ - |host_initial_state | int | Initial state |\n|host_is_executing | int | is there\ - \ a check currently running **(0/1)** |\n|host_is_flapping | int | Whether the\ - \ state is flapping **(0/1)** |\n|host_label_names | list | A list of the names\ - \ of the labels |\n|host_label_source_names | list | A list of the names of the\ - \ label sources |\n|host_label_source_values | list | A list of the values of\ - \ the label sources |\n|host_label_sources | dict | A dictionary of the label\ - \ sources |\n|host_label_values | list | A list of the values of the labels |\n\ - |host_labels | dict | A dictionary of the labels |\n|host_last_check | time |\ - \ Time of the last check **(Unix timestamp)** |\n|host_last_hard_state | int |\ - \ Last hard state |\n|host_last_hard_state_change | time | Time of the last hard\ - \ state change - soft or hard **(Unix timestamp)** |\n|host_last_notification\ - \ | time | Time of the last notification **(Unix timestamp)** |\n|host_last_state\ - \ | int | State before last state change |\n|host_last_state_change | time | Time\ - \ of the last state change - soft or hard **(Unix timestamp)** |\n|host_last_time_down\ - \ | time | The last time the host was DOWN **(Unix timestamp)** |\n|host_last_time_unreachable\ - \ | time | The last time the host was UNREACHABLE **(Unix timestamp)** |\n|host_last_time_up\ - \ | time | The last time the host was UP **(Unix timestamp)** |\n|host_latency\ - \ | float | Time difference between scheduled check time and actual check time\ - \ |\n|host_long_plugin_output | string | Long **(extra)** output of the last check\ - \ |\n|host_low_flap_threshold | float | Low threshold of flap detection |\n|host_max_check_attempts\ - \ | int | Maximum attempts for active checks before a hard state |\n|host_metrics\ - \ | list | A list of all metrics of this object that historically existed |\n\ - |host_mk_inventory | blob | The file content of the Check_MK HW/SW-Inventory |\n\ - |host_mk_inventory_gz | blob | The gzipped file content of the Check_MK HW/SW-Inventory\ - \ |\n|host_mk_inventory_last | time | The timestamp of the last Check_MK HW/SW-Inventory\ - \ for this host. 0 means that no inventory data is present |\n|host_mk_logwatch_files\ - \ | list | This list of logfiles with problems fetched via mk_logwatch |\n|host_modified_attributes\ - \ | int | A bitmask specifying which attributes have been modified |\n|host_modified_attributes_list\ - \ | list | A list of all modified attributes |\n|host_name | string | Host name\ - \ |\n|host_next_check | time | Scheduled time for the next check **(Unix timestamp)**\ - \ |\n|host_next_notification | time | Time of the next notification **(Unix timestamp)**\ - \ |\n|host_no_more_notifications | int | Whether to stop sending notifications\ - \ **(0/1)** |\n|host_notes | string | Optional notes for this object, with macros\ - \ not expanded |\n|host_notes_expanded | string | The same as notes, but with\ - \ the most important macros expanded |\n|host_notes_url | string | An optional\ - \ URL with further information about the object |\n|host_notes_url_expanded |\ - \ string | Same es notes_url, but with the most important macros expanded |\n\ - |host_notification_interval | float | Interval of periodic notification in minutes\ - \ or 0 if its off |\n|host_notification_period | string | Time period in which\ - \ problems of this object will be notified. If empty then notification will be\ - \ always |\n|host_notification_postponement_reason | string | reason for postponing\ - \ the pending notification, empty if nothing is postponed |\n|host_notifications_enabled\ - \ | int | Whether notifications of the host are enabled **(0/1)** |\n|host_num_services\ - \ | int | The total number of services of the host |\n|host_num_services_crit\ - \ | int | The number of the host's services with the soft state CRIT |\n|host_num_services_handled_problems\ - \ | int | The number of the host's services which have handled problems |\n|host_num_services_hard_crit\ - \ | int | The number of the host's services with the hard state CRIT |\n|host_num_services_hard_ok\ - \ | int | The number of the host's services with the hard state OK |\n|host_num_services_hard_unknown\ - \ | int | The number of the host's services with the hard state UNKNOWN |\n|host_num_services_hard_warn\ - \ | int | The number of the host's services with the hard state WARN |\n|host_num_services_ok\ - \ | int | The number of the host's services with the soft state OK |\n|host_num_services_pending\ - \ | int | The number of the host's services which have not been checked yet **(pending)**\ - \ |\n|host_num_services_unhandled_problems | int | The number of the host's services\ - \ which have unhandled problems |\n|host_num_services_unknown | int | The number\ - \ of the host's services with the soft state UNKNOWN |\n|host_num_services_warn\ - \ | int | The number of the host's services with the soft state WARN |\n|host_obsess_over_host\ - \ | int | The current obsess_over_host setting **(0/1)** |\n|host_parents | list\ - \ | A list of all direct parents of the host |\n|host_pending_flex_downtime |\ - \ int | Number of pending flexible downtimes |\n|host_percent_state_change | float\ - \ | Percent state change |\n|host_perf_data | string | Optional performance data\ - \ of the last check |\n|host_plugin_output | string | Output of the last check\ - \ |\n|host_pnpgraph_present | int | Whether there is a PNP4Nagios graph present\ - \ for this object **(-1/0/1)** |\n|host_previous_hard_state | int | Previous hard\ - \ state **(that hard state before the current/last hard state)** |\n|host_process_performance_data\ - \ | int | Whether processing of performance data is enabled **(0/1)** |\n|host_retry_interval\ - \ | float | Number of basic interval lengths between checks when retrying after\ - \ a soft error |\n|host_scheduled_downtime_depth | int | The number of downtimes\ - \ this object is currently in |\n|host_service_period | string | Time period during\ - \ which the object is expected to be available |\n|host_services | list | A list\ - \ of all services of the host |\n|host_services_with_fullstate | list | A list\ - \ of all services including full state information. The list of entries can grow\ - \ in future versions. |\n|host_services_with_info | list | A list of all services\ - \ including detailed information about each service |\n|host_services_with_state\ - \ | list | A list of all services of the host together with state and has_been_checked\ - \ |\n|host_smartping_timeout | int | Maximum expected time between two received\ - \ packets in ms |\n|host_staleness | float | The staleness of this object |\n\ - |host_state | int | The current state of the object, for hosts: 0/1/2 for UP/DOWN/UNREACH,\ - \ for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN |\n|host_state_type | int | Type\ - \ of the current state **(0: soft, 1: hard)** |\n|host_statusmap_image | string\ - \ | The name of in image file for the status map |\n|host_structured_status |\ - \ blob | The file content of the structured status of the Check_MK HW/SW-Inventory\ - \ |\n|host_tag_names | list | A list of the names of the tags |\n|host_tag_values\ - \ | list | A list of the values of the tags |\n|host_tags | dict | A dictionary\ - \ of the tags |\n|host_total_services | int | The total number of services of\ - \ the host |\n|host_worst_service_hard_state | int | The worst hard state of all\ - \ of the host's services **(OK <= WARN <= UNKNOWN <= CRIT)** |\n|host_worst_service_state\ - \ | int | The worst soft state of all of the host's services **(OK <= WARN <=\ - \ UNKNOWN <= CRIT)** |\n|host_x_3d | float | 3D-Coordinates: X |\n|host_y_3d |\ - \ float | 3D-Coordinates: Y |\n|host_z_3d | float | 3D-Coordinates: Z |\n\n##\ - \ Comments Table\n\n### Columns:\n\n| Column name | Type | Description |\n| -\ - \ | - | - |\n|author | string | The contact that entered the comment |\n|comment\ - \ | string | A comment text |\n|entry_time | time | The time the entry was made\ - \ as UNIX timestamp |\n|entry_type | int | The type of the comment: 1 is user,\ - \ 2 is downtime, 3 is flapping and 4 is acknowledgement |\n|expire_time | time\ - \ | The time of expiry of this comment as a UNIX timestamp |\n|expires | int |\ - \ Whether this comment expires |\n|id | int | The id of the comment |\n|is_service\ - \ | int | 0, if this entry is for a host, 1 if it is for a service |\n|persistent\ - \ | int | Whether this comment is persistent **(0/1)** |\n|source | int | The\ - \ source of the comment **(0 is internal and 1 is external)** |\n|type | int |\ - \ The type of the comment: 1 is host, 2 is service |\n\n### Adjacent columns:\n\ - \n| Column name | Type | Description |\n| - | - | - |\n|host_accept_passive_checks\ - \ | int | Whether passive host checks are accepted **(0/1)** |\n|host_acknowledged\ - \ | int | Whether the current problem has been acknowledged **(0/1)** |\n|host_acknowledgement_type\ - \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|host_action_url\ - \ | string | An optional URL to custom actions or information about this host\ - \ |\n|host_action_url_expanded | string | The same as action_url, but with the\ - \ most important macros expanded |\n|host_active_checks_enabled | int | Whether\ - \ active checks of the object are enabled **(0/1)** |\n|host_address | string\ - \ | IP address |\n|host_alias | string | An alias name for the host |\n|host_check_command\ - \ | string | Logical command name for active checks |\n|host_check_command_expanded\ - \ | string | Logical command name for active checks, with macros expanded |\n\ - |host_check_flapping_recovery_notification | int | Whether to check to send a\ - \ recovery notification when flapping stops **(0/1)** |\n|host_check_freshness\ - \ | int | Whether freshness checks are enabled **(0/1)** |\n|host_check_interval\ - \ | float | Number of basic interval lengths between two scheduled checks |\n\ - |host_check_options | int | The current check option, forced, normal, freshness\ - \ **(0-2)** |\n|host_check_period | string | Time period in which this object\ - \ will be checked. If empty then the check will always be executed. |\n|host_check_type\ - \ | int | Type of check **(0: active, 1: passive)** |\n|host_checks_enabled |\ - \ int | Whether checks of the object are enabled **(0/1)** |\n|host_childs | list\ - \ | A list of all direct children of the host |\n|host_comments | list | A list\ - \ of the ids of all comments |\n|host_comments_with_extra_info | list | A list\ - \ of all comments with id, author, comment, entry type and entry time |\n|host_comments_with_info\ - \ | list | A list of all comments with id, author and comment |\n|host_contact_groups\ - \ | list | A list of all contact groups this object is in |\n|host_contacts |\ - \ list | A list of all contacts of this object |\n|host_current_attempt | int\ - \ | Number of the current check attempts |\n|host_current_notification_number\ - \ | int | Number of the current notification |\n|host_custom_variable_names |\ - \ list | A list of the names of the custom variables |\n|host_custom_variable_values\ - \ | list | A list of the values of the custom variables |\n|host_custom_variables\ - \ | dict | A dictionary of the custom variables |\n|host_display_name | string\ - \ | Optional display name |\n|host_downtimes | list | A list of the ids of all\ - \ scheduled downtimes of this object |\n|host_downtimes_with_extra_info | list\ - \ | A list of the scheduled downtimes with id, author, comment, origin, entry_time,\ - \ start_time, end_time, fixed, duration, recurring and is_pending |\n|host_downtimes_with_info\ - \ | list | A list of the scheduled downtimes with id, author and comment |\n|host_event_handler\ - \ | string | Command used as event handler |\n|host_event_handler_enabled | int\ - \ | Whether event handling is enabled **(0/1)** |\n|host_execution_time | float\ - \ | Time the check needed for execution |\n|host_filename | string | The value\ - \ of the custom variable FILENAME |\n|host_first_notification_delay | float |\ - \ Delay before the first notification |\n|host_flap_detection_enabled | int |\ - \ Whether flap detection is enabled **(0/1)** |\n|host_flappiness | float | The\ - \ current level of flappiness, this corresponds with the recent frequency of state\ - \ changes |\n|host_groups | list | A list of all host groups this object is in\ - \ |\n|host_hard_state | int | The effective hard state of this object |\n|host_has_been_checked\ - \ | int | Whether a check has already been executed **(0/1)** |\n|host_high_flap_threshold\ - \ | float | High threshold of flap detection |\n|host_icon_image | string | The\ - \ name of an image file to be used in the web pages |\n|host_icon_image_alt |\ - \ string | Alternative text for the icon_image |\n|host_icon_image_expanded |\ - \ string | The same as icon_image, but with the most important macros expanded\ - \ |\n|host_in_check_period | int | Whether this object is currently in its check\ - \ period **(0/1)** |\n|host_in_notification_period | int | Whether this object\ - \ is currently in its notification period **(0/1)** |\n|host_in_service_period\ - \ | int | Whether this object is currently in its service period **(0/1)** |\n\ - |host_initial_state | int | Initial state |\n|host_is_executing | int | is there\ - \ a check currently running **(0/1)** |\n|host_is_flapping | int | Whether the\ - \ state is flapping **(0/1)** |\n|host_label_names | list | A list of the names\ - \ of the labels |\n|host_label_source_names | list | A list of the names of the\ - \ label sources |\n|host_label_source_values | list | A list of the values of\ - \ the label sources |\n|host_label_sources | dict | A dictionary of the label\ - \ sources |\n|host_label_values | list | A list of the values of the labels |\n\ - |host_labels | dict | A dictionary of the labels |\n|host_last_check | time |\ - \ Time of the last check **(Unix timestamp)** |\n|host_last_hard_state | int |\ - \ Last hard state |\n|host_last_hard_state_change | time | Time of the last hard\ - \ state change - soft or hard **(Unix timestamp)** |\n|host_last_notification\ - \ | time | Time of the last notification **(Unix timestamp)** |\n|host_last_state\ - \ | int | State before last state change |\n|host_last_state_change | time | Time\ - \ of the last state change - soft or hard **(Unix timestamp)** |\n|host_last_time_down\ - \ | time | The last time the host was DOWN **(Unix timestamp)** |\n|host_last_time_unreachable\ - \ | time | The last time the host was UNREACHABLE **(Unix timestamp)** |\n|host_last_time_up\ - \ | time | The last time the host was UP **(Unix timestamp)** |\n|host_latency\ - \ | float | Time difference between scheduled check time and actual check time\ - \ |\n|host_long_plugin_output | string | Long **(extra)** output of the last check\ - \ |\n|host_low_flap_threshold | float | Low threshold of flap detection |\n|host_max_check_attempts\ - \ | int | Maximum attempts for active checks before a hard state |\n|host_metrics\ - \ | list | A list of all metrics of this object that historically existed |\n\ - |host_mk_inventory | blob | The file content of the Check_MK HW/SW-Inventory |\n\ - |host_mk_inventory_gz | blob | The gzipped file content of the Check_MK HW/SW-Inventory\ - \ |\n|host_mk_inventory_last | time | The timestamp of the last Check_MK HW/SW-Inventory\ - \ for this host. 0 means that no inventory data is present |\n|host_mk_logwatch_files\ - \ | list | This list of logfiles with problems fetched via mk_logwatch |\n|host_modified_attributes\ - \ | int | A bitmask specifying which attributes have been modified |\n|host_modified_attributes_list\ - \ | list | A list of all modified attributes |\n|host_name | string | Host name\ - \ |\n|host_next_check | time | Scheduled time for the next check **(Unix timestamp)**\ - \ |\n|host_next_notification | time | Time of the next notification **(Unix timestamp)**\ - \ |\n|host_no_more_notifications | int | Whether to stop sending notifications\ - \ **(0/1)** |\n|host_notes | string | Optional notes for this object, with macros\ - \ not expanded |\n|host_notes_expanded | string | The same as notes, but with\ - \ the most important macros expanded |\n|host_notes_url | string | An optional\ - \ URL with further information about the object |\n|host_notes_url_expanded |\ - \ string | Same es notes_url, but with the most important macros expanded |\n\ - |host_notification_interval | float | Interval of periodic notification in minutes\ - \ or 0 if its off |\n|host_notification_period | string | Time period in which\ - \ problems of this object will be notified. If empty then notification will be\ - \ always |\n|host_notification_postponement_reason | string | reason for postponing\ - \ the pending notification, empty if nothing is postponed |\n|host_notifications_enabled\ - \ | int | Whether notifications of the host are enabled **(0/1)** |\n|host_num_services\ - \ | int | The total number of services of the host |\n|host_num_services_crit\ - \ | int | The number of the host's services with the soft state CRIT |\n|host_num_services_handled_problems\ - \ | int | The number of the host's services which have handled problems |\n|host_num_services_hard_crit\ - \ | int | The number of the host's services with the hard state CRIT |\n|host_num_services_hard_ok\ - \ | int | The number of the host's services with the hard state OK |\n|host_num_services_hard_unknown\ - \ | int | The number of the host's services with the hard state UNKNOWN |\n|host_num_services_hard_warn\ - \ | int | The number of the host's services with the hard state WARN |\n|host_num_services_ok\ - \ | int | The number of the host's services with the soft state OK |\n|host_num_services_pending\ - \ | int | The number of the host's services which have not been checked yet **(pending)**\ - \ |\n|host_num_services_unhandled_problems | int | The number of the host's services\ - \ which have unhandled problems |\n|host_num_services_unknown | int | The number\ - \ of the host's services with the soft state UNKNOWN |\n|host_num_services_warn\ - \ | int | The number of the host's services with the soft state WARN |\n|host_obsess_over_host\ - \ | int | The current obsess_over_host setting **(0/1)** |\n|host_parents | list\ - \ | A list of all direct parents of the host |\n|host_pending_flex_downtime |\ - \ int | Number of pending flexible downtimes |\n|host_percent_state_change | float\ - \ | Percent state change |\n|host_perf_data | string | Optional performance data\ - \ of the last check |\n|host_plugin_output | string | Output of the last check\ - \ |\n|host_pnpgraph_present | int | Whether there is a PNP4Nagios graph present\ - \ for this object **(-1/0/1)** |\n|host_previous_hard_state | int | Previous hard\ - \ state **(that hard state before the current/last hard state)** |\n|host_process_performance_data\ - \ | int | Whether processing of performance data is enabled **(0/1)** |\n|host_retry_interval\ - \ | float | Number of basic interval lengths between checks when retrying after\ - \ a soft error |\n|host_scheduled_downtime_depth | int | The number of downtimes\ - \ this object is currently in |\n|host_service_period | string | Time period during\ - \ which the object is expected to be available |\n|host_services | list | A list\ - \ of all services of the host |\n|host_services_with_fullstate | list | A list\ - \ of all services including full state information. The list of entries can grow\ - \ in future versions. |\n|host_services_with_info | list | A list of all services\ - \ including detailed information about each service |\n|host_services_with_state\ - \ | list | A list of all services of the host together with state and has_been_checked\ - \ |\n|host_smartping_timeout | int | Maximum expected time between two received\ - \ packets in ms |\n|host_staleness | float | The staleness of this object |\n\ - |host_state | int | The current state of the object, for hosts: 0/1/2 for UP/DOWN/UNREACH,\ - \ for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN |\n|host_state_type | int | Type\ - \ of the current state **(0: soft, 1: hard)** |\n|host_statusmap_image | string\ - \ | The name of in image file for the status map |\n|host_structured_status |\ - \ blob | The file content of the structured status of the Check_MK HW/SW-Inventory\ - \ |\n|host_tag_names | list | A list of the names of the tags |\n|host_tag_values\ - \ | list | A list of the values of the tags |\n|host_tags | dict | A dictionary\ - \ of the tags |\n|host_total_services | int | The total number of services of\ - \ the host |\n|host_worst_service_hard_state | int | The worst hard state of all\ - \ of the host's services **(OK <= WARN <= UNKNOWN <= CRIT)** |\n|host_worst_service_state\ - \ | int | The worst soft state of all of the host's services **(OK <= WARN <=\ - \ UNKNOWN <= CRIT)** |\n|host_x_3d | float | 3D-Coordinates: X |\n|host_y_3d |\ - \ float | 3D-Coordinates: Y |\n|host_z_3d | float | 3D-Coordinates: Z |\n|service_accept_passive_checks\ - \ | int | Whether passive host checks are accepted **(0/1)** |\n|service_acknowledged\ - \ | int | Whether the current problem has been acknowledged **(0/1)** |\n|service_acknowledgement_type\ - \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|service_action_url\ - \ | string | An optional URL to custom actions or information about this host\ - \ |\n|service_action_url_expanded | string | The same as action_url, but with\ - \ the most important macros expanded |\n|service_active_checks_enabled | int |\ - \ Whether active checks of the object are enabled **(0/1)** |\n|service_cache_interval\ - \ | int | For checks that base on cached agent data the interval in that this\ - \ cache is recreated. 0 for other services. |\n|service_cached_at | time | For\ - \ checks that base on cached agent data the time when this data was created. 0\ - \ for other services. |\n|service_check_command | string | Logical command name\ - \ for active checks |\n|service_check_command_expanded | string | Logical command\ - \ name for active checks, with macros expanded |\n|service_check_flapping_recovery_notification\ - \ | int | Whether to check to send a recovery notification when flapping stops\ - \ **(0/1)** |\n|service_check_freshness | int | Whether freshness checks are enabled\ - \ **(0/1)** |\n|service_check_interval | float | Number of basic interval lengths\ - \ between two scheduled checks |\n|service_check_options | int | The current check\ - \ option, forced, normal, freshness **(0-2)** |\n|service_check_period | string\ - \ | Time period in which this object will be checked. If empty then the check\ - \ will always be executed. |\n|service_check_type | int | Type of check **(0:\ - \ active, 1: passive)** |\n|service_checks_enabled | int | Whether checks of the\ - \ object are enabled **(0/1)** |\n|service_comments | list | A list of the ids\ - \ of all comments |\n|service_comments_with_extra_info | list | A list of all\ - \ comments with id, author, comment, entry type and entry time |\n|service_comments_with_info\ - \ | list | A list of all comments with id, author and comment |\n|service_contact_groups\ - \ | list | A list of all contact groups this object is in |\n|service_contacts\ - \ | list | A list of all contacts of this object |\n|service_current_attempt |\ - \ int | Number of the current check attempts |\n|service_current_notification_number\ - \ | int | Number of the current notification |\n|service_custom_variable_names\ - \ | list | A list of the names of the custom variables |\n|service_custom_variable_values\ - \ | list | A list of the values of the custom variables |\n|service_custom_variables\ - \ | dict | A dictionary of the custom variables |\n|service_description | string\ - \ | Service description |\n|service_display_name | string | Optional display name\ - \ |\n|service_downtimes | list | A list of the ids of all scheduled downtimes\ - \ of this object |\n|service_downtimes_with_extra_info | list | A list of the\ - \ scheduled downtimes with id, author, comment, origin, entry_time, start_time,\ - \ end_time, fixed, duration, recurring and is_pending |\n|service_downtimes_with_info\ - \ | list | A list of the scheduled downtimes with id, author and comment |\n|service_event_handler\ - \ | string | Command used as event handler |\n|service_event_handler_enabled |\ - \ int | Whether event handling is enabled **(0/1)** |\n|service_execution_time\ - \ | float | Time the check needed for execution |\n|service_first_notification_delay\ - \ | float | Delay before the first notification |\n|service_flap_detection_enabled\ - \ | int | Whether flap detection is enabled **(0/1)** |\n|service_flappiness |\ - \ float | The current level of flappiness, this corresponds with the recent frequency\ - \ of state changes |\n|service_groups | list | A list of all service groups this\ - \ object is in |\n|service_hard_state | int | The effective hard state of this\ - \ object |\n|service_has_been_checked | int | Whether a check has already been\ - \ executed **(0/1)** |\n|service_high_flap_threshold | float | High threshold\ - \ of flap detection |\n|service_icon_image | string | The name of an image file\ - \ to be used in the web pages |\n|service_icon_image_alt | string | Alternative\ - \ text for the icon_image |\n|service_icon_image_expanded | string | The same\ - \ as icon_image, but with the most important macros expanded |\n|service_in_check_period\ - \ | int | Whether this object is currently in its check period **(0/1)** |\n|service_in_notification_period\ - \ | int | Whether this object is currently in its notification period **(0/1)**\ - \ |\n|service_in_passive_check_period | int | Whether this service is currently\ - \ in its passive check period **(0/1)** |\n|service_in_service_period | int |\ - \ Whether this object is currently in its service period **(0/1)** |\n|service_initial_state\ - \ | int | Initial state |\n|service_is_executing | int | is there a check currently\ - \ running **(0/1)** |\n|service_is_flapping | int | Whether the state is flapping\ - \ **(0/1)** |\n|service_label_names | list | A list of the names of the labels\ - \ |\n|service_label_source_names | list | A list of the names of the label sources\ - \ |\n|service_label_source_values | list | A list of the values of the label sources\ - \ |\n|service_label_sources | dict | A dictionary of the label sources |\n|service_label_values\ - \ | list | A list of the values of the labels |\n|service_labels | dict | A dictionary\ - \ of the labels |\n|service_last_check | time | Time of the last check **(Unix\ - \ timestamp)** |\n|service_last_hard_state | int | Last hard state |\n|service_last_hard_state_change\ - \ | time | Time of the last hard state change - soft or hard **(Unix timestamp)**\ - \ |\n|service_last_notification | time | Time of the last notification **(Unix\ - \ timestamp)** |\n|service_last_state | int | State before last state change |\n\ - |service_last_state_change | time | Time of the last state change - soft or hard\ - \ **(Unix timestamp)** |\n|service_last_time_critical | time | The last time the\ - \ service was CRIT **(Unix timestamp)** |\n|service_last_time_ok | time | The\ - \ last time the service was OK **(Unix timestamp)** |\n|service_last_time_unknown\ - \ | time | The last time the service was UNKNOWN **(Unix timestamp)** |\n|service_last_time_warning\ - \ | time | The last time the service was WARN **(Unix timestamp)** |\n|service_latency\ - \ | float | Time difference between scheduled check time and actual check time\ - \ |\n|service_long_plugin_output | string | Long **(extra)** output of the last\ - \ check |\n|service_low_flap_threshold | float | Low threshold of flap detection\ - \ |\n|service_max_check_attempts | int | Maximum attempts for active checks before\ - \ a hard state |\n|service_metrics | list | A list of all metrics of this object\ - \ that historically existed |\n|service_modified_attributes | int | A bitmask\ - \ specifying which attributes have been modified |\n|service_modified_attributes_list\ - \ | list | A list of all modified attributes |\n|service_next_check | time | Scheduled\ - \ time for the next check **(Unix timestamp)** |\n|service_next_notification |\ - \ time | Time of the next notification **(Unix timestamp)** |\n|service_no_more_notifications\ - \ | int | Whether to stop sending notifications **(0/1)** |\n|service_notes |\ - \ string | Optional notes for this object, with macros not expanded |\n|service_notes_expanded\ - \ | string | The same as notes, but with the most important macros expanded |\n\ - |service_notes_url | string | An optional URL with further information about the\ - \ object |\n|service_notes_url_expanded | string | Same es notes_url, but with\ - \ the most important macros expanded |\n|service_notification_interval | float\ - \ | Interval of periodic notification in minutes or 0 if its off |\n|service_notification_period\ - \ | string | Time period in which problems of this object will be notified. If\ - \ empty then notification will be always |\n|service_notification_postponement_reason\ - \ | string | reason for postponing the pending notification, empty if nothing\ - \ is postponed |\n|service_notifications_enabled | int | Whether notifications\ - \ of the host are enabled **(0/1)** |\n|service_obsess_over_service | int | The\ - \ current obsess_over_service setting **(0/1)** |\n|service_passive_check_period\ - \ | string | Time period in which this **(passive)** service will be checked.\ - \ |\n|service_pending_flex_downtime | int | Number of pending flexible downtimes\ - \ |\n|service_percent_state_change | float | Percent state change |\n|service_perf_data\ - \ | string | Optional performance data of the last check |\n|service_plugin_output\ - \ | string | Output of the last check |\n|service_pnpgraph_present | int | Whether\ - \ there is a PNP4Nagios graph present for this object **(-1/0/1)** |\n|service_previous_hard_state\ - \ | int | Previous hard state **(that hard state before the current/last hard\ - \ state)** |\n|service_process_performance_data | int | Whether processing of\ - \ performance data is enabled **(0/1)** |\n|service_retry_interval | float | Number\ - \ of basic interval lengths between checks when retrying after a soft error |\n\ - |service_robotmk_last_error_log | blob | The file content of the Robotmk error\ - \ log |\n|service_robotmk_last_error_log_gz | blob | The gzipped file content\ - \ of the Robotmk error log |\n|service_robotmk_last_log | blob | The file content\ - \ of the Robotmk log |\n|service_robotmk_last_log_gz | blob | The gzipped file\ - \ content of the Robotmk log |\n|service_scheduled_downtime_depth | int | The\ - \ number of downtimes this object is currently in |\n|service_service_period |\ - \ string | Time period during which the object is expected to be available |\n\ - |service_staleness | float | The staleness of this object |\n|service_state |\ - \ int | The current state of the object, for hosts: 0/1/2 for UP/DOWN/UNREACH,\ - \ for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN |\n|service_state_type | int\ - \ | Type of the current state **(0: soft, 1: hard)** |\n|service_tag_names | list\ - \ | A list of the names of the tags |\n|service_tag_values | list | A list of\ - \ the values of the tags |\n|service_tags | dict | A dictionary of the tags |\n\ - \n## Eventconsoleevents Table\n\n### Columns:\n\n| Column name | Type | Description\ - \ |\n| - | - | - |\n|event_application | string | Syslog tag/application |\n|event_comment\ - \ | string | Event comment |\n|event_contact | string | Contact information |\n\ - |event_contact_groups | list | Contact groups |\n|event_contact_groups_precedence\ - \ | string | Whether or not the host- or rule groups have precedence |\n|event_core_host\ - \ | string | The canonical name of the host for this event as known in the monitoring\ - \ |\n|event_count | int | The number of occurrences of this event within period\ - \ |\n|event_facility | int | Syslog facility |\n|event_first | time | Time of\ - \ the first occurrence of the event **(Unix timestamp)** |\n|event_host | string\ - \ | The host name for this event, potentially rewritten |\n|event_host_in_downtime\ - \ | int | Whether or not the host **(if found in core)** was in downtime during\ - \ event creation **(0/1)** |\n|event_id | int | The unique ID for this event |\n\ - |event_ipaddress | string | The IP address where the event originated |\n|event_last\ - \ | time | Time of the last occurrence of this event **(Unix timestamp)** |\n\ - |event_match_groups | list | Text groups from regular expression match |\n|event_match_groups_syslog_application\ - \ | list | The syslog application match groups |\n|event_orig_host | string |\ - \ The original host name for this event |\n|event_owner | string | The owner of\ - \ the event |\n|event_phase | string | The phase the event is currently in **(one\ - \ of open/closed/delayed/counting/ack)** |\n|event_pid | int | The process ID\ - \ of the originating process |\n|event_priority | int | Syslog priority |\n|event_rule_id\ - \ | string | The ID of the rule |\n|event_sl | int | The service level for this\ - \ event |\n|event_state | int | The state of the event **(0/1/2/3)** |\n|event_text\ - \ | string | The textual description of the event |\n\n### Adjacent columns:\n\ - \n| Column name | Type | Description |\n| - | - | - |\n|host_accept_passive_checks\ - \ | int | Whether passive host checks are accepted **(0/1)** |\n|host_acknowledged\ - \ | int | Whether the current problem has been acknowledged **(0/1)** |\n|host_acknowledgement_type\ - \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|host_action_url\ - \ | string | An optional URL to custom actions or information about this host\ - \ |\n|host_action_url_expanded | string | The same as action_url, but with the\ - \ most important macros expanded |\n|host_active_checks_enabled | int | Whether\ - \ active checks of the object are enabled **(0/1)** |\n|host_address | string\ - \ | IP address |\n|host_alias | string | An alias name for the host |\n|host_check_command\ - \ | string | Logical command name for active checks |\n|host_check_command_expanded\ - \ | string | Logical command name for active checks, with macros expanded |\n\ - |host_check_flapping_recovery_notification | int | Whether to check to send a\ - \ recovery notification when flapping stops **(0/1)** |\n|host_check_freshness\ - \ | int | Whether freshness checks are enabled **(0/1)** |\n|host_check_interval\ - \ | float | Number of basic interval lengths between two scheduled checks |\n\ - |host_check_options | int | The current check option, forced, normal, freshness\ - \ **(0-2)** |\n|host_check_period | string | Time period in which this object\ - \ will be checked. If empty then the check will always be executed. |\n|host_check_type\ - \ | int | Type of check **(0: active, 1: passive)** |\n|host_checks_enabled |\ - \ int | Whether checks of the object are enabled **(0/1)** |\n|host_childs | list\ - \ | A list of all direct children of the host |\n|host_comments | list | A list\ - \ of the ids of all comments |\n|host_comments_with_extra_info | list | A list\ - \ of all comments with id, author, comment, entry type and entry time |\n|host_comments_with_info\ - \ | list | A list of all comments with id, author and comment |\n|host_contact_groups\ - \ | list | A list of all contact groups this object is in |\n|host_contacts |\ - \ list | A list of all contacts of this object |\n|host_current_attempt | int\ - \ | Number of the current check attempts |\n|host_current_notification_number\ - \ | int | Number of the current notification |\n|host_custom_variable_names |\ - \ list | A list of the names of the custom variables |\n|host_custom_variable_values\ - \ | list | A list of the values of the custom variables |\n|host_custom_variables\ - \ | dict | A dictionary of the custom variables |\n|host_display_name | string\ - \ | Optional display name |\n|host_downtimes | list | A list of the ids of all\ - \ scheduled downtimes of this object |\n|host_downtimes_with_extra_info | list\ - \ | A list of the scheduled downtimes with id, author, comment, origin, entry_time,\ - \ start_time, end_time, fixed, duration, recurring and is_pending |\n|host_downtimes_with_info\ - \ | list | A list of the scheduled downtimes with id, author and comment |\n|host_event_handler\ - \ | string | Command used as event handler |\n|host_event_handler_enabled | int\ - \ | Whether event handling is enabled **(0/1)** |\n|host_execution_time | float\ - \ | Time the check needed for execution |\n|host_filename | string | The value\ - \ of the custom variable FILENAME |\n|host_first_notification_delay | float |\ - \ Delay before the first notification |\n|host_flap_detection_enabled | int |\ - \ Whether flap detection is enabled **(0/1)** |\n|host_flappiness | float | The\ - \ current level of flappiness, this corresponds with the recent frequency of state\ - \ changes |\n|host_groups | list | A list of all host groups this object is in\ - \ |\n|host_hard_state | int | The effective hard state of this object |\n|host_has_been_checked\ - \ | int | Whether a check has already been executed **(0/1)** |\n|host_high_flap_threshold\ - \ | float | High threshold of flap detection |\n|host_icon_image | string | The\ - \ name of an image file to be used in the web pages |\n|host_icon_image_alt |\ - \ string | Alternative text for the icon_image |\n|host_icon_image_expanded |\ - \ string | The same as icon_image, but with the most important macros expanded\ - \ |\n|host_in_check_period | int | Whether this object is currently in its check\ - \ period **(0/1)** |\n|host_in_notification_period | int | Whether this object\ - \ is currently in its notification period **(0/1)** |\n|host_in_service_period\ - \ | int | Whether this object is currently in its service period **(0/1)** |\n\ - |host_initial_state | int | Initial state |\n|host_is_executing | int | is there\ - \ a check currently running **(0/1)** |\n|host_is_flapping | int | Whether the\ - \ state is flapping **(0/1)** |\n|host_label_names | list | A list of the names\ - \ of the labels |\n|host_label_source_names | list | A list of the names of the\ - \ label sources |\n|host_label_source_values | list | A list of the values of\ - \ the label sources |\n|host_label_sources | dict | A dictionary of the label\ - \ sources |\n|host_label_values | list | A list of the values of the labels |\n\ - |host_labels | dict | A dictionary of the labels |\n|host_last_check | time |\ - \ Time of the last check **(Unix timestamp)** |\n|host_last_hard_state | int |\ - \ Last hard state |\n|host_last_hard_state_change | time | Time of the last hard\ - \ state change - soft or hard **(Unix timestamp)** |\n|host_last_notification\ - \ | time | Time of the last notification **(Unix timestamp)** |\n|host_last_state\ - \ | int | State before last state change |\n|host_last_state_change | time | Time\ - \ of the last state change - soft or hard **(Unix timestamp)** |\n|host_last_time_down\ - \ | time | The last time the host was DOWN **(Unix timestamp)** |\n|host_last_time_unreachable\ - \ | time | The last time the host was UNREACHABLE **(Unix timestamp)** |\n|host_last_time_up\ - \ | time | The last time the host was UP **(Unix timestamp)** |\n|host_latency\ - \ | float | Time difference between scheduled check time and actual check time\ - \ |\n|host_long_plugin_output | string | Long **(extra)** output of the last check\ - \ |\n|host_low_flap_threshold | float | Low threshold of flap detection |\n|host_max_check_attempts\ - \ | int | Maximum attempts for active checks before a hard state |\n|host_metrics\ - \ | list | A list of all metrics of this object that historically existed |\n\ - |host_mk_inventory | blob | The file content of the Check_MK HW/SW-Inventory |\n\ - |host_mk_inventory_gz | blob | The gzipped file content of the Check_MK HW/SW-Inventory\ - \ |\n|host_mk_inventory_last | time | The timestamp of the last Check_MK HW/SW-Inventory\ - \ for this host. 0 means that no inventory data is present |\n|host_mk_logwatch_files\ - \ | list | This list of logfiles with problems fetched via mk_logwatch |\n|host_modified_attributes\ - \ | int | A bitmask specifying which attributes have been modified |\n|host_modified_attributes_list\ - \ | list | A list of all modified attributes |\n|host_name | string | Host name\ - \ |\n|host_next_check | time | Scheduled time for the next check **(Unix timestamp)**\ - \ |\n|host_next_notification | time | Time of the next notification **(Unix timestamp)**\ - \ |\n|host_no_more_notifications | int | Whether to stop sending notifications\ - \ **(0/1)** |\n|host_notes | string | Optional notes for this object, with macros\ - \ not expanded |\n|host_notes_expanded | string | The same as notes, but with\ - \ the most important macros expanded |\n|host_notes_url | string | An optional\ - \ URL with further information about the object |\n|host_notes_url_expanded |\ - \ string | Same es notes_url, but with the most important macros expanded |\n\ - |host_notification_interval | float | Interval of periodic notification in minutes\ - \ or 0 if its off |\n|host_notification_period | string | Time period in which\ - \ problems of this object will be notified. If empty then notification will be\ - \ always |\n|host_notification_postponement_reason | string | reason for postponing\ - \ the pending notification, empty if nothing is postponed |\n|host_notifications_enabled\ - \ | int | Whether notifications of the host are enabled **(0/1)** |\n|host_num_services\ - \ | int | The total number of services of the host |\n|host_num_services_crit\ - \ | int | The number of the host's services with the soft state CRIT |\n|host_num_services_handled_problems\ - \ | int | The number of the host's services which have handled problems |\n|host_num_services_hard_crit\ - \ | int | The number of the host's services with the hard state CRIT |\n|host_num_services_hard_ok\ - \ | int | The number of the host's services with the hard state OK |\n|host_num_services_hard_unknown\ - \ | int | The number of the host's services with the hard state UNKNOWN |\n|host_num_services_hard_warn\ - \ | int | The number of the host's services with the hard state WARN |\n|host_num_services_ok\ - \ | int | The number of the host's services with the soft state OK |\n|host_num_services_pending\ - \ | int | The number of the host's services which have not been checked yet **(pending)**\ - \ |\n|host_num_services_unhandled_problems | int | The number of the host's services\ - \ which have unhandled problems |\n|host_num_services_unknown | int | The number\ - \ of the host's services with the soft state UNKNOWN |\n|host_num_services_warn\ - \ | int | The number of the host's services with the soft state WARN |\n|host_obsess_over_host\ - \ | int | The current obsess_over_host setting **(0/1)** |\n|host_parents | list\ - \ | A list of all direct parents of the host |\n|host_pending_flex_downtime |\ - \ int | Number of pending flexible downtimes |\n|host_percent_state_change | float\ - \ | Percent state change |\n|host_perf_data | string | Optional performance data\ - \ of the last check |\n|host_plugin_output | string | Output of the last check\ - \ |\n|host_pnpgraph_present | int | Whether there is a PNP4Nagios graph present\ - \ for this object **(-1/0/1)** |\n|host_previous_hard_state | int | Previous hard\ - \ state **(that hard state before the current/last hard state)** |\n|host_process_performance_data\ - \ | int | Whether processing of performance data is enabled **(0/1)** |\n|host_retry_interval\ - \ | float | Number of basic interval lengths between checks when retrying after\ - \ a soft error |\n|host_scheduled_downtime_depth | int | The number of downtimes\ - \ this object is currently in |\n|host_service_period | string | Time period during\ - \ which the object is expected to be available |\n|host_services | list | A list\ - \ of all services of the host |\n|host_services_with_fullstate | list | A list\ - \ of all services including full state information. The list of entries can grow\ - \ in future versions. |\n|host_services_with_info | list | A list of all services\ - \ including detailed information about each service |\n|host_services_with_state\ - \ | list | A list of all services of the host together with state and has_been_checked\ - \ |\n|host_smartping_timeout | int | Maximum expected time between two received\ - \ packets in ms |\n|host_staleness | float | The staleness of this object |\n\ - |host_state | int | The current state of the object, for hosts: 0/1/2 for UP/DOWN/UNREACH,\ - \ for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN |\n|host_state_type | int | Type\ - \ of the current state **(0: soft, 1: hard)** |\n|host_statusmap_image | string\ - \ | The name of in image file for the status map |\n|host_structured_status |\ - \ blob | The file content of the structured status of the Check_MK HW/SW-Inventory\ - \ |\n|host_tag_names | list | A list of the names of the tags |\n|host_tag_values\ - \ | list | A list of the values of the tags |\n|host_tags | dict | A dictionary\ - \ of the tags |\n|host_total_services | int | The total number of services of\ - \ the host |\n|host_worst_service_hard_state | int | The worst hard state of all\ - \ of the host's services **(OK <= WARN <= UNKNOWN <= CRIT)** |\n|host_worst_service_state\ - \ | int | The worst soft state of all of the host's services **(OK <= WARN <=\ - \ UNKNOWN <= CRIT)** |\n|host_x_3d | float | 3D-Coordinates: X |\n|host_y_3d |\ - \ float | 3D-Coordinates: Y |\n|host_z_3d | float | 3D-Coordinates: Z |\n\n\n\ - # Authentication\n\nTo use this API from an automated client, a user needs to\ - \ be set up in Checkmk. Any kind of user,\nbe it *automation* or *GUI* users,\ - \ can be used to access the REST API. On a newly created site\nsome users are\ - \ already created. You can configure them in Checkmk at *Setup* > *Users*.\n\n\ - For the various authentication methods that can be used please consult the following\ - \ descriptions,\nwhich occur in the order of precedence. This means that on a\ - \ request which receives multiple\nauthentication methods, the one with the highest\ - \ priority \"wins\" and is used. This is especially\nconvenient when developing\ - \ automation scripts, as these can directly be used with either the\ncurrently\ - \ logged in GUI user, or the \"Bearer\" authentication method which takes precedence\ - \ over the\nGUI authentication method. The result is that the user doesn't have\ - \ to log out to check that the\nscripts works with the other method.\n\n\n\n\n\n# Compatibility\n\n## HTTP client compatibility\n\nIf you have a client\ - \ which cannot do the HTTP PUT or DELETE methods, you can use the\n`X-HTTP-Method-Override`\ - \ HTTP header to force the server into believing the client actually sent\nsuch\ - \ a method. In these cases the HTTP method to use has to be POST. You cannot override\ - \ from GET.\n\n## Compatibility policy\n\nIt is our policy to keep all documented\ - \ parts backwards compatible, as long as there is no\ncompelling reason (like\ - \ security, etc.) to break compatibility.\n\nIn the event of a break in backwards\ - \ compatibility, these changes are documented and, if possible,\nannounced by\ - \ deprecating the field or endpoint in question beforehand. Please understand\ - \ that this\ncan't be promised for all cases (security, etc.) though.\n\n## Versioning\n\ - \n### Definition\n\nThe REST API is versioned by a *major* and *minor* version\ - \ number.\n\nThe *major* number is incremented when backwards incompatible changes\ - \ to the API have been made.\nThis will reset the *minor* number to *0*. A *werk*\ - \ which contains the details of the change and\nmarking the change as incompatible\ - \ will be released when this happens.\n\nTh *minor* number will be increased when\ - \ backwards compatible changes are added to the API. A\n*werk* detailing the additions\ - \ will be released when this happens.\n\n**Note:** Despite the noted backward\ - \ compatibility, API consumers are best to ensure that their\nimplementation does\ - \ not disrupt use-case requirements.\n\n### Usage\n\nThe *major* version is part\ - \ of the URL of each endpoint, while the whole version (in the form\n*major*.*minor*)\ - \ can be sent via the HTTP header `X-API-Version`. If the header is not sent,\n\ - the most recent *minor* version of the through the URL selected *major* version\ - \ is used.\nThe header will also be present in the accompanying HTTP response.\n\ - \n### Format\n\n * URL: *v1*, *v2*, etc.\n * X-API-Version HTTP header: *major.minor*\n\ - \n### Notes\n\n * In the first release, the version part in the URL has been documented\ - \ as `1.0`. These\n URLs will continue to work in the future, although using\ - \ the `X-API-Version` header will not be\n possible with this version identifier.\ - \ You have to use the above documented format (v1, v2, ...)\n in the URL to\ - \ be able to use the `X-API-Version` header.\n\n## Undocumented behaviour\n\n\ - We cannot guarantee bug-for-bug backwards compatibility. If a behaviour of an\ - \ endpoint is not\ndocumented we may change it without incrementing the API version." - license: - name: GNU General Public License version 2 - url: https://checkmk.com/legal/gpl - contact: - name: Contact the Checkmk Team - url: https://checkmk.com/contact - email: feedback@checkmk.com - title: Checkmk REST-API - version: '1.0' -externalDocs: - description: The official Checkmk user guide - url: https://docs.checkmk.com/ -x-logo: - url: https://checkmk.com/bilder/brand-assets/checkmk_logo_main.png - altText: Checkmk -x-tagGroups: -- name: Monitoring - tags: - - Acknowledge problems - - Comments - - Downtimes - - Event Console - - Host status - - Metrics - - Service status - - Miscellaneous -- name: Setup - tags: - - Activate changes - - Agents - - Aux Tags - - Business intelligence (BI) - - Contact groups - - Folders - - Hosts - - Host groups - - Host tag groups - - Notification Rules - - Passwords - - Rules - - Rulesets - - Service discovery - - Service groups - - Site Management - - Time periods - - Users - - User Roles -- name: Checkmk Internal - tags: - - Certificates - - Hosts (internal) -x-ignoredHeaderParameters: -- User-Agent -- X-Test-Header -security: -- headerAuth: [] -- webserverAuth: [] -- cookieAuth: [] -paths: - /domain-types/acknowledge/collections/host: - post: - tags: - - Acknowledge problems - description: "\n\nThis endpoint requires the following permissions: \n * `action.acknowledge`:\ - \ Acknowledge host and service problems and remove acknowledgements\n" - operationId: cmk.gui.plugins.openapi.endpoints.acknowledgement.set_acknowledgement_on_hosts - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '422': - description: 'Unprocessable Entity: The query yielded no result.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AcknowledgeHostRelatedProblem' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/acknowledge/collections/host\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"acknowledge_type\"\ - : \"host\",\n \"sticky\": False,\n \"persistent\": False,\n\ - \ \"notify\": False,\n \"comment\": \"This was expected.\"\ - ,\n \"host_name\": \"example.com\",\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/acknowledge/collections/host\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n # This schema has multiple\ - \ variations. Please refer to\n # the 'Payload' section for details.\n\ - \ data=json.dumps({\n \"acknowledge_type\": \"host\",\n \ - \ \"sticky\": False,\n \"persistent\": False,\n \"notify\"\ - : False,\n \"comment\": \"This was expected.\",\n \"host_name\"\ - : \"example.com\",\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/acknowledge/collections/host\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n acknowledge_type='host'\\\ - \n sticky:=false\\\n persistent:=false\\\n notify:=false\\\n \ - \ comment='This was expected.'\\\n host_name='example.com'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"acknowledge_type\":\ - \ \"host\",\n \"comment\": \"This was expected.\",\n \"\ - host_name\": \"example.com\",\n \"notify\": false,\n \"\ - persistent\": false,\n \"sticky\": false\n }' \\\n \"\ - $API_URL/domain-types/acknowledge/collections/host\")\n\nresp=$( echo \"\ - ${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk\ - \ -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Set acknowledgement on related hosts - /domain-types/acknowledge/collections/service: - post: - tags: - - Acknowledge problems - description: "\n\nThis endpoint requires the following permissions: \n * `action.acknowledge`:\ - \ Acknowledge host and service problems and remove acknowledgements\n" - operationId: cmk.gui.plugins.openapi.endpoints.acknowledgement.set_acknowledgement_on_services - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '422': - description: 'Unprocessable Entity: Service was not in a problem state.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AcknowledgeServiceRelatedProblem' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/acknowledge/collections/service\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"acknowledge_type\"\ - : \"service\",\n \"sticky\": False,\n \"persistent\": False,\n\ - \ \"notify\": False,\n \"comment\": \"This was expected.\"\ - ,\n \"host_name\": \"example.com\",\n \"service_description\"\ - : \"CPU load\",\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/acknowledge/collections/service\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n # This schema has multiple\ - \ variations. Please refer to\n # the 'Payload' section for details.\n\ - \ data=json.dumps({\n \"acknowledge_type\": \"service\",\n \ - \ \"sticky\": False,\n \"persistent\": False,\n \"notify\"\ - : False,\n \"comment\": \"This was expected.\",\n \"host_name\"\ - : \"example.com\",\n \"service_description\": \"CPU load\",\n \ - \ }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\nif\ - \ resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/acknowledge/collections/service\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n acknowledge_type='service'\\\ - \n sticky:=false\\\n persistent:=false\\\n notify:=false\\\n \ - \ comment='This was expected.'\\\n host_name='example.com'\\\n service_description='CPU\ - \ load'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"acknowledge_type\":\ - \ \"service\",\n \"comment\": \"This was expected.\",\n \ - \ \"host_name\": \"example.com\",\n \"notify\": false,\n \ - \ \"persistent\": false,\n \"service_description\": \"CPU\ - \ load\",\n \"sticky\": false\n }' \\\n \"$API_URL/domain-types/acknowledge/collections/service\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Set acknowledgement on related services - /domain-types/activation_run/actions/activate-changes/invoke: - post: - tags: - - Activate changes - description: "This endpoint will start an asynchronous background job that will\ - \ activate all pending changes.\nIt will either return a response immediately\ - \ (when redirect=False) which includes the ID for\nthe just triggered activation\ - \ run or will redirect (when redirect=True) to the \"Wait for\ncompletion\"\ - \ endpoint and only return a response when the background job is completed.\n\ - The relevant ETag for the current set of pending changes can be obtained from\ - \ the 'Show all\npending changes' endpoint. However, if there are alterations\ - \ to the list of pending changes, a\nnew query to the endpoint will be needed\ - \ to acquire the updated ETag.This endpoint requires the following permissions:\ - \ \n * All of:\n * `wato.activate`: This permission is needed for activating\ - \ the current configuration (and thus rewriting the monitoring configuration\ - \ and restart the monitoring daemon.)\n * Optionally:\n * `wato.activateforeign`:\ - \ When several users work in parallel with Setup then several pending changes\ - \ of different users might pile up before changes are activated. Only with\ - \ this permission a user will be allowed to activate the current configuration\ - \ if this situation appears.\n * Optionally:\n * Any of:\n * `general.see_all`:\ - \ See all objects regardless of contacts and contact groups. If combined with\ - \ 'perform commands' then commands may be done on all objects.\n * `bi.see_all`:\ - \ With this permission set, the BI aggregation rules are applied to all hosts\ - \ and services - not only those the user is a contact for. If you remove this\ - \ permissions then the user will see incomplete aggregation trees with status\ - \ based only on those items.\n * `mkeventd.seeall`: If a user lacks\ - \ this permission then he/she can see only those events that originate from\ - \ a host that he/she is a contact for.\n" - operationId: cmk.gui.plugins.openapi.endpoints.activate_changes.activate_changes - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: 'Unauthorized: The API user may not activate another users - changes, or the user may and activation was not forced explicitly.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Activation not possible because of licensing issues.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '422': - description: 'Unprocessable Entity: There are no changes to be activated.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '423': - description: 'Locked: There is already an activation running.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: Some sites could not be activated.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '302': - description: 'Found: The activation has been started and is still running. - Redirecting to the ''Wait for completion'' endpoint.' - content: {} - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: Activation has been started, but not completed (if you - need to wait for completion, see documentation for this endpoint).' - content: - application/json: - schema: - $ref: '#/components/schemas/ActivationRunResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ActivateChanges' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\nsession.max_redirects = 100 # increase if necessary\n\ - \nresp = session.post(\n f\"{API_URL}/domain-types/activation_run/actions/activate-changes/invoke\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\n \"redirect\"\ - : False,\n \"sites\": [\"production\"],\n \"force_foreign_changes\"\ - : False,\n },\n allow_redirects=True,\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelif resp.status_code == 302:\n print(\"Redirected to\", resp.headers[\"\ - location\"])\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/activation_run/actions/activate-changes/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ - \ the, to be modified, object's ETag header.\n \"Content-Type\":\ - \ 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"redirect\": False,\n \"sites\": [\"production\"],\n \ - \ \"force_foreign_changes\": False,\n }).encode('utf-8'),\n)\nresponse\ - \ = urllib.request.urlopen(request)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelif resp.status_code\ - \ == 302:\n print(\"Redirected to\", resp.headers[\"location\"])\nelse:\n\ - \ raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/activation_run/actions/activate-changes/invoke\" \\\ - \n --follow \\\n --all \\\n \"Authorization: Bearer $USERNAME $PASSWORD\"\ - \ \\\n \"Accept: application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"\ - ' \\\n 'Content-Type:application/json' \\\n redirect:=false\\\n \ - \ sites:='[\"production\"]'\\\n force_foreign_changes:=false" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl -L \\\n --write-out\ - \ \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept: application/json\"\ - \ \\\n --header \"If-Match: \"a20ceacf346041dc\"\" \\\n --header \"\ - Content-Type: application/json\" \\\n --data '{\n \"force_foreign_changes\"\ - : false,\n \"redirect\": false,\n \"sites\": [\n \ - \ \"production\"\n ]\n }' \\\n \"$API_URL/domain-types/activation_run/actions/activate-changes/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Activate pending changes - /objects/activation_run/{activation_id}/actions/wait-for-completion/invoke: - get: - tags: - - Activate changes - description: "This endpoint will periodically redirect on itself to prevent\ - \ timeouts.This endpoint requires the following permissions: \n * `wato.activate`:\ - \ This permission is needed for activating the current configuration (and\ - \ thus rewriting the monitoring configuration and restart the monitoring daemon.)\n" - operationId: cmk.gui.plugins.openapi.endpoints.activate_changes.activate_changes_wait_for_completion - parameters: - - in: path - name: activation_id - required: true - description: The activation-id. - schema: - type: string - example: d3b07384d113e0ec49eaa6238ad5ff00 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: There is no running activation with this activation_id.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '302': - description: 'Found: The activation is still running. Redirecting to the - ''Wait for completion'' endpoint.' - content: {} - '204': - description: 'No Content: The activation has been completed.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\nsession.max_redirects = 100 # increase if necessary\n\ - \nresp = session.get(\n f\"{API_URL}/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00/actions/wait-for-completion/invoke\"\ - ,\n allow_redirects=True,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelif resp.status_code\ - \ == 302:\n print(\"Redirected to\", resp.headers[\"location\"])\nelse:\n\ - \ raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00/actions/wait-for-completion/invoke\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelif resp.status_code == 302:\n print(\"Redirected\ - \ to\", resp.headers[\"location\"])\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00/actions/wait-for-completion/invoke\"\ - \ \\\n --follow \\\n --all \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00/actions/wait-for-completion/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Wait for activation completion - /domain-types/activation_run/collections/running: - get: - tags: - - Activate changes - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * Any of:\n * `general.see_all`: See all objects regardless of contacts\ - \ and contact groups. If combined with 'perform commands' then commands may\ - \ be done on all objects.\n * `bi.see_all`: With this permission set,\ - \ the BI aggregation rules are applied to all hosts and services - not only\ - \ those the user is a contact for. If you remove this permissions then the\ - \ user will see incomplete aggregation trees with status based only on those\ - \ items.\n * `mkeventd.seeall`: If a user lacks this permission then he/she\ - \ can see only those events that originate from a host that he/she is a contact\ - \ for.\n" - operationId: cmk.gui.plugins.openapi.endpoints.activate_changes.list_activations - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ActivationRunCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/activation_run/collections/running\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/activation_run/collections/running\",\n \ - \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/activation_run/collections/running\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/activation_run/collections/running\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all currently running activations - /domain-types/activation_run/collections/pending_changes: - get: - tags: - - Activate changes - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * Any of:\n * `general.see_all`: See all objects regardless of contacts\ - \ and contact groups. If combined with 'perform commands' then commands may\ - \ be done on all objects.\n * `bi.see_all`: With this permission set,\ - \ the BI aggregation rules are applied to all hosts and services - not only\ - \ those the user is a contact for. If you remove this permissions then the\ - \ user will see incomplete aggregation trees with status based only on those\ - \ items.\n * `mkeventd.seeall`: If a user lacks this permission then he/she\ - \ can see only those events that originate from a host that he/she is a contact\ - \ for.\n" - operationId: cmk.gui.plugins.openapi.endpoints.activate_changes.list_pending_changes - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/PendingChangesCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/activation_run/collections/pending_changes\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/activation_run/collections/pending_changes\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/activation_run/collections/pending_changes\" \\\n\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/activation_run/collections/pending_changes\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all pending changes - /objects/activation_run/{activation_id}: - get: - tags: - - Activate changes - description: "If the activation is still running a link to the wait-for-completion\ - \ resource for the activation job is included.This endpoint requires the following\ - \ permissions: \n * `wato.activate`: This permission is needed for activating\ - \ the current configuration (and thus rewriting the monitoring configuration\ - \ and restart the monitoring daemon.)\n" - operationId: cmk.gui.plugins.openapi.endpoints.activate_changes.show_activation - parameters: - - in: path - name: activation_id - required: true - description: The activation-id. - schema: - type: string - example: d3b07384d113e0ec49eaa6238ad5ff00 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: There is no running activation with this activation_id.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ActivationRunResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00\" \\\n\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show the activation status - /domain-types/agent/actions/download/invoke: - get: - tags: - - Agents - description: '' - operationId: cmk.gui.plugins.openapi.endpoints.agent.download_agent - parameters: - - in: query - name: os_type - required: true - description: The type of the operating system. May be one of linux_rpm, linux_deb, - windows_msi - schema: - type: string - enum: - - linux_deb - - linux_rpm - - windows_msi - example: linux_deb - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/octet-stream: - schema: - type: string - format: binary - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\nimport shutil\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/octet-stream'\n\nresp = session.get(\n f\"{API_URL}/domain-types/agent/actions/download/invoke\"\ - ,\n params={ # goes into query string\n \"os_type\": 'linux_deb',\ - \ # (required) The type of the operating system.\n },\n stream=True,\n\ - )\nif resp.status_code == 200:\n file_name = resp.headers[\"content-disposition\"\ - ].split(\"filename=\")[1].strip('\"')\n with open(file_name, 'wb') as\ - \ out_file:\n resp.raw.decode_content = True\n shutil.copyfileobj(resp.raw,\ - \ out_file)\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport shutil\n\ - import urllib.parse\nimport urllib.request\n\nHOST_NAME = \"localhost\"\n\ - SITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string =\ - \ urllib.parse.urlencode({\n \"os_type\": 'linux_deb', # (required)\ - \ The type of the operating system.\n})\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/agent/actions/download/invoke?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/octet-stream\"\ - ,\n },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n file_name = resp.headers[\"content-disposition\"].split(\"\ - filename=\")[1].strip('\"')\n with open(file_name, 'wb') as out_file:\n\ - \ shutil.copyfileobj(response, out_file)\n print(\"Done\")\nelse:\n\ - \ raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/agent/actions/download/invoke\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/octet-stream\"\ - \ \\\n os_type=='linux_deb' \\\n --download \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/octet-stream\" \\\n --data-urlencode\ - \ 'os_type=linux_deb' \\\n \"$API_URL/domain-types/agent/actions/download/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Download agents shipped with Checkmk - /domain-types/aux_tag/collections/all: - post: - tags: - - Aux Tags - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n * `wato.hosttags`: Create, remove and edit tags.\ - \ Removing tags also might remove rules, so this permission should not be\ - \ available to normal users.\n" - operationId: cmk.gui.plugins.openapi.endpoints.aux_tags.create_aux_tag - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/AuxTagResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AuxTagAttrsCreate' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/aux_tag/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"aux_tag_id\": \"ip-v4\",\n \"topic\"\ - : \"Monitoring agents\",\n \"title\": \"AuxTagExampleTitle\",\n \ - \ \"help\": \"AuxTagExampleHelp\",\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/aux_tag/collections/all\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"aux_tag_id\": \"ip-v4\",\n \"topic\": \"Monitoring agents\"\ - ,\n \"title\": \"AuxTagExampleTitle\",\n \"help\": \"AuxTagExampleHelp\"\ - ,\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/aux_tag/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n aux_tag_id='ip-v4'\\\n topic='Monitoring\ - \ agents'\\\n title='AuxTagExampleTitle'\\\n help='AuxTagExampleHelp'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"aux_tag_id\": \"ip-v4\",\n \"\ - help\": \"AuxTagExampleHelp\",\n \"title\": \"AuxTagExampleTitle\"\ - ,\n \"topic\": \"Monitoring agents\"\n }' \\\n \"$API_URL/domain-types/aux_tag/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create an Auxiliary Tag - get: - tags: - - Aux Tags - description: "\n\nThis endpoint requires the following permissions: \n * `wato.hosttags`:\ - \ Create, remove and edit tags. Removing tags also might remove rules, so\ - \ this permission should not be available to normal users.\n" - operationId: cmk.gui.plugins.openapi.endpoints.aux_tags.show_aux_tags - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/AuxTagResponseCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/aux_tag/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/aux_tag/collections/all\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/aux_tag/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/aux_tag/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show Auxiliary Tags - /objects/aux_tag/{aux_tag_id}/actions/delete/invoke: - post: - tags: - - Aux Tags - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n * `wato.hosttags`: Create, remove and edit tags.\ - \ Removing tags also might remove rules, so this permission should not be\ - \ available to normal users.\n" - operationId: cmk.gui.plugins.openapi.endpoints.aux_tags.delete_aux_tag - parameters: - - in: path - name: aux_tag_id - required: true - description: An auxiliary tag id - schema: - type: string - example: ip-v4 - pattern: ^[-0-9a-zA-Z_]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: The request is in conflict with the stored resource.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/aux_tag/ip-v4/actions/delete/invoke\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/aux_tag/ip-v4/actions/delete/invoke\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n },\n)\n\ - response = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/aux_tag/ip-v4/actions/delete/invoke\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/aux_tag/ip-v4/actions/delete/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete an Auxiliary Tag - /objects/aux_tag/{aux_tag_id}: - put: - tags: - - Aux Tags - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n * `wato.hosttags`: Create, remove and edit tags.\ - \ Removing tags also might remove rules, so this permission should not be\ - \ available to normal users.\n" - operationId: cmk.gui.plugins.openapi.endpoints.aux_tags.put_aux_tag - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: aux_tag_id - required: true - description: An auxiliary tag id - schema: - type: string - example: ip-v4 - pattern: ^[-0-9a-zA-Z_]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/AuxTagResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/AuxTagAttrsUpdate' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/aux_tag/ip-v4\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"topic\": \"Monitoring agents\",\n \ - \ \"title\": \"AuxTagExampleTitle\",\n \"help\": \"AuxTagExampleHelp\"\ - ,\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/aux_tag/ip-v4\",\n method=\"PUT\",\n headers={\n\ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ - \ \"Accept\": \"application/json\",\n \"Content-Type\": 'application/json',\ - \ # (required) A header specifying which type of content is in the request/response\ - \ body.\n },\n data=json.dumps({\n \"topic\": \"Monitoring\ - \ agents\",\n \"title\": \"AuxTagExampleTitle\",\n \"help\"\ - : \"AuxTagExampleHelp\",\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/aux_tag/ip-v4\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ - \ \\\n topic='Monitoring agents'\\\n title='AuxTagExampleTitle'\\\n\ - \ help='AuxTagExampleHelp'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"help\": \"AuxTagExampleHelp\",\n \ - \ \"title\": \"AuxTagExampleTitle\",\n \"topic\": \"Monitoring\ - \ agents\"\n }' \\\n \"$API_URL/objects/aux_tag/ip-v4\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Update an aux tag - get: - tags: - - Aux Tags - description: "\n\nThis endpoint requires the following permissions: \n * `wato.hosttags`:\ - \ Create, remove and edit tags. Removing tags also might remove rules, so\ - \ this permission should not be available to normal users.\n" - operationId: cmk.gui.plugins.openapi.endpoints.aux_tags.show_aux_tag - parameters: - - in: path - name: aux_tag_id - required: true - description: An auxiliary tag id - schema: - type: string - example: ip-v4 - pattern: ^[-0-9a-zA-Z_]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/AuxTagResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/aux_tag/ip-v4\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/aux_tag/ip-v4\",\n method=\"GET\",\n headers={\n\ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ - \ \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/aux_tag/ip-v4\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/aux_tag/ip-v4\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Show an Auxiliary Tag - /objects/bi_aggregation/{aggregation_id}: - delete: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.bi_rules`: Use the Setup BI module, create, modify and\ - \ delete BI rules and aggregations in packs that you are a contact of.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.delete_bi_aggregation - parameters: - - in: path - name: aggregation_id - required: true - description: The unique id for the aggregation - schema: - type: string - example: aggregation1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/bi_aggregation/aggregation1\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_aggregation/aggregation1\",\n method=\"\ - DELETE\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n },\n)\n\ - response = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/bi_aggregation/aggregation1\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/bi_aggregation/aggregation1\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a BI aggregation - get: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * `wato.bi_rules`:\ - \ Use the Setup BI module, create, modify and delete BI rules and aggregations\ - \ in packs that you are a contact of.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.get_bi_aggregation - parameters: - - in: path - name: aggregation_id - required: true - description: The unique id for the aggregation - schema: - type: string - example: aggregation1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/BIAggregationEndpoint' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/bi_aggregation/aggregation1\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_aggregation/aggregation1\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/bi_aggregation/aggregation1\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/bi_aggregation/aggregation1\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Get a BI aggregation - post: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.bi_rules`: Use the Setup BI module, create, modify and\ - \ delete BI rules and aggregations in packs that you are a contact of.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.post_bi_aggregation - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: aggregation_id - required: true - description: The unique id for the aggregation - schema: - type: string - example: aggregation1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/BIAggregationEndpoint' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BIAggregationEndpoint' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/bi_aggregation/aggregation1\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"id\": \"aggr1\",\n \"comment\": \"\ - Rule comment\",\n \"customer\": \"customer1\",\n \"groups\"\ - : {\n \"names\": [\"groupA\", \"groupB\"],\n \"paths\"\ - : [\n [\"path\", \"group\", \"a\"],\n [\"\ - path\", \"group\", \"b\"],\n ],\n },\n \"node\"\ - : {\n \"search\": {\"type\": \"empty\"},\n \"action\"\ - : {\n \"type\": \"state_of_host\",\n \"host_regex\"\ - : \"\",\n },\n },\n \"aggregation_visualization\"\ - : {\n \"ignore_rule_styles\": False,\n \"layout_id\"\ - : \"builtin_default\",\n \"line_style\": \"round\",\n \ - \ },\n \"computation_options\": {\n \"disabled\": False,\n\ - \ \"use_hard_states\": False,\n \"escalate_downtimes_as_warn\"\ - : False,\n \"freeze_aggregations\": False,\n },\n \ - \ \"pack_id\": \"pack1\",\n },\n)\nif resp.status_code == 200:\n \ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_aggregation/aggregation1\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"id\": \"aggr1\",\n \"comment\": \"Rule comment\",\n \ - \ \"customer\": \"customer1\",\n \"groups\": {\n \"names\"\ - : [\"groupA\", \"groupB\"],\n \"paths\": [\n [\"\ - path\", \"group\", \"a\"],\n [\"path\", \"group\", \"b\"\ - ],\n ],\n },\n \"node\": {\n \"search\"\ - : {\"type\": \"empty\"},\n \"action\": {\n \"\ - type\": \"state_of_host\",\n \"host_regex\": \"\",\n \ - \ },\n },\n \"aggregation_visualization\": {\n \ - \ \"ignore_rule_styles\": False,\n \"layout_id\": \"builtin_default\"\ - ,\n \"line_style\": \"round\",\n },\n \"computation_options\"\ - : {\n \"disabled\": False,\n \"use_hard_states\":\ - \ False,\n \"escalate_downtimes_as_warn\": False,\n \ - \ \"freeze_aggregations\": False,\n },\n \"pack_id\": \"\ - pack1\",\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/bi_aggregation/aggregation1\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n id='aggr1'\\\n comment='Rule\ - \ comment'\\\n customer='customer1'\\\n groups[names]:='[\"groupA\"\ - , \"groupB\"]'\\\n groups[paths]:='[[\"path\", \"group\", \"a\"], [\"\ - path\", \"group\", \"b\"]]'\\\n node[search][type]='empty'\\\n node[action][type]='state_of_host'\\\ - \n node[action][host_regex]=''\\\n aggregation_visualization[ignore_rule_styles]:=false\\\ - \n aggregation_visualization[layout_id]='builtin_default'\\\n aggregation_visualization[line_style]='round'\\\ - \n computation_options[disabled]:=false\\\n computation_options[use_hard_states]:=false\\\ - \n computation_options[escalate_downtimes_as_warn]:=false\\\n computation_options[freeze_aggregations]:=false\\\ - \n pack_id='pack1'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"aggregation_visualization\": {\n \ - \ \"ignore_rule_styles\": false,\n \"layout_id\": \"builtin_default\"\ - ,\n \"line_style\": \"round\"\n },\n \"comment\"\ - : \"Rule comment\",\n \"computation_options\": {\n \"\ - disabled\": false,\n \"escalate_downtimes_as_warn\": false,\n\ - \ \"freeze_aggregations\": false,\n \"use_hard_states\"\ - : false\n },\n \"customer\": \"customer1\",\n \ - \ \"groups\": {\n \"names\": [\n \"groupA\",\n\ - \ \"groupB\"\n ],\n \"paths\": [\n \ - \ [\n \"path\",\n \"group\",\n\ - \ \"a\"\n ],\n [\n \ - \ \"path\",\n \"group\",\n \"b\"\n \ - \ ]\n ]\n },\n \"id\": \"aggr1\",\n\ - \ \"node\": {\n \"action\": {\n \"host_regex\"\ - : \"\",\n \"type\": \"state_of_host\"\n },\n \ - \ \"search\": {\n \"type\": \"empty\"\n \ - \ }\n },\n \"pack_id\": \"pack1\"\n }' \\\n \ - \ \"$API_URL/objects/bi_aggregation/aggregation1\")\n\nresp=$( echo \"${out}\"\ - \ | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk -F\"=\"\ - \ '/^xxx-status_code/ {print $2}')\n\n# For indentation, please install\ - \ 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\nif [[\ - \ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo \"\ - Request error\"\n exit 1\nfi" - summary: Create a BI aggregation - put: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.bi_rules`: Use the Setup BI module, create, modify and\ - \ delete BI rules and aggregations in packs that you are a contact of.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.put_bi_aggregation - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: aggregation_id - required: true - description: The unique id for the aggregation - schema: - type: string - example: aggregation1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/BIAggregationEndpoint' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BIAggregationEndpoint' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/bi_aggregation/aggregation1\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"id\": \"aggr1\",\n \"comment\": \"\ - Rule comment\",\n \"customer\": \"customer1\",\n \"groups\"\ - : {\n \"names\": [\"groupA\", \"groupB\"],\n \"paths\"\ - : [\n [\"path\", \"group\", \"a\"],\n [\"\ - path\", \"group\", \"b\"],\n ],\n },\n \"node\"\ - : {\n \"search\": {\"type\": \"empty\"},\n \"action\"\ - : {\n \"type\": \"state_of_host\",\n \"host_regex\"\ - : \"\",\n },\n },\n \"aggregation_visualization\"\ - : {\n \"ignore_rule_styles\": False,\n \"layout_id\"\ - : \"builtin_default\",\n \"line_style\": \"round\",\n \ - \ },\n \"computation_options\": {\n \"disabled\": False,\n\ - \ \"use_hard_states\": False,\n \"escalate_downtimes_as_warn\"\ - : False,\n \"freeze_aggregations\": False,\n },\n \ - \ \"pack_id\": \"pack1\",\n },\n)\nif resp.status_code == 200:\n \ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_aggregation/aggregation1\",\n method=\"\ - PUT\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"Content-Type\":\ - \ 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"id\": \"aggr1\",\n \"comment\": \"Rule comment\",\n \ - \ \"customer\": \"customer1\",\n \"groups\": {\n \"names\"\ - : [\"groupA\", \"groupB\"],\n \"paths\": [\n [\"\ - path\", \"group\", \"a\"],\n [\"path\", \"group\", \"b\"\ - ],\n ],\n },\n \"node\": {\n \"search\"\ - : {\"type\": \"empty\"},\n \"action\": {\n \"\ - type\": \"state_of_host\",\n \"host_regex\": \"\",\n \ - \ },\n },\n \"aggregation_visualization\": {\n \ - \ \"ignore_rule_styles\": False,\n \"layout_id\": \"builtin_default\"\ - ,\n \"line_style\": \"round\",\n },\n \"computation_options\"\ - : {\n \"disabled\": False,\n \"use_hard_states\":\ - \ False,\n \"escalate_downtimes_as_warn\": False,\n \ - \ \"freeze_aggregations\": False,\n },\n \"pack_id\": \"\ - pack1\",\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/bi_aggregation/aggregation1\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n id='aggr1'\\\n comment='Rule\ - \ comment'\\\n customer='customer1'\\\n groups[names]:='[\"groupA\"\ - , \"groupB\"]'\\\n groups[paths]:='[[\"path\", \"group\", \"a\"], [\"\ - path\", \"group\", \"b\"]]'\\\n node[search][type]='empty'\\\n node[action][type]='state_of_host'\\\ - \n node[action][host_regex]=''\\\n aggregation_visualization[ignore_rule_styles]:=false\\\ - \n aggregation_visualization[layout_id]='builtin_default'\\\n aggregation_visualization[line_style]='round'\\\ - \n computation_options[disabled]:=false\\\n computation_options[use_hard_states]:=false\\\ - \n computation_options[escalate_downtimes_as_warn]:=false\\\n computation_options[freeze_aggregations]:=false\\\ - \n pack_id='pack1'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"aggregation_visualization\": {\n \ - \ \"ignore_rule_styles\": false,\n \"layout_id\": \"builtin_default\"\ - ,\n \"line_style\": \"round\"\n },\n \"comment\"\ - : \"Rule comment\",\n \"computation_options\": {\n \"\ - disabled\": false,\n \"escalate_downtimes_as_warn\": false,\n\ - \ \"freeze_aggregations\": false,\n \"use_hard_states\"\ - : false\n },\n \"customer\": \"customer1\",\n \ - \ \"groups\": {\n \"names\": [\n \"groupA\",\n\ - \ \"groupB\"\n ],\n \"paths\": [\n \ - \ [\n \"path\",\n \"group\",\n\ - \ \"a\"\n ],\n [\n \ - \ \"path\",\n \"group\",\n \"b\"\n \ - \ ]\n ]\n },\n \"id\": \"aggr1\",\n\ - \ \"node\": {\n \"action\": {\n \"host_regex\"\ - : \"\",\n \"type\": \"state_of_host\"\n },\n \ - \ \"search\": {\n \"type\": \"empty\"\n \ - \ }\n },\n \"pack_id\": \"pack1\"\n }' \\\n \ - \ \"$API_URL/objects/bi_aggregation/aggregation1\")\n\nresp=$( echo \"${out}\"\ - \ | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk -F\"=\"\ - \ '/^xxx-status_code/ {print $2}')\n\n# For indentation, please install\ - \ 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\nif [[\ - \ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo \"\ - Request error\"\n exit 1\nfi" - summary: Update an existing BI aggregation - /objects/bi_pack/{pack_id}: - delete: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.bi_rules`: Use the Setup BI module, create, modify and\ - \ delete BI rules and aggregations in packs that you are a contact of.\n \ - \ * `wato.bi_admin`: Edit all rules and aggregations for Business Intelligence,\ - \ create, modify and delete rule packs.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.delete_bi_pack - parameters: - - in: path - name: pack_id - required: true - description: The unique id for the aggregation pack - schema: - type: string - example: pack1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/bi_pack/pack1\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_pack/pack1\",\n method=\"DELETE\",\n \ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/bi_pack/pack1\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/bi_pack/pack1\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Delete BI pack - get: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * `wato.bi_rules`:\ - \ Use the Setup BI module, create, modify and delete BI rules and aggregations\ - \ in packs that you are a contact of.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.get_bi_pack - parameters: - - in: path - name: pack_id - required: true - description: The unique id for the aggregation pack - schema: - type: string - example: pack1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/bi_pack/pack1\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_pack/pack1\",\n method=\"GET\",\n headers={\n\ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ - \ \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/bi_pack/pack1\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/bi_pack/pack1\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Get a BI pack and its rules and aggregations - post: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.bi_rules`: Use the Setup BI module, create, modify and\ - \ delete BI rules and aggregations in packs that you are a contact of.\n \ - \ * `wato.bi_admin`: Edit all rules and aggregations for Business Intelligence,\ - \ create, modify and delete rule packs.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.post_bi_pack - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: pack_id - required: true - description: The unique id for the aggregation pack - schema: - type: string - example: pack1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/BIPackEndpoint' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BIPackEndpoint' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/bi_pack/pack1\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"title\": \"BI Title\",\n \"contact_groups\"\ - : [\n \"contact\",\n \"contactgroup_b\",\n \ - \ ],\n \"public\": \"false\",\n },\n)\nif resp.status_code ==\ - \ 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_pack/pack1\",\n method=\"POST\",\n headers={\n\ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ - \ \"Accept\": \"application/json\",\n \"Content-Type\": 'application/json',\ - \ # (required) A header specifying which type of content is in the request/response\ - \ body.\n },\n data=json.dumps({\n \"title\": \"BI Title\"\ - ,\n \"contact_groups\": [\n \"contact\",\n \ - \ \"contactgroup_b\",\n ],\n \"public\": \"false\",\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/bi_pack/pack1\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ - \ \\\n title='BI Title'\\\n contact_groups:='[\"contact\", \"contactgroup_b\"\ - ]'\\\n public='false'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"contact_groups\": [\n \"contact\"\ - ,\n \"contactgroup_b\"\n ],\n \"public\": \"\ - false\",\n \"title\": \"BI Title\"\n }' \\\n \"$API_URL/objects/bi_pack/pack1\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a new BI pack - put: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.bi_rules`: Use the Setup BI module, create, modify and\ - \ delete BI rules and aggregations in packs that you are a contact of.\n \ - \ * `wato.bi_admin`: Edit all rules and aggregations for Business Intelligence,\ - \ create, modify and delete rule packs.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.put_bi_pack - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: pack_id - required: true - description: The unique id for the aggregation pack - schema: - type: string - example: pack1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/BIPackEndpoint' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BIPackEndpoint' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/bi_pack/pack1\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"title\": \"BI Title\",\n \"contact_groups\"\ - : [\n \"contact\",\n \"contactgroup_b\",\n \ - \ ],\n \"public\": \"false\",\n },\n)\nif resp.status_code ==\ - \ 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_pack/pack1\",\n method=\"PUT\",\n headers={\n\ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ - \ \"Accept\": \"application/json\",\n \"Content-Type\": 'application/json',\ - \ # (required) A header specifying which type of content is in the request/response\ - \ body.\n },\n data=json.dumps({\n \"title\": \"BI Title\"\ - ,\n \"contact_groups\": [\n \"contact\",\n \ - \ \"contactgroup_b\",\n ],\n \"public\": \"false\",\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/bi_pack/pack1\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ - \ \\\n title='BI Title'\\\n contact_groups:='[\"contact\", \"contactgroup_b\"\ - ]'\\\n public='false'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"contact_groups\": [\n \"contact\"\ - ,\n \"contactgroup_b\"\n ],\n \"public\": \"\ - false\",\n \"title\": \"BI Title\"\n }' \\\n \"$API_URL/objects/bi_pack/pack1\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update an existing BI pack - /objects/bi_rule/{rule_id}: - delete: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.bi_rules`: Use the Setup BI module, create, modify and\ - \ delete BI rules and aggregations in packs that you are a contact of.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.delete_bi_rule - parameters: - - in: path - name: rule_id - required: true - description: The unique id for the rule - schema: - type: string - example: rule1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: The request is in conflict with the stored resource.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/bi_rule/rule1\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_rule/rule1\",\n method=\"DELETE\",\n \ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/bi_rule/rule1\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/bi_rule/rule1\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Delete BI rule - get: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * `wato.bi_rules`:\ - \ Use the Setup BI module, create, modify and delete BI rules and aggregations\ - \ in packs that you are a contact of.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.get_bi_rule - parameters: - - in: path - name: rule_id - required: true - description: The unique id for the rule - schema: - type: string - example: rule1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/BIRuleEndpoint' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/bi_rule/rule1\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_rule/rule1\",\n method=\"GET\",\n headers={\n\ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ - \ \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/bi_rule/rule1\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/bi_rule/rule1\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Show a BI rule - post: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.bi_rules`: Use the Setup BI module, create, modify and\ - \ delete BI rules and aggregations in packs that you are a contact of.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.post_bi_rule - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: rule_id - required: true - description: The unique id for the rule - schema: - type: string - example: rule1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/BIRuleEndpoint' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BIRuleEndpoint' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/bi_rule/rule1\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"id\": \"rule1\",\n \"nodes\": [],\n\ - \ \"params\": {\"arguments\": [\"foo\", \"bar\"]},\n \"node_visualization\"\ - : {\n \"type\": \"block\",\n \"style_config\": {},\n\ - \ },\n \"properties\": {\n \"title\": \"\",\n \ - \ \"comment\": \"\",\n \"docu_url\": \"\",\n \ - \ \"icon\": \"\",\n \"state_messages\": {},\n },\n\ - \ \"aggregation_function\": {\n \"type\": \"best\",\n\ - \ \"count\": 1,\n \"restrict_state\": 2,\n \ - \ },\n \"computation_options\": {\"disabled\": False},\n \"\ - pack_id\": \"pack1\",\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_rule/rule1\",\n method=\"POST\",\n headers={\n\ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ - \ \"Accept\": \"application/json\",\n \"Content-Type\": 'application/json',\ - \ # (required) A header specifying which type of content is in the request/response\ - \ body.\n },\n data=json.dumps({\n \"id\": \"rule1\",\n \ - \ \"nodes\": [],\n \"params\": {\"arguments\": [\"foo\", \"bar\"\ - ]},\n \"node_visualization\": {\n \"type\": \"block\"\ - ,\n \"style_config\": {},\n },\n \"properties\"\ - : {\n \"title\": \"\",\n \"comment\": \"\",\n \ - \ \"docu_url\": \"\",\n \"icon\": \"\",\n \"\ - state_messages\": {},\n },\n \"aggregation_function\": {\n\ - \ \"type\": \"best\",\n \"count\": 1,\n \ - \ \"restrict_state\": 2,\n },\n \"computation_options\":\ - \ {\"disabled\": False},\n \"pack_id\": \"pack1\",\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/bi_rule/rule1\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ - \ \\\n id='rule1'\\\n nodes:='[]'\\\n params[arguments]:='[\"foo\"\ - , \"bar\"]'\\\n node_visualization[type]='block'\\\n properties[title]=''\\\ - \n properties[comment]=''\\\n properties[docu_url]=''\\\n properties[icon]=''\\\ - \n aggregation_function[type]='best'\\\n aggregation_function[count]:=1\\\ - \n aggregation_function[restrict_state]:=2\\\n computation_options[disabled]:=false\\\ - \n pack_id='pack1'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"aggregation_function\": {\n \ - \ \"count\": 1,\n \"restrict_state\": 2,\n \"type\"\ - : \"best\"\n },\n \"computation_options\": {\n \ - \ \"disabled\": false\n },\n \"id\": \"rule1\",\n\ - \ \"node_visualization\": {\n \"style_config\": {},\n\ - \ \"type\": \"block\"\n },\n \"nodes\": [],\n\ - \ \"pack_id\": \"pack1\",\n \"params\": {\n \ - \ \"arguments\": [\n \"foo\",\n \"bar\"\n \ - \ ]\n },\n \"properties\": {\n \"comment\"\ - : \"\",\n \"docu_url\": \"\",\n \"icon\": \"\",\n\ - \ \"state_messages\": {},\n \"title\": \"\"\n \ - \ }\n }' \\\n \"$API_URL/objects/bi_rule/rule1\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Create a new BI rule - put: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.bi_rules`: Use the Setup BI module, create, modify and\ - \ delete BI rules and aggregations in packs that you are a contact of.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.put_bi_rule - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: rule_id - required: true - description: The unique id for the rule - schema: - type: string - example: rule1 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/BIRuleEndpoint' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BIRuleEndpoint' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/bi_rule/rule1\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"id\": \"rule1\",\n \"nodes\": [],\n\ - \ \"params\": {\"arguments\": [\"foo\", \"bar\"]},\n \"node_visualization\"\ - : {\n \"type\": \"block\",\n \"style_config\": {},\n\ - \ },\n \"properties\": {\n \"title\": \"\",\n \ - \ \"comment\": \"\",\n \"docu_url\": \"\",\n \ - \ \"icon\": \"\",\n \"state_messages\": {},\n },\n\ - \ \"aggregation_function\": {\n \"type\": \"best\",\n\ - \ \"count\": 1,\n \"restrict_state\": 2,\n \ - \ },\n \"computation_options\": {\"disabled\": False},\n \"\ - pack_id\": \"pack1\",\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/bi_rule/rule1\",\n method=\"PUT\",\n headers={\n\ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ - \ \"Accept\": \"application/json\",\n \"Content-Type\": 'application/json',\ - \ # (required) A header specifying which type of content is in the request/response\ - \ body.\n },\n data=json.dumps({\n \"id\": \"rule1\",\n \ - \ \"nodes\": [],\n \"params\": {\"arguments\": [\"foo\", \"bar\"\ - ]},\n \"node_visualization\": {\n \"type\": \"block\"\ - ,\n \"style_config\": {},\n },\n \"properties\"\ - : {\n \"title\": \"\",\n \"comment\": \"\",\n \ - \ \"docu_url\": \"\",\n \"icon\": \"\",\n \"\ - state_messages\": {},\n },\n \"aggregation_function\": {\n\ - \ \"type\": \"best\",\n \"count\": 1,\n \ - \ \"restrict_state\": 2,\n },\n \"computation_options\":\ - \ {\"disabled\": False},\n \"pack_id\": \"pack1\",\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/bi_rule/rule1\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ - \ \\\n id='rule1'\\\n nodes:='[]'\\\n params[arguments]:='[\"foo\"\ - , \"bar\"]'\\\n node_visualization[type]='block'\\\n properties[title]=''\\\ - \n properties[comment]=''\\\n properties[docu_url]=''\\\n properties[icon]=''\\\ - \n aggregation_function[type]='best'\\\n aggregation_function[count]:=1\\\ - \n aggregation_function[restrict_state]:=2\\\n computation_options[disabled]:=false\\\ - \n pack_id='pack1'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"aggregation_function\": {\n \ - \ \"count\": 1,\n \"restrict_state\": 2,\n \"type\"\ - : \"best\"\n },\n \"computation_options\": {\n \ - \ \"disabled\": false\n },\n \"id\": \"rule1\",\n\ - \ \"node_visualization\": {\n \"style_config\": {},\n\ - \ \"type\": \"block\"\n },\n \"nodes\": [],\n\ - \ \"pack_id\": \"pack1\",\n \"params\": {\n \ - \ \"arguments\": [\n \"foo\",\n \"bar\"\n \ - \ ]\n },\n \"properties\": {\n \"comment\"\ - : \"\",\n \"docu_url\": \"\",\n \"icon\": \"\",\n\ - \ \"state_messages\": {},\n \"title\": \"\"\n \ - \ }\n }' \\\n \"$API_URL/objects/bi_rule/rule1\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Update an existing BI rule - /domain-types/bi_aggregation/actions/aggregation_state/invoke: - post: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * `wato.bi_rules`:\ - \ Use the Setup BI module, create, modify and delete BI rules and aggregations\ - \ in packs that you are a contact of.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.get_bi_aggregation_state - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/BIAggregationStateResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BIAggregationStateRequest' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/bi_aggregation/actions/aggregation_state/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"filter_names\": [\"Host foo\"],\n \ - \ \"filter_groups\": [\"My Group\"],\n },\n)\nif resp.status_code ==\ - \ 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/bi_aggregation/actions/aggregation_state/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"filter_names\": [\"Host foo\"],\n \"filter_groups\": [\"\ - My Group\"],\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/bi_aggregation/actions/aggregation_state/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n filter_names:='[\"\ - Host foo\"]'\\\n filter_groups:='[\"My Group\"]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"filter_groups\": [\n \"My Group\"\ - \n ],\n \"filter_names\": [\n \"Host foo\"\n\ - \ ]\n }' \\\n \"$API_URL/domain-types/bi_aggregation/actions/aggregation_state/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Get the state of BI aggregations - /domain-types/bi_pack/collections/all: - get: - tags: - - Business intelligence (BI) - description: "\n\nThis endpoint requires the following permissions: \n * `wato.bi_rules`:\ - \ Use the Setup BI module, create, modify and delete BI rules and aggregations\ - \ in packs that you are a contact of.\n" - operationId: cmk.gui.plugins.openapi.endpoints.bi.get_bi_packs - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObjectCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/bi_pack/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/bi_pack/collections/all\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/bi_pack/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/bi_pack/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all BI packs - /agent_controller_certificates_settings: - get: - tags: - - Certificates - description: "\n\nThis endpoint requires the following permissions: \n * Any\ - \ of:\n * `wato.seeall`: When this permission is set then the user sees\ - \ also such modules he has no explicit access to (see below).\n * `wato.global`:\ - \ Access to the module Global settings\n" - operationId: cmk.gui.plugins.openapi.endpoints.cert.agent_controller_certificates_settings - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Unauthorized to read the global settings' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/AgentControllerCertificateSettings' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/agent_controller_certificates_settings\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/agent_controller_certificates_settings\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/agent_controller_certificates_settings\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/agent_controller_certificates_settings\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show agent controller certificate settings - /csr: - post: - tags: - - Certificates - description: "\n\nThis endpoint requires the following permissions: \n * `general.agent_pairing`:\ - \ Only relevant for the agent controller shipped with Checkmk 2.1. Pairing\ - \ of Checkmk agents with the monitoring site. This step establishes trust\ - \ between the agent and the monitoring site.\n" - operationId: cmk.gui.plugins.openapi.endpoints.cert.make_certificate - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: You do not have the permission for agent pairing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/X509PEM' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/X509ReqPEMUUID' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/csr\",\n\ - \ headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"csr\": \"-----BEGIN CERTIFICATE REQUEST-----\\\ - n...\\n-----END CERTIFICATE REQUEST-----\\n\"\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/csr\",\n method=\"POST\",\n headers={\n \"\ - Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \"Accept\"\ - : \"application/json\",\n \"Content-Type\": 'application/json', \ - \ # (required) A header specifying which type of content is in the request/response\ - \ body.\n },\n data=json.dumps({\n \"csr\": \"-----BEGIN CERTIFICATE\ - \ REQUEST-----\\n...\\n-----END CERTIFICATE REQUEST-----\\n\"\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/csr\" \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ \"Accept: application/json\" \\\n 'Content-Type:application/json'\ - \ \\\n csr='-----BEGIN CERTIFICATE REQUEST-----\n ...\n -----END\ - \ CERTIFICATE REQUEST-----\n '" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"csr\": \"-----BEGIN CERTIFICATE REQUEST-----\\\ - n...\\n-----END CERTIFICATE REQUEST-----\\n\"\n }' \\\n \"$API_URL/csr\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: X.509 PEM-encoded Certificate Signing Requests (CSRs) - /root_cert: - get: - tags: - - Certificates - description: "\n\nThis endpoint requires the following permissions: \n * `general.agent_pairing`:\ - \ Only relevant for the agent controller shipped with Checkmk 2.1. Pairing\ - \ of Checkmk agents with the monitoring site. This step establishes trust\ - \ between the agent and the monitoring site.\n" - operationId: cmk.gui.plugins.openapi.endpoints.cert.root_cert - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: You do not have the permission for agent pairing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/X509PEM' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/root_cert\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/root_cert\",\n method=\"GET\",\n headers={\n \ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \"\ - Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/root_cert\" \\\n \"Authorization: Bearer $USERNAME $PASSWORD\"\ - \ \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/root_cert\")\n\nresp=$( echo \"\ - ${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk\ - \ -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: X.509 PEM-encoded root certificate - /domain-types/comment/collections/host: - post: - tags: - - Comments - description: "\n\nThis endpoint requires the following permissions: \n * `action.addcomment`:\ - \ Add comments to hosts or services, and remove comments\n" - operationId: cmk.gui.plugins.openapi.endpoints.comment.create_host_comment - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateHostRelatedComment' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/comment/collections/host\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"comment\"\ - : \"Windows\",\n \"persistent\": False,\n \"comment_type\"\ - : \"host\",\n \"host_name\": \"example.com\",\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/comment/collections/host\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n # This schema has multiple\ - \ variations. Please refer to\n # the 'Payload' section for details.\n\ - \ data=json.dumps({\n \"comment\": \"Windows\",\n \"persistent\"\ - : False,\n \"comment_type\": \"host\",\n \"host_name\": \"\ - example.com\",\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/comment/collections/host\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n comment='Windows'\\\ - \n persistent:=false\\\n comment_type='host'\\\n host_name='example.com'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"comment\": \"Windows\"\ - ,\n \"comment_type\": \"host\",\n \"host_name\": \"example.com\"\ - ,\n \"persistent\": false\n }' \\\n \"$API_URL/domain-types/comment/collections/host\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a host comment - /domain-types/comment/collections/service: - post: - tags: - - Comments - description: "\n\nThis endpoint requires the following permissions: \n * `action.addcomment`:\ - \ Add comments to hosts or services, and remove comments\n" - operationId: cmk.gui.plugins.openapi.endpoints.comment.create_service_comment - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateServiceRelatedComment' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/comment/collections/service\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"comment\"\ - : \"Windows\",\n \"persistent\": False,\n \"comment_type\"\ - : \"service\",\n \"host_name\": \"example.com\",\n \"service_description\"\ - : \"Memory\",\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/comment/collections/service\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n # This schema has multiple\ - \ variations. Please refer to\n # the 'Payload' section for details.\n\ - \ data=json.dumps({\n \"comment\": \"Windows\",\n \"persistent\"\ - : False,\n \"comment_type\": \"service\",\n \"host_name\"\ - : \"example.com\",\n \"service_description\": \"Memory\",\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/comment/collections/service\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n comment='Windows'\\\ - \n persistent:=false\\\n comment_type='service'\\\n host_name='example.com'\\\ - \n service_description='Memory'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"comment\": \"Windows\"\ - ,\n \"comment_type\": \"service\",\n \"host_name\": \"\ - example.com\",\n \"persistent\": false,\n \"service_description\"\ - : \"Memory\"\n }' \\\n \"$API_URL/domain-types/comment/collections/service\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a service comment - /domain-types/comment/actions/delete/invoke: - post: - tags: - - Comments - description: "\n\nThis endpoint requires the following permissions: \n * `action.addcomment`:\ - \ Add comments to hosts or services, and remove comments\n" - operationId: cmk.gui.plugins.openapi.endpoints.comment.delete_comments - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteComments' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/comment/actions/delete/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"delete_type\"\ - : \"delete_by_query\",\n \"comment_id\": 21,\n \"site_id\"\ - : \"production\",\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/comment/actions/delete/invoke\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n # This schema has multiple\ - \ variations. Please refer to\n # the 'Payload' section for details.\n\ - \ data=json.dumps({\n \"delete_type\": \"delete_by_query\",\n\ - \ \"comment_id\": 21,\n \"site_id\": \"production\",\n \ - \ }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\nif\ - \ resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/comment/actions/delete/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n delete_type='delete_by_query'\\\ - \n comment_id:=21\\\n site_id='production'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"comment_id\": 21,\n\ - \ \"delete_type\": \"delete_by_query\",\n \"site_id\"\ - : \"production\"\n }' \\\n \"$API_URL/domain-types/comment/actions/delete/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete comments - /objects/comment/{comment_id}: - get: - tags: - - Comments - description: '' - operationId: cmk.gui.plugins.openapi.endpoints.comment.show_comment - parameters: - - in: query - name: site_id - required: true - description: An existing site id - schema: - type: string - example: heute - - in: path - name: comment_id - required: true - description: An existing comment's ID - schema: - type: integer - example: '1' - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/CommentObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/comment/1\"\ - ,\n params={ # goes into query string\n \"site_id\": 'heute',\ - \ # (required) An existing site id\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"site_id\": 'heute', # (required) An existing site id\n})\n\nrequest\ - \ = urllib.request.Request(\n f\"{API_URL}/objects/comment/1?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/comment/1\" \\\n \"Authorization: Bearer $USERNAME $PASSWORD\"\ - \ \\\n \"Accept: application/json\" \\\n site_id=='heute' \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'site_id=heute'\ - \ \\\n \"$API_URL/objects/comment/1\")\n\nresp=$( echo \"${out}\" | grep\ - \ -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk -F\"=\" '/^xxx-status_code/\ - \ {print $2}')\n\n# For indentation, please install 'jq' (JSON query tool)\n\ - echo \"$resp\" | jq\n# echo \"$resp\"\n\nif [[ $code -lt 400 ]]; then\n\ - \ echo \"OK\"\n exit 0\nelse\n echo \"Request error\"\n exit\ - \ 1\nfi" - summary: Show a comment - /domain-types/comment/collections/{collection_name}: - get: - tags: - - Comments - description: '' - operationId: cmk.gui.plugins.openapi.endpoints.comment.show_comments - parameters: - - in: query - name: query - required: false - description: An query expression of the Livestatus 'comments' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - schema: - example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, - {"op": "!=", "left": "state", "right": "0"}]}' - allOf: - - $ref: '#/components/schemas/Expr' - - in: query - name: service_description - required: false - description: The service description. No exception is raised when the specified - service description does not exist - schema: - type: string - example: Memory - - in: query - name: host_name - required: false - description: The host name. No exception is raised when the specified host - name does not exist - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - - in: query - name: site_id - required: false - description: An existing site id - schema: - type: string - example: heute - - in: path - name: collection_name - required: true - description: Do you want to get comments from 'hosts', 'services' or 'all' - schema: - type: string - enum: - - host - - service - - all - example: all - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/CommentCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/comment/collections/all\"\ - ,\n params={ # goes into query string\n \"query\": '{\"op\":\ - \ \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"name\", \"right\": \"\ - example.com\"}, {\"op\": \"!=\", \"left\": \"state\", \"right\": \"0\"}]}',\ - \ # An query expression of the Livestatus 'comments' table in nested dictionary\ - \ form.\n \"host_name\": 'example.com', # The host name.\n \ - \ \"service_description\": 'Memory', # The service description.\n \ - \ \"site_id\": 'heute', # An existing site id\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"query\": '{\"op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\":\ - \ \"name\", \"right\": \"example.com\"}, {\"op\": \"!=\", \"left\": \"state\"\ - , \"right\": \"0\"}]}', # An query expression of the Livestatus 'comments'\ - \ table in nested dictionary form.\n \"host_name\": 'example.com', #\ - \ The host name.\n \"service_description\": 'Memory', # The service\ - \ description.\n \"site_id\": 'heute', # An existing site id\n})\n\n\ - request = urllib.request.Request(\n f\"{API_URL}/domain-types/comment/collections/all?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/comment/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ query=='{\"op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"name\"\ - , \"right\": \"example.com\"}, {\"op\": \"!=\", \"left\": \"state\", \"\ - right\": \"0\"}]}' \\\n host_name=='example.com' \\\n service_description=='Memory'\ - \ \\\n site_id=='heute' \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'query={\"\ - op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"name\", \"right\"\ - : \"example.com\"}, {\"op\": \"!=\", \"left\": \"state\", \"right\": \"\ - 0\"}]}' \\\n --data-urlencode 'host_name=example.com' \\\n --data-urlencode\ - \ 'service_description=Memory' \\\n --data-urlencode 'site_id=heute'\ - \ \\\n \"$API_URL/domain-types/comment/collections/all\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Show comments - /domain-types/contact_group_config/actions/bulk-create/invoke: - post: - tags: - - Contact groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.users`: This permission is needed for the modules Users,\ - \ Roles and Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.bulk_create - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ContactGroupCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkInputContactGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/contact_group_config/actions/bulk-create/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"entries\": [\n {\n \ - \ \"name\": \"OnCall\",\n \"alias\": \"Not on Sundays\"\ - ,\n }\n ]\n },\n)\nif resp.status_code == 200:\n \ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/contact_group_config/actions/bulk-create/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"entries\": [\n {\n \"name\": \"OnCall\"\ - ,\n \"alias\": \"Not on Sundays\",\n }\n \ - \ ]\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/contact_group_config/actions/bulk-create/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n entries:='[{\"\ - name\": \"OnCall\", \"alias\": \"Not on Sundays\"}]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n {\n \ - \ \"alias\": \"Not on Sundays\",\n \"name\": \"OnCall\"\ - \n }\n ]\n }' \\\n \"$API_URL/domain-types/contact_group_config/actions/bulk-create/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk create contact groups - /domain-types/contact_group_config/actions/bulk-delete/invoke: - post: - tags: - - Contact groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.users`: This permission is needed for the modules Users,\ - \ Roles and Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.bulk_delete - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: The request is in conflict with the stored resource.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkDeleteContactGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/contact_group_config/actions/bulk-delete/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"entries\": [\"windows\", \"panels\"]},\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/contact_group_config/actions/bulk-delete/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - entries\": [\"windows\", \"panels\"]}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/contact_group_config/actions/bulk-delete/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n entries:='[\"\ - windows\", \"panels\"]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n \"windows\",\n\ - \ \"panels\"\n ]\n }' \\\n \"$API_URL/domain-types/contact_group_config/actions/bulk-delete/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk delete contact groups - /domain-types/contact_group_config/actions/bulk-update/invoke: - put: - tags: - - Contact groups - description: "Please be aware that when doing bulk updates, it is not possible\ - \ to prevent the\n[Updating Values](\"lost update problem\"), which is normally\ - \ prevented by the ETag locking\nmechanism. Use at your own risk.This endpoint\ - \ requires the following permissions: \n * All of:\n * `wato.edit`: This\ - \ permission is needed in order to make any changes or perform any actions\ - \ at all. Without this permission, the user is only able to view data, and\ - \ that only in modules he has explicit permissions for.\n * `wato.users`:\ - \ This permission is needed for the modules Users, Roles and\ - \ Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.bulk_update - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ContactGroupCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkUpdateContactGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/domain-types/contact_group_config/actions/bulk-update/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"entries\": [\n {\n \ - \ \"name\": \"OnCall\",\n \"attributes\": {\n \ - \ \"alias\": \"Not on Sundays\"\n },\n \ - \ }\n ]\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/contact_group_config/actions/bulk-update/invoke\"\ - ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"entries\": [\n {\n \"name\": \"OnCall\"\ - ,\n \"attributes\": {\n \"alias\": \"\ - Not on Sundays\"\n },\n }\n ]\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/domain-types/contact_group_config/actions/bulk-update/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n entries:='[{\"\ - name\": \"OnCall\", \"attributes\": {\"alias\": \"Not on Sundays\"}}]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n {\n \ - \ \"attributes\": {\n \"alias\": \"Not on Sundays\"\n\ - \ },\n \"name\": \"OnCall\"\n }\n \ - \ ]\n }' \\\n \"$API_URL/domain-types/contact_group_config/actions/bulk-update/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk update contact groups - /domain-types/contact_group_config/collections/all: - post: - tags: - - Contact groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.users`: This permission is needed for the modules Users,\ - \ Roles and Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.create - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/InputContactGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/contact_group_config/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"name\": \"OnCall\", \"alias\": \"Not on Sundays.\"\ - },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/contact_group_config/collections/all\",\n\ - \ method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - name\": \"OnCall\", \"alias\": \"Not on Sundays.\"}).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/contact_group_config/collections/all\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'Content-Type:application/json' \\\n name='OnCall'\\\n alias='Not\ - \ on Sundays.'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"alias\": \"Not on Sundays.\",\n \ - \ \"name\": \"OnCall\"\n }' \\\n \"$API_URL/domain-types/contact_group_config/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a contact group - get: - tags: - - Contact groups - description: "\n\nThis endpoint requires the following permissions: \n * `wato.users`:\ - \ This permission is needed for the modules Users, Roles and\ - \ Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.list_group - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ContactGroupCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/contact_group_config/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/contact_group_config/collections/all\",\n\ - \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/contact_group_config/collections/all\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/contact_group_config/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all contact groups - /objects/contact_group_config/{name}: - delete: - tags: - - Contact groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.users`: This permission is needed for the modules Users,\ - \ Roles and Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.delete - parameters: - - in: path - name: name - required: true - description: The identifier name of the group. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_\.]*\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: The request is in conflict with the stored resource.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/contact_group_config/pathname\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/contact_group_config/pathname\",\n method=\"\ - DELETE\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n },\n)\n\ - response = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/contact_group_config/pathname\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/contact_group_config/pathname\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a contact group - get: - tags: - - Contact groups - description: "\n\nThis endpoint requires the following permissions: \n * `wato.users`:\ - \ This permission is needed for the modules Users, Roles and\ - \ Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.show - parameters: - - in: path - name: name - required: true - description: The identifier name of the group. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_\.]*\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ContactGroup' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/contact_group_config/pathname\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/contact_group_config/pathname\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/contact_group_config/pathname\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/contact_group_config/pathname\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a contact group - put: - tags: - - Contact groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.users`: This permission is needed for the modules Users,\ - \ Roles and Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.update - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: name - required: true - description: The identifier name of the group. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_\.]*\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ContactGroup' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/contact_group_config/pathname\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\"alias\": \"Example\ - \ Group\"},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/contact_group_config/pathname\",\n method=\"\ - PUT\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ - a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ - \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n data=json.dumps({\"alias\": \"Example Group\"}).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/contact_group_config/pathname\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ - \ \\\n alias='Example Group'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"alias\": \"Example Group\"\n }' \\\n \"$API_URL/objects/contact_group_config/pathname\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update a contact group - /domain-types/downtime/collections/host: - post: - tags: - - Downtimes - description: "\n\nThis endpoint requires the following permissions: \n * `action.downtimes`:\ - \ Schedule and remove downtimes on hosts and services\n" - operationId: cmk.gui.plugins.openapi.endpoints.downtime.create_host_related_downtime - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '422': - description: 'Unprocessable Entity: The request could not be processed.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateHostRelatedDowntime' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/downtime/collections/host\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"start_time\"\ - : \"2017-07-21T17:32:28Z\",\n \"end_time\": \"2017-07-21T17:32:28Z\"\ - ,\n \"recur\": \"hour\",\n \"duration\": 60,\n \"comment\"\ - : \"Security updates\",\n \"downtime_type\": \"host\",\n \"\ - host_name\": \"example.com\",\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/downtime/collections/host\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n # This schema has multiple\ - \ variations. Please refer to\n # the 'Payload' section for details.\n\ - \ data=json.dumps({\n \"start_time\": \"2017-07-21T17:32:28Z\"\ - ,\n \"end_time\": \"2017-07-21T17:32:28Z\",\n \"recur\": \"\ - hour\",\n \"duration\": 60,\n \"comment\": \"Security updates\"\ - ,\n \"downtime_type\": \"host\",\n \"host_name\": \"example.com\"\ - ,\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/downtime/collections/host\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n start_time='2017-07-21T17:32:28Z'\\\ - \n end_time='2017-07-21T17:32:28Z'\\\n recur='hour'\\\n duration:=60\\\ - \n comment='Security updates'\\\n downtime_type='host'\\\n host_name='example.com'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"comment\": \"Security\ - \ updates\",\n \"downtime_type\": \"host\",\n \"duration\"\ - : 60,\n \"end_time\": \"2017-07-21T17:32:28Z\",\n \"host_name\"\ - : \"example.com\",\n \"recur\": \"hour\",\n \"start_time\"\ - : \"2017-07-21T17:32:28Z\"\n }' \\\n \"$API_URL/domain-types/downtime/collections/host\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a host related scheduled downtime - /domain-types/downtime/collections/service: - post: - tags: - - Downtimes - description: "\n\nThis endpoint requires the following permissions: \n * `action.downtimes`:\ - \ Schedule and remove downtimes on hosts and services\n" - operationId: cmk.gui.plugins.openapi.endpoints.downtime.create_service_related_downtime - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '422': - description: 'Unprocessable Entity: The request could not be processed.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateServiceRelatedDowntime' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/downtime/collections/service\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"start_time\"\ - : \"2017-07-21T17:32:28Z\",\n \"end_time\": \"2017-07-21T17:32:28Z\"\ - ,\n \"recur\": \"hour\",\n \"duration\": 60,\n \"comment\"\ - : \"Security updates\",\n \"downtime_type\": \"service\",\n \ - \ \"host_name\": \"example.com\",\n \"service_descriptions\": [\n\ - \ \"CPU utilization\",\n \"Memory\",\n ],\n\ - \ },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/downtime/collections/service\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n # This schema has multiple\ - \ variations. Please refer to\n # the 'Payload' section for details.\n\ - \ data=json.dumps({\n \"start_time\": \"2017-07-21T17:32:28Z\"\ - ,\n \"end_time\": \"2017-07-21T17:32:28Z\",\n \"recur\": \"\ - hour\",\n \"duration\": 60,\n \"comment\": \"Security updates\"\ - ,\n \"downtime_type\": \"service\",\n \"host_name\": \"example.com\"\ - ,\n \"service_descriptions\": [\n \"CPU utilization\"\ - ,\n \"Memory\",\n ],\n }).encode('utf-8'),\n)\nresponse\ - \ = urllib.request.urlopen(request)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/downtime/collections/service\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n start_time='2017-07-21T17:32:28Z'\\\ - \n end_time='2017-07-21T17:32:28Z'\\\n recur='hour'\\\n duration:=60\\\ - \n comment='Security updates'\\\n downtime_type='service'\\\n host_name='example.com'\\\ - \n service_descriptions:='[\"CPU utilization\", \"Memory\"]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"comment\": \"Security\ - \ updates\",\n \"downtime_type\": \"service\",\n \"duration\"\ - : 60,\n \"end_time\": \"2017-07-21T17:32:28Z\",\n \"host_name\"\ - : \"example.com\",\n \"recur\": \"hour\",\n \"service_descriptions\"\ - : [\n \"CPU utilization\",\n \"Memory\"\n \ - \ ],\n \"start_time\": \"2017-07-21T17:32:28Z\"\n }' \\\ - \n \"$API_URL/domain-types/downtime/collections/service\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Create a service related scheduled downtime - /domain-types/downtime/actions/delete/invoke: - post: - tags: - - Downtimes - description: "\n\nThis endpoint requires the following permissions: \n * `action.downtimes`:\ - \ Schedule and remove downtimes on hosts and services\n" - operationId: cmk.gui.plugins.openapi.endpoints.downtime.delete_downtime - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteDowntime' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/downtime/actions/delete/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"site_id\"\ - : \"heute\",\n \"delete_type\": \"params\",\n \"downtime_id\"\ - : \"54\",\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/downtime/actions/delete/invoke\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n # This schema has multiple\ - \ variations. Please refer to\n # the 'Payload' section for details.\n\ - \ data=json.dumps({\n \"site_id\": \"heute\",\n \"delete_type\"\ - : \"params\",\n \"downtime_id\": \"54\",\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/downtime/actions/delete/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n site_id='heute'\\\ - \n delete_type='params'\\\n downtime_id='54'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"delete_type\": \"params\"\ - ,\n \"downtime_id\": \"54\",\n \"site_id\": \"heute\"\n\ - \ }' \\\n \"$API_URL/domain-types/downtime/actions/delete/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a scheduled downtime - /objects/downtime/{downtime_id}: - get: - tags: - - Downtimes - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * Any of:\n * `general.see_all`: See all objects regardless of contacts\ - \ and contact groups. If combined with 'perform commands' then commands may\ - \ be done on all objects.\n * `bi.see_all`: With this permission set,\ - \ the BI aggregation rules are applied to all hosts and services - not only\ - \ those the user is a contact for. If you remove this permissions then the\ - \ user will see incomplete aggregation trees with status based only on those\ - \ items.\n * `mkeventd.seeall`: If a user lacks this permission then he/she\ - \ can see only those events that originate from a host that he/she is a contact\ - \ for.\n * `wato.see_all_folders`: Users without this permissions can\ - \ only see folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.downtime.show_downtime - parameters: - - in: query - name: site_id - required: true - description: An existing site id - schema: - type: string - example: heute - - in: path - name: downtime_id - required: true - description: The id of the downtime - schema: - type: integer - example: '1' - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DowntimeObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/downtime/1\"\ - ,\n params={ # goes into query string\n \"site_id\": 'heute',\ - \ # (required) An existing site id\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"site_id\": 'heute', # (required) An existing site id\n})\n\nrequest\ - \ = urllib.request.Request(\n f\"{API_URL}/objects/downtime/1?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/downtime/1\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n site_id=='heute'\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'site_id=heute'\ - \ \\\n \"$API_URL/objects/downtime/1\")\n\nresp=$( echo \"${out}\" |\ - \ grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk -F\"=\" '/^xxx-status_code/\ - \ {print $2}')\n\n# For indentation, please install 'jq' (JSON query tool)\n\ - echo \"$resp\" | jq\n# echo \"$resp\"\n\nif [[ $code -lt 400 ]]; then\n\ - \ echo \"OK\"\n exit 0\nelse\n echo \"Request error\"\n exit\ - \ 1\nfi" - summary: Show downtime - /domain-types/downtime/collections/all: - get: - tags: - - Downtimes - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * Any of:\n * `general.see_all`: See all objects regardless of contacts\ - \ and contact groups. If combined with 'perform commands' then commands may\ - \ be done on all objects.\n * `bi.see_all`: With this permission set,\ - \ the BI aggregation rules are applied to all hosts and services - not only\ - \ those the user is a contact for. If you remove this permissions then the\ - \ user will see incomplete aggregation trees with status based only on those\ - \ items.\n * `mkeventd.seeall`: If a user lacks this permission then he/she\ - \ can see only those events that originate from a host that he/she is a contact\ - \ for.\n * `wato.see_all_folders`: Users without this permissions can\ - \ only see folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.downtime.show_downtimes - parameters: - - in: query - name: query - required: false - description: An query expression of the Livestatus 'downtimes' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - schema: - example: '{"op": "and", "expr": [{"op": "=", "left": "host_name", "right": - "example.com"}, {"op": "=", "left": "type", "right": "0"}]}' - allOf: - - $ref: '#/components/schemas/Expr' - - in: query - name: service_description - required: false - description: The service description. No exception is raised when the specified - service description does not exist. This parameter can be combined with - the host_name parameter to only filter for service downtimes of on a specific - host. Cannot be used together with the query parameter. - schema: - type: string - example: Memory - - in: query - name: host_name - required: false - description: The host name. No exception is raised when the specified host - name does not exist. Using this parameter only will filter for host downtimes - only. Cannot be used together with the query parameter. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - - in: query - name: downtime_type - required: false - description: The type of the downtime to be listed. Only filters the result - when using the host_name or service_description parameter. - schema: - type: string - default: both - enum: - - host - - service - - both - example: host - - in: query - name: site_id - required: false - description: An existing site id - schema: - type: string - example: heute - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DowntimeCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/downtime/collections/all\"\ - ,\n params={ # goes into query string\n \"host_name\": 'example.com',\ - \ # The host name.\n \"service_description\": 'Memory', # The service\ - \ description.\n \"query\": '{\"op\": \"and\", \"expr\": [{\"op\"\ - : \"=\", \"left\": \"host_name\", \"right\": \"example.com\"}, {\"op\":\ - \ \"=\", \"left\": \"type\", \"right\": \"0\"}]}', # An query expression\ - \ of the Livestatus 'downtimes' table in nested dictionary form.\n \ - \ \"downtime_type\": 'host', # The type of the downtime to be listed.\n\ - \ \"site_id\": 'heute', # An existing site id\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"host_name\": 'example.com', # The host name.\n \"service_description\"\ - : 'Memory', # The service description.\n \"query\": '{\"op\": \"and\"\ - , \"expr\": [{\"op\": \"=\", \"left\": \"host_name\", \"right\": \"example.com\"\ - }, {\"op\": \"=\", \"left\": \"type\", \"right\": \"0\"}]}', # An query\ - \ expression of the Livestatus 'downtimes' table in nested dictionary form.\n\ - \ \"downtime_type\": 'host', # The type of the downtime to be listed.\n\ - \ \"site_id\": 'heute', # An existing site id\n})\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/downtime/collections/all?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/downtime/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ host_name=='example.com' \\\n service_description=='Memory' \\\n\ - \ query=='{\"op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"host_name\"\ - , \"right\": \"example.com\"}, {\"op\": \"=\", \"left\": \"type\", \"right\"\ - : \"0\"}]}' \\\n downtime_type=='host' \\\n site_id=='heute' \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'host_name=example.com'\ - \ \\\n --data-urlencode 'service_description=Memory' \\\n --data-urlencode\ - \ 'query={\"op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"host_name\"\ - , \"right\": \"example.com\"}, {\"op\": \"=\", \"left\": \"type\", \"right\"\ - : \"0\"}]}' \\\n --data-urlencode 'downtime_type=host' \\\n --data-urlencode\ - \ 'site_id=heute' \\\n \"$API_URL/domain-types/downtime/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all scheduled downtimes - /domain-types/event_console/actions/delete/invoke: - post: - tags: - - Event Console - description: "\n\nThis endpoint requires the following permissions: \n * `mkeventd.delete`:\ - \ Finally archive an event without any further action\n" - operationId: cmk.gui.plugins.openapi.endpoints.event_console.archive_events_with_filter - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteECEvents' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/event_console/actions/delete/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"site_id\"\ - : \"heute\",\n \"filter_type\": \"by_id\",\n \"event_id\"\ - : 1,\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/event_console/actions/delete/invoke\",\n\ - \ method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n #\ - \ This schema has multiple variations. Please refer to\n # the 'Payload'\ - \ section for details.\n data=json.dumps({\n \"site_id\": \"heute\"\ - ,\n \"filter_type\": \"by_id\",\n \"event_id\": 1,\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/event_console/actions/delete/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n site_id='heute'\\\ - \n filter_type='by_id'\\\n event_id:=1" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"event_id\": 1,\n \ - \ \"filter_type\": \"by_id\",\n \"site_id\": \"heute\"\n\ - \ }' \\\n \"$API_URL/domain-types/event_console/actions/delete/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Archive events - /objects/event_console/{event_id}/actions/change_state/invoke: - post: - tags: - - Event Console - description: "\n\nThis endpoint requires the following permissions: \n * `mkeventd.changestate`:\ - \ This permission allows to change the state classification of an event (e.g.\ - \ from CRIT to WARN).\n" - operationId: cmk.gui.plugins.openapi.endpoints.event_console.change_event_state - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: event_id - required: true - description: The event console event ID. - schema: - type: string - example: '1' - pattern: ^[0-9]+$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEventState' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/event_console/1/actions/change_state/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"site_id\": \"heute\", \"new_state\": \"ok\"},\n)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/event_console/1/actions/change_state/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - site_id\": \"heute\", \"new_state\": \"ok\"}).encode('utf-8'),\n)\nresponse\ - \ = urllib.request.urlopen(request)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/event_console/1/actions/change_state/invoke\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'Content-Type:application/json' \\\n site_id='heute'\\\n \ - \ new_state='ok'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"new_state\": \"ok\",\n \"site_id\"\ - : \"heute\"\n }' \\\n \"$API_URL/objects/event_console/1/actions/change_state/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Change event state - /domain-types/event_console/actions/change_state/invoke: - post: - tags: - - Event Console - description: "\n\nThis endpoint requires the following permissions: \n * `mkeventd.changestate`:\ - \ This permission allows to change the state classification of an event (e.g.\ - \ from CRIT to WARN).\n" - operationId: cmk.gui.plugins.openapi.endpoints.event_console.change_multiple_event_states - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEventStateSelector' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/event_console/actions/change_state/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"filter_type\"\ - : \"params\",\n \"site_id\": \"heute\",\n \"new_state\": \"\ - ok\",\n \"query\": '{\"op\": \"=\", \"left\": \"eventconsoleevents.event_host\"\ - , \"right\": \"test_host\"}',\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/event_console/actions/change_state/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n #\ - \ This schema has multiple variations. Please refer to\n # the 'Payload'\ - \ section for details.\n data=json.dumps({\n \"filter_type\":\ - \ \"params\",\n \"site_id\": \"heute\",\n \"new_state\": \"\ - ok\",\n \"query\": '{\"op\": \"=\", \"left\": \"eventconsoleevents.event_host\"\ - , \"right\": \"test_host\"}',\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/event_console/actions/change_state/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n filter_type='params'\\\ - \n site_id='heute'\\\n new_state='ok'\\\n query='{\"op\": \"=\"\ - , \"left\": \"eventconsoleevents.event_host\", \"right\": \"test_host\"\ - }'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"filter_type\": \"params\"\ - ,\n \"new_state\": \"ok\",\n \"query\": \"{\\\"op\\\"\ - : \\\"=\\\", \\\"left\\\": \\\"eventconsoleevents.event_host\\\", \\\"right\\\ - \": \\\"test_host\\\"}\",\n \"site_id\": \"heute\"\n }'\ - \ \\\n \"$API_URL/domain-types/event_console/actions/change_state/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Change multiple event states - /objects/event_console/{event_id}: - get: - tags: - - Event Console - description: '' - operationId: cmk.gui.plugins.openapi.endpoints.event_console.show_event - parameters: - - in: query - name: site_id - required: true - description: An existing site id - schema: - type: string - example: heute - - in: path - name: event_id - required: true - description: The event console event ID. - schema: - type: string - example: '1' - pattern: ^[0-9]+$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ECEventResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/event_console/1\"\ - ,\n params={ # goes into query string\n \"site_id\": 'heute',\ - \ # (required) An existing site id\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"site_id\": 'heute', # (required) An existing site id\n})\n\nrequest\ - \ = urllib.request.Request(\n f\"{API_URL}/objects/event_console/1?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/event_console/1\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n site_id=='heute'\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'site_id=heute'\ - \ \\\n \"$API_URL/objects/event_console/1\")\n\nresp=$( echo \"${out}\"\ - \ | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk -F\"=\"\ - \ '/^xxx-status_code/ {print $2}')\n\n# For indentation, please install\ - \ 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\nif [[\ - \ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo \"\ - Request error\"\n exit 1\nfi" - summary: Show an event - /domain-types/event_console/collections/all: - get: - tags: - - Event Console - description: '' - operationId: cmk.gui.plugins.openapi.endpoints.event_console.show_events - parameters: - - in: query - name: query - required: false - description: An query expression of the Livestatus 'eventconsoleevents' table - in nested dictionary form. If you want to use multiple expressions, nest - them with the AND/OR operators. - schema: - example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, - {"op": "!=", "left": "state", "right": "0"}]}' - allOf: - - $ref: '#/components/schemas/Expr' - - in: query - name: host - required: false - description: The host name. No exception is raised when the specified host - name does not exist - schema: - type: string - example: host_1 - pattern: ^[-0-9a-zA-Z_.]+\Z - - in: query - name: application - required: false - description: Show events that originated from this app. - schema: - type: string - example: app_1 - - in: query - name: state - required: false - description: The state - schema: - type: string - enum: - - ok - - warning - - critical - - unknown - example: ok - - in: query - name: phase - required: false - description: The event phase, open or ack - schema: - type: string - enum: - - open - - ack - example: open - - in: query - name: site_id - required: false - description: An existing site id - schema: - type: string - example: heute - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/EventConsoleResponseCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/event_console/collections/all\"\ - ,\n params={ # goes into query string\n \"query\": '{\"op\":\ - \ \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"name\", \"right\": \"\ - example.com\"}, {\"op\": \"!=\", \"left\": \"state\", \"right\": \"0\"}]}',\ - \ # An query expression of the Livestatus 'eventconsoleevents' table in\ - \ nested dictionary form.\n \"host\": 'host_1', # The host name.\n\ - \ \"application\": 'app_1', # Show events that originated from this\ - \ app.\n \"state\": 'ok', # The state\n \"phase\": 'open',\ - \ # The event phase, open or ack\n \"site_id\": 'heute', # An existing\ - \ site id\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"query\": '{\"op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\":\ - \ \"name\", \"right\": \"example.com\"}, {\"op\": \"!=\", \"left\": \"state\"\ - , \"right\": \"0\"}]}', # An query expression of the Livestatus 'eventconsoleevents'\ - \ table in nested dictionary form.\n \"host\": 'host_1', # The host\ - \ name.\n \"application\": 'app_1', # Show events that originated from\ - \ this app.\n \"state\": 'ok', # The state\n \"phase\": 'open', \ - \ # The event phase, open or ack\n \"site_id\": 'heute', # An existing\ - \ site id\n})\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/event_console/collections/all?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/event_console/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ query=='{\"op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"name\"\ - , \"right\": \"example.com\"}, {\"op\": \"!=\", \"left\": \"state\", \"\ - right\": \"0\"}]}' \\\n host=='host_1' \\\n application=='app_1' \\\ - \n state=='ok' \\\n phase=='open' \\\n site_id=='heute' \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'query={\"\ - op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"name\", \"right\"\ - : \"example.com\"}, {\"op\": \"!=\", \"left\": \"state\", \"right\": \"\ - 0\"}]}' \\\n --data-urlencode 'host=host_1' \\\n --data-urlencode\ - \ 'application=app_1' \\\n --data-urlencode 'state=ok' \\\n --data-urlencode\ - \ 'phase=open' \\\n --data-urlencode 'site_id=heute' \\\n \"$API_URL/domain-types/event_console/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show events - /objects/event_console/{event_id}/actions/update_and_acknowledge/invoke: - post: - tags: - - Event Console - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `mkeventd.update`: Needed for acknowledging and changing the comment\ - \ and contact of an event\n * `mkeventd.update_comment`: Needed for changing\ - \ a comment when updating an event\n * `mkeventd.update_contact`: Needed\ - \ for changing a contact when updating an event\n * Optionally:\n *\ - \ Any of:\n * `mkeventd.seeall`: If a user lacks this permission then\ - \ he/she can see only those events that originate from a host that he/she\ - \ is a contact for.\n * `general.see_all`: See all objects regardless\ - \ of contacts and contact groups. If combined with 'perform commands' then\ - \ commands may be done on all objects.\n * `bi.see_all`: With this permission\ - \ set, the BI aggregation rules are applied to all hosts and services - not\ - \ only those the user is a contact for. If you remove this permissions then\ - \ the user will see incomplete aggregation trees with status based only on\ - \ those items.\n" - operationId: cmk.gui.plugins.openapi.endpoints.event_console.update_and_acknowledge_event - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: event_id - required: true - description: The event console event ID. - schema: - type: string - example: '1' - pattern: ^[0-9]+$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateAndAcknowledeEventSiteIDRequired' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/event_console/1/actions/update_and_acknowledge/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"phase\": \"ack\",\n \"change_comment\"\ - : \"Comment now acked\",\n \"change_contact\": \"Mr Monitor\",\n\ - \ \"site_id\": \"heute\",\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/event_console/1/actions/update_and_acknowledge/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"phase\": \"ack\",\n \"change_comment\": \"Comment now\ - \ acked\",\n \"change_contact\": \"Mr Monitor\",\n \"site_id\"\ - : \"heute\",\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/event_console/1/actions/update_and_acknowledge/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n phase='ack'\\\ - \n change_comment='Comment now acked'\\\n change_contact='Mr Monitor'\\\ - \n site_id='heute'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"change_comment\": \"Comment now acked\"\ - ,\n \"change_contact\": \"Mr Monitor\",\n \"phase\": \"\ - ack\",\n \"site_id\": \"heute\"\n }' \\\n \"$API_URL/objects/event_console/1/actions/update_and_acknowledge/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update and acknowledge an event - /domain-types/event_console/actions/update_and_acknowledge/invoke: - post: - tags: - - Event Console - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `mkeventd.update`: Needed for acknowledging and changing the comment\ - \ and contact of an event\n * `mkeventd.update_comment`: Needed for changing\ - \ a comment when updating an event\n * `mkeventd.update_contact`: Needed\ - \ for changing a contact when updating an event\n * Optionally:\n *\ - \ Any of:\n * `mkeventd.seeall`: If a user lacks this permission then\ - \ he/she can see only those events that originate from a host that he/she\ - \ is a contact for.\n * `general.see_all`: See all objects regardless\ - \ of contacts and contact groups. If combined with 'perform commands' then\ - \ commands may be done on all objects.\n * `bi.see_all`: With this permission\ - \ set, the BI aggregation rules are applied to all hosts and services - not\ - \ only those the user is a contact for. If you remove this permissions then\ - \ the user will see incomplete aggregation trees with status based only on\ - \ those items.\n" - operationId: cmk.gui.plugins.openapi.endpoints.event_console.update_and_acknowledge_multiple_events - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateAndAcknowledgeSelector' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/event_console/actions/update_and_acknowledge/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"phase\":\ - \ \"ack\",\n \"change_comment\": \"Comment now acked\",\n \ - \ \"change_contact\": \"Mr Monitor\",\n \"filter_type\": \"all\"\ - ,\n \"site_id\": \"heute\",\n \"query\": '{\"op\": \"=\",\ - \ \"left\": \"eventconsoleevents.event_host\", \"right\": \"test_host\"\ - }',\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/event_console/actions/update_and_acknowledge/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n #\ - \ This schema has multiple variations. Please refer to\n # the 'Payload'\ - \ section for details.\n data=json.dumps({\n \"phase\": \"ack\"\ - ,\n \"change_comment\": \"Comment now acked\",\n \"change_contact\"\ - : \"Mr Monitor\",\n \"filter_type\": \"all\",\n \"site_id\"\ - : \"heute\",\n \"query\": '{\"op\": \"=\", \"left\": \"eventconsoleevents.event_host\"\ - , \"right\": \"test_host\"}',\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/event_console/actions/update_and_acknowledge/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n phase='ack'\\\ - \n change_comment='Comment now acked'\\\n change_contact='Mr Monitor'\\\ - \n filter_type='all'\\\n site_id='heute'\\\n query='{\"op\": \"\ - =\", \"left\": \"eventconsoleevents.event_host\", \"right\": \"test_host\"\ - }'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"change_comment\": \"\ - Comment now acked\",\n \"change_contact\": \"Mr Monitor\",\n \ - \ \"filter_type\": \"all\",\n \"phase\": \"ack\",\n \ - \ \"query\": \"{\\\"op\\\": \\\"=\\\", \\\"left\\\": \\\"eventconsoleevents.event_host\\\ - \", \\\"right\\\": \\\"test_host\\\"}\",\n \"site_id\": \"heute\"\ - \n }' \\\n \"$API_URL/domain-types/event_console/actions/update_and_acknowledge/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update and acknowledge events - /domain-types/folder_config/actions/bulk-update/invoke: - put: - tags: - - Folders - description: "Please be aware that when doing bulk updates, it is not possible\ - \ to prevent the\n[Updating Values](\"lost update problem\"), which is normally\ - \ prevented by the ETag locking\nmechanism. Use at your own riskThis endpoint\ - \ requires the following permissions: \n * All of:\n * `wato.edit`: This\ - \ permission is needed in order to make any changes or perform any actions\ - \ at all. Without this permission, the user is only able to view data, and\ - \ that only in modules he has explicit permissions for.\n * `wato.edit_folders`:\ - \ Modify the properties of existing folders.\n * Optionally:\n * `wato.all_folders`:\ - \ Without this permission, operations on folders can only be done by users\ - \ that are members of one of the folders contact groups. This permission grants\ - \ full access to all folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.folder_config.bulk_update - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/FolderCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkUpdateFolder' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/domain-types/folder_config/actions/bulk-update/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"entries\": [\n {\"remove_attributes\"\ - : [\"tag_foobar\"]}\n ]\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/folder_config/actions/bulk-update/invoke\"\ - ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"entries\": [\n {\"remove_attributes\": [\"tag_foobar\"\ - ]}\n ]\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/domain-types/folder_config/actions/bulk-update/invoke\" \\\n \ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'Content-Type:application/json' \\\n entries:='[{\"remove_attributes\"\ - : [\"tag_foobar\"]}]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n {\n \ - \ \"remove_attributes\": [\n \"tag_foobar\"\n \ - \ ]\n }\n ]\n }' \\\n \"$API_URL/domain-types/folder_config/actions/bulk-update/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk update folders - /domain-types/folder_config/collections/all: - post: - tags: - - Folders - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.manage_folders`: Add new folders and delete existing folders.\ - \ If a folder to be deleted contains hosts then the permission to delete hosts\ - \ is also required.\n * Optionally:\n * `wato.manage_hosts`: Add hosts\ - \ to the monitoring and remove hosts from the monitoring. Please also add\ - \ the permission Modify existing hosts.\n * Optionally:\n * `wato.all_folders`:\ - \ Without this permission, operations on folders can only be done by users\ - \ that are members of one of the folders contact groups. This permission grants\ - \ full access to all folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.folder_config.create - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/Folder' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateFolder' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/folder_config/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"name\": \"production\",\n \"title\"\ - : \"Production Hosts\",\n \"parent\": \"/\",\n \"attributes\"\ - : {\"tag_criticality\": \"prod\"},\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/folder_config/collections/all\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"name\": \"production\",\n \"title\": \"Production Hosts\"\ - ,\n \"parent\": \"/\",\n \"attributes\": {\"tag_criticality\"\ - : \"prod\"},\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/folder_config/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n name='production'\\\n title='Production\ - \ Hosts'\\\n parent='/'\\\n attributes[tag_criticality]='prod'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"attributes\": {\n \"tag_criticality\"\ - : \"prod\"\n },\n \"name\": \"production\",\n \ - \ \"parent\": \"/\",\n \"title\": \"Production Hosts\"\n \ - \ }' \\\n \"$API_URL/domain-types/folder_config/collections/all\")\n\ - \nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a folder - get: - tags: - - Folders - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * `wato.see_all_folders`: Users without this permissions can only see\ - \ folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.folder_config.list_folders - parameters: - - in: query - name: parent - required: false - description: 'Show all sub-folders of this folder. The default is the root-folder. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate - for your quoting/escaping needs. A good default choice is `~`.' - schema: - type: string - example: /servers - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - - in: query - name: recursive - required: false - description: 'List the folder (default: root) and all its sub-folders recursively.' - schema: - type: boolean - default: false - example: false - - in: query - name: show_hosts - required: false - description: When set, all hosts that are stored in each folder will also - be shown. On large setups this may come at a performance cost, so by default - this is switched off. - schema: - type: boolean - default: false - example: false - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/FolderCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/folder_config/collections/all\"\ - ,\n params={ # goes into query string\n \"parent\": '/servers',\ - \ # Show all sub-folders of this folder.\n \"recursive\": False,\ - \ # List the folder (default: root) and all its sub-folders recursively.\n\ - \ \"show_hosts\": False, # When set, all hosts that are stored in\ - \ each folder will also be shown.\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"parent\": '/servers', # Show all sub-folders of this folder.\n \ - \ \"recursive\": False, # List the folder (default: root) and all its\ - \ sub-folders recursively.\n \"show_hosts\": False, # When set, all\ - \ hosts that are stored in each folder will also be shown.\n})\n\nrequest\ - \ = urllib.request.Request(\n f\"{API_URL}/domain-types/folder_config/collections/all?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/folder_config/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ parent=='/servers' \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'parent=/servers'\ - \ \\\n \"$API_URL/domain-types/folder_config/collections/all\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Show all folders - /objects/folder_config/{folder}: - delete: - tags: - - Folders - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.manage_folders`: Add new folders and delete existing folders.\ - \ If a folder to be deleted contains hosts then the permission to delete hosts\ - \ is also required.\n * Optionally:\n * `wato.manage_hosts`: Add hosts\ - \ to the monitoring and remove hosts from the monitoring. Please also add\ - \ the permission Modify existing hosts.\n * Optionally:\n * `wato.all_folders`:\ - \ Without this permission, operations on folders can only be done by users\ - \ that are members of one of the folders contact groups. This permission grants\ - \ full access to all folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.folder_config.delete - parameters: - - in: path - name: folder - required: true - description: 'The path of the folder being requested. Please be aware that - slashes can''t be used in the URL. Also, escaping the slashes via %2f will - not work. Please replace the path delimiters with the tilde character `~`. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate - for your quoting/escaping needs. A good default choice is `~`.' - schema: - type: string - example: ~my~fine~folder - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: 'Unauthorized: The user is not authorized to do this request.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/folder_config/~my~fine~folder\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/folder_config/~my~fine~folder\",\n method=\"\ - DELETE\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n },\n)\n\ - response = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/folder_config/~my~fine~folder\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/folder_config/~my~fine~folder\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a folder - get: - tags: - - Folders - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * `wato.see_all_folders`: Users without this permissions can only see\ - \ folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.folder_config.show_folder - parameters: - - in: query - name: show_hosts - required: false - description: When set, all hosts that are stored in this folder will also - be shown. On large setups this may come at a performance cost, so by default - this is switched off. - schema: - type: boolean - default: false - example: false - - in: path - name: folder - required: true - description: 'The path of the folder being requested. Please be aware that - slashes can''t be used in the URL. Also, escaping the slashes via %2f will - not work. Please replace the path delimiters with the tilde character `~`. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate - for your quoting/escaping needs. A good default choice is `~`.' - schema: - type: string - example: ~my~fine~folder - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/Folder' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/folder_config/~my~fine~folder\"\ - ,\n params={ # goes into query string\n \"show_hosts\": False,\ - \ # When set, all hosts that are stored in this folder will also be shown.\n\ - \ },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"show_hosts\": False, # When set, all hosts that are stored in this\ - \ folder will also be shown.\n})\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/folder_config/~my~fine~folder?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/folder_config/~my~fine~folder\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n \"$API_URL/objects/folder_config/~my~fine~folder\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a folder - put: - tags: - - Folders - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.edit_folders`: Modify the properties of existing folders.\n\ - \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ - \ on folders can only be done by users that are members of one of the folders\ - \ contact groups. This permission grants full access to all folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.folder_config.update - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: folder - required: true - description: 'The path of the folder being requested. Please be aware that - slashes can''t be used in the URL. Also, escaping the slashes via %2f will - not work. Please replace the path delimiters with the tilde character `~`. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate - for your quoting/escaping needs. A good default choice is `~`.' - schema: - type: string - example: ~my~fine~folder - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/Folder' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateFolder' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/folder_config/~my~fine~folder\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\n \"title\"\ - : \"Virtual Servers\",\n \"attributes\": {\"tag_networking\": \"\ - wan\"},\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/folder_config/~my~fine~folder\",\n method=\"\ - PUT\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ - a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ - \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n data=json.dumps({\n \"title\": \"Virtual Servers\",\n\ - \ \"attributes\": {\"tag_networking\": \"wan\"},\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/folder_config/~my~fine~folder\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ - \ \\\n title='Virtual Servers'\\\n attributes[tag_networking]='wan'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"attributes\": {\n \"tag_networking\": \"wan\"\n\ - \ },\n \"title\": \"Virtual Servers\"\n }' \\\n\ - \ \"$API_URL/objects/folder_config/~my~fine~folder\")\n\nresp=$( echo\ - \ \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" |\ - \ awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Update a folder - /objects/folder_config/{folder}/collections/hosts: - get: - tags: - - Folders - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * `wato.see_all_folders`: Users without this permissions can only see\ - \ folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.folder_config.hosts_of_folder - parameters: - - in: path - name: folder - required: true - description: 'The path of the folder being requested. Please be aware that - slashes can''t be used in the URL. Also, escaping the slashes via %2f will - not work. Please replace the path delimiters with the tilde character `~`. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate - for your quoting/escaping needs. A good default choice is `~`.' - schema: - type: string - example: ~my~fine~folder - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostConfigCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/folder_config/~my~fine~folder/collections/hosts\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/folder_config/~my~fine~folder/collections/hosts\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/folder_config/~my~fine~folder/collections/hosts\" \\\n\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/folder_config/~my~fine~folder/collections/hosts\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all hosts in a folder - /objects/folder_config/{folder}/actions/move/invoke: - post: - tags: - - Folders - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.manage_folders`: Add new folders and delete existing folders.\ - \ If a folder to be deleted contains hosts then the permission to delete hosts\ - \ is also required.\n * Optionally:\n * `wato.manage_hosts`: Add hosts\ - \ to the monitoring and remove hosts from the monitoring. Please also add\ - \ the permission Modify existing hosts.\n * Optionally:\n * `wato.all_folders`:\ - \ Without this permission, operations on folders can only be done by users\ - \ that are members of one of the folders contact groups. This permission grants\ - \ full access to all folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.folder_config.move - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: folder - required: true - description: 'The path of the folder being requested. Please be aware that - slashes can''t be used in the URL. Also, escaping the slashes via %2f will - not work. Please replace the path delimiters with the tilde character `~`. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate - for your quoting/escaping needs. A good default choice is `~`.' - schema: - type: string - example: ~my~fine~folder - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/Folder' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/MoveFolder' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/folder_config/~my~fine~folder/actions/move/invoke\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\"destination\": \"\ - ~my~fine/folder\"},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/folder_config/~my~fine~folder/actions/move/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ - \ the, to be modified, object's ETag header.\n \"Content-Type\":\ - \ 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\"destination\"\ - : \"~my~fine/folder\"}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/folder_config/~my~fine~folder/actions/move/invoke\" \\\n\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ - \ \\\n destination='~my~fine/folder'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"destination\": \"~my~fine/folder\"\n }' \\\n \"$API_URL/objects/folder_config/~my~fine~folder/actions/move/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Move a folder - /domain-types/host/collections/all: - get: - tags: - - Host status - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * Any of:\n * `general.see_all`: See all objects regardless of contacts\ - \ and contact groups. If combined with 'perform commands' then commands may\ - \ be done on all objects.\n * `bi.see_all`: With this permission set,\ - \ the BI aggregation rules are applied to all hosts and services - not only\ - \ those the user is a contact for. If you remove this permissions then the\ - \ user will see incomplete aggregation trees with status based only on those\ - \ items.\n * `mkeventd.seeall`: If a user lacks this permission then he/she\ - \ can see only those events that originate from a host that he/she is a contact\ - \ for.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host.list_hosts - parameters: - - in: query - name: sites - required: false - explode: true - style: form - description: Restrict the query to this particular site. - schema: - type: array - default: [] - items: - type: string - - in: query - name: query - required: false - description: An query expression of the Livestatus 'hosts' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - schema: - example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, - {"op": "!=", "left": "state", "right": "0"}]}' - allOf: - - $ref: '#/components/schemas/Expr' - - in: query - name: columns - required: false - explode: true - style: form - description: The desired columns of the `hosts` table. If left empty, a default - set of columns is used. - schema: - type: array - default: - - name - example: - - name - items: - type: string - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObjectCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/host/collections/all\"\ - ,\n params={ # goes into query string\n \"query\": '{\"op\":\ - \ \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"name\", \"right\": \"\ - example.com\"}, {\"op\": \"!=\", \"left\": \"state\", \"right\": \"0\"}]}',\ - \ # An query expression of the Livestatus 'hosts' table in nested dictionary\ - \ form.\n \"columns\": ['name'], # The desired columns of the `hosts`\ - \ table.\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"query\": '{\"op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\":\ - \ \"name\", \"right\": \"example.com\"}, {\"op\": \"!=\", \"left\": \"state\"\ - , \"right\": \"0\"}]}', # An query expression of the Livestatus 'hosts'\ - \ table in nested dictionary form.\n \"columns\": ['name'], # The desired\ - \ columns of the `hosts` table.\n})\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/host/collections/all?{query_string}\",\n\ - \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/host/collections/all\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n query=='{\"\ - op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"name\", \"right\"\ - : \"example.com\"}, {\"op\": \"!=\", \"left\": \"state\", \"right\": \"\ - 0\"}]}' \\\n columns=='['name']' \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'query={\"\ - op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"name\", \"right\"\ - : \"example.com\"}, {\"op\": \"!=\", \"left\": \"state\", \"right\": \"\ - 0\"}]}' \\\n --data-urlencode 'columns=name' \\\n \"$API_URL/domain-types/host/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show hosts of specific condition - /domain-types/host_config/actions/bulk-create/invoke: - post: - tags: - - Hosts - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.manage_hosts`: Add hosts to the monitoring and remove hosts\ - \ from the monitoring. Please also add the permission Modify existing hosts.\n\ - \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ - \ on folders can only be done by users that are members of one of the folders\ - \ contact groups. This permission grants full access to all folders and hosts.\n\ - \ * Optionally:\n * Any of:\n * `bi.see_all`: With this permission\ - \ set, the BI aggregation rules are applied to all hosts and services - not\ - \ only those the user is a contact for. If you remove this permissions then\ - \ the user will see incomplete aggregation trees with status based only on\ - \ those items.\n * `general.see_all`: See all objects regardless of\ - \ contacts and contact groups. If combined with 'perform commands' then commands\ - \ may be done on all objects.\n * `mkeventd.seeall`: If a user lacks\ - \ this permission then he/she can see only those events that originate from\ - \ a host that he/she is a contact for.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.bulk_create_hosts - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: query - name: bake_agent - required: false - description: Tries to bake the agents for the just created hosts. This process - is started in the background after configuring the host. Please note that - the backing may take some time and might block subsequent API calls. This - only works when using the Enterprise Editions. - schema: - type: boolean - default: false - example: false - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/BulkHostActionWithFailedHosts' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostConfigCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkCreateHost' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_config/actions/bulk-create/invoke\"\ - ,\n params={ # goes into query string\n \"bake_agent\": False,\ - \ # Tries to bake the agents for the just created hosts.\n },\n headers={\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n json={\n\ - \ \"entries\": [\n {\n \"host_name\": \"\ - example.com\",\n \"folder\": \"/\",\n \"attributes\"\ - : {},\n }\n ]\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"bake_agent\": False, # Tries to bake the agents for the just created\ - \ hosts.\n})\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/host_config/actions/bulk-create/invoke?{query_string}\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"entries\": [\n {\n \"host_name\": \"\ - example.com\",\n \"folder\": \"/\",\n \"attributes\"\ - : {},\n }\n ]\n }).encode('utf-8'),\n)\nresponse =\ - \ urllib.request.urlopen(request)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/host_config/actions/bulk-create/invoke\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'Content-Type:application/json' \\\n entries:='[{\"host_name\"\ - : \"example.com\", \"folder\": \"/\", \"attributes\": {}}]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"entries\": [\n \ - \ {\n \"attributes\": {},\n \"folder\":\ - \ \"/\",\n \"host_name\": \"example.com\"\n }\n\ - \ ]\n }' \\\n \"$API_URL/domain-types/host_config/actions/bulk-create/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk create hosts - /domain-types/host_config/actions/bulk-delete/invoke: - post: - tags: - - Hosts - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.manage_hosts`: Add hosts to the monitoring and remove hosts\ - \ from the monitoring. Please also add the permission Modify existing hosts.\n\ - \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ - \ on folders can only be done by users that are members of one of the folders\ - \ contact groups. This permission grants full access to all folders and hosts.\n\ - \ * Optionally:\n * Any of:\n * `bi.see_all`: With this permission\ - \ set, the BI aggregation rules are applied to all hosts and services - not\ - \ only those the user is a contact for. If you remove this permissions then\ - \ the user will see incomplete aggregation trees with status based only on\ - \ those items.\n * `general.see_all`: See all objects regardless of\ - \ contacts and contact groups. If combined with 'perform commands' then commands\ - \ may be done on all objects.\n * `mkeventd.seeall`: If a user lacks\ - \ this permission then he/she can see only those events that originate from\ - \ a host that he/she is a contact for.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.bulk_delete - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkDeleteHost' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_config/actions/bulk-delete/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"entries\": [\"example\", \"sample\"]},\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/host_config/actions/bulk-delete/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - entries\": [\"example\", \"sample\"]}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/host_config/actions/bulk-delete/invoke\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'Content-Type:application/json' \\\n entries:='[\"example\"\ - , \"sample\"]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n \"example\",\n\ - \ \"sample\"\n ]\n }' \\\n \"$API_URL/domain-types/host_config/actions/bulk-delete/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk delete hosts - /domain-types/host_config/actions/bulk-update/invoke: - put: - tags: - - Hosts - description: "Please be aware that when doing bulk updates, it is not possible\ - \ to prevent the\n[Updating Values](\"lost update problem\"), which is normally\ - \ prevented by the ETag locking\nmechanism. Use at your own risk.This endpoint\ - \ requires the following permissions: \n * All of:\n * `wato.edit`: This\ - \ permission is needed in order to make any changes or perform any actions\ - \ at all. Without this permission, the user is only able to view data, and\ - \ that only in modules he has explicit permissions for.\n * `wato.edit_hosts`:\ - \ Modify the properties of existing hosts. Please note: for the management\ - \ of services (inventory) there is a separate permission (see below)\n *\ - \ Optionally:\n * `wato.all_folders`: Without this permission, operations\ - \ on folders can only be done by users that are members of one of the folders\ - \ contact groups. This permission grants full access to all folders and hosts.\n\ - \ * Optionally:\n * `wato.see_all_folders`: Users without this permissions\ - \ can only see folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.bulk_update_hosts - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/BulkHostActionWithFailedHosts' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostConfigCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkUpdateHost' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/domain-types/host_config/actions/bulk-update/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"entries\": [\n {\n \ - \ \"host_name\": \"example.com\",\n \"attributes\": {},\n\ - \ }\n ]\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/host_config/actions/bulk-update/invoke\"\ - ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"entries\": [\n {\n \"host_name\": \"\ - example.com\",\n \"attributes\": {},\n }\n \ - \ ]\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/domain-types/host_config/actions/bulk-update/invoke\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'Content-Type:application/json' \\\n entries:='[{\"host_name\"\ - : \"example.com\", \"attributes\": {}}]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n {\n \ - \ \"attributes\": {},\n \"host_name\": \"example.com\"\n\ - \ }\n ]\n }' \\\n \"$API_URL/domain-types/host_config/actions/bulk-update/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk update hosts - /domain-types/host_config/collections/clusters: - post: - tags: - - Hosts - description: "A cluster host groups many hosts (called nodes in this context)\ - \ into a conceptual cluster.\nAll the services of the individual nodes will\ - \ be collated on the cluster host.This endpoint requires the following permissions:\ - \ \n * All of:\n * `wato.edit`: This permission is needed in order to make\ - \ any changes or perform any actions at all. Without this permission, the\ - \ user is only able to view data, and that only in modules he has explicit\ - \ permissions for.\n * `wato.manage_hosts`: Add hosts to the monitoring\ - \ and remove hosts from the monitoring. Please also add the permission Modify\ - \ existing hosts.\n * Optionally:\n * `wato.all_folders`: Without\ - \ this permission, operations on folders can only be done by users that are\ - \ members of one of the folders contact groups. This permission grants full\ - \ access to all folders and hosts.\n * Optionally:\n * Any of:\n \ - \ * `bi.see_all`: With this permission set, the BI aggregation rules are\ - \ applied to all hosts and services - not only those the user is a contact\ - \ for. If you remove this permissions then the user will see incomplete aggregation\ - \ trees with status based only on those items.\n * `general.see_all`:\ - \ See all objects regardless of contacts and contact groups. If combined with\ - \ 'perform commands' then commands may be done on all objects.\n * `mkeventd.seeall`:\ - \ If a user lacks this permission then he/she can see only those events that\ - \ originate from a host that he/she is a contact for.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.create_cluster_host - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: query - name: bake_agent - required: false - description: Tries to bake the agents for the just created hosts. This process - is started in the background after configuring the host. Please note that - the backing may take some time and might block subsequent API calls. This - only works when using the Enterprise Editions. - schema: - type: boolean - default: false - example: false - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostConfig' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateClusterHost' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_config/collections/clusters\"\ - ,\n params={ # goes into query string\n \"bake_agent\": False,\ - \ # Tries to bake the agents for the just created hosts.\n },\n headers={\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n json={\n\ - \ \"folder\": \"/\",\n \"host_name\": \"example.com\",\n \ - \ \"attributes\": {\"ipaddress\": \"192.168.0.123\"},\n \"\ - nodes\": [\"host1\", \"host2\", \"host3\"],\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"bake_agent\": False, # Tries to bake the agents for the just created\ - \ hosts.\n})\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/host_config/collections/clusters?{query_string}\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"folder\": \"/\",\n \"host_name\": \"example.com\",\n \ - \ \"attributes\": {\"ipaddress\": \"192.168.0.123\"},\n \"\ - nodes\": [\"host1\", \"host2\", \"host3\"],\n }).encode('utf-8'),\n)\n\ - response = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/host_config/collections/clusters\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n folder='/'\\\n host_name='example.com'\\\ - \n attributes[ipaddress]='192.168.0.123'\\\n nodes:='[\"host1\", \"\ - host2\", \"host3\"]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"attributes\": {\n \ - \ \"ipaddress\": \"192.168.0.123\"\n },\n \"\ - folder\": \"/\",\n \"host_name\": \"example.com\",\n \"\ - nodes\": [\n \"host1\",\n \"host2\",\n \ - \ \"host3\"\n ]\n }' \\\n \"$API_URL/domain-types/host_config/collections/clusters\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a cluster host - /domain-types/host_config/collections/all: - post: - tags: - - Hosts - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.manage_hosts`: Add hosts to the monitoring and remove hosts\ - \ from the monitoring. Please also add the permission Modify existing hosts.\n\ - \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ - \ on folders can only be done by users that are members of one of the folders\ - \ contact groups. This permission grants full access to all folders and hosts.\n\ - \ * Optionally:\n * Any of:\n * `bi.see_all`: With this permission\ - \ set, the BI aggregation rules are applied to all hosts and services - not\ - \ only those the user is a contact for. If you remove this permissions then\ - \ the user will see incomplete aggregation trees with status based only on\ - \ those items.\n * `general.see_all`: See all objects regardless of\ - \ contacts and contact groups. If combined with 'perform commands' then commands\ - \ may be done on all objects.\n * `mkeventd.seeall`: If a user lacks\ - \ this permission then he/she can see only those events that originate from\ - \ a host that he/she is a contact for.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.create_host - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: query - name: bake_agent - required: false - description: Tries to bake the agents for the just created hosts. This process - is started in the background after configuring the host. Please note that - the backing may take some time and might block subsequent API calls. This - only works when using the Enterprise Editions. - schema: - type: boolean - default: false - example: false - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostConfig' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateHost' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_config/collections/all\"\ - ,\n params={ # goes into query string\n \"bake_agent\": False,\ - \ # Tries to bake the agents for the just created hosts.\n },\n headers={\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n json={\n\ - \ \"folder\": \"/\",\n \"host_name\": \"example.com\",\n \ - \ \"attributes\": {\"ipaddress\": \"192.168.0.123\"},\n },\n)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"bake_agent\": False, # Tries to bake the agents for the just created\ - \ hosts.\n})\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/host_config/collections/all?{query_string}\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"folder\": \"/\",\n \"host_name\": \"example.com\",\n \ - \ \"attributes\": {\"ipaddress\": \"192.168.0.123\"},\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/host_config/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n folder='/'\\\n host_name='example.com'\\\ - \n attributes[ipaddress]='192.168.0.123'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"attributes\": {\n \ - \ \"ipaddress\": \"192.168.0.123\"\n },\n \"\ - folder\": \"/\",\n \"host_name\": \"example.com\"\n }' \\\ - \n \"$API_URL/domain-types/host_config/collections/all\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Create a host - get: - tags: - - Hosts - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * `wato.see_all_folders`: Users without this permissions can only see\ - \ folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.list_hosts - parameters: - - in: query - name: effective_attributes - required: false - description: Show all effective attributes on hosts, not just the attributes - which were set on this host specifically. This includes all attributes of - all of this host's parent folders. - schema: - type: boolean - default: false - example: false - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostConfigCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/host_config/collections/all\"\ - ,\n params={ # goes into query string\n \"effective_attributes\"\ - : False, # Show all effective attributes on hosts, not just the attributes\ - \ which were set on this host specifically.\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"effective_attributes\": False, # Show all effective attributes on\ - \ hosts, not just the attributes which were set on this host specifically.\n\ - })\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/host_config/collections/all?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/host_config/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n \"$API_URL/domain-types/host_config/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all hosts - /objects/host_config/{host_name}: - delete: - tags: - - Hosts - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.manage_hosts`: Add hosts to the monitoring and remove hosts\ - \ from the monitoring. Please also add the permission Modify existing hosts.\n\ - \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ - \ on folders can only be done by users that are members of one of the folders\ - \ contact groups. This permission grants full access to all folders and hosts.\n\ - \ * Optionally:\n * Any of:\n * `bi.see_all`: With this permission\ - \ set, the BI aggregation rules are applied to all hosts and services - not\ - \ only those the user is a contact for. If you remove this permissions then\ - \ the user will see incomplete aggregation trees with status based only on\ - \ those items.\n * `general.see_all`: See all objects regardless of\ - \ contacts and contact groups. If combined with 'perform commands' then commands\ - \ may be done on all objects.\n * `mkeventd.seeall`: If a user lacks\ - \ this permission then he/she can see only those events that originate from\ - \ a host that he/she is a contact for.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.delete - parameters: - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/host_config/example.com\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_config/example.com\",\n method=\"DELETE\"\ - ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/host_config/example.com\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/host_config/example.com\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a host - get: - tags: - - Hosts - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * `wato.see_all_folders`: Users without this permissions can only see\ - \ folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.show_host - parameters: - - in: query - name: effective_attributes - required: false - description: Show all effective attributes on hosts, not just the attributes - which were set on this host specifically. This includes all attributes of - all of this host's parent folders. - schema: - type: boolean - default: false - example: false - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostConfig' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host_config/example.com\"\ - ,\n params={ # goes into query string\n \"effective_attributes\"\ - : False, # Show all effective attributes on hosts, not just the attributes\ - \ which were set on this host specifically.\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"effective_attributes\": False, # Show all effective attributes on\ - \ hosts, not just the attributes which were set on this host specifically.\n\ - })\n\nrequest = urllib.request.Request(\n f\"{API_URL}/objects/host_config/example.com?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/host_config/example.com\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n \"$API_URL/objects/host_config/example.com\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a host - put: - tags: - - Hosts - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.edit_hosts`: Modify the properties of existing hosts. Please\ - \ note: for the management of services (inventory) there is a separate permission\ - \ (see below)\n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n * Optionally:\n * `wato.see_all_folders`: Users\ - \ without this permissions can only see folders with a contact group they\ - \ are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.update_host - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostConfig' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateHost' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_config/example.com\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\"attributes\": {\"\ - ipaddress\": \"192.168.0.123\"}},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_config/example.com\",\n method=\"PUT\"\ - ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ - a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ - \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n data=json.dumps({\"attributes\": {\"ipaddress\": \"192.168.0.123\"\ - }}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\nif\ - \ resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/host_config/example.com\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'If-Match:\"\ - a20ceacf346041dc\"' \\\n 'Content-Type:application/json' \\\n attributes[ipaddress]='192.168.0.123'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"attributes\": {\n \"ipaddress\": \"192.168.0.123\"\ - \n }\n }' \\\n \"$API_URL/objects/host_config/example.com\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update a host - /objects/host_config/{host_name}/actions/move/invoke: - post: - tags: - - Hosts - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.edit_hosts`: Modify the properties of existing hosts. Please\ - \ note: for the management of services (inventory) there is a separate permission\ - \ (see below)\n * `wato.move_hosts`: Move existing hosts to other folders.\ - \ Please also add the permission Modify existing hosts.\n * Optionally:\n\ - \ * `wato.see_all_folders`: Users without this permissions can only see\ - \ folders with a contact group they are in.\n * `wato.edit`: This permission\ - \ is needed in order to make any changes or perform any actions at all. Without\ - \ this permission, the user is only able to view data, and that only in modules\ - \ he has explicit permissions for.\n * `wato.manage_hosts`: Add hosts to\ - \ the monitoring and remove hosts from the monitoring. Please also add the\ - \ permission Modify existing hosts.\n * Optionally:\n * `wato.all_folders`:\ - \ Without this permission, operations on folders can only be done by users\ - \ that are members of one of the folders contact groups. This permission grants\ - \ full access to all folders and hosts.\n * Optionally:\n * Any of:\n\ - \ * `bi.see_all`: With this permission set, the BI aggregation rules\ - \ are applied to all hosts and services - not only those the user is a contact\ - \ for. If you remove this permissions then the user will see incomplete aggregation\ - \ trees with status based only on those items.\n * `general.see_all`:\ - \ See all objects regardless of contacts and contact groups. If combined with\ - \ 'perform commands' then commands may be done on all objects.\n * `mkeventd.seeall`:\ - \ If a user lacks this permission then he/she can see only those events that\ - \ originate from a host that he/she is a contact for.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.move - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostConfig' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/MoveHost' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/host_config/example.com/actions/move/invoke\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\"target_folder\"\ - : \"~my~fine~folder\"},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_config/example.com/actions/move/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ - \ the, to be modified, object's ETag header.\n \"Content-Type\":\ - \ 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\"target_folder\"\ - : \"~my~fine~folder\"}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/host_config/example.com/actions/move/invoke\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ - \ \\\n target_folder='~my~fine~folder'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"target_folder\": \"~my~fine~folder\"\n }' \\\n \"\ - $API_URL/objects/host_config/example.com/actions/move/invoke\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Move a host to another folder - /objects/host_config/{host_name}/actions/rename/invoke: - put: - tags: - - Hosts - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.manage_hosts`: Add hosts to the monitoring and remove hosts\ - \ from the monitoring. Please also add the permission Modify existing hosts.\n\ - \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ - \ on folders can only be done by users that are members of one of the folders\ - \ contact groups. This permission grants full access to all folders and hosts.\n\ - \ * Optionally:\n * Any of:\n * `bi.see_all`: With this permission\ - \ set, the BI aggregation rules are applied to all hosts and services - not\ - \ only those the user is a contact for. If you remove this permissions then\ - \ the user will see incomplete aggregation trees with status based only on\ - \ those items.\n * `general.see_all`: See all objects regardless of\ - \ contacts and contact groups. If combined with 'perform commands' then commands\ - \ may be done on all objects.\n * `mkeventd.seeall`: If a user lacks\ - \ this permission then he/she can see only those events that originate from\ - \ a host that he/she is a contact for.\n * `wato.edit_hosts`: Modify the\ - \ properties of existing hosts. Please note: for the management of services\ - \ (inventory) there is a separate permission (see below)\n * `wato.rename_hosts`:\ - \ Rename existing hosts. Please also add the permission Modify existing\ - \ hosts.\n * Optionally:\n * `wato.see_all_folders`: Users without\ - \ this permissions can only see folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.rename_host - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '422': - description: 'Unprocessable Entity: The host could not be renamed.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: There are pending changes not yet activated.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostConfig' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RenameHost' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_config/example.com/actions/rename/invoke\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\"new_name\": \"newhost\"\ - },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_config/example.com/actions/rename/invoke\"\ - ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ - \ the, to be modified, object's ETag header.\n \"Content-Type\":\ - \ 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\"new_name\"\ - : \"newhost\"}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/host_config/example.com/actions/rename/invoke\" \\\n \ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ - \ \\\n new_name='newhost'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"new_name\": \"newhost\"\n }' \\\n \"$API_URL/objects/host_config/example.com/actions/rename/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Rename a host - /objects/host_config/{host_name}/properties/nodes: - put: - tags: - - Hosts - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.edit_hosts`: Modify the properties of existing hosts. Please\ - \ note: for the management of services (inventory) there is a separate permission\ - \ (see below)\n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n * Optionally:\n * `wato.see_all_folders`: Users\ - \ without this permissions can only see folders with a contact group they\ - \ are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_config.update_nodes - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: host_name - required: true - description: A cluster host. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectProperty' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateNodes' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_config/example.com/properties/nodes\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\"nodes\": [\"host1\"\ - , \"host2\", \"host3\"]},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_config/example.com/properties/nodes\",\n\ - \ method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ - \ the, to be modified, object's ETag header.\n \"Content-Type\":\ - \ 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\"nodes\"\ - : [\"host1\", \"host2\", \"host3\"]}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/host_config/example.com/properties/nodes\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ - \ \\\n nodes:='[\"host1\", \"host2\", \"host3\"]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"nodes\": [\n \"host1\",\n \"host2\",\n\ - \ \"host3\"\n ]\n }' \\\n \"$API_URL/objects/host_config/example.com/properties/nodes\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update the nodes of a cluster host - /domain-types/host_group_config/actions/bulk-create/invoke: - post: - tags: - - Host groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.groups`: Access to the modules for managing host and service\ - \ groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.bulk_create - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostGroupCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkInputHostGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_group_config/actions/bulk-create/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"entries\": [\n {\n \ - \ \"name\": \"windows\",\n \"alias\": \"Windows Servers\"\ - ,\n }\n ]\n },\n)\nif resp.status_code == 200:\n \ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/host_group_config/actions/bulk-create/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"entries\": [\n {\n \"name\": \"windows\"\ - ,\n \"alias\": \"Windows Servers\",\n }\n \ - \ ]\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/host_group_config/actions/bulk-create/invoke\" \\\n\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'Content-Type:application/json' \\\n entries:='[{\"name\":\ - \ \"windows\", \"alias\": \"Windows Servers\"}]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n {\n \ - \ \"alias\": \"Windows Servers\",\n \"name\": \"windows\"\ - \n }\n ]\n }' \\\n \"$API_URL/domain-types/host_group_config/actions/bulk-create/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk create host groups - /domain-types/host_group_config/actions/bulk-delete/invoke: - post: - tags: - - Host groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.groups`: Access to the modules for managing host and service\ - \ groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.bulk_delete - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: The request is in conflict with the stored resource.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkDeleteHostGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_group_config/actions/bulk-delete/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"entries\": [\"windows\", \"panels\"]},\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/host_group_config/actions/bulk-delete/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - entries\": [\"windows\", \"panels\"]}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/host_group_config/actions/bulk-delete/invoke\" \\\n\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'Content-Type:application/json' \\\n entries:='[\"windows\"\ - , \"panels\"]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n \"windows\",\n\ - \ \"panels\"\n ]\n }' \\\n \"$API_URL/domain-types/host_group_config/actions/bulk-delete/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk delete host groups - /domain-types/host_group_config/actions/bulk-update/invoke: - put: - tags: - - Host groups - description: "Please be aware that when doing bulk updates, it is not possible\ - \ to prevent the\n[Updating Values](\"lost update problem\"), which is normally\ - \ prevented by the ETag locking\nmechanism. Use at your own riskThis endpoint\ - \ requires the following permissions: \n * All of:\n * `wato.edit`: This\ - \ permission is needed in order to make any changes or perform any actions\ - \ at all. Without this permission, the user is only able to view data, and\ - \ that only in modules he has explicit permissions for.\n * `wato.groups`:\ - \ Access to the modules for managing host and service groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.bulk_update - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostGroupCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkUpdateHostGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/domain-types/host_group_config/actions/bulk-update/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"entries\": [\n {\n \ - \ \"name\": \"windows\",\n \"attributes\": {\n \ - \ \"alias\": \"Windows Servers\"\n },\n \ - \ }\n ]\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/host_group_config/actions/bulk-update/invoke\"\ - ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"entries\": [\n {\n \"name\": \"windows\"\ - ,\n \"attributes\": {\n \"alias\": \"\ - Windows Servers\"\n },\n }\n ]\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/domain-types/host_group_config/actions/bulk-update/invoke\" \\\n\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'Content-Type:application/json' \\\n entries:='[{\"name\":\ - \ \"windows\", \"attributes\": {\"alias\": \"Windows Servers\"}}]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n {\n \ - \ \"attributes\": {\n \"alias\": \"Windows Servers\"\n\ - \ },\n \"name\": \"windows\"\n }\n\ - \ ]\n }' \\\n \"$API_URL/domain-types/host_group_config/actions/bulk-update/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk update host groups - /domain-types/host_group_config/collections/all: - post: - tags: - - Host groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.groups`: Access to the modules for managing host and service\ - \ groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.create - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostGroup' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/InputHostGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_group_config/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"name\": \"windows\", \"alias\": \"Windows Servers\"\ - },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/host_group_config/collections/all\",\n \ - \ method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - name\": \"windows\", \"alias\": \"Windows Servers\"}).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/host_group_config/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n name='windows'\\\n alias='Windows\ - \ Servers'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"alias\": \"Windows Servers\",\n \ - \ \"name\": \"windows\"\n }' \\\n \"$API_URL/domain-types/host_group_config/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a host group - get: - tags: - - Host groups - description: "\n\nThis endpoint requires the following permissions: \n * `wato.groups`:\ - \ Access to the modules for managing host and service groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.list_groups - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostGroupCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/host_group_config/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/host_group_config/collections/all\",\n \ - \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/host_group_config/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/host_group_config/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all host groups - /objects/host_group_config/{name}: - delete: - tags: - - Host groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.groups`: Access to the modules for managing host and service\ - \ groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.delete - parameters: - - in: path - name: name - required: true - description: The identifier name of the group. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_\.]*\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: The request is in conflict with the stored resource.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/host_group_config/pathname\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_group_config/pathname\",\n method=\"DELETE\"\ - ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/host_group_config/pathname\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/host_group_config/pathname\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a host group - get: - tags: - - Host groups - description: "\n\nThis endpoint requires the following permissions: \n * `wato.groups`:\ - \ Access to the modules for managing host and service groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.get - parameters: - - in: path - name: name - required: true - description: The identifier name of the group. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_\.]*\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostGroup' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host_group_config/pathname\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_group_config/pathname\",\n method=\"GET\"\ - ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/host_group_config/pathname\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/host_group_config/pathname\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a host group - put: - tags: - - Host groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.groups`: Access to the modules for managing host and service\ - \ groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.update - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: name - required: true - description: The identifier name of the group. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_\.]*\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostGroup' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateGroup1' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_group_config/pathname\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\"alias\": \"Example\ - \ Group\"},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_group_config/pathname\",\n method=\"PUT\"\ - ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ - a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ - \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n data=json.dumps({\"alias\": \"Example Group\"}).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/host_group_config/pathname\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'If-Match:\"\ - a20ceacf346041dc\"' \\\n 'Content-Type:application/json' \\\n alias='Example\ - \ Group'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"alias\": \"Example Group\"\n }' \\\n \"$API_URL/objects/host_group_config/pathname\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update a host group - /objects/host_config_internal/{host_name}/actions/link_uuid/invoke: - put: - tags: - - Hosts (internal) - description: "\n\nThis endpoint requires the following permissions: \n * Any\ - \ of:\n * `wato.all_folders`: Without this permission, operations on folders\ - \ can only be done by users that are members of one of the folders contact\ - \ groups. This permission grants full access to all folders and hosts.\n \ - \ * `wato.edit_hosts`: Modify the properties of existing hosts. Please note:\ - \ for the management of services (inventory) there is a separate permission\ - \ (see below)\n * Optionally:\n * `wato.see_all_folders`: Users without\ - \ this permissions can only see folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_internal.link_with_uuid - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: 'Unauthorized: You do not have the permissions to edit this - host.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/LinkHostUUID' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_config_internal/example.com/actions/link_uuid/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"uuid\": \"34e4c967-1591-4883-8cdf-0e335b09618d\"},\n\ - )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_config_internal/example.com/actions/link_uuid/invoke\"\ - ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - uuid\": \"34e4c967-1591-4883-8cdf-0e335b09618d\"}).encode('utf-8'),\n)\n\ - response = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/host_config_internal/example.com/actions/link_uuid/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n uuid='34e4c967-1591-4883-8cdf-0e335b09618d'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"uuid\": \"34e4c967-1591-4883-8cdf-0e335b09618d\"\ - \n }' \\\n \"$API_URL/objects/host_config_internal/example.com/actions/link_uuid/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Link a host to a UUID - /objects/host_config_internal/{host_name}/actions/register/invoke: - put: - tags: - - Hosts (internal) - description: "\n\nThis endpoint requires the following permissions: \n * Any\ - \ of:\n * `agent_registration.register_any_existing_host`: This permission\ - \ allows the registration of any existing host.\n * `agent_registration.register_managed_existing_host`:\ - \ This permission allows the registration of any existing host the user is\ - \ a contact of.\n * All of:\n * Optionally:\n * `wato.see_all_folders`:\ - \ Users without this permissions can only see folders with a contact group\ - \ they are in.\n * Any of:\n * `wato.all_folders`: Without this\ - \ permission, operations on folders can only be done by users that are members\ - \ of one of the folders contact groups. This permission grants full access\ - \ to all folders and hosts.\n * `wato.edit_hosts`: Modify the properties\ - \ of existing hosts. Please note: for the management of services (inventory)\ - \ there is a separate permission (see below)\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_internal.register - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: You do not have the permissions to register this - host.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '405': - description: 'Method Not Allowed: This host cannot be registered on this - site.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ConnectionMode' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterHost' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_config_internal/example.com/actions/register/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"uuid\": \"34e4c967-1591-4883-8cdf-0e335b09618d\"},\n\ - )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_config_internal/example.com/actions/register/invoke\"\ - ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - uuid\": \"34e4c967-1591-4883-8cdf-0e335b09618d\"}).encode('utf-8'),\n)\n\ - response = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/host_config_internal/example.com/actions/register/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n uuid='34e4c967-1591-4883-8cdf-0e335b09618d'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"uuid\": \"34e4c967-1591-4883-8cdf-0e335b09618d\"\ - \n }' \\\n \"$API_URL/objects/host_config_internal/example.com/actions/register/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Register an existing host, ie. link it to a UUID - /objects/host_config_internal/{host_name}: - get: - tags: - - Hosts (internal) - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * `wato.see_all_folders`: Users without this permissions can only see\ - \ folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_internal.show_host - parameters: - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: 'Unauthorized: You do not have read access to this host.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostConfigSchemaInternal' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host_config_internal/example.com\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_config_internal/example.com\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/host_config_internal/example.com\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/host_config_internal/example.com\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a host - /domain-types/host_tag_group/collections/all: - post: - tags: - - Host tag groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.hosttags`: Create, remove and edit tags. Removing tags\ - \ also might remove rules, so this permission should not be available to normal\ - \ users.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_tag_group.create_host_tag_group - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/InputHostTagGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_tag_group/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"ident\": \"group_id\",\n \"title\"\ - : \"Kubernetes\",\n \"topic\": \"Data Sources\",\n \"help\"\ - : \"Kubernetes Pods\",\n \"tags\": [{\"ident\": \"pod\", \"title\"\ - : \"Pod\"}],\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/host_tag_group/collections/all\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"ident\": \"group_id\",\n \"title\": \"Kubernetes\",\n \ - \ \"topic\": \"Data Sources\",\n \"help\": \"Kubernetes Pods\"\ - ,\n \"tags\": [{\"ident\": \"pod\", \"title\": \"Pod\"}],\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/host_tag_group/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n ident='group_id'\\\n title='Kubernetes'\\\ - \n topic='Data Sources'\\\n help='Kubernetes Pods'\\\n tags:='[{\"\ - ident\": \"pod\", \"title\": \"Pod\"}]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"help\": \"Kubernetes Pods\",\n \ - \ \"ident\": \"group_id\",\n \"tags\": [\n {\n \ - \ \"ident\": \"pod\",\n \"title\": \"Pod\"\n \ - \ }\n ],\n \"title\": \"Kubernetes\",\n \ - \ \"topic\": \"Data Sources\"\n }' \\\n \"$API_URL/domain-types/host_tag_group/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a host tag group - get: - tags: - - Host tag groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.hosttags`: Create, remove and edit tags. Removing tags also\ - \ might remove rules, so this permission should not be available to normal\ - \ users.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_tag_group.list_host_tag_groups - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/HostTagGroupCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/host_tag_group/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/host_tag_group/collections/all\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/host_tag_group/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/host_tag_group/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all host tag groups - /objects/host_tag_group/{name}: - delete: - tags: - - Host tag groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.hosttags`: Create, remove and edit tags. Removing tags\ - \ also might remove rules, so this permission should not be available to normal\ - \ users.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_tag_group.delete_host_tag_group - parameters: - - in: query - name: repair - required: false - description: The host tag group can still be in use. Setting repair to True - gives permission to automatically remove the tag from the affected hosts. - schema: - type: boolean - default: false - example: false - - in: path - name: name - required: true - description: The name of the host tag group - schema: - type: string - example: datasource - pattern: ^[^\d\W][-\w]*$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: 'Unauthorized: The user is not authorized to do this request.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '405': - description: 'Method Not Allowed: Method not allowed: This request is only - allowed with other HTTP methods' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/host_tag_group/datasource\"\ - ,\n params={ # goes into query string\n \"repair\": False, #\ - \ The host tag group can still be in use.\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"repair\": False, # The host tag group can still be in use.\n})\n\ - \nrequest = urllib.request.Request(\n f\"{API_URL}/objects/host_tag_group/datasource?{query_string}\"\ - ,\n method=\"DELETE\",\n headers={\n \"Authorization\": f\"\ - Bearer {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\"\ - ,\n },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/host_tag_group/datasource\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request DELETE \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n \"$API_URL/objects/host_tag_group/datasource\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a host tag group - get: - tags: - - Host tag groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.hosttags`: Create, remove and edit tags. Removing tags also\ - \ might remove rules, so this permission should not be available to normal\ - \ users.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_tag_group.show_host_tag_group - parameters: - - in: path - name: name - required: true - description: The name of the host tag group - schema: - type: string - example: datasource - pattern: ^[^\d\W][-\w]*$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ConcreteHostTagGroup' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host_tag_group/datasource\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_tag_group/datasource\",\n method=\"GET\"\ - ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/host_tag_group/datasource\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/host_tag_group/datasource\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a host tag group - put: - tags: - - Host tag groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.hosttags`: Create, remove and edit tags. Removing tags\ - \ also might remove rules, so this permission should not be available to normal\ - \ users.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.host_tag_group.update_host_tag_group - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: name - required: true - description: The name of the host tag group - schema: - type: string - example: datasource - pattern: ^[^\d\W][-\w]*$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: 'Unauthorized: The user is not authorized to do this request.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '405': - description: 'Method Not Allowed: Method not allowed: This request is only - allowed with other HTTP methods' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ConcreteHostTagGroup' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateHostTagGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_tag_group/datasource\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\n \"title\"\ - : \"Kubernetes\",\n \"topic\": \"Data Sources\",\n \"help\"\ - : \"Kubernetes Pods\",\n \"tags\": [{\"ident\": \"pod\", \"title\"\ - : \"Pod\"}],\n \"repair\": False,\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host_tag_group/datasource\",\n method=\"PUT\"\ - ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ - a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ - \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n data=json.dumps({\n \"title\": \"Kubernetes\",\n \ - \ \"topic\": \"Data Sources\",\n \"help\": \"Kubernetes Pods\"\ - ,\n \"tags\": [{\"ident\": \"pod\", \"title\": \"Pod\"}],\n \ - \ \"repair\": False,\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/host_tag_group/datasource\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'If-Match:\"\ - a20ceacf346041dc\"' \\\n 'Content-Type:application/json' \\\n title='Kubernetes'\\\ - \n topic='Data Sources'\\\n help='Kubernetes Pods'\\\n tags:='[{\"\ - ident\": \"pod\", \"title\": \"Pod\"}]'\\\n repair:=false" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"help\": \"Kubernetes Pods\",\n \"repair\": false,\n\ - \ \"tags\": [\n {\n \"ident\": \"pod\"\ - ,\n \"title\": \"Pod\"\n }\n ],\n \ - \ \"title\": \"Kubernetes\",\n \"topic\": \"Data Sources\"\n\ - \ }' \\\n \"$API_URL/objects/host_tag_group/datasource\")\n\n\ - resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ - ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update a host tag group - /domain-types/metric/actions/get/invoke: - post: - tags: - - Metrics - description: This endpoint retrieves a predefined graph (consisting of multiple - metrics) or a single metric. - operationId: cmk.gui.plugins.openapi.endpoints.metric.get_graph - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/GraphCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Get' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/metric/actions/get/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n # This schema has multiple variations. Please refer to\n \ - \ # the 'Payload' section for details.\n json={\n \"time_range\"\ - : {\n \"start\": \"2023-11-15 12:02:54.160009\",\n \ - \ \"end\": \"2023-11-15 12:17:54.160014\",\n },\n \"reduce\"\ - : \"max\",\n \"site\": \"heute\",\n \"host_name\": \"my.cool.host\"\ - ,\n \"service_description\": \"Check_MK\",\n \"type\": \"\ - single_metric\",\n \"graph_id\": \"cmk_cpu_time_by_phase\",\n \ - \ },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/metric/actions/get/invoke\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n # This schema has multiple\ - \ variations. Please refer to\n # the 'Payload' section for details.\n\ - \ data=json.dumps({\n \"time_range\": {\n \"start\"\ - : \"2023-11-15 12:02:54.160009\",\n \"end\": \"2023-11-15 12:17:54.160014\"\ - ,\n },\n \"reduce\": \"max\",\n \"site\": \"heute\"\ - ,\n \"host_name\": \"my.cool.host\",\n \"service_description\"\ - : \"Check_MK\",\n \"type\": \"single_metric\",\n \"graph_id\"\ - : \"cmk_cpu_time_by_phase\",\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/domain-types/metric/actions/get/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n time_range[start]='2023-11-15\ - \ 12:02:54.160009'\\\n time_range[end]='2023-11-15 12:17:54.160014'\\\ - \n reduce='max'\\\n site='heute'\\\n host_name='my.cool.host'\\\ - \n service_description='Check_MK'\\\n type='single_metric'\\\n \ - \ graph_id='cmk_cpu_time_by_phase'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ - \ application/json\" \\\n --data '{\n \"graph_id\": \"cmk_cpu_time_by_phase\"\ - ,\n \"host_name\": \"my.cool.host\",\n \"reduce\": \"\ - max\",\n \"service_description\": \"Check_MK\",\n \"site\"\ - : \"heute\",\n \"time_range\": {\n \"end\": \"2023-11-15\ - \ 12:17:54.160014\",\n \"start\": \"2023-11-15 12:02:54.160009\"\ - \n },\n \"type\": \"single_metric\"\n }' \\\n \ - \ \"$API_URL/domain-types/metric/actions/get/invoke\")\n\nresp=$( echo\ - \ \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" |\ - \ awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Get metrics - /objects/notification_rule/{rule_id}/actions/delete/invoke: - post: - tags: - - Notification Rules - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.see_all_folders`: Users without this permissions can only\ - \ see folders with a contact group they are in.\n * `general.edit_notifications`:\ - \ This allows a user to edit his personal notification settings. You also\ - \ need the permission Edit the user profile in order to do this.\n" - operationId: cmk.gui.plugins.openapi.endpoints.notification_rules.delete_rule - parameters: - - in: path - name: rule_id - required: true - description: The notification rule ID. - schema: - type: string - example: 5425d554-5741-4bbf-b907-1a391dfab5bb - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb/actions/delete/invoke\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb/actions/delete/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb/actions/delete/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb/actions/delete/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a notification rule - /domain-types/notification_rule/collections/all: - post: - tags: - - Notification Rules - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.see_all_folders`: Users without this permissions can only\ - \ see folders with a contact group they are in.\n * `general.edit_notifications`:\ - \ This allows a user to edit his personal notification settings. You also\ - \ need the permission Edit the user profile in order to do this.\n" - operationId: cmk.gui.plugins.openapi.endpoints.notification_rules.post_rule - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/NotificationRuleResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/NotificationRuleRequest' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/notification_rule/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"rule_config\": {\n \"rule_properties\"\ - : {\n \"description\": \"A description or title of this rule.\"\ - ,\n \"comment\": \"A example comment.\",\n \ - \ \"documentation_url\": \"http://link/to/documentation\",\n \ - \ \"do_not_apply_this_rule\": {\n \"state\": \"\ - disabled\"\n },\n \"allow_users_to_deactivate\"\ - : {\n \"state\": \"enabled\"\n },\n \ - \ },\n \"notification_method\": {\n \"\ - notify_plugin\": {\n \"option\": \"create_notification_with_the_following_parameters\"\ - ,\n \"plugin_params\": {\n \"\ - plugin_name\": \"mail\",\n \"from_details\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n \"reply_to\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"subject_for_host_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"subject_for_service_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n\ - \ \"info_to_be_displayed_in_the_email_body\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n \"insert_html_section_between_body_and_table\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"url_prefix_for_links_to_checkmk\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"sort_order_for_bulk_notificaions\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"send_separate_notification_to_every_recipient\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"enable_sync_smtp\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"display_graphs_among_each_other\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"graphs_per_notification\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"bulk_notifications_with_graphs\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n },\n },\n \ - \ \"notification_bulking\": {\n \"state\": \"disabled\"\ - \n },\n },\n \"contact_selection\"\ - : {\n \"all_contacts_of_the_notified_object\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"all_users\": {\"state\": \"disabled\"},\n \"all_users_with_an_email_address\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"the_following_users\": {\n \"state\"\ - : \"disabled\"\n },\n \"members_of_contact_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"explicit_email_addresses\": {\n \"\ - state\": \"disabled\"\n },\n \"restrict_by_custom_macros\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"restrict_by_contact_groups\": {\n \"\ - state\": \"disabled\"\n },\n },\n \"\ - conditions\": {\n \"match_sites\": {\"state\": \"disabled\"\ - },\n \"match_folder\": {\"state\": \"disabled\"},\n \ - \ \"match_host_tags\": {\n \"state\": \"disabled\"\ - \n },\n \"match_host_labels\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"match_host_groups\": {\n \"state\": \"disabled\"\ - \n },\n \"match_hosts\": {\"state\": \"disabled\"\ - },\n \"match_exclude_hosts\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_service_labels\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_groups\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_exclude_service_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_groups_regex\": {\n \"\ - state\": \"disabled\"\n },\n \"match_exclude_service_groups_regex\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_services\": {\n \"state\": \"\ - disabled\"\n },\n \"match_exclude_services\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_check_types\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_plugin_output\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_contact_groups\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_service_levels\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_only_during_time_period\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_host_event_type\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_event_type\": {\n \"\ - state\": \"disabled\"\n },\n \"restrict_to_notification_numbers\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"throttle_periodic_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_notification_comment\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"event_console_alerts\": {\n \"state\"\ - : \"disabled\"\n },\n },\n }\n },\n\ - )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/notification_rule/collections/all\",\n \ - \ method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"rule_config\": {\n \"rule_properties\": {\n \ - \ \"description\": \"A description or title of this rule.\",\n\ - \ \"comment\": \"A example comment.\",\n \"\ - documentation_url\": \"http://link/to/documentation\",\n \ - \ \"do_not_apply_this_rule\": {\n \"state\": \"disabled\"\ - \n },\n \"allow_users_to_deactivate\": {\n\ - \ \"state\": \"enabled\"\n },\n \ - \ },\n \"notification_method\": {\n \"notify_plugin\"\ - : {\n \"option\": \"create_notification_with_the_following_parameters\"\ - ,\n \"plugin_params\": {\n \"\ - plugin_name\": \"mail\",\n \"from_details\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n \"reply_to\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"subject_for_host_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"subject_for_service_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n\ - \ \"info_to_be_displayed_in_the_email_body\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n \"insert_html_section_between_body_and_table\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"url_prefix_for_links_to_checkmk\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"sort_order_for_bulk_notificaions\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"send_separate_notification_to_every_recipient\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"enable_sync_smtp\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"display_graphs_among_each_other\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"graphs_per_notification\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"bulk_notifications_with_graphs\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n },\n },\n \ - \ \"notification_bulking\": {\n \"state\": \"disabled\"\ - \n },\n },\n \"contact_selection\"\ - : {\n \"all_contacts_of_the_notified_object\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"all_users\": {\"state\": \"disabled\"},\n \"all_users_with_an_email_address\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"the_following_users\": {\n \"state\"\ - : \"disabled\"\n },\n \"members_of_contact_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"explicit_email_addresses\": {\n \"\ - state\": \"disabled\"\n },\n \"restrict_by_custom_macros\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"restrict_by_contact_groups\": {\n \"\ - state\": \"disabled\"\n },\n },\n \"\ - conditions\": {\n \"match_sites\": {\"state\": \"disabled\"\ - },\n \"match_folder\": {\"state\": \"disabled\"},\n \ - \ \"match_host_tags\": {\n \"state\": \"disabled\"\ - \n },\n \"match_host_labels\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"match_host_groups\": {\n \"state\": \"disabled\"\ - \n },\n \"match_hosts\": {\"state\": \"disabled\"\ - },\n \"match_exclude_hosts\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_service_labels\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_groups\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_exclude_service_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_groups_regex\": {\n \"\ - state\": \"disabled\"\n },\n \"match_exclude_service_groups_regex\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_services\": {\n \"state\": \"\ - disabled\"\n },\n \"match_exclude_services\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_check_types\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_plugin_output\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_contact_groups\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_service_levels\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_only_during_time_period\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_host_event_type\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_event_type\": {\n \"\ - state\": \"disabled\"\n },\n \"restrict_to_notification_numbers\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"throttle_periodic_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_notification_comment\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"event_console_alerts\": {\n \"state\"\ - : \"disabled\"\n },\n },\n }\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/notification_rule/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n rule_config[rule_properties][description]='A\ - \ description or title of this rule.'\\\n rule_config[rule_properties][comment]='A\ - \ example comment.'\\\n rule_config[rule_properties][documentation_url]='http://link/to/documentation'\\\ - \n rule_config[rule_properties][do_not_apply_this_rule][state]='disabled'\\\ - \n rule_config[rule_properties][allow_users_to_deactivate][state]='enabled'\\\ - \n rule_config[notification_method][notify_plugin][option]='create_notification_with_the_following_parameters'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][plugin_name]='mail'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][from_details][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][reply_to][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][subject_for_host_notifications][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][subject_for_service_notifications][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][info_to_be_displayed_in_the_email_body][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][insert_html_section_between_body_and_table][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][url_prefix_for_links_to_checkmk][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][sort_order_for_bulk_notificaions][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][send_separate_notification_to_every_recipient][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][enable_sync_smtp][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][display_graphs_among_each_other][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][graphs_per_notification][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][bulk_notifications_with_graphs][state]='disabled'\\\ - \n rule_config[notification_method][notification_bulking][state]='disabled'\\\ - \n rule_config[contact_selection][all_contacts_of_the_notified_object][state]='disabled'\\\ - \n rule_config[contact_selection][all_users][state]='disabled'\\\n \ - \ rule_config[contact_selection][all_users_with_an_email_address][state]='disabled'\\\ - \n rule_config[contact_selection][the_following_users][state]='disabled'\\\ - \n rule_config[contact_selection][members_of_contact_groups][state]='disabled'\\\ - \n rule_config[contact_selection][explicit_email_addresses][state]='disabled'\\\ - \n rule_config[contact_selection][restrict_by_custom_macros][state]='disabled'\\\ - \n rule_config[contact_selection][restrict_by_contact_groups][state]='disabled'\\\ - \n rule_config[conditions][match_sites][state]='disabled'\\\n rule_config[conditions][match_folder][state]='disabled'\\\ - \n rule_config[conditions][match_host_tags][state]='disabled'\\\n \ - \ rule_config[conditions][match_host_labels][state]='disabled'\\\n rule_config[conditions][match_host_groups][state]='disabled'\\\ - \n rule_config[conditions][match_hosts][state]='disabled'\\\n rule_config[conditions][match_exclude_hosts][state]='disabled'\\\ - \n rule_config[conditions][match_service_labels][state]='disabled'\\\n\ - \ rule_config[conditions][match_service_groups][state]='disabled'\\\n\ - \ rule_config[conditions][match_exclude_service_groups][state]='disabled'\\\ - \n rule_config[conditions][match_service_groups_regex][state]='disabled'\\\ - \n rule_config[conditions][match_exclude_service_groups_regex][state]='disabled'\\\ - \n rule_config[conditions][match_services][state]='disabled'\\\n rule_config[conditions][match_exclude_services][state]='disabled'\\\ - \n rule_config[conditions][match_check_types][state]='disabled'\\\n \ - \ rule_config[conditions][match_plugin_output][state]='disabled'\\\n \ - \ rule_config[conditions][match_contact_groups][state]='disabled'\\\n\ - \ rule_config[conditions][match_service_levels][state]='disabled'\\\n\ - \ rule_config[conditions][match_only_during_time_period][state]='disabled'\\\ - \n rule_config[conditions][match_host_event_type][state]='disabled'\\\ - \n rule_config[conditions][match_service_event_type][state]='disabled'\\\ - \n rule_config[conditions][restrict_to_notification_numbers][state]='disabled'\\\ - \n rule_config[conditions][throttle_periodic_notifications][state]='disabled'\\\ - \n rule_config[conditions][match_notification_comment][state]='disabled'\\\ - \n rule_config[conditions][event_console_alerts][state]='disabled'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"rule_config\": {\n \"conditions\"\ - : {\n \"event_console_alerts\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_check_types\": {\n\ - \ \"state\": \"disabled\"\n },\n \ - \ \"match_contact_groups\": {\n \"state\": \"disabled\"\ - \n },\n \"match_exclude_hosts\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_exclude_service_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_exclude_service_groups_regex\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_exclude_services\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_folder\": {\n \"state\": \"disabled\"\n \ - \ },\n \"match_host_event_type\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_host_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_host_labels\": {\n \"state\": \"disabled\"\ - \n },\n \"match_host_tags\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_hosts\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_notification_comment\": {\n \"state\": \"\ - disabled\"\n },\n \"match_only_during_time_period\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_plugin_output\": {\n \"state\": \"disabled\"\ - \n },\n \"match_service_event_type\": {\n \ - \ \"state\": \"disabled\"\n },\n \"\ - match_service_groups\": {\n \"state\": \"disabled\"\n \ - \ },\n \"match_service_groups_regex\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_service_labels\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_levels\": {\n \"state\": \"disabled\"\ - \n },\n \"match_services\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_sites\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"restrict_to_notification_numbers\": {\n \"state\"\ - : \"disabled\"\n },\n \"throttle_periodic_notifications\"\ - : {\n \"state\": \"disabled\"\n }\n \ - \ },\n \"contact_selection\": {\n \"all_contacts_of_the_notified_object\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"all_users\": {\n \"state\": \"disabled\"\n \ - \ },\n \"all_users_with_an_email_address\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"explicit_email_addresses\": {\n \"state\": \"disabled\"\ - \n },\n \"members_of_contact_groups\": {\n \ - \ \"state\": \"disabled\"\n },\n \"\ - restrict_by_contact_groups\": {\n \"state\": \"disabled\"\ - \n },\n \"restrict_by_custom_macros\": {\n \ - \ \"state\": \"disabled\"\n },\n \"\ - the_following_users\": {\n \"state\": \"disabled\"\n \ - \ }\n },\n \"notification_method\": {\n \ - \ \"notification_bulking\": {\n \"state\": \"\ - disabled\"\n },\n \"notify_plugin\": {\n \ - \ \"option\": \"create_notification_with_the_following_parameters\"\ - ,\n \"plugin_params\": {\n \"bulk_notifications_with_graphs\"\ - : {\n \"state\": \"disabled\"\n },\n\ - \ \"display_graphs_among_each_other\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"enable_sync_smtp\": {\n \"state\": \"disabled\"\ - \n },\n \"from_details\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"graphs_per_notification\": {\n \"state\": \"\ - disabled\"\n },\n \"info_to_be_displayed_in_the_email_body\"\ - : {\n \"state\": \"disabled\"\n },\n\ - \ \"insert_html_section_between_body_and_table\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"plugin_name\": \"mail\",\n \"reply_to\"\ - : {\n \"state\": \"disabled\"\n },\n\ - \ \"send_separate_notification_to_every_recipient\": {\n\ - \ \"state\": \"disabled\"\n },\n \ - \ \"sort_order_for_bulk_notificaions\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"subject_for_host_notifications\": {\n \"state\":\ - \ \"disabled\"\n },\n \"subject_for_service_notifications\"\ - : {\n \"state\": \"disabled\"\n },\n\ - \ \"url_prefix_for_links_to_checkmk\": {\n \ - \ \"state\": \"disabled\"\n }\n }\n\ - \ }\n },\n \"rule_properties\": {\n \ - \ \"allow_users_to_deactivate\": {\n \"state\"\ - : \"enabled\"\n },\n \"comment\": \"A example\ - \ comment.\",\n \"description\": \"A description or title of\ - \ this rule.\",\n \"do_not_apply_this_rule\": {\n \ - \ \"state\": \"disabled\"\n },\n \"documentation_url\"\ - : \"http://link/to/documentation\"\n }\n }\n \ - \ }' \\\n \"$API_URL/domain-types/notification_rule/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a notification rule - get: - tags: - - Notification Rules - description: "\n\nThis endpoint requires the following permissions: \n * `general.edit_notifications`:\ - \ This allows a user to edit his personal notification settings. You also\ - \ need the permission Edit the user profile in order to do this.\n" - operationId: cmk.gui.plugins.openapi.endpoints.notification_rules.show_rules - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/NotificationRuleResponseCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/notification_rule/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/notification_rule/collections/all\",\n \ - \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/notification_rule/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/notification_rule/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all notification rules - /objects/notification_rule/{rule_id}: - put: - tags: - - Notification Rules - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.see_all_folders`: Users without this permissions can only\ - \ see folders with a contact group they are in.\n * `general.edit_notifications`:\ - \ This allows a user to edit his personal notification settings. You also\ - \ need the permission Edit the user profile in order to do this.\n" - operationId: cmk.gui.plugins.openapi.endpoints.notification_rules.put_rule - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: rule_id - required: true - description: The notification rule ID. - schema: - type: string - example: 5425d554-5741-4bbf-b907-1a391dfab5bb - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/NotificationRuleResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/NotificationRuleRequest' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"rule_config\": {\n \"rule_properties\"\ - : {\n \"description\": \"A description or title of this rule.\"\ - ,\n \"comment\": \"A example comment.\",\n \ - \ \"documentation_url\": \"http://link/to/documentation\",\n \ - \ \"do_not_apply_this_rule\": {\n \"state\": \"\ - disabled\"\n },\n \"allow_users_to_deactivate\"\ - : {\n \"state\": \"enabled\"\n },\n \ - \ },\n \"notification_method\": {\n \"\ - notify_plugin\": {\n \"option\": \"create_notification_with_the_following_parameters\"\ - ,\n \"plugin_params\": {\n \"\ - plugin_name\": \"mail\",\n \"from_details\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n \"reply_to\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"subject_for_host_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"subject_for_service_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n\ - \ \"info_to_be_displayed_in_the_email_body\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n \"insert_html_section_between_body_and_table\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"url_prefix_for_links_to_checkmk\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"sort_order_for_bulk_notificaions\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"send_separate_notification_to_every_recipient\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"enable_sync_smtp\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"display_graphs_among_each_other\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"graphs_per_notification\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"bulk_notifications_with_graphs\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n },\n },\n \ - \ \"notification_bulking\": {\n \"state\": \"disabled\"\ - \n },\n },\n \"contact_selection\"\ - : {\n \"all_contacts_of_the_notified_object\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"all_users\": {\"state\": \"disabled\"},\n \"all_users_with_an_email_address\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"the_following_users\": {\n \"state\"\ - : \"disabled\"\n },\n \"members_of_contact_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"explicit_email_addresses\": {\n \"\ - state\": \"disabled\"\n },\n \"restrict_by_custom_macros\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"restrict_by_contact_groups\": {\n \"\ - state\": \"disabled\"\n },\n },\n \"\ - conditions\": {\n \"match_sites\": {\"state\": \"disabled\"\ - },\n \"match_folder\": {\"state\": \"disabled\"},\n \ - \ \"match_host_tags\": {\n \"state\": \"disabled\"\ - \n },\n \"match_host_labels\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"match_host_groups\": {\n \"state\": \"disabled\"\ - \n },\n \"match_hosts\": {\"state\": \"disabled\"\ - },\n \"match_exclude_hosts\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_service_labels\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_groups\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_exclude_service_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_groups_regex\": {\n \"\ - state\": \"disabled\"\n },\n \"match_exclude_service_groups_regex\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_services\": {\n \"state\": \"\ - disabled\"\n },\n \"match_exclude_services\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_check_types\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_plugin_output\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_contact_groups\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_service_levels\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_only_during_time_period\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_host_event_type\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_event_type\": {\n \"\ - state\": \"disabled\"\n },\n \"restrict_to_notification_numbers\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"throttle_periodic_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_notification_comment\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"event_console_alerts\": {\n \"state\"\ - : \"disabled\"\n },\n },\n }\n },\n\ - )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb\"\ - ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"rule_config\": {\n \"rule_properties\": {\n \ - \ \"description\": \"A description or title of this rule.\",\n\ - \ \"comment\": \"A example comment.\",\n \"\ - documentation_url\": \"http://link/to/documentation\",\n \ - \ \"do_not_apply_this_rule\": {\n \"state\": \"disabled\"\ - \n },\n \"allow_users_to_deactivate\": {\n\ - \ \"state\": \"enabled\"\n },\n \ - \ },\n \"notification_method\": {\n \"notify_plugin\"\ - : {\n \"option\": \"create_notification_with_the_following_parameters\"\ - ,\n \"plugin_params\": {\n \"\ - plugin_name\": \"mail\",\n \"from_details\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n \"reply_to\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"subject_for_host_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"subject_for_service_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n\ - \ \"info_to_be_displayed_in_the_email_body\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n \"insert_html_section_between_body_and_table\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"url_prefix_for_links_to_checkmk\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"sort_order_for_bulk_notificaions\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"send_separate_notification_to_every_recipient\"\ - : {\n \"state\": \"disabled\"\n \ - \ },\n \"enable_sync_smtp\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"display_graphs_among_each_other\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"graphs_per_notification\": {\n \ - \ \"state\": \"disabled\"\n \ - \ },\n \"bulk_notifications_with_graphs\": {\n\ - \ \"state\": \"disabled\"\n \ - \ },\n },\n },\n \ - \ \"notification_bulking\": {\n \"state\": \"disabled\"\ - \n },\n },\n \"contact_selection\"\ - : {\n \"all_contacts_of_the_notified_object\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"all_users\": {\"state\": \"disabled\"},\n \"all_users_with_an_email_address\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"the_following_users\": {\n \"state\"\ - : \"disabled\"\n },\n \"members_of_contact_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"explicit_email_addresses\": {\n \"\ - state\": \"disabled\"\n },\n \"restrict_by_custom_macros\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"restrict_by_contact_groups\": {\n \"\ - state\": \"disabled\"\n },\n },\n \"\ - conditions\": {\n \"match_sites\": {\"state\": \"disabled\"\ - },\n \"match_folder\": {\"state\": \"disabled\"},\n \ - \ \"match_host_tags\": {\n \"state\": \"disabled\"\ - \n },\n \"match_host_labels\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"match_host_groups\": {\n \"state\": \"disabled\"\ - \n },\n \"match_hosts\": {\"state\": \"disabled\"\ - },\n \"match_exclude_hosts\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_service_labels\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_groups\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_exclude_service_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_groups_regex\": {\n \"\ - state\": \"disabled\"\n },\n \"match_exclude_service_groups_regex\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_services\": {\n \"state\": \"\ - disabled\"\n },\n \"match_exclude_services\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_check_types\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_plugin_output\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_contact_groups\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_service_levels\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_only_during_time_period\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_host_event_type\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_event_type\": {\n \"\ - state\": \"disabled\"\n },\n \"restrict_to_notification_numbers\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"throttle_periodic_notifications\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_notification_comment\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"event_console_alerts\": {\n \"state\"\ - : \"disabled\"\n },\n },\n }\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n rule_config[rule_properties][description]='A\ - \ description or title of this rule.'\\\n rule_config[rule_properties][comment]='A\ - \ example comment.'\\\n rule_config[rule_properties][documentation_url]='http://link/to/documentation'\\\ - \n rule_config[rule_properties][do_not_apply_this_rule][state]='disabled'\\\ - \n rule_config[rule_properties][allow_users_to_deactivate][state]='enabled'\\\ - \n rule_config[notification_method][notify_plugin][option]='create_notification_with_the_following_parameters'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][plugin_name]='mail'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][from_details][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][reply_to][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][subject_for_host_notifications][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][subject_for_service_notifications][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][info_to_be_displayed_in_the_email_body][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][insert_html_section_between_body_and_table][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][url_prefix_for_links_to_checkmk][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][sort_order_for_bulk_notificaions][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][send_separate_notification_to_every_recipient][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][enable_sync_smtp][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][display_graphs_among_each_other][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][graphs_per_notification][state]='disabled'\\\ - \n rule_config[notification_method][notify_plugin][plugin_params][bulk_notifications_with_graphs][state]='disabled'\\\ - \n rule_config[notification_method][notification_bulking][state]='disabled'\\\ - \n rule_config[contact_selection][all_contacts_of_the_notified_object][state]='disabled'\\\ - \n rule_config[contact_selection][all_users][state]='disabled'\\\n \ - \ rule_config[contact_selection][all_users_with_an_email_address][state]='disabled'\\\ - \n rule_config[contact_selection][the_following_users][state]='disabled'\\\ - \n rule_config[contact_selection][members_of_contact_groups][state]='disabled'\\\ - \n rule_config[contact_selection][explicit_email_addresses][state]='disabled'\\\ - \n rule_config[contact_selection][restrict_by_custom_macros][state]='disabled'\\\ - \n rule_config[contact_selection][restrict_by_contact_groups][state]='disabled'\\\ - \n rule_config[conditions][match_sites][state]='disabled'\\\n rule_config[conditions][match_folder][state]='disabled'\\\ - \n rule_config[conditions][match_host_tags][state]='disabled'\\\n \ - \ rule_config[conditions][match_host_labels][state]='disabled'\\\n rule_config[conditions][match_host_groups][state]='disabled'\\\ - \n rule_config[conditions][match_hosts][state]='disabled'\\\n rule_config[conditions][match_exclude_hosts][state]='disabled'\\\ - \n rule_config[conditions][match_service_labels][state]='disabled'\\\n\ - \ rule_config[conditions][match_service_groups][state]='disabled'\\\n\ - \ rule_config[conditions][match_exclude_service_groups][state]='disabled'\\\ - \n rule_config[conditions][match_service_groups_regex][state]='disabled'\\\ - \n rule_config[conditions][match_exclude_service_groups_regex][state]='disabled'\\\ - \n rule_config[conditions][match_services][state]='disabled'\\\n rule_config[conditions][match_exclude_services][state]='disabled'\\\ - \n rule_config[conditions][match_check_types][state]='disabled'\\\n \ - \ rule_config[conditions][match_plugin_output][state]='disabled'\\\n \ - \ rule_config[conditions][match_contact_groups][state]='disabled'\\\n\ - \ rule_config[conditions][match_service_levels][state]='disabled'\\\n\ - \ rule_config[conditions][match_only_during_time_period][state]='disabled'\\\ - \n rule_config[conditions][match_host_event_type][state]='disabled'\\\ - \n rule_config[conditions][match_service_event_type][state]='disabled'\\\ - \n rule_config[conditions][restrict_to_notification_numbers][state]='disabled'\\\ - \n rule_config[conditions][throttle_periodic_notifications][state]='disabled'\\\ - \n rule_config[conditions][match_notification_comment][state]='disabled'\\\ - \n rule_config[conditions][event_console_alerts][state]='disabled'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"rule_config\": {\n \"conditions\"\ - : {\n \"event_console_alerts\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_check_types\": {\n\ - \ \"state\": \"disabled\"\n },\n \ - \ \"match_contact_groups\": {\n \"state\": \"disabled\"\ - \n },\n \"match_exclude_hosts\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_exclude_service_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_exclude_service_groups_regex\": {\n \"state\"\ - : \"disabled\"\n },\n \"match_exclude_services\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_folder\": {\n \"state\": \"disabled\"\n \ - \ },\n \"match_host_event_type\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_host_groups\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_host_labels\": {\n \"state\": \"disabled\"\ - \n },\n \"match_host_tags\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_hosts\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_notification_comment\": {\n \"state\": \"\ - disabled\"\n },\n \"match_only_during_time_period\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_plugin_output\": {\n \"state\": \"disabled\"\ - \n },\n \"match_service_event_type\": {\n \ - \ \"state\": \"disabled\"\n },\n \"\ - match_service_groups\": {\n \"state\": \"disabled\"\n \ - \ },\n \"match_service_groups_regex\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_service_labels\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"match_service_levels\": {\n \"state\": \"disabled\"\ - \n },\n \"match_services\": {\n \ - \ \"state\": \"disabled\"\n },\n \"match_sites\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"restrict_to_notification_numbers\": {\n \"state\"\ - : \"disabled\"\n },\n \"throttle_periodic_notifications\"\ - : {\n \"state\": \"disabled\"\n }\n \ - \ },\n \"contact_selection\": {\n \"all_contacts_of_the_notified_object\"\ - : {\n \"state\": \"disabled\"\n },\n \ - \ \"all_users\": {\n \"state\": \"disabled\"\n \ - \ },\n \"all_users_with_an_email_address\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"explicit_email_addresses\": {\n \"state\": \"disabled\"\ - \n },\n \"members_of_contact_groups\": {\n \ - \ \"state\": \"disabled\"\n },\n \"\ - restrict_by_contact_groups\": {\n \"state\": \"disabled\"\ - \n },\n \"restrict_by_custom_macros\": {\n \ - \ \"state\": \"disabled\"\n },\n \"\ - the_following_users\": {\n \"state\": \"disabled\"\n \ - \ }\n },\n \"notification_method\": {\n \ - \ \"notification_bulking\": {\n \"state\": \"\ - disabled\"\n },\n \"notify_plugin\": {\n \ - \ \"option\": \"create_notification_with_the_following_parameters\"\ - ,\n \"plugin_params\": {\n \"bulk_notifications_with_graphs\"\ - : {\n \"state\": \"disabled\"\n },\n\ - \ \"display_graphs_among_each_other\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"enable_sync_smtp\": {\n \"state\": \"disabled\"\ - \n },\n \"from_details\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"graphs_per_notification\": {\n \"state\": \"\ - disabled\"\n },\n \"info_to_be_displayed_in_the_email_body\"\ - : {\n \"state\": \"disabled\"\n },\n\ - \ \"insert_html_section_between_body_and_table\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"plugin_name\": \"mail\",\n \"reply_to\"\ - : {\n \"state\": \"disabled\"\n },\n\ - \ \"send_separate_notification_to_every_recipient\": {\n\ - \ \"state\": \"disabled\"\n },\n \ - \ \"sort_order_for_bulk_notificaions\": {\n \ - \ \"state\": \"disabled\"\n },\n \ - \ \"subject_for_host_notifications\": {\n \"state\":\ - \ \"disabled\"\n },\n \"subject_for_service_notifications\"\ - : {\n \"state\": \"disabled\"\n },\n\ - \ \"url_prefix_for_links_to_checkmk\": {\n \ - \ \"state\": \"disabled\"\n }\n }\n\ - \ }\n },\n \"rule_properties\": {\n \ - \ \"allow_users_to_deactivate\": {\n \"state\"\ - : \"enabled\"\n },\n \"comment\": \"A example\ - \ comment.\",\n \"description\": \"A description or title of\ - \ this rule.\",\n \"do_not_apply_this_rule\": {\n \ - \ \"state\": \"disabled\"\n },\n \"documentation_url\"\ - : \"http://link/to/documentation\"\n }\n }\n \ - \ }' \\\n \"$API_URL/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update a notification rule - get: - tags: - - Notification Rules - description: "\n\nThis endpoint requires the following permissions: \n * `general.edit_notifications`:\ - \ This allows a user to edit his personal notification settings. You also\ - \ need the permission Edit the user profile in order to do this.\n" - operationId: cmk.gui.plugins.openapi.endpoints.notification_rules.show_rule - parameters: - - in: path - name: rule_id - required: true - description: The notification rule ID. - schema: - type: string - example: 5425d554-5741-4bbf-b907-1a391dfab5bb - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/NotificationRuleResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/notification_rule/5425d554-5741-4bbf-b907-1a391dfab5bb\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a notification rule - /domain-types/password/collections/all: - post: - tags: - - Passwords - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.passwords`: This permission is needed for the module Passwords.\n\ - \ * Optionally:\n * `wato.edit_all_passwords`: Without this permission,\ - \ users can only edit passwords which are shared with a contact group they\ - \ are member of. This permission grants full access to all passwords.\n" - operationId: cmk.gui.plugins.openapi.endpoints.password.create_password - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/PasswordObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/InputPassword' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/password/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"ident\": \"pass\",\n \"title\": \"\ - Kubernetes login\",\n \"comment\": \"Kommentar\",\n \"documentation_url\"\ - : \"localhost\",\n \"password\": \"password\",\n \"owner\"\ - : \"admin\",\n \"shared\": [\"all\"],\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/password/collections/all\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"ident\": \"pass\",\n \"title\": \"Kubernetes login\",\n \ - \ \"comment\": \"Kommentar\",\n \"documentation_url\": \"localhost\"\ - ,\n \"password\": \"password\",\n \"owner\": \"admin\",\n\ - \ \"shared\": [\"all\"],\n }).encode('utf-8'),\n)\nresponse =\ - \ urllib.request.urlopen(request)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/password/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n ident='pass'\\\n title='Kubernetes\ - \ login'\\\n comment='Kommentar'\\\n documentation_url='localhost'\\\ - \n password='password'\\\n owner='admin'\\\n shared:='[\"all\"\ - ]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"comment\": \"Kommentar\",\n \"\ - documentation_url\": \"localhost\",\n \"ident\": \"pass\",\n \ - \ \"owner\": \"admin\",\n \"password\": \"password\",\n\ - \ \"shared\": [\n \"all\"\n ],\n \"\ - title\": \"Kubernetes login\"\n }' \\\n \"$API_URL/domain-types/password/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a password - get: - tags: - - Passwords - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.passwords`: This permission is needed for the module Passwords.\n\ - \ * Optionally:\n * `wato.edit_all_passwords`: Without this permission,\ - \ users can only edit passwords which are shared with a contact group they\ - \ are member of. This permission grants full access to all passwords.\n" - operationId: cmk.gui.plugins.openapi.endpoints.password.list_passwords - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/PasswordCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/password/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/password/collections/all\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/password/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/password/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all passwords - /objects/password/{name}: - delete: - tags: - - Passwords - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.passwords`: This permission is needed for the module Passwords.\n\ - \ * Optionally:\n * `wato.edit_all_passwords`: Without this permission,\ - \ users can only edit passwords which are shared with a contact group they\ - \ are member of. This permission grants full access to all passwords.\n" - operationId: cmk.gui.plugins.openapi.endpoints.password.delete_password - parameters: - - in: path - name: name - required: true - description: A name used as an identifier. Can be of arbitrary (sensible) - length. - schema: - type: string - example: pathname - pattern: ^[^\d\W][-\w]*$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/password/pathname\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/password/pathname\",\n method=\"DELETE\",\n\ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/password/pathname\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/password/pathname\")\n\n\ - resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ - ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a password - get: - tags: - - Passwords - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.passwords`: This permission is needed for the module Passwords.\n\ - \ * Optionally:\n * `wato.edit_all_passwords`: Without this permission,\ - \ users can only edit passwords which are shared with a contact group they\ - \ are member of. This permission grants full access to all passwords.\n" - operationId: cmk.gui.plugins.openapi.endpoints.password.show_password - parameters: - - in: path - name: name - required: true - description: A name used as an identifier. Can be of arbitrary (sensible) - length. - schema: - type: string - example: pathname - pattern: ^[^\d\W][-\w]*$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/PasswordObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/password/pathname\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/password/pathname\",\n method=\"GET\",\n \ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/password/pathname\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/password/pathname\")\n\n\ - resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ - ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a password - put: - tags: - - Passwords - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.passwords`: This permission is needed for the module Passwords.\n\ - \ * Optionally:\n * `wato.edit_all_passwords`: Without this permission,\ - \ users can only edit passwords which are shared with a contact group they\ - \ are member of. This permission grants full access to all passwords.\n" - operationId: cmk.gui.plugins.openapi.endpoints.password.update_password - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: name - required: true - description: A name used as an identifier. Can be of arbitrary (sensible) - length. - schema: - type: string - example: pathname - pattern: ^[^\d\W][-\w]*$ - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/PasswordObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePassword' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/password/pathname\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\n \"title\"\ - : \"Kubernetes login\",\n \"comment\": \"Kommentar\",\n \"\ - documentation_url\": \"localhost\",\n \"password\": \"password\"\ - ,\n \"owner\": \"admin\",\n \"shared\": [\"all\"],\n },\n\ - )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/password/pathname\",\n method=\"PUT\",\n \ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ - a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ - \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n data=json.dumps({\n \"title\": \"Kubernetes login\"\ - ,\n \"comment\": \"Kommentar\",\n \"documentation_url\": \"\ - localhost\",\n \"password\": \"password\",\n \"owner\": \"\ - admin\",\n \"shared\": [\"all\"],\n }).encode('utf-8'),\n)\nresponse\ - \ = urllib.request.urlopen(request)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/password/pathname\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'If-Match:\"\ - a20ceacf346041dc\"' \\\n 'Content-Type:application/json' \\\n title='Kubernetes\ - \ login'\\\n comment='Kommentar'\\\n documentation_url='localhost'\\\ - \n password='password'\\\n owner='admin'\\\n shared:='[\"all\"\ - ]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"comment\": \"Kommentar\",\n \"documentation_url\"\ - : \"localhost\",\n \"owner\": \"admin\",\n \"password\"\ - : \"password\",\n \"shared\": [\n \"all\"\n \ - \ ],\n \"title\": \"Kubernetes login\"\n }' \\\n \"\ - $API_URL/objects/password/pathname\")\n\nresp=$( echo \"${out}\" | grep\ - \ -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk -F\"=\" '/^xxx-status_code/\ - \ {print $2}')\n\n# For indentation, please install 'jq' (JSON query tool)\n\ - echo \"$resp\" | jq\n# echo \"$resp\"\n\nif [[ $code -lt 400 ]]; then\n\ - \ echo \"OK\"\n exit 0\nelse\n echo \"Request error\"\n exit\ - \ 1\nfi" - summary: Update a password - /domain-types/rule/collections/all: - post: - tags: - - Rules - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.rulesets`: Access to the module for managing Checkmk rules.\ - \ Please note that a user can only manage rules in folders he has permissions\ - \ to. \n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.rule.create_rule - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/RuleObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/InputRuleObject' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/rule/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"properties\": {\"disabled\": False},\n \ - \ \"value_raw\": \"{'cmk/os_family': 'linux'}\",\n \"conditions\"\ - : {},\n \"ruleset\": \"host_label_rules\",\n \"folder\": \"\ - ~hosts~linux\",\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/rule/collections/all\",\n method=\"POST\"\ - ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"Content-Type\":\ - \ 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"properties\": {\"disabled\": False},\n \"value_raw\": \"{'cmk/os_family':\ - \ 'linux'}\",\n \"conditions\": {},\n \"ruleset\": \"host_label_rules\"\ - ,\n \"folder\": \"~hosts~linux\",\n }).encode('utf-8'),\n)\nresponse\ - \ = urllib.request.urlopen(request)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/rule/collections/all\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ - \ \\\n properties[disabled]:=false\\\n value_raw='{'cmk/os_family':\ - \ 'linux'}'\\\n ruleset='host_label_rules'\\\n folder='~hosts~linux'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"conditions\": {},\n \"folder\"\ - : \"~hosts~linux\",\n \"properties\": {\n \"disabled\"\ - : false\n },\n \"ruleset\": \"host_label_rules\",\n \ - \ \"value_raw\": \"{'\\''cmk/os_family'\\'': '\\''linux'\\''}\"\n\ - \ }' \\\n \"$API_URL/domain-types/rule/collections/all\")\n\n\ - resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ - ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create rule - get: - tags: - - Rules - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.rulesets`: Access to the module for managing Checkmk rules.\ - \ Please note that a user can only manage rules in folders he has permissions\ - \ to. \n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.rule.list_rules - parameters: - - in: query - name: ruleset_name - required: true - description: The name of the ruleset. - schema: - type: string - example: host_groups - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/RuleCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/rule/collections/all\"\ - ,\n params={ # goes into query string\n \"ruleset_name\": 'host_groups',\ - \ # (required) The name of the ruleset.\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"ruleset_name\": 'host_groups', # (required) The name of the ruleset.\n\ - })\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/rule/collections/all?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/rule/collections/all\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n ruleset_name=='host_groups'\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'ruleset_name=host_groups'\ - \ \\\n \"$API_URL/domain-types/rule/collections/all\")\n\nresp=$( echo\ - \ \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" |\ - \ awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: List rules - /objects/rule/{rule_id}: - delete: - tags: - - Rules - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.rulesets`: Access to the module for managing Checkmk rules.\ - \ Please note that a user can only manage rules in folders he has permissions\ - \ to. \n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.rule.delete_rule - parameters: - - in: path - name: rule_id - required: true - description: The ID of the rule. - schema: - type: string - example: 0a168697-14a2-48d0-9c3c-ca65569a39e2 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The rule to be deleted was not found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Rule was deleted successfully.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\",\n\ - \ method=\"DELETE\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\" \\\n \ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a rule - put: - tags: - - Rules - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.rulesets`: Access to the module for managing Checkmk rules.\ - \ Please note that a user can only manage rules in folders he has permissions\ - \ to. \n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.rule.edit_rule - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: rule_id - required: true - description: The ID of the rule. - schema: - type: string - example: 0a168697-14a2-48d0-9c3c-ca65569a39e2 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/RuleObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateRuleObject' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\n \"properties\"\ - : {\"disabled\": False},\n \"value_raw\": \"{'cmk/os_family': 'linux'}\"\ - ,\n \"conditions\": {},\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\",\n\ - \ method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ - \ the, to be modified, object's ETag header.\n \"Content-Type\":\ - \ 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"properties\": {\"disabled\": False},\n \"value_raw\": \"{'cmk/os_family':\ - \ 'linux'}\",\n \"conditions\": {},\n }).encode('utf-8'),\n)\n\ - response = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ - \ \\\n properties[disabled]:=false\\\n value_raw='{'cmk/os_family':\ - \ 'linux'}'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"conditions\": {},\n \"properties\": {\n \ - \ \"disabled\": false\n },\n \"value_raw\": \"{'\\''cmk/os_family'\\\ - '': '\\''linux'\\''}\"\n }' \\\n \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Modify a rule - get: - tags: - - Rules - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.rulesets`: Access to the module for managing Checkmk rules.\ - \ Please note that a user can only manage rules in folders he has permissions\ - \ to. \n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.rule.show_rule - parameters: - - in: path - name: rule_id - required: true - description: The ID of the rule. - schema: - type: string - example: 0a168697-14a2-48d0-9c3c-ca65569a39e2 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/RuleObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\",\n\ - \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a rule - /objects/rule/{rule_id}/actions/move/invoke: - post: - tags: - - Rules - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.rulesets`: Access to the module for managing Checkmk rules.\ - \ Please note that a user can only manage rules in folders he has permissions\ - \ to. \n * Optionally:\n * `wato.all_folders`: Without this permission,\ - \ operations on folders can only be done by users that are members of one\ - \ of the folders contact groups. This permission grants full access to all\ - \ folders and hosts.\n" - operationId: cmk.gui.plugins.openapi.endpoints.rule.move_rule_to - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: rule_id - required: true - description: The ID of the rule. - schema: - type: string - example: 0a168697-14a2-48d0-9c3c-ca65569a39e2 - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/RuleObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/MoveRuleTo' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2/actions/move/invoke\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n # This schema has multiple\ - \ variations. Please refer to\n # the 'Payload' section for details.\n\ - \ json={\"position\": \"top_of_folder\", \"folder\": \"/\"},\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2/actions/move/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ - \ the, to be modified, object's ETag header.\n \"Content-Type\":\ - \ 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n # This schema has multiple\ - \ variations. Please refer to\n # the 'Payload' section for details.\n\ - \ data=json.dumps({\"position\": \"top_of_folder\", \"folder\": \"/\"\ - }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\n# This schema\ - \ has multiple variations. Please refer to the\n# 'Payload' section for\ - \ details.\nhttp POST \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2/actions/move/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ - \ \\\n position='top_of_folder'\\\n folder='/'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ - \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ - \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --header \"If-Match:\ - \ \"a20ceacf346041dc\"\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"folder\": \"/\",\n \"position\"\ - : \"top_of_folder\"\n }' \\\n \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2/actions/move/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Move a rule to a specific location - /domain-types/ruleset/collections/all: - get: - tags: - - Rulesets - description: "\n\nThis endpoint requires the following permissions: \n * `wato.rulesets`:\ - \ Access to the module for managing Checkmk rules. Please note that a user\ - \ can only manage rules in folders he has permissions to. \n" - operationId: cmk.gui.plugins.openapi.endpoints.ruleset.list_rulesets - parameters: - - in: query - name: fulltext - required: false - description: Search all keys (like `name`, `title`, `help`, etc.) for this - text. Regex allowed. - schema: - type: string - - in: query - name: folder - required: false - description: 'The folder in which to search for rules. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate - for your quoting/escaping needs. A good default choice is `~`.' - schema: - type: string - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - - in: query - name: deprecated - required: false - description: Only show deprecated rulesets. Defaults to False. - schema: - type: boolean - default: false - - in: query - name: used - required: false - description: Only show used rulesets. Defaults to True. - schema: - type: boolean - default: true - - in: query - name: name - required: false - description: A regex of the name. - schema: - type: string - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/RulesetCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/ruleset/collections/all\"\ - ,\n params={ # goes into query string\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - })\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/ruleset/collections/all?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/ruleset/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n \"$API_URL/domain-types/ruleset/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Search rule sets - /objects/ruleset/{ruleset_name}: - get: - tags: - - Rulesets - description: "\n\nThis endpoint requires the following permissions: \n * `wato.rulesets`:\ - \ Access to the module for managing Checkmk rules. Please note that a user\ - \ can only manage rules in folders he has permissions to. \n" - operationId: cmk.gui.plugins.openapi.endpoints.ruleset.show_ruleset - parameters: - - in: path - name: ruleset_name - required: true - description: The name of the ruleset. - schema: - type: string - example: host_groups - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/RulesetObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/ruleset/host_groups\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/ruleset/host_groups\",\n method=\"GET\",\n\ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/ruleset/host_groups\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/ruleset/host_groups\")\n\ - \nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a ruleset - /domain-types/service/collections/all: - get: - tags: - - Service status - description: "This list is filterable by various parameters.This endpoint requires\ - \ the following permissions: \n * Optionally:\n * Any of:\n * `general.see_all`:\ - \ See all objects regardless of contacts and contact groups. If combined with\ - \ 'perform commands' then commands may be done on all objects.\n * `bi.see_all`:\ - \ With this permission set, the BI aggregation rules are applied to all hosts\ - \ and services - not only those the user is a contact for. If you remove this\ - \ permissions then the user will see incomplete aggregation trees with status\ - \ based only on those items.\n * `mkeventd.seeall`: If a user lacks this\ - \ permission then he/she can see only those events that originate from a host\ - \ that he/she is a contact for.\n * `wato.see_all_folders`: Users without\ - \ this permissions can only see folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service._list_all_services - parameters: - - in: query - name: sites - required: false - explode: true - style: form - description: Restrict the query to this particular site. - schema: - type: array - items: - type: string - - in: query - name: query - required: false - description: An query expression of the Livestatus 'services' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - schema: - example: '{"op": "=", "left": "host_name", "right": "example.com"}' - allOf: - - $ref: '#/components/schemas/Expr' - - in: query - name: columns - required: false - explode: true - style: form - description: The desired columns of the `services` table. If left empty, a - default set of columns is used. - schema: - type: array - default: - - host_name - - description - example: &id001 - - host_name - - description - items: - type: string - - in: query - name: host_name - required: false - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObjectCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/service/collections/all\"\ - ,\n params={ # goes into query string\n \"host_name\": 'example.com',\ - \ # A hostname.\n \"query\": '{\"op\": \"=\", \"left\": \"host_name\"\ - , \"right\": \"example.com\"}', # An query expression of the Livestatus\ - \ 'services' table in nested dictionary form.\n \"columns\": ['host_name',\ - \ 'description'], # The desired columns of the `services` table.\n },\n\ - )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"host_name\": 'example.com', # A hostname.\n \"query\": '{\"op\"\ - : \"=\", \"left\": \"host_name\", \"right\": \"example.com\"}', # An query\ - \ expression of the Livestatus 'services' table in nested dictionary form.\n\ - \ \"columns\": ['host_name', 'description'], # The desired columns of\ - \ the `services` table.\n})\n\nrequest = urllib.request.Request(\n f\"\ - {API_URL}/domain-types/service/collections/all?{query_string}\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/service/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ host_name=='example.com' \\\n query=='{\"op\": \"=\", \"left\":\ - \ \"host_name\", \"right\": \"example.com\"}' \\\n columns=='['host_name',\ - \ 'description']' \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'host_name=example.com'\ - \ \\\n --data-urlencode 'query={\"op\": \"=\", \"left\": \"host_name\"\ - , \"right\": \"example.com\"}' \\\n --data-urlencode 'columns=host_name'\ - \ \\\n --data-urlencode 'columns=description' \\\n \"$API_URL/domain-types/service/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all monitored services - /objects/host/{host_name}/collections/services: - get: - tags: - - Service status - description: "This list is filterable by various parameters.This endpoint requires\ - \ the following permissions: \n * Optionally:\n * Any of:\n * `general.see_all`:\ - \ See all objects regardless of contacts and contact groups. If combined with\ - \ 'perform commands' then commands may be done on all objects.\n * `bi.see_all`:\ - \ With this permission set, the BI aggregation rules are applied to all hosts\ - \ and services - not only those the user is a contact for. If you remove this\ - \ permissions then the user will see incomplete aggregation trees with status\ - \ based only on those items.\n * `mkeventd.seeall`: If a user lacks this\ - \ permission then he/she can see only those events that originate from a host\ - \ that he/she is a contact for.\n * `wato.see_all_folders`: Users without\ - \ this permissions can only see folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service._list_host_services - parameters: - - in: query - name: sites - required: false - explode: true - style: form - description: Restrict the query to this particular site. - schema: - type: array - items: - type: string - - in: query - name: query - required: false - description: An query expression of the Livestatus 'services' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - schema: - example: '{"op": "=", "left": "host_name", "right": "example.com"}' - allOf: - - $ref: '#/components/schemas/Expr' - - in: query - name: columns - required: false - explode: true - style: form - description: The desired columns of the `services` table. If left empty, a - default set of columns is used. - schema: - type: array - default: - - host_name - - description - example: *id001 - items: - type: string - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObjectCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host/example.com/collections/services\"\ - ,\n params={ # goes into query string\n \"query\": '{\"op\":\ - \ \"=\", \"left\": \"host_name\", \"right\": \"example.com\"}', # An query\ - \ expression of the Livestatus 'services' table in nested dictionary form.\n\ - \ \"columns\": ['host_name', 'description'], # The desired columns\ - \ of the `services` table.\n },\n)\nif resp.status_code == 200:\n \ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"query\": '{\"op\": \"=\", \"left\": \"host_name\", \"right\": \"\ - example.com\"}', # An query expression of the Livestatus 'services' table\ - \ in nested dictionary form.\n \"columns\": ['host_name', 'description'],\ - \ # The desired columns of the `services` table.\n})\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host/example.com/collections/services?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/host/example.com/collections/services\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ query=='{\"op\": \"=\", \"left\": \"host_name\", \"right\": \"example.com\"\ - }' \\\n columns=='['host_name', 'description']' \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'query={\"\ - op\": \"=\", \"left\": \"host_name\", \"right\": \"example.com\"}' \\\n\ - \ --data-urlencode 'columns=host_name' \\\n --data-urlencode 'columns=description'\ - \ \\\n \"$API_URL/objects/host/example.com/collections/services\")\n\n\ - resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ - ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show the monitored services of a host - /objects/host/{host_name}/actions/show_service/invoke: - get: - tags: - - Service status - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * Any of:\n * `general.see_all`: See all objects regardless of contacts\ - \ and contact groups. If combined with 'perform commands' then commands may\ - \ be done on all objects.\n * `bi.see_all`: With this permission set,\ - \ the BI aggregation rules are applied to all hosts and services - not only\ - \ those the user is a contact for. If you remove this permissions then the\ - \ user will see incomplete aggregation trees with status based only on those\ - \ items.\n * `mkeventd.seeall`: If a user lacks this permission then he/she\ - \ can see only those events that originate from a host that he/she is a contact\ - \ for.\n * `wato.see_all_folders`: Users without this permissions can\ - \ only see folders with a contact group they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service.show_service - parameters: - - in: query - name: service_description - required: true - description: The service description of the selected host - schema: - type: string - example: Filesystem %boot - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host/example.com/actions/show_service/invoke\"\ - ,\n params={ # goes into query string\n \"service_description\"\ - : 'Filesystem %boot', # (required) The service description of the selected\ - \ host\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"service_description\": 'Filesystem %boot', # (required) The service\ - \ description of the selected host\n})\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host/example.com/actions/show_service/invoke?{query_string}\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/host/example.com/actions/show_service/invoke\" \\\n \ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n service_description=='Filesystem %boot' \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'service_description=Filesystem\ - \ %boot' \\\n \"$API_URL/objects/host/example.com/actions/show_service/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show the monitored service of a host - /objects/host/{host_name}/actions/discover_services/invoke: - post: - tags: - - Service discovery - description: "`WARNING`: This URL is deprecated, see [Werk 14538](https://checkmk.com/werk/14538)\ - \ for more details.\n\nThis endpoint requires the following permissions: \n\ - \ * All of:\n * `wato.edit`: This permission is needed in order to make\ - \ any changes or perform any actions at all. Without this permission, the\ - \ user is only able to view data, and that only in modules he has explicit\ - \ permissions for.\n * Optionally:\n * `wato.service_discovery_to_undecided`:\ - \ Service discovery: Move to undecided services\n * Optionally:\n *\ - \ `wato.service_discovery_to_monitored`: Service discovery: Move to monitored\ - \ services\n * Optionally:\n * `wato.service_discovery_to_ignored`:\ - \ Service discovery: Disabled services\n * Optionally:\n * `wato.service_discovery_to_removed`:\ - \ Service discovery: Remove services\n * Optionally:\n * `wato.services`:\ - \ Do inventory and service configuration on existing hosts.\n * Optionally:\n\ - \ * `wato.see_all_folders`: Users without this permissions can only see\ - \ folders with a contact group they are in.\n" - deprecated: true - operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.execute-14538 - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: Host could not be found' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: A service discovery background job is currently - running' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '302': - description: 'Found: The service discovery background job has been initialized. - Redirecting to the ''Wait for service discovery completion'' endpoint.' - content: {} - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DiscoverServicesDeprecated' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\nsession.max_redirects = 100 # increase if necessary\n\ - \nresp = session.post(\n f\"{API_URL}/objects/host/example.com/actions/discover_services/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"mode\": \"refresh\"},\n allow_redirects=True,\n\ - )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelif resp.status_code == 302:\n print(\"\ - Redirected to\", resp.headers[\"location\"])\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host/example.com/actions/discover_services/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - mode\": \"refresh\"}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelif resp.status_code == 302:\n print(\"\ - Redirected to\", resp.headers[\"location\"])\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/host/example.com/actions/discover_services/invoke\" \\\n\ - \ --follow \\\n --all \\\n \"Authorization: Bearer $USERNAME $PASSWORD\"\ - \ \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ - \ \\\n mode='refresh'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"mode\": \"refresh\"\n }' \\\n \ - \ \"$API_URL/objects/host/example.com/actions/discover_services/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Execute a service discovery on a host - /domain-types/discovery_run/actions/bulk-discovery-start/invoke: - post: - tags: - - Service discovery - description: '' - operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.execute_bulk_discovery - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: A bulk discovery job is already active' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DiscoveryBackgroundJobStatusObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkDiscovery' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/discovery_run/actions/bulk-discovery-start/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"hostnames\": [\"example\", \"sample\"],\n\ - \ \"mode\": \"refresh\",\n \"do_full_scan\": True,\n \ - \ \"bulk_size\": 10,\n \"ignore_errors\": True,\n },\n)\nif\ - \ resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/discovery_run/actions/bulk-discovery-start/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"hostnames\": [\"example\", \"sample\"],\n \"mode\": \"\ - refresh\",\n \"do_full_scan\": True,\n \"bulk_size\": 10,\n\ - \ \"ignore_errors\": True,\n }).encode('utf-8'),\n)\nresponse\ - \ = urllib.request.urlopen(request)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/discovery_run/actions/bulk-discovery-start/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n hostnames:='[\"\ - example\", \"sample\"]'\\\n mode='refresh'\\\n do_full_scan:=true\\\ - \n bulk_size:=10\\\n ignore_errors:=true" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"bulk_size\": 10,\n \"do_full_scan\"\ - : true,\n \"hostnames\": [\n \"example\",\n \ - \ \"sample\"\n ],\n \"ignore_errors\": true,\n \ - \ \"mode\": \"refresh\"\n }' \\\n \"$API_URL/domain-types/discovery_run/actions/bulk-discovery-start/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Start a bulk discovery job - /domain-types/service_discovery_run/actions/start/invoke: - post: - tags: - - Service discovery - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * Optionally:\n * `wato.service_discovery_to_undecided`: Service\ - \ discovery: Move to undecided services\n * Optionally:\n * `wato.service_discovery_to_monitored`:\ - \ Service discovery: Move to monitored services\n * Optionally:\n *\ - \ `wato.service_discovery_to_ignored`: Service discovery: Disabled services\n\ - \ * Optionally:\n * `wato.service_discovery_to_removed`: Service discovery:\ - \ Remove services\n * Optionally:\n * `wato.services`: Do inventory\ - \ and service configuration on existing hosts.\n * Optionally:\n * `wato.see_all_folders`:\ - \ Users without this permissions can only see folders with a contact group\ - \ they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.execute_service_discovery - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: A service discovery background job is currently - running' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '302': - description: 'Found: The service discovery background job has been initialized. - Redirecting to the ''Wait for service discovery completion'' endpoint.' - content: {} - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DiscoverServices' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\nsession.max_redirects = 100 # increase if necessary\n\ - \nresp = session.post(\n f\"{API_URL}/domain-types/service_discovery_run/actions/start/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"host_name\": \"example.com\", \"mode\": \"refresh\"\ - },\n allow_redirects=True,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelif resp.status_code\ - \ == 302:\n print(\"Redirected to\", resp.headers[\"location\"])\nelse:\n\ - \ raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/service_discovery_run/actions/start/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - host_name\": \"example.com\", \"mode\": \"refresh\"}).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelif resp.status_code == 302:\n print(\"Redirected to\", resp.headers[\"\ - location\"])\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/service_discovery_run/actions/start/invoke\" \\\n\ - \ --follow \\\n --all \\\n \"Authorization: Bearer $USERNAME $PASSWORD\"\ - \ \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ - \ \\\n host_name='example.com'\\\n mode='refresh'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"host_name\": \"example.com\",\n \ - \ \"mode\": \"refresh\"\n }' \\\n \"$API_URL/domain-types/service_discovery_run/actions/start/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Execute a service discovery on a host - /objects/service_discovery_run/{host_name}/actions/wait-for-completion/invoke: - get: - tags: - - Service discovery - description: This endpoint will periodically redirect on itself to prevent timeouts. - operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.service_discovery_run_wait_for_completion - parameters: - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: There is no running service discovery' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '302': - description: 'Found: The service discovery is still running. Redirecting - to the ''Wait for completion'' endpoint.' - content: {} - '204': - description: 'No Content: The service discovery has been completed.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\nsession.max_redirects = 100 # increase if necessary\n\ - \nresp = session.get(\n f\"{API_URL}/objects/service_discovery_run/example.com/actions/wait-for-completion/invoke\"\ - ,\n allow_redirects=True,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelif resp.status_code\ - \ == 302:\n print(\"Redirected to\", resp.headers[\"location\"])\nelse:\n\ - \ raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/service_discovery_run/example.com/actions/wait-for-completion/invoke\"\ - ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelif resp.status_code == 302:\n print(\"Redirected\ - \ to\", resp.headers[\"location\"])\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/service_discovery_run/example.com/actions/wait-for-completion/invoke\"\ - \ \\\n --follow \\\n --all \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/service_discovery_run/example.com/actions/wait-for-completion/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Wait for service discovery completion - /objects/discovery_run/{job_id}: - get: - tags: - - Service discovery - description: '' - operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.show_bulk_discovery_status - parameters: - - in: path - name: job_id - required: true - description: The unique identifier of the background job executing the bulk - discovery - schema: - type: string - example: bulk_discovery - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: There is no running background job with this job_id.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DiscoveryBackgroundJobStatusObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/discovery_run/bulk_discovery\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/discovery_run/bulk_discovery\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/discovery_run/bulk_discovery\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/discovery_run/bulk_discovery\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show the status of a bulk discovery job - /objects/service_discovery/{host_name}: - get: - tags: - - Service discovery - description: '' - operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.show_service_discovery_result - parameters: - - in: path - name: host_name - required: true - description: The host of the service discovery result - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/service_discovery/example.com\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/service_discovery/example.com\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/service_discovery/example.com\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/service_discovery/example.com\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show the current service discovery result - /objects/service_discovery_run/{host_name}: - get: - tags: - - Service discovery - description: '' - operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.show_service_discovery_run - parameters: - - in: path - name: host_name - required: true - description: A hostname. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/service_discovery_run/example.com\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/service_discovery_run/example.com\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/service_discovery_run/example.com\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/service_discovery_run/example.com\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show the last service discovery background job on a host - /domain-types/service/collections/services: - get: - tags: - - Service discovery - description: '`WARNING`: This URL is deprecated, see [Werk 14537](https://checkmk.com/werk/14537) - for more details. - - - ' - deprecated: true - operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.show_services-14537 - parameters: - - in: query - name: host_name - required: true - description: The host of the discovered services. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - - in: query - name: discovery_phase - required: true - description: The discovery phase of the services. - schema: - type: string - enum: - - active - - active_ignored - - clustered_ignored - - clustered_monitored - - clustered_undecided - - clustered_vanished - - custom - - custom_ignored - - ignored - - legacy - - legacy_ignored - - manual - - monitored - - removed - - undecided - - vanished - example: monitored - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/service/collections/services\"\ - ,\n params={ # goes into query string\n \"host_name\": 'example.com',\ - \ # (required) The host of the discovered services.\n \"discovery_phase\"\ - : 'monitored', # (required) The discovery phase of the services.\n },\n\ - )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.parse\n\ - import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ - API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ - \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ - \ \"host_name\": 'example.com', # (required) The host of the discovered\ - \ services.\n \"discovery_phase\": 'monitored', # (required) The discovery\ - \ phase of the services.\n})\n\nrequest = urllib.request.Request(\n f\"\ - {API_URL}/domain-types/service/collections/services?{query_string}\",\n\ - \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/service/collections/services\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ host_name=='example.com' \\\n discovery_phase=='monitored' \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ - \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ - n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ - \ --header \"Accept: application/json\" \\\n --data-urlencode 'host_name=example.com'\ - \ \\\n --data-urlencode 'discovery_phase=monitored' \\\n \"$API_URL/domain-types/service/collections/services\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all services of specific phase - /objects/host/{host_name}/actions/update_discovery_phase/invoke: - put: - tags: - - Service discovery - description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ - \ * Any of:\n * `wato.service_discovery_to_monitored`: Service discovery:\ - \ Move to monitored services\n * `wato.service_discovery_to_ignored`:\ - \ Service discovery: Disabled services\n * `wato.service_discovery_to_undecided`:\ - \ Service discovery: Move to undecided services\n * `wato.service_discovery_to_removed`:\ - \ Service discovery: Remove services\n * Optionally:\n * `wato.see_all_folders`:\ - \ Users without this permissions can only see folders with a contact group\ - \ they are in.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.update_service_phase - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: host_name - required: true - description: The host of the service which shall be updated. - schema: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: Host could not be found' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateDiscoveryPhase' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host/example.com/actions/update_discovery_phase/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"check_type\": \"df\",\n \"service_item\"\ - : \"/home\",\n \"target_phase\": \"monitored\",\n },\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/host/example.com/actions/update_discovery_phase/invoke\"\ - ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"check_type\": \"df\",\n \"service_item\": \"/home\",\n\ - \ \"target_phase\": \"monitored\",\n }).encode('utf-8'),\n)\n\ - response = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/host/example.com/actions/update_discovery_phase/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n check_type='df'\\\ - \n service_item='/home'\\\n target_phase='monitored'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"check_type\": \"df\",\n \"service_item\"\ - : \"/home\",\n \"target_phase\": \"monitored\"\n }' \\\n\ - \ \"$API_URL/objects/host/example.com/actions/update_discovery_phase/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update the phase of a service - /domain-types/service_group_config/actions/bulk-create/invoke: - post: - tags: - - Service groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.groups`: Access to the modules for managing host and service\ - \ groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.bulk_create - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceGroupCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkInputServiceGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/service_group_config/actions/bulk-create/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"entries\": [\n {\n \ - \ \"name\": \"environment\",\n \"alias\": \"Environment\ - \ Sensors\",\n }\n ]\n },\n)\nif resp.status_code ==\ - \ 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/service_group_config/actions/bulk-create/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"entries\": [\n {\n \"name\": \"environment\"\ - ,\n \"alias\": \"Environment Sensors\",\n }\n\ - \ ]\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/service_group_config/actions/bulk-create/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n entries:='[{\"\ - name\": \"environment\", \"alias\": \"Environment Sensors\"}]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n {\n \ - \ \"alias\": \"Environment Sensors\",\n \"name\": \"environment\"\ - \n }\n ]\n }' \\\n \"$API_URL/domain-types/service_group_config/actions/bulk-create/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk create service groups - /domain-types/service_group_config/actions/bulk-delete/invoke: - post: - tags: - - Service groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.groups`: Access to the modules for managing host and service\ - \ groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.bulk_delete - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: The request is in conflict with the stored resource.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkDeleteServiceGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/service_group_config/actions/bulk-delete/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"entries\": [\"windows\", \"panels\"]},\n)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/service_group_config/actions/bulk-delete/invoke\"\ - ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - entries\": [\"windows\", \"panels\"]}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/service_group_config/actions/bulk-delete/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n entries:='[\"\ - windows\", \"panels\"]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n \"windows\",\n\ - \ \"panels\"\n ]\n }' \\\n \"$API_URL/domain-types/service_group_config/actions/bulk-delete/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk delete service groups - /domain-types/service_group_config/actions/bulk-update/invoke: - put: - tags: - - Service groups - description: "Please be aware that when doing bulk updates, it is not possible\ - \ to prevent the\n[Updating Values](\"lost update problem\"), which is normally\ - \ prevented by the ETag locking\nmechanism. Use at your own risk.This endpoint\ - \ requires the following permissions: \n * All of:\n * `wato.edit`: This\ - \ permission is needed in order to make any changes or perform any actions\ - \ at all. Without this permission, the user is only able to view data, and\ - \ that only in modules he has explicit permissions for.\n * `wato.groups`:\ - \ Access to the modules for managing host and service groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.bulk_update - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceGroupCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/BulkUpdateServiceGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/domain-types/service_group_config/actions/bulk-update/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"entries\": [\n {\n \ - \ \"name\": \"windows\",\n \"attributes\": {\n \ - \ \"alias\": \"Windows Servers\"\n },\n \ - \ }\n ]\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/service_group_config/actions/bulk-update/invoke\"\ - ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"entries\": [\n {\n \"name\": \"windows\"\ - ,\n \"attributes\": {\n \"alias\": \"\ - Windows Servers\"\n },\n }\n ]\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/domain-types/service_group_config/actions/bulk-update/invoke\"\ - \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ - \ application/json\" \\\n 'Content-Type:application/json' \\\n entries:='[{\"\ - name\": \"windows\", \"attributes\": {\"alias\": \"Windows Servers\"}}]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"entries\": [\n {\n \ - \ \"attributes\": {\n \"alias\": \"Windows Servers\"\n\ - \ },\n \"name\": \"windows\"\n }\n\ - \ ]\n }' \\\n \"$API_URL/domain-types/service_group_config/actions/bulk-update/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Bulk update service groups - /domain-types/service_group_config/collections/all: - post: - tags: - - Service groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.groups`: Access to the modules for managing host and service\ - \ groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.create - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/DomainObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/InputServiceGroup' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/service_group_config/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"name\": \"windows\",\n \"alias\":\ - \ \"Environment Sensors\",\n },\n)\nif resp.status_code == 200:\n \ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/service_group_config/collections/all\",\n\ - \ method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ - \ \"name\": \"windows\",\n \"alias\": \"Environment Sensors\"\ - ,\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/service_group_config/collections/all\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'Content-Type:application/json' \\\n name='windows'\\\n \ - \ alias='Environment Sensors'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"alias\": \"Environment Sensors\",\n \ - \ \"name\": \"windows\"\n }' \\\n \"$API_URL/domain-types/service_group_config/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a service group - get: - tags: - - Service groups - description: "\n\nThis endpoint requires the following permissions: \n * `wato.groups`:\ - \ Access to the modules for managing host and service groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.list_groups - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceGroupCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/service_group_config/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/service_group_config/collections/all\",\n\ - \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/service_group_config/collections/all\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/service_group_config/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all service groups - /objects/service_group_config/{name}: - delete: - tags: - - Service groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.groups`: Access to the modules for managing host and service\ - \ groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.delete - parameters: - - in: path - name: name - required: true - description: The identifier name of the group. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_\.]*\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: The request is in conflict with the stored resource.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/service_group_config/pathname\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/service_group_config/pathname\",\n method=\"\ - DELETE\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n },\n)\n\ - response = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/service_group_config/pathname\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/service_group_config/pathname\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a service group - get: - tags: - - Service groups - description: "\n\nThis endpoint requires the following permissions: \n * `wato.groups`:\ - \ Access to the modules for managing host and service groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.show_group - parameters: - - in: path - name: name - required: true - description: The identifier name of the group. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_\.]*\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceGroup' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/service_group_config/pathname\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/service_group_config/pathname\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/service_group_config/pathname\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/service_group_config/pathname\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a service group - put: - tags: - - Service groups - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.groups`: Access to the modules for managing host and service\ - \ groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.update - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: name - required: true - description: The identifier name of the group. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_\.]*\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceGroup' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateGroup2' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/service_group_config/pathname\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\"alias\": \"Example\ - \ Group\"},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/service_group_config/pathname\",\n method=\"\ - PUT\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ - a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ - \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n data=json.dumps({\"alias\": \"Example Group\"}).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/service_group_config/pathname\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ - \ \\\n alias='Example Group'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"alias\": \"Example Group\"\n }' \\\n \"$API_URL/objects/service_group_config/pathname\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update a service group - /objects/site_connection/{site_id}/actions/delete/invoke: - post: - tags: - - Site Management - description: "\n\nThis endpoint requires the following permissions: \n * `wato.sites`:\ - \ Access to the module for managing connections to remote monitoring sites.\n" - operationId: cmk.gui.plugins.openapi.endpoints.site_management.delete_site - parameters: - - in: path - name: site_id - required: true - description: The site ID. - schema: - type: string - example: prod - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/site_connection/prod/actions/delete/invoke\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/site_connection/prod/actions/delete/invoke\",\n\ - \ method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/site_connection/prod/actions/delete/invoke\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/site_connection/prod/actions/delete/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a site connection - /domain-types/site_connection/collections/all: - post: - tags: - - Site Management - description: "\n\nThis endpoint requires the following permissions: \n * `wato.sites`:\ - \ Access to the module for managing connections to remote monitoring sites.\n" - operationId: cmk.gui.plugins.openapi.endpoints.site_management.post_site - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/SiteConnectionResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SiteConnectionRequestCreate' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/site_connection/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"site_config\": {\n \"basic_settings\"\ - : {\n \"alias\": \"Die remote site 1\",\n \ - \ \"site_id\": \"site_id_1\",\n },\n \"status_connection\"\ - : {\n \"connection\": {\n \"socket_type\"\ - : \"tcp\",\n \"host\": \"123.124.1.3\",\n \ - \ \"port\": 1253,\n \"encrypted\": True,\n \ - \ \"verify\": False,\n },\n \ - \ \"proxy\": {\n \"use_livestatus_daemon\": \"with_proxy\"\ - ,\n \"global_settings\": False,\n \ - \ \"params\": {\n \"channels\": 15,\n \ - \ \"heartbeat\": {\n \"interval\"\ - : 12,\n \"timeout\": 3.0,\n \ - \ },\n \"channel_timeout\": 3.5,\n \ - \ \"query_timeout\": 120.2,\n \"connect_retry\"\ - : 4.6,\n \"cache\": True,\n },\n\ - \ \"tcp\": {\n \"port\": 6560,\n\ - \ \"only_from\": [\"192.168.1.1\"],\n \ - \ \"tls\": False,\n },\n },\n\ - \ \"connect_timeout\": 2,\n \"persistent_connection\"\ - : False,\n \"url_prefix\": \"/heute_remote_1/\",\n \ - \ \"status_host\": {\n \"status_host_set\":\ - \ \"disabled\"\n },\n \"disable_in_status_gui\"\ - : False,\n },\n \"configuration_connection\": {\n\ - \ \"enable_replication\": True,\n \"url_of_remote_site\"\ - : \"http://localhost/heute_remote_site_id_1/check_mk/\",\n \ - \ \"disable_remote_configuration\": True,\n \"ignore_tls_errors\"\ - : False,\n \"direct_login_to_web_gui_allowed\": True,\n \ - \ \"user_sync\": {\n \"sync_with_ldap_connections\"\ - : \"all\"\n },\n \"replicate_event_console\"\ - : True,\n \"replicate_extensions\": True,\n },\n\ - \ }\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/site_connection/collections/all\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"site_config\": {\n \"basic_settings\": {\n \ - \ \"alias\": \"Die remote site 1\",\n \"site_id\": \"\ - site_id_1\",\n },\n \"status_connection\": {\n \ - \ \"connection\": {\n \"socket_type\": \"\ - tcp\",\n \"host\": \"123.124.1.3\",\n \ - \ \"port\": 1253,\n \"encrypted\": True,\n \ - \ \"verify\": False,\n },\n \"\ - proxy\": {\n \"use_livestatus_daemon\": \"with_proxy\"\ - ,\n \"global_settings\": False,\n \ - \ \"params\": {\n \"channels\": 15,\n \ - \ \"heartbeat\": {\n \"interval\"\ - : 12,\n \"timeout\": 3.0,\n \ - \ },\n \"channel_timeout\": 3.5,\n \ - \ \"query_timeout\": 120.2,\n \"connect_retry\"\ - : 4.6,\n \"cache\": True,\n },\n\ - \ \"tcp\": {\n \"port\": 6560,\n\ - \ \"only_from\": [\"192.168.1.1\"],\n \ - \ \"tls\": False,\n },\n },\n\ - \ \"connect_timeout\": 2,\n \"persistent_connection\"\ - : False,\n \"url_prefix\": \"/heute_remote_1/\",\n \ - \ \"status_host\": {\n \"status_host_set\":\ - \ \"disabled\"\n },\n \"disable_in_status_gui\"\ - : False,\n },\n \"configuration_connection\": {\n\ - \ \"enable_replication\": True,\n \"url_of_remote_site\"\ - : \"http://localhost/heute_remote_site_id_1/check_mk/\",\n \ - \ \"disable_remote_configuration\": True,\n \"ignore_tls_errors\"\ - : False,\n \"direct_login_to_web_gui_allowed\": True,\n \ - \ \"user_sync\": {\n \"sync_with_ldap_connections\"\ - : \"all\"\n },\n \"replicate_event_console\"\ - : True,\n \"replicate_extensions\": True,\n },\n\ - \ }\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/site_connection/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n site_config[basic_settings][alias]='Die\ - \ remote site 1'\\\n site_config[basic_settings][site_id]='site_id_1'\\\ - \n site_config[status_connection][connection][socket_type]='tcp'\\\n\ - \ site_config[status_connection][connection][host]='123.124.1.3'\\\n\ - \ site_config[status_connection][connection][port]:=1253\\\n site_config[status_connection][connection][encrypted]:=true\\\ - \n site_config[status_connection][connection][verify]:=false\\\n site_config[status_connection][proxy][use_livestatus_daemon]='with_proxy'\\\ - \n site_config[status_connection][proxy][global_settings]:=false\\\n\ - \ site_config[status_connection][proxy][params][channels]:=15\\\n \ - \ site_config[status_connection][proxy][params][heartbeat][interval]:=12\\\ - \n site_config[status_connection][proxy][params][heartbeat][timeout]:=3.0\\\ - \n site_config[status_connection][proxy][params][channel_timeout]:=3.5\\\ - \n site_config[status_connection][proxy][params][query_timeout]:=120.2\\\ - \n site_config[status_connection][proxy][params][connect_retry]:=4.6\\\ - \n site_config[status_connection][proxy][params][cache]:=true\\\n \ - \ site_config[status_connection][proxy][tcp][port]:=6560\\\n site_config[status_connection][proxy][tcp][only_from]:='[\"\ - 192.168.1.1\"]'\\\n site_config[status_connection][proxy][tcp][tls]:=false\\\ - \n site_config[status_connection][connect_timeout]:=2\\\n site_config[status_connection][persistent_connection]:=false\\\ - \n site_config[status_connection][url_prefix]='/heute_remote_1/'\\\n\ - \ site_config[status_connection][status_host][status_host_set]='disabled'\\\ - \n site_config[status_connection][disable_in_status_gui]:=false\\\n \ - \ site_config[configuration_connection][enable_replication]:=true\\\n\ - \ site_config[configuration_connection][url_of_remote_site]='http://localhost/heute_remote_site_id_1/check_mk/'\\\ - \n site_config[configuration_connection][disable_remote_configuration]:=true\\\ - \n site_config[configuration_connection][ignore_tls_errors]:=false\\\n\ - \ site_config[configuration_connection][direct_login_to_web_gui_allowed]:=true\\\ - \n site_config[configuration_connection][user_sync][sync_with_ldap_connections]='all'\\\ - \n site_config[configuration_connection][replicate_event_console]:=true\\\ - \n site_config[configuration_connection][replicate_extensions]:=true" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"site_config\": {\n \"basic_settings\"\ - : {\n \"alias\": \"Die remote site 1\",\n \"site_id\"\ - : \"site_id_1\"\n },\n \"configuration_connection\"\ - : {\n \"direct_login_to_web_gui_allowed\": true,\n \ - \ \"disable_remote_configuration\": true,\n \"enable_replication\"\ - : true,\n \"ignore_tls_errors\": false,\n \"replicate_event_console\"\ - : true,\n \"replicate_extensions\": true,\n \"\ - url_of_remote_site\": \"http://localhost/heute_remote_site_id_1/check_mk/\"\ - ,\n \"user_sync\": {\n \"sync_with_ldap_connections\"\ - : \"all\"\n }\n },\n \"status_connection\"\ - : {\n \"connect_timeout\": 2,\n \"connection\"\ - : {\n \"encrypted\": true,\n \"host\": \"\ - 123.124.1.3\",\n \"port\": 1253,\n \"socket_type\"\ - : \"tcp\",\n \"verify\": false\n },\n \ - \ \"disable_in_status_gui\": false,\n \"persistent_connection\"\ - : false,\n \"proxy\": {\n \"global_settings\"\ - : false,\n \"params\": {\n \"cache\": true,\n\ - \ \"channel_timeout\": 3.5,\n \"channels\"\ - : 15,\n \"connect_retry\": 4.6,\n \"heartbeat\"\ - : {\n \"interval\": 12,\n \"timeout\"\ - : 3.0\n },\n \"query_timeout\": 120.2\n\ - \ },\n \"tcp\": {\n \"only_from\"\ - : [\n \"192.168.1.1\"\n ],\n \ - \ \"port\": 6560,\n \"tls\": false\n \ - \ },\n \"use_livestatus_daemon\": \"with_proxy\"\n\ - \ },\n \"status_host\": {\n \"\ - status_host_set\": \"disabled\"\n },\n \"url_prefix\"\ - : \"/heute_remote_1/\"\n }\n }\n }' \\\n \"\ - $API_URL/domain-types/site_connection/collections/all\")\n\nresp=$( echo\ - \ \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" |\ - \ awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Create a site connection - get: - tags: - - Site Management - description: "\n\nThis endpoint requires the following permissions: \n * `wato.sites`:\ - \ Access to the module for managing connections to remote monitoring sites.\n" - operationId: cmk.gui.plugins.openapi.endpoints.site_management.show_sites - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/SiteConnectionResponseCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/site_connection/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/site_connection/collections/all\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/site_connection/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/site_connection/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all site connections - /objects/site_connection/{site_id}: - put: - tags: - - Site Management - description: "\n\nThis endpoint requires the following permissions: \n * `wato.sites`:\ - \ Access to the module for managing connections to remote monitoring sites.\n" - operationId: cmk.gui.plugins.openapi.endpoints.site_management.put_site - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: site_id - required: true - description: A site ID that exists. - schema: - type: string - example: prod - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/SiteConnectionResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SiteConnectionRequestUpdate' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/site_connection/prod\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"site_config\": {\n \"basic_settings\"\ - : {\n \"alias\": \"Die remote site 1\",\n \ - \ \"site_id\": \"site_id_1\",\n },\n \"status_connection\"\ - : {\n \"connection\": {\n \"socket_type\"\ - : \"tcp\",\n \"host\": \"123.124.1.3\",\n \ - \ \"port\": 1253,\n \"encrypted\": True,\n \ - \ \"verify\": False,\n },\n \ - \ \"proxy\": {\n \"use_livestatus_daemon\": \"with_proxy\"\ - ,\n \"global_settings\": False,\n \ - \ \"params\": {\n \"channels\": 15,\n \ - \ \"heartbeat\": {\n \"interval\"\ - : 12,\n \"timeout\": 3.0,\n \ - \ },\n \"channel_timeout\": 3.5,\n \ - \ \"query_timeout\": 120.2,\n \"connect_retry\"\ - : 4.6,\n \"cache\": True,\n },\n\ - \ \"tcp\": {\n \"port\": 6560,\n\ - \ \"only_from\": [\"192.168.1.1\"],\n \ - \ \"tls\": False,\n },\n },\n\ - \ \"connect_timeout\": 2,\n \"persistent_connection\"\ - : False,\n \"url_prefix\": \"/heute_remote_1/\",\n \ - \ \"status_host\": {\n \"status_host_set\":\ - \ \"disabled\"\n },\n \"disable_in_status_gui\"\ - : False,\n },\n \"configuration_connection\": {\n\ - \ \"enable_replication\": True,\n \"url_of_remote_site\"\ - : \"http://localhost/heute_remote_site_id_1/check_mk/\",\n \ - \ \"disable_remote_configuration\": True,\n \"ignore_tls_errors\"\ - : False,\n \"direct_login_to_web_gui_allowed\": True,\n \ - \ \"user_sync\": {\n \"sync_with_ldap_connections\"\ - : \"all\"\n },\n \"replicate_event_console\"\ - : True,\n \"replicate_extensions\": True,\n },\n\ - \ }\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/site_connection/prod\",\n method=\"PUT\",\n\ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"Content-Type\":\ - \ 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"site_config\": {\n \"basic_settings\": {\n \ - \ \"alias\": \"Die remote site 1\",\n \"site_id\": \"\ - site_id_1\",\n },\n \"status_connection\": {\n \ - \ \"connection\": {\n \"socket_type\": \"\ - tcp\",\n \"host\": \"123.124.1.3\",\n \ - \ \"port\": 1253,\n \"encrypted\": True,\n \ - \ \"verify\": False,\n },\n \"\ - proxy\": {\n \"use_livestatus_daemon\": \"with_proxy\"\ - ,\n \"global_settings\": False,\n \ - \ \"params\": {\n \"channels\": 15,\n \ - \ \"heartbeat\": {\n \"interval\"\ - : 12,\n \"timeout\": 3.0,\n \ - \ },\n \"channel_timeout\": 3.5,\n \ - \ \"query_timeout\": 120.2,\n \"connect_retry\"\ - : 4.6,\n \"cache\": True,\n },\n\ - \ \"tcp\": {\n \"port\": 6560,\n\ - \ \"only_from\": [\"192.168.1.1\"],\n \ - \ \"tls\": False,\n },\n },\n\ - \ \"connect_timeout\": 2,\n \"persistent_connection\"\ - : False,\n \"url_prefix\": \"/heute_remote_1/\",\n \ - \ \"status_host\": {\n \"status_host_set\":\ - \ \"disabled\"\n },\n \"disable_in_status_gui\"\ - : False,\n },\n \"configuration_connection\": {\n\ - \ \"enable_replication\": True,\n \"url_of_remote_site\"\ - : \"http://localhost/heute_remote_site_id_1/check_mk/\",\n \ - \ \"disable_remote_configuration\": True,\n \"ignore_tls_errors\"\ - : False,\n \"direct_login_to_web_gui_allowed\": True,\n \ - \ \"user_sync\": {\n \"sync_with_ldap_connections\"\ - : \"all\"\n },\n \"replicate_event_console\"\ - : True,\n \"replicate_extensions\": True,\n },\n\ - \ }\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/site_connection/prod\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ - \ \\\n site_config[basic_settings][alias]='Die remote site 1'\\\n \ - \ site_config[basic_settings][site_id]='site_id_1'\\\n site_config[status_connection][connection][socket_type]='tcp'\\\ - \n site_config[status_connection][connection][host]='123.124.1.3'\\\n\ - \ site_config[status_connection][connection][port]:=1253\\\n site_config[status_connection][connection][encrypted]:=true\\\ - \n site_config[status_connection][connection][verify]:=false\\\n site_config[status_connection][proxy][use_livestatus_daemon]='with_proxy'\\\ - \n site_config[status_connection][proxy][global_settings]:=false\\\n\ - \ site_config[status_connection][proxy][params][channels]:=15\\\n \ - \ site_config[status_connection][proxy][params][heartbeat][interval]:=12\\\ - \n site_config[status_connection][proxy][params][heartbeat][timeout]:=3.0\\\ - \n site_config[status_connection][proxy][params][channel_timeout]:=3.5\\\ - \n site_config[status_connection][proxy][params][query_timeout]:=120.2\\\ - \n site_config[status_connection][proxy][params][connect_retry]:=4.6\\\ - \n site_config[status_connection][proxy][params][cache]:=true\\\n \ - \ site_config[status_connection][proxy][tcp][port]:=6560\\\n site_config[status_connection][proxy][tcp][only_from]:='[\"\ - 192.168.1.1\"]'\\\n site_config[status_connection][proxy][tcp][tls]:=false\\\ - \n site_config[status_connection][connect_timeout]:=2\\\n site_config[status_connection][persistent_connection]:=false\\\ - \n site_config[status_connection][url_prefix]='/heute_remote_1/'\\\n\ - \ site_config[status_connection][status_host][status_host_set]='disabled'\\\ - \n site_config[status_connection][disable_in_status_gui]:=false\\\n \ - \ site_config[configuration_connection][enable_replication]:=true\\\n\ - \ site_config[configuration_connection][url_of_remote_site]='http://localhost/heute_remote_site_id_1/check_mk/'\\\ - \n site_config[configuration_connection][disable_remote_configuration]:=true\\\ - \n site_config[configuration_connection][ignore_tls_errors]:=false\\\n\ - \ site_config[configuration_connection][direct_login_to_web_gui_allowed]:=true\\\ - \n site_config[configuration_connection][user_sync][sync_with_ldap_connections]='all'\\\ - \n site_config[configuration_connection][replicate_event_console]:=true\\\ - \n site_config[configuration_connection][replicate_extensions]:=true" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"site_config\": {\n \"basic_settings\"\ - : {\n \"alias\": \"Die remote site 1\",\n \"site_id\"\ - : \"site_id_1\"\n },\n \"configuration_connection\"\ - : {\n \"direct_login_to_web_gui_allowed\": true,\n \ - \ \"disable_remote_configuration\": true,\n \"enable_replication\"\ - : true,\n \"ignore_tls_errors\": false,\n \"replicate_event_console\"\ - : true,\n \"replicate_extensions\": true,\n \"\ - url_of_remote_site\": \"http://localhost/heute_remote_site_id_1/check_mk/\"\ - ,\n \"user_sync\": {\n \"sync_with_ldap_connections\"\ - : \"all\"\n }\n },\n \"status_connection\"\ - : {\n \"connect_timeout\": 2,\n \"connection\"\ - : {\n \"encrypted\": true,\n \"host\": \"\ - 123.124.1.3\",\n \"port\": 1253,\n \"socket_type\"\ - : \"tcp\",\n \"verify\": false\n },\n \ - \ \"disable_in_status_gui\": false,\n \"persistent_connection\"\ - : false,\n \"proxy\": {\n \"global_settings\"\ - : false,\n \"params\": {\n \"cache\": true,\n\ - \ \"channel_timeout\": 3.5,\n \"channels\"\ - : 15,\n \"connect_retry\": 4.6,\n \"heartbeat\"\ - : {\n \"interval\": 12,\n \"timeout\"\ - : 3.0\n },\n \"query_timeout\": 120.2\n\ - \ },\n \"tcp\": {\n \"only_from\"\ - : [\n \"192.168.1.1\"\n ],\n \ - \ \"port\": 6560,\n \"tls\": false\n \ - \ },\n \"use_livestatus_daemon\": \"with_proxy\"\n\ - \ },\n \"status_host\": {\n \"\ - status_host_set\": \"disabled\"\n },\n \"url_prefix\"\ - : \"/heute_remote_1/\"\n }\n }\n }' \\\n \"\ - $API_URL/objects/site_connection/prod\")\n\nresp=$( echo \"${out}\" | grep\ - \ -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk -F\"=\" '/^xxx-status_code/\ - \ {print $2}')\n\n# For indentation, please install 'jq' (JSON query tool)\n\ - echo \"$resp\" | jq\n# echo \"$resp\"\n\nif [[ $code -lt 400 ]]; then\n\ - \ echo \"OK\"\n exit 0\nelse\n echo \"Request error\"\n exit\ - \ 1\nfi" - summary: Update a site connection - get: - tags: - - Site Management - description: "\n\nThis endpoint requires the following permissions: \n * `wato.sites`:\ - \ Access to the module for managing connections to remote monitoring sites.\n" - operationId: cmk.gui.plugins.openapi.endpoints.site_management.show_site - parameters: - - in: path - name: site_id - required: true - description: A site ID that exists. - schema: - type: string - example: prod - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/SiteConnectionResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/site_connection/prod\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/site_connection/prod\",\n method=\"GET\",\n\ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/site_connection/prod\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/site_connection/prod\")\n\ - \nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a site connection - /objects/site_connection/{site_id}/actions/login/invoke: - post: - tags: - - Site Management - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.users`: This permission is needed for the modules Users,\ - \ Roles and Contact Groups\n * `wato.sites`: Access to the\ - \ module for managing connections to remote monitoring sites.\n" - operationId: cmk.gui.plugins.openapi.endpoints.site_management.site_login - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: site_id - required: true - description: A site ID that exists. - schema: - type: string - example: prod - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '401': - description: 'Unauthorized: The user is not authorized to do this request.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SiteLoginRequest' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/site_connection/prod/actions/login/invoke\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\"username\": \"cmkadmin\", \"password\": \"password\"\ - },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/site_connection/prod/actions/login/invoke\",\n\ - \ method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ \"Content-Type\": 'application/json', # (required) A header specifying\ - \ which type of content is in the request/response body.\n },\n data=json.dumps({\"\ - username\": \"cmkadmin\", \"password\": \"password\"}).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/site_connection/prod/actions/login/invoke\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\\n 'Content-Type:application/json' \\\n username='cmkadmin'\\\n\ - \ password='password'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"password\": \"password\",\n \"\ - username\": \"cmkadmin\"\n }' \\\n \"$API_URL/objects/site_connection/prod/actions/login/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Login to a remote site - /objects/site_connection/{site_id}/actions/logout/invoke: - post: - tags: - - Site Management - description: "\n\nThis endpoint requires the following permissions: \n * `wato.sites`:\ - \ Access to the module for managing connections to remote monitoring sites.\n" - operationId: cmk.gui.plugins.openapi.endpoints.site_management.site_logout - parameters: - - in: path - name: site_id - required: true - description: A site ID that exists. - schema: - type: string - example: prod - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/site_connection/prod/actions/logout/invoke\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/site_connection/prod/actions/logout/invoke\",\n\ - \ method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ - \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ - \ },\n)\nresponse = urllib.request.urlopen(request)\nif resp.status_code\ - \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/objects/site_connection/prod/actions/logout/invoke\" \\\n \"\ - Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ - \ \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/site_connection/prod/actions/logout/invoke\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Logout from a remote site - /domain-types/time_period/collections/all: - post: - tags: - - Time periods - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.timeperiods`: Access to the module Time periods\n" - operationId: cmk.gui.plugins.openapi.endpoints.time_periods.create_timeperiod - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/TimePeriodResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateTimePeriod' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/time_period/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"name\": \"first\",\n \"alias\": \"\ - alias\",\n \"active_time_ranges\": [\n {\n \ - \ \"day\": \"monday\",\n \"time_ranges\": [\n \ - \ {\n \"start\": \"12:00:00\",\n \ - \ \"end\": \"14:00:00\",\n }\n \ - \ ],\n }\n ],\n \"exceptions\": [\n\ - \ {\n \"date\": \"2020-01-01\",\n \ - \ \"time_ranges\": [\n {\n \ - \ \"start\": \"14:00:00\",\n \"end\": \"18:00:00\"\ - ,\n }\n ],\n }\n ],\n\ - \ \"exclude\": [\"name\"],\n },\n)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/time_period/collections/all\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"name\": \"first\",\n \"alias\": \"alias\",\n \"active_time_ranges\"\ - : [\n {\n \"day\": \"monday\",\n \ - \ \"time_ranges\": [\n {\n \"\ - start\": \"12:00:00\",\n \"end\": \"14:00:00\",\n\ - \ }\n ],\n }\n ],\n\ - \ \"exceptions\": [\n {\n \"date\": \"\ - 2020-01-01\",\n \"time_ranges\": [\n {\n\ - \ \"start\": \"14:00:00\",\n \ - \ \"end\": \"18:00:00\",\n }\n ],\n\ - \ }\n ],\n \"exclude\": [\"name\"],\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/time_period/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n name='first'\\\n alias='alias'\\\ - \n active_time_ranges:='[{\"day\": \"monday\", \"time_ranges\": [{\"\ - start\": \"12:00:00\", \"end\": \"14:00:00\"}]}]'\\\n exceptions:='[{\"\ - date\": \"2020-01-01\", \"time_ranges\": [{\"start\": \"14:00:00\", \"end\"\ - : \"18:00:00\"}]}]'\\\n exclude:='[\"name\"]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"active_time_ranges\": [\n {\n\ - \ \"day\": \"monday\",\n \"time_ranges\": [\n\ - \ {\n \"end\": \"14:00:00\",\n \ - \ \"start\": \"12:00:00\"\n }\n ]\n\ - \ }\n ],\n \"alias\": \"alias\",\n \ - \ \"exceptions\": [\n {\n \"date\": \"2020-01-01\"\ - ,\n \"time_ranges\": [\n {\n \ - \ \"end\": \"18:00:00\",\n \"start\": \"14:00:00\"\n\ - \ }\n ]\n }\n ],\n \ - \ \"exclude\": [\n \"name\"\n ],\n \"name\"\ - : \"first\"\n }' \\\n \"$API_URL/domain-types/time_period/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a time period - get: - tags: - - Time periods - description: "\n\nThis endpoint requires the following permissions: \n * `wato.timeperiods`:\ - \ Access to the module Time periods\n" - operationId: cmk.gui.plugins.openapi.endpoints.time_periods.list_time_periods - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/TimePeriodResponseCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/time_period/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/time_period/collections/all\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/time_period/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/time_period/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all time periods - /objects/time_period/{name}: - delete: - tags: - - Time periods - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.timeperiods`: Access to the module Time periods\n" - operationId: cmk.gui.plugins.openapi.endpoints.time_periods.delete - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: path - name: name - required: true - description: A name used as an identifier. Can be of arbitrary (sensible) - length. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '405': - description: 'Method Not Allowed: Method not allowed: This request is only - allowed with other HTTP methods' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '409': - description: 'Conflict: The request is in conflict with the stored resource.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/time_period/pathname\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n },\n)\nif\ - \ resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/time_period/pathname\",\n method=\"DELETE\"\ - ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ - a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ - \ ETag header.\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/time_period/pathname\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'If-Match:\"\ - a20ceacf346041dc\"' \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n \"$API_URL/objects/time_period/pathname\")\n\nresp=$( echo \"\ - ${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk\ - \ -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Delete a time period - get: - tags: - - Time periods - description: "\n\nThis endpoint requires the following permissions: \n * `wato.timeperiods`:\ - \ Access to the module Time periods\n" - operationId: cmk.gui.plugins.openapi.endpoints.time_periods.show_time_period - parameters: - - in: path - name: name - required: true - description: A name used as an identifier. Can be of arbitrary (sensible) - length. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/TimePeriodResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/time_period/pathname\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/time_period/pathname\",\n method=\"GET\",\n\ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/time_period/pathname\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/time_period/pathname\")\n\ - \nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a time period - put: - tags: - - Time periods - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.timeperiods`: Access to the module Time periods\n" - operationId: cmk.gui.plugins.openapi.endpoints.time_periods.update_timeperiod - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: name - required: true - description: A name used as an identifier. Can be of arbitrary (sensible) - length. - schema: - type: string - example: pathname - pattern: ^[-a-z0-9A-Z_]+\Z - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '405': - description: 'Method Not Allowed: Method not allowed: This request is only - allowed with other HTTP methods' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/TimePeriodResponse' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateTimePeriod' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/time_period/pathname\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\n \"alias\"\ - : \"new_alias\",\n \"active_time_ranges\": [\n {\n \ - \ \"day\": \"monday\",\n \"time_ranges\": [\n\ - \ {\n \"start\": \"12:00:00\"\ - ,\n \"end\": \"14:00:00\",\n }\n\ - \ ],\n }\n ],\n \"exceptions\":\ - \ [\n {\n \"date\": \"2020-01-01\",\n \ - \ \"time_ranges\": [\n {\n \ - \ \"start\": \"14:00:00\",\n \"end\": \"18:00:00\"\ - ,\n }\n ],\n }\n ],\n\ - \ \"exclude\": [\"time_name\"],\n },\n)\nif resp.status_code ==\ - \ 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ - \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/time_period/pathname\",\n method=\"PUT\",\n\ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ - a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ - \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n data=json.dumps({\n \"alias\": \"new_alias\",\n \ - \ \"active_time_ranges\": [\n {\n \"day\":\ - \ \"monday\",\n \"time_ranges\": [\n {\n\ - \ \"start\": \"12:00:00\",\n \ - \ \"end\": \"14:00:00\",\n }\n ],\n\ - \ }\n ],\n \"exceptions\": [\n {\n \ - \ \"date\": \"2020-01-01\",\n \"time_ranges\"\ - : [\n {\n \"start\": \"14:00:00\"\ - ,\n \"end\": \"18:00:00\",\n }\n\ - \ ],\n }\n ],\n \"exclude\": [\"\ - time_name\"],\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/time_period/pathname\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'If-Match:\"\ - a20ceacf346041dc\"' \\\n 'Content-Type:application/json' \\\n alias='new_alias'\\\ - \n active_time_ranges:='[{\"day\": \"monday\", \"time_ranges\": [{\"\ - start\": \"12:00:00\", \"end\": \"14:00:00\"}]}]'\\\n exceptions:='[{\"\ - date\": \"2020-01-01\", \"time_ranges\": [{\"start\": \"14:00:00\", \"end\"\ - : \"18:00:00\"}]}]'\\\n exclude:='[\"time_name\"]'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"active_time_ranges\": [\n {\n \"day\"\ - : \"monday\",\n \"time_ranges\": [\n {\n \ - \ \"end\": \"14:00:00\",\n \"start\": \"\ - 12:00:00\"\n }\n ]\n }\n \ - \ ],\n \"alias\": \"new_alias\",\n \"exceptions\": [\n\ - \ {\n \"date\": \"2020-01-01\",\n \"\ - time_ranges\": [\n {\n \"end\": \"18:00:00\"\ - ,\n \"start\": \"14:00:00\"\n }\n \ - \ ]\n }\n ],\n \"exclude\": [\n \ - \ \"time_name\"\n ]\n }' \\\n \"$API_URL/objects/time_period/pathname\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Update a time period - /domain-types/user_config/collections/all: - post: - tags: - - Users - description: "You can pass custom attributes you defined directly in the top\ - \ level JSON object of the request.This endpoint requires the following permissions:\ - \ \n * All of:\n * `wato.edit`: This permission is needed in order to make\ - \ any changes or perform any actions at all. Without this permission, the\ - \ user is only able to view data, and that only in modules he has explicit\ - \ permissions for.\n * `wato.users`: This permission is needed for the modules\ - \ Users, Roles and Contact Groups\n * Optionally:\n\ - \ * `wato.groups`: Access to the modules for managing host and service\ - \ groups.\n" - operationId: cmk.gui.plugins.openapi.endpoints.user_config.create_user - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/UserObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateUser' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/user_config/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"username\": \"cmkuser\",\n \"fullname\"\ - : \"Mathias Kettner\",\n \"auth_option\": {\n \"auth_type\"\ - : \"password\",\n \"password\": \"password\",\n },\n \ - \ \"disable_login\": False,\n \"contact_options\": {\n \ - \ \"email\": \"user@example.com\"\n },\n \"pager_address\"\ - : \"\",\n \"idle_timeout\": {\"option\": \"global\"},\n \"\ - roles\": [\"user\"],\n \"authorized_sites\": [\"heute\"],\n \ - \ \"contactgroups\": [\"all\"],\n \"disable_notifications\": {\"\ - disable\": False},\n \"language\": \"en\",\n \"temperature_unit\"\ - : \"celsius\",\n \"interface_options\": {\n \"interface_theme\"\ - : \"dark\"\n },\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/user_config/collections/all\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"username\": \"cmkuser\",\n \"fullname\": \"Mathias Kettner\"\ - ,\n \"auth_option\": {\n \"auth_type\": \"password\",\n\ - \ \"password\": \"password\",\n },\n \"disable_login\"\ - : False,\n \"contact_options\": {\n \"email\": \"user@example.com\"\ - \n },\n \"pager_address\": \"\",\n \"idle_timeout\"\ - : {\"option\": \"global\"},\n \"roles\": [\"user\"],\n \"\ - authorized_sites\": [\"heute\"],\n \"contactgroups\": [\"all\"],\n\ - \ \"disable_notifications\": {\"disable\": False},\n \"language\"\ - : \"en\",\n \"temperature_unit\": \"celsius\",\n \"interface_options\"\ - : {\n \"interface_theme\": \"dark\"\n },\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/user_config/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n username='cmkuser'\\\n fullname='Mathias\ - \ Kettner'\\\n auth_option[auth_type]='password'\\\n auth_option[password]='password'\\\ - \n disable_login:=false\\\n contact_options[email]='user@example.com'\\\ - \n pager_address=''\\\n idle_timeout[option]='global'\\\n roles:='[\"\ - user\"]'\\\n authorized_sites:='[\"heute\"]'\\\n contactgroups:='[\"\ - all\"]'\\\n disable_notifications[disable]:=false\\\n language='en'\\\ - \n temperature_unit='celsius'\\\n interface_options[interface_theme]='dark'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"auth_option\": {\n \"auth_type\"\ - : \"password\",\n \"password\": \"password\"\n },\n\ - \ \"authorized_sites\": [\n \"heute\"\n ],\n\ - \ \"contact_options\": {\n \"email\": \"user@example.com\"\ - \n },\n \"contactgroups\": [\n \"all\"\n \ - \ ],\n \"disable_login\": false,\n \"disable_notifications\"\ - : {\n \"disable\": false\n },\n \"fullname\"\ - : \"Mathias Kettner\",\n \"idle_timeout\": {\n \"option\"\ - : \"global\"\n },\n \"interface_options\": {\n \ - \ \"interface_theme\": \"dark\"\n },\n \"language\"\ - : \"en\",\n \"pager_address\": \"\",\n \"roles\": [\n\ - \ \"user\"\n ],\n \"temperature_unit\": \"\ - celsius\",\n \"username\": \"cmkuser\"\n }' \\\n \"$API_URL/domain-types/user_config/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create a user - get: - tags: - - Users - description: "\n\nThis endpoint requires the following permissions: \n * `wato.users`:\ - \ This permission is needed for the modules Users, Roles and\ - \ Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.user_config.list_users - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/UserCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/user_config/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/user_config/collections/all\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/user_config/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/user_config/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all users - /objects/user_config/{username}: - delete: - tags: - - Users - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.users`: This permission is needed for the modules Users,\ - \ Roles and Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.user_config.delete_user - parameters: - - in: path - name: username - required: true - description: An unique username for the user - schema: - type: string - example: cmkuser - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/user_config/cmkuser\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/user_config/cmkuser\",\n method=\"DELETE\"\ - ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/user_config/cmkuser\" \\\n \"Authorization: Bearer\ - \ $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/user_config/cmkuser\")\n\ - \nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Delete a user - put: - tags: - - Users - description: "You can pass custom attributes you defined directly in the top\ - \ level JSON object of the request.This endpoint requires the following permissions:\ - \ \n * All of:\n * `wato.edit`: This permission is needed in order to make\ - \ any changes or perform any actions at all. Without this permission, the\ - \ user is only able to view data, and that only in modules he has explicit\ - \ permissions for.\n * `wato.users`: This permission is needed for the modules\ - \ Users, Roles and Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.user_config.edit_user - parameters: - - in: header - name: If-Match - required: true - description: The value of the, to be modified, object's ETag header. You can - get this value by displaying the object it individually. To update this - object the currently stored ETag needs to be the same as the one sent. The - content of the ETag can potentially be anything and should be treated as - semantically opaque. - schema: - type: string - example: '"a20ceacf346041dc"' - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: username - required: true - description: An unique username for the user - schema: - type: string - example: cmkuser - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/UserObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - '412': - description: 'Precondition Failed: The value of the If-Match header doesn''t - match the object''s ETag.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '428': - description: 'Precondition Required: The required If-Match header is missing.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUser' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/user_config/cmkuser\"\ - ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ - \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n json={\n \"fullname\"\ - : \"Mathias Kettner\",\n \"auth_option\": {\n \"auth_type\"\ - : \"password\",\n \"password\": \"password\",\n },\n \ - \ \"disable_login\": False,\n \"contact_options\": {\n \ - \ \"email\": \"user@example.com\"\n },\n \"pager_address\"\ - : \"\",\n \"idle_timeout\": {},\n \"roles\": [\"user\"],\n\ - \ \"authorized_sites\": [\"heute\"],\n \"contactgroups\":\ - \ [\"all\"],\n \"disable_notifications\": {\"disabled\": False},\n\ - \ \"language\": \"en\",\n \"temperature_unit\": \"celsius\"\ - ,\n \"interface_options\": {\n \"interface_theme\": \"\ - dark\"\n },\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/user_config/cmkuser\",\n method=\"PUT\",\n\ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ - a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ - \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n data=json.dumps({\n \"fullname\": \"Mathias Kettner\"\ - ,\n \"auth_option\": {\n \"auth_type\": \"password\",\n\ - \ \"password\": \"password\",\n },\n \"disable_login\"\ - : False,\n \"contact_options\": {\n \"email\": \"user@example.com\"\ - \n },\n \"pager_address\": \"\",\n \"idle_timeout\"\ - : {},\n \"roles\": [\"user\"],\n \"authorized_sites\": [\"\ - heute\"],\n \"contactgroups\": [\"all\"],\n \"disable_notifications\"\ - : {\"disabled\": False},\n \"language\": \"en\",\n \"temperature_unit\"\ - : \"celsius\",\n \"interface_options\": {\n \"interface_theme\"\ - : \"dark\"\n },\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/user_config/cmkuser\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'If-Match:\"\ - a20ceacf346041dc\"' \\\n 'Content-Type:application/json' \\\n fullname='Mathias\ - \ Kettner'\\\n auth_option[auth_type]='password'\\\n auth_option[password]='password'\\\ - \n disable_login:=false\\\n contact_options[email]='user@example.com'\\\ - \n pager_address=''\\\n roles:='[\"user\"]'\\\n authorized_sites:='[\"\ - heute\"]'\\\n contactgroups:='[\"all\"]'\\\n disable_notifications[disabled]:=false\\\ - \n language='en'\\\n temperature_unit='celsius'\\\n interface_options[interface_theme]='dark'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ - \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ - \ \"auth_option\": {\n \"auth_type\": \"password\",\n\ - \ \"password\": \"password\"\n },\n \"authorized_sites\"\ - : [\n \"heute\"\n ],\n \"contact_options\"\ - : {\n \"email\": \"user@example.com\"\n },\n \ - \ \"contactgroups\": [\n \"all\"\n ],\n \"\ - disable_login\": false,\n \"disable_notifications\": {\n \ - \ \"disabled\": false\n },\n \"fullname\": \"Mathias\ - \ Kettner\",\n \"idle_timeout\": {},\n \"interface_options\"\ - : {\n \"interface_theme\": \"dark\"\n },\n \ - \ \"language\": \"en\",\n \"pager_address\": \"\",\n \"\ - roles\": [\n \"user\"\n ],\n \"temperature_unit\"\ - : \"celsius\"\n }' \\\n \"$API_URL/objects/user_config/cmkuser\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Edit a user - get: - tags: - - Users - description: "\n\nThis endpoint requires the following permissions: \n * `wato.users`:\ - \ This permission is needed for the modules Users, Roles and\ - \ Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.user_config.show_user - parameters: - - in: path - name: username - required: true - description: An unique username for the user - schema: - type: string - example: cmkuser - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/UserObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - ETag: - required: false - description: The HTTP ETag header for this resource. It identifies the - current state of the object and needs to be sent along in the "If-Match" - request-header for subsequent modifications. Please note that the - actual ETag returned by some endpoints may look different than the - one shown in this example. - allowEmptyValue: false - example: '"a20ceacf346041dc"' - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/user_config/cmkuser\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/user_config/cmkuser\",\n method=\"GET\",\n\ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/user_config/cmkuser\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/user_config/cmkuser\")\n\ - \nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show a user - /domain-types/user_role/collections/all: - post: - tags: - - User Roles - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.users`: This permission is needed for the modules Users,\ - \ Roles and Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.user_role.create_userrole - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/UserRoleObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateUserRole' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/user_role/collections/all\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"role_id\": \"admin\",\n \"new_role_id\"\ - : \"limited_permissions_user\",\n \"new_alias\": \"user_a\",\n \ - \ },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/user_role/collections/all\",\n method=\"\ - POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ - \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ - : 'application/json', # (required) A header specifying which type of content\ - \ is in the request/response body.\n },\n data=json.dumps({\n \ - \ \"role_id\": \"admin\",\n \"new_role_id\": \"limited_permissions_user\"\ - ,\n \"new_alias\": \"user_a\",\n }).encode('utf-8'),\n)\nresponse\ - \ = urllib.request.urlopen(request)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ - elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp POST \"\ - $API_URL/domain-types/user_role/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ - \ 'Content-Type:application/json' \\\n role_id='admin'\\\n new_role_id='limited_permissions_user'\\\ - \n new_alias='user_a'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"new_alias\": \"user_a\",\n \"\ - new_role_id\": \"limited_permissions_user\",\n \"role_id\": \"\ - admin\"\n }' \\\n \"$API_URL/domain-types/user_role/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Create/clone a user role - get: - tags: - - User Roles - description: "\n\nThis endpoint requires the following permissions: \n * `wato.users`:\ - \ This permission is needed for the modules Users, Roles and\ - \ Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.user_role.list_user_roles - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/UserRoleCollection' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/user_role/collections/all\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/domain-types/user_role/collections/all\",\n method=\"\ - GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/domain-types/user_role/collections/all\" \\\n \"Authorization:\ - \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/domain-types/user_role/collections/all\"\ - )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ - \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ - \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ - $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ - \ echo \"Request error\"\n exit 1\nfi" - summary: Show all user roles - /objects/user_role/{role_id}: - delete: - tags: - - User Roles - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.users`: This permission is needed for the modules Users,\ - \ Roles and Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.user_role.delete_userrole - parameters: - - in: path - name: role_id - required: true - description: An existing custom user role that you want to delete. - schema: - type: string - example: userx - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '204': - description: 'No Content: Operation done successfully. No further output.' - content: {} - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/user_role/userx\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/user_role/userx\",\n method=\"DELETE\",\n \ - \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ - ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp DELETE\ - \ \"$API_URL/objects/user_role/userx\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/user_role/userx\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Delete a user role - put: - tags: - - User Roles - description: "\n\nThis endpoint requires the following permissions: \n * All\ - \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ - \ or perform any actions at all. Without this permission, the user is only\ - \ able to view data, and that only in modules he has explicit permissions\ - \ for.\n * `wato.users`: This permission is needed for the modules Users,\ - \ Roles and Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.user_role.edit_userrole - parameters: - - in: header - name: Content-Type - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. When - the request body is empty, this header should not be sent. - schema: - type: string - example: application/json - - in: path - name: role_id - required: true - description: An existing user role. - schema: - type: string - example: userx - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '415': - description: 'Unsupported Media Type: The submitted content-type is not - supported.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '400': - description: 'Bad Request: Parameter or validation failure.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/UserRoleObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/EditUserRole' - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/user_role/userx\"\ - ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ - \ A header specifying which type of content is in the request/response body.\n\ - \ },\n json={\n \"new_role_id\": \"new_userrole_id\",\n \ - \ \"new_alias\": \"new_userrole_alias\",\n \"new_basedon\": \"\ - guest\",\n \"new_permissions\": {\n \"general.edit_profile\"\ - : \"yes\",\n \"general.message\": \"no\",\n },\n },\n\ - )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/user_role/userx\",\n method=\"PUT\",\n headers={\n\ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ - \ \"Accept\": \"application/json\",\n \"Content-Type\": 'application/json',\ - \ # (required) A header specifying which type of content is in the request/response\ - \ body.\n },\n data=json.dumps({\n \"new_role_id\": \"new_userrole_id\"\ - ,\n \"new_alias\": \"new_userrole_alias\",\n \"new_basedon\"\ - : \"guest\",\n \"new_permissions\": {\n \"general.edit_profile\"\ - : \"yes\",\n \"general.message\": \"no\",\n },\n }).encode('utf-8'),\n\ - )\nresponse = urllib.request.urlopen(request)\nif resp.status_code == 200:\n\ - \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ - Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp PUT \"\ - $API_URL/objects/user_role/userx\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ - \ \\\n new_role_id='new_userrole_id'\\\n new_alias='new_userrole_alias'\\\ - \n new_basedon='guest'\\\n new_permissions[general.edit_profile]='yes'\\\ - \n new_permissions[general.message]='no'" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n --header \"Content-Type: application/json\"\ - \ \\\n --data '{\n \"new_alias\": \"new_userrole_alias\",\n\ - \ \"new_basedon\": \"guest\",\n \"new_permissions\": {\n\ - \ \"general.edit_profile\": \"yes\",\n \"general.message\"\ - : \"no\"\n },\n \"new_role_id\": \"new_userrole_id\"\n\ - \ }' \\\n \"$API_URL/objects/user_role/userx\")\n\nresp=$( echo\ - \ \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" |\ - \ awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Edit a user role - get: - tags: - - User Roles - description: "\n\nThis endpoint requires the following permissions: \n * `wato.users`:\ - \ This permission is needed for the modules Users, Roles and\ - \ Contact Groups\n" - operationId: cmk.gui.plugins.openapi.endpoints.user_role.show_user_role - parameters: - - in: path - name: role_id - required: true - description: An existing user role. - schema: - type: string - example: userx - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '403': - description: 'Forbidden: Configuration via Setup is disabled.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '404': - description: 'Not Found: The requested object has not been found.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/UserRoleObject' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/user_role/userx\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/objects/user_role/userx\",\n method=\"GET\",\n headers={\n\ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ - \ \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/objects/user_role/userx\" \\\n \"Authorization: Bearer $USERNAME\ - \ $PASSWORD\" \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/objects/user_role/userx\")\n\nresp=$(\ - \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ - \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ - \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ - \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ - \ \"Request error\"\n exit 1\nfi" - summary: Show a user role - /version: - get: - tags: - - Miscellaneous - description: '' - operationId: cmk.gui.plugins.openapi.endpoints.version.search - responses: - '406': - description: 'Not Acceptable: The requests accept headers can not be satisfied.' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ApiError' - '200': - description: 'OK: The operation was done successfully.' - content: - application/json: - schema: - $ref: '#/components/schemas/InstalledVersions' - headers: - Content-Type: - required: true - description: A header specifying which type of content is in the request/response - body. This is required when sending encoded data in a POST/PUT body. - When the request body is empty, this header should not be sent. - allowEmptyValue: false - example: application/json - schema: - type: string - X-Checkmk-Edition: - required: true - description: The checkmk edition. - allowEmptyValue: false - example: cre - schema: - type: string - X-Checkmk-Version: - required: true - description: The checkmk version. - allowEmptyValue: false - example: 2.2.0p10 - schema: - type: string - x-codeSamples: - - label: requests - lang: python - source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ - \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ - session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ - \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/version\"\ - ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ - \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: urllib - lang: python - source: "#!/usr/bin/env python3\nimport json\nimport pprint\nimport urllib.request\n\ - \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ - \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ - \ f\"{API_URL}/version\",\n method=\"GET\",\n headers={\n \ - \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \"Accept\"\ - : \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ - if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ - \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" - - label: httpie - lang: bash - source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ - http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ - \nPASSWORD=\"test123\"\n\n# Requires httpie version >= 3\n\nhttp GET \"\ - $API_URL/version\" \\\n \"Authorization: Bearer $USERNAME $PASSWORD\"\ - \ \\\n \"Accept: application/json\" \\" - - label: curl - lang: bash - source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ - httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ - \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ - automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ - \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ - \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ - \ application/json\" \\\n \"$API_URL/version\")\n\nresp=$( echo \"${out}\"\ - \ | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk -F\"=\"\ - \ '/^xxx-status_code/ {print $2}')\n\n# For indentation, please install\ - \ 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\nif [[\ - \ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo \"\ - Request error\"\n exit 1\nfi" - summary: Display some version information -tags: -- name: Acknowledge problems - x-displayName: Acknowledge problems - description: 'A problem occurs if a host is not UP or a service ist not OK. - - The acknowledgement of the problem is the indication that the reported issue is - known and that - - somebody is attending to it. - - - You can find an introduction to the acknowledgement of problems in the - - [Checkmk guide](https://docs.checkmk.com/latest/en/basics_ackn.html).' -- name: Activate changes - x-displayName: Activate changes - description: 'When changes are activated, Checkmk transfers the current configuration - status to the ongoing - - monitoring. - - - Changes in the configuration - adding a new host, for example - will initially - have no effect - - on the monitoring. Changes must first be activated, which will bring all changes - that you have - - accumulated since the last activation as a "bundle" into the operational monitoring. - - - You can find an introduction to the configuration of Checkmk including activation - of changes in the - - [Checkmk guide](https://docs.checkmk.com/latest/en/wato.html).' -- name: Agents - x-displayName: Agents - description: 'An agent is a small program that is installed on a host in order for - Checkmk to be able query - - data from the host. - - - An introduction to agents can be found in the - - [Checkmk guide](https://docs.checkmk.com/latest/en/wato_monitoringagents.html). - - - You can find more about the agent bakery and automatic agent updates of checkmk - enterprise - - in [Agent Deployment](https://docs.checkmk.com/latest/en/agent_deployment.html).' -- name: Aux Tags - x-displayName: Aux Tags - description: 'Auxiliary tags solve the following problem: Imagine that you define - a host tag group Operating - - System, with the tags Linux, AIX, Windows 2016, and Windows 2019. Now you want - to define a rule - - that should apply to all Windows hosts. - - - One way to do this is to define an auxiliary tag named Windows. Assign this auxiliary - tag to - - both Windows 2016 and Windows 2019. A host that has either tag will then always - automatically - - receive the auxiliary tag Windows from Checkmk. In the rules, Windows will appear - as a separate - - tag for resolving conditions.' -- name: Business intelligence (BI) - x-displayName: Business intelligence (BI) - description: 'BI is used in Checkmk to set up a tree based on the status of hosts - and services as branches and to - - extend with higher level nodes summarizing (or aggregating) the status of the - contained objects. - - A BI pack contains the configuration data by means of BI aggregations and BI rules. - - A BI aggregation is a tree of nodes and a BI rule is used to define a node and - its status. - - - You can find an introduction to BI in the - - [Checkmk guide](https://docs.checkmk.com/latest/en/bi.html).' -- name: Certificates - x-displayName: Certificates - description: 'WARNING: Use at your own risk, not supported. - - - Checkmk uses TLS certificates to secure agent communication.' -- name: Comments - x-displayName: Comments - description: "In Checkmk you can add comments to hosts and services to store textual\ - \ information related to the object.\nThe comments can later be viewed through\ - \ the user interface or read via API. You could e.g.\nadd maintenance information\ - \ about the related host or service to help your colleagues in case problems occur.\n\ - \nThe comment endpoints allow for:\n* POST creating comments for both hosts and\ - \ services.\n* LIST for getting all host & service comments.\n* GET for getting\ - \ a comment using its ID.\n* DELETE for deleting a comment or comments.\n\nEach\ - \ host or service can have multiple comments.\n\nRelated documentation\n https://docs.checkmk.com/latest/en/commands.html#commands" -- name: Contact groups - x-displayName: Contact groups - description: "Contact groups are the link between hosts and services on one side\ - \ and users on the other.\nEvery contact group represents a responsibility for\ - \ a specific area in the IT landscape.\n\nYou can find an introduction to user\ - \ management including contact groups in the\n[Checkmk guide](https://docs.checkmk.com/latest/en/wato_user.html).\n\ - \n### Relations\n\nA contact group object can have the following relations present\ - \ in `links`:\n\n * `self` - The contact group itself.\n * `urn:org.restfulobject/rels:update`\ - \ - An endpoint to change this contact group.\n * `urn:org.restfulobject/rels:delete`\ - \ - An endpoint to delete this contact group." -- name: Downtimes - x-displayName: Downtimes - description: "A (scheduled) downtime is a planned maintenance period.\nHosts and\ - \ services are handled differently by Checkmk during a downtime, for example,\n\ - notifications are disabled.\n\n### Related documentation\n\nHow to use the query\ - \ DSL used in the `query` parameters of these endpoints, have a look at the\n\ - [Querying Status Data](#section/Querying-Status-Data) section of this documentation.\n\ - \nThese endpoints support all [Livestatus filter operators](https://docs.checkmk.com/latest/en/livestatus_references.html#heading_filter),\n\ - which you can look up in the Checkmk documentation.\n\nFor a detailed list of\ - \ columns, please take a look at the [downtimes table](https://github.com/checkmk/checkmk/blob/master/cmk/gui/plugins/openapi/livestatus_helpers/tables/downtimes.py)\n\ - definition on GitHub.\n\n### Relations\n\nDowntime object can have the following\ - \ relations:\n\n * `self` - The downtime itself.\n * `urn:com.checkmk:rels/host_config`\ - \ - The host the downtime applies to.\n * `urn:org.restfulobjects/delete` - The\ - \ endpoint to delete downtimes." -- name: Event Console - x-displayName: Event Console - description: "With the Event Console (EC for short), Checkmk provides a fully integrated\ - \ system for monitoring events\nfrom sources including syslog, SNMP traps, Windows\ - \ Event Logs, log files and own applications. Events are\nnot simply defined as\ - \ states, but they form a category of their own and are in fact displayed as separate\n\ - information by Checkmk in the sidebar\u2019s Overview.\n\nThe event console endpoints\ - \ allow for\n* Show event console event/s.\n * Query the event console table\ - \ using filters, id or live status query.\n* Update & Acknowledge event/s.\n \ - \ * Query the event console table using filters, id or live status query and\ - \ set the phase to ack or open.\n* Change State of event/s.\n * Query the event\ - \ console table using filters, id or live status query and set the state for those\ - \ events.\n* Archive event/s.\n * Query the event console table using filters,\ - \ id or live status query and archive those events." -- name: Folders - x-displayName: Folders - description: "Folders are used in Checkmk to organize the hosts in a tree structure.\n\ - The root (or main) folder is always existing, other folders can be created manually.\n\ - If you build the tree cleverly you can use it to pass on attributes in a meaningful\ - \ manner.\n\nYou can find an introduction to hosts including folders in the\n\ - [Checkmk guide](https://docs.checkmk.com/latest/en/wato_hosts.html).\n\nDue to\ - \ HTTP escaping folders are represented with the tilde character (`~`) as the\ - \ path separator.\n\n### Host and Folder attributes\n\nEvery host and folder can\ - \ have \"attributes\" set, which determine the behavior of Checkmk. Each\nhost\ - \ inherits all attributes of its folder and the folder's parent folders. So setting\ - \ an SNMP\ncommunity in a folder is equivalent to setting the same on all hosts\ - \ in said folder.\n\nSome host endpoints allow one to view the \"effective attributes\"\ - , which is an aggregation of all\nattributes up to the root.\n\n### Relations\n\ - \nA folder_config object can have the following relations present in `links`:\n\ - \n * `self` - The folder itself.\n * `urn:org.restfulobjects:rels/update` - The\ - \ endpoint to update this folder.\n * `urn:org.restfulobjects:rels/delete` - The\ - \ endpoint to delete this folder." -- name: Host status - x-displayName: Host status - description: "The host status provides the host's \"health\" information.\n\n###\ - \ Related documentation\n\nHow to use the query DSL used in the `query` parameters\ - \ of these endpoints, have a look at the\n[Querying Status Data](#section/Querying-Status-Data)\ - \ section of this documentation.\n\nThese endpoints support all [Livestatus filter\ - \ operators](https://docs.checkmk.com/latest/en/livestatus_references.html#heading_filter),\n\ - which you can look up in the Checkmk documentation.\n\nFor a detailed list of\ - \ columns, please take a look at the [hosts table](https://github.com/checkmk/checkmk/blob/master/cmk/gui/plugins/openapi/livestatus_helpers/tables/hosts.py)\n\ - definition on GitHub.\n\n### Examples\n\nThe query expression for all non-OK hosts\ - \ would be:\n\n {'op': '!=', 'left': 'state', 'right': '0'}\n\nTo search for\ - \ unreachable hosts:\n\n {'op': '=', 'left': 'state', 'right': '2'}\n\nTo search\ - \ for all hosts with their host name or alias starting with 'location1-':\n\n\ - \ {'op': '~', 'left': 'name', 'right': 'location1-.*'}\n\n {'op': '~', 'left':\ - \ 'alias', 'right': 'location1-.*'}\n\nTo search for hosts with specific tags\ - \ set on them:\n\n {'op': '~', 'left': 'tag_names', 'right': 'windows'}" -- name: Hosts - x-displayName: Hosts - description: "A host is an object that is monitored by Checkmk, for example, a server\ - \ or a network device.\nA host belongs to a certain folder, is usually connected\ - \ to a data source (agent or SNMP) and\nprovides one or more services.\n\nA cluster\ - \ host is a special host type containing the nodes the cluster consists of and\ - \ having\nthe services assigned that are provided by the cluster.\n\nYou can find\ - \ an introduction to hosts in the\n[Checkmk guide](https://docs.checkmk.com/latest/en/wato_hosts.html).\n\ - \nPlease note that every host always resides in a folder. The folder is included\ - \ twice\nin the host's links: Once based upon the canonical path and once based\ - \ upon the folder's\nunique id. You can never remove a host from a folder, just\ - \ move it to a different one.\n\n### Host and Folder attributes\n\nEvery host\ - \ and folder can have \"attributes\" set, which determine the behavior of Checkmk.\ - \ Each\nhost inherits all attributes of its folder and the folder's parent folders.\ - \ So setting an SNMP\ncommunity in a folder is equivalent to setting the same\ - \ on all hosts in said folder.\n\nSome host endpoints allow one to view the \"\ - effective attributes\", which is an aggregation of all\nattributes up to the root.\n\ - \n### Relations\n\nA host_config object can have the following relations present\ - \ in `links`:\n\n * `self` - The host itself.\n * `urn:com.checkmk:rels/folder_config`\ - \ - The folder object this host resides in.\n * `urn:org.restfulobjects:rels/update`\ - \ - The endpoint to update this host.\n * `urn:org.restfulobjects:rels/delete`\ - \ - The endpoint to delete this host." -- name: Host groups - x-displayName: Host groups - description: "Host groups are a way to organize hosts in Checkmk for monitoring.\n\ - By using a host group you can generate suitable views for overview and/or analysis.\n\ - \nYou can find an introduction to hosts including host groups in the\n[Checkmk\ - \ guide](https://docs.checkmk.com/latest/en/wato_hosts.html).\n\nA host group\ - \ object can have the following relations present in `links`:\n\n * `self` - The\ - \ host group itself.\n * `urn:org.restfulobject/rels:update` - An endpoint to\ - \ change this host group.\n * `urn:org.restfulobject/rels:delete` - An endpoint\ - \ to delete this host group." -- name: Hosts (internal) - x-displayName: Hosts (internal) - description: 'WARNING: Use at your own risk, not supported.' -- name: Host tag groups - x-displayName: Host tag groups - description: 'Host tag groups are, besides the static folder structure, another - more flexible way to - - organize hosts in Checkmk for configuration. - - A host tag group is a collection of different host tags, with each host receiving - exactly one - - tag from the group. - - - You can find an introduction to hosts including host tags and host tag groups - in the - - [Checkmk guide](https://docs.checkmk.com/latest/en/wato_hosts.html).' -- name: Metrics - x-displayName: Metrics - description: 'Metrics visible in the Checkmk user interface can also be retrieved - via the - - REST-API.' -- name: Notification Rules - x-displayName: Notification Rules - description: 'The notification rules endpoints give you the flexibility to create, - edit, delete and show - - all notification rules configured. - - - * POST for creating new notification rules. - - * PUT for updating current notification rules. - - * LIST for listing all current notification rules. - - * GET for getting a single notification rule. - - * DELETE for deleting a single notification rule.' -- name: Passwords - x-displayName: Passwords - description: 'Passwords intended for authentication of certain checks can be stored - in the Checkmk - - password store. You can use in a rule a password stored in the password store - without knowing or - - entering the password.' -- name: Rules - x-displayName: Rules -- name: Rulesets - x-displayName: Rulesets -- name: Service status - x-displayName: Service status - description: 'The service status provides the service''s "health" information. - - - A service (for example, a file system or a process) is a property of a certain - host that - - is monitored by Checkmk. - - - ### Related documentation - - - How to use the query DSL used in the `query` parameters of these endpoints, have - a look at the - - [Querying Status Data](#section/Querying-Status-Data) section of this documentation. - - - These endpoints support all [Livestatus filter operators](https://docs.checkmk.com/latest/en/livestatus_references.html#heading_filter), - - which you can look up in the Checkmk documentation. - - - For a detailed list of columns have a look at the [services table](https://github.com/checkmk/checkmk/blob/master/cmk/gui/plugins/openapi/livestatus_helpers/tables/services.py) - - definition on GitHub.' -- name: Service discovery - x-displayName: Service discovery - description: 'A service discovery is the automatic and reliable detection of all - services to be monitored on - - a host. - - - You can find an introduction to services including service discovery in the - - [Checkmk guide](https://docs.checkmk.com/latest/en/wato_services.html).' -- name: Service groups - x-displayName: Service groups - description: "Service groups are a way to organize services in Checkmk for monitoring.\n\ - By using a service group you can generate suitable views for overview and/or analysis,\n\ - for example, file system services of multiple hosts.\n\nYou can find an introduction\ - \ to services including service groups in the\n[Checkmk guide](https://docs.checkmk.com/latest/en/wato_services.html).\n\ - \nA service group object can have the following relations present in `links`:\n\ - \n * `self` - The service group itself.\n * `urn:org.restfulobject/rels:update`\ - \ - An endpoint to change this service group.\n * `urn:org.restfulobject/rels:delete`\ - \ - An endpoint to delete this service group." -- name: Site Management - x-displayName: Site Management - description: 'The site management endpoints give you the flexibility to configure - connections with - - distributed sites the same way you would via the web interface. - - - The site management endpoints allow for: - - - * POST for creating new site configurations. - - * PUT for updating current site configurations. - - * LIST for listing all current site configurations. - - * GET for getting a single site configuration. - - * DELETE for deleting a single site configuration via its site id. - - * LOGIN for logging into an existing site. - - * LOGOUT for logging out of an existing site.' -- name: Time periods - x-displayName: Time periods - description: 'With time periods the monitoring with Checkmk can be adapted to recurring - conditions, for - - example, to avoid senseless notifications. - - - You can find an introduction to time periods in the - - [Checkmk guide](https://docs.checkmk.com/latest/en/timeperiods.html).' -- name: Users - x-displayName: Users -- name: User Roles - x-displayName: User Roles - description: "Checkmk always assigns permissions to users via roles \u2014 never\ - \ directly. A role is nothing more than a list of permissions.\nIt is important\ - \ that you understand that roles define the level of permissions and not the reference\ - \ to any hosts or services.\nThat is what contact groups are for.\n\nAs standard\ - \ Checkmk comes with the following three predefined roles, which can never be\ - \ deleted, but can be customised at will:\n\nWhen adding a new custom role, it\ - \ will be a clone of one of the default roles, i.e it will automatically inherit\ - \ all of the\npermissions of that default role. Also, when new permissions are\ - \ added, builtin roles will automatically be permitted or not\npermitted and the\ - \ custom roles will also inherit those permission settings.\n\n* Role: admin\n\ - Permissions: All permissions - especially the right to change permissions.\n\ - Function: The Checkmk administrator who is in charge of the monitoring system\ - \ itself.\n\n* Role: user\nPermissions: May only see their own hosts and services,\ - \ may only make changes in the web interface in folders\nauthorized for them and\ - \ generally may not do anything that affects other users.\nFunction: The normal\ - \ Checkmk user who uses monitoring and responds to notifications.\n\n* Role: guest\n\ - Permissions: May see everything but not change anything.\nFunction: 'Guest' is\ - \ intended simply for 'watching', with all guests sharing a common account.\n\ - For example, useful for public status monitors hanging on a wall." -- name: Miscellaneous - x-displayName: Miscellaneous - description: This folder collects individual endpoints not fitting into the other - endpoint folders. -openapi: 3.0.2 -components: - schemas: - AcknowledgeHostProblem: - type: object - properties: - acknowledge_type: - type: string - description: The acknowledge host selection type. - enum: &id002 - - host - - hostgroup - - host_by_query - example: host - sticky: - type: boolean - default: true - description: If set, only a state-change of the host to an UP state will - discard the acknowledgement. Otherwise it will be discarded on any state-change. - Defaults to False. - example: false - persistent: - type: boolean - default: false - description: If set, the comment will persist a restart. Defaults to False. - example: false - notify: - type: boolean - default: true - description: If set, notifications will be sent out to the configured contacts. - Defaults to False. - example: false - comment: - type: string - description: If set, this comment will be stored alongside the acknowledgement. - example: This was expected. - host_name: - type: string - description: The name of the host. - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - required: - - acknowledge_type - - comment - - host_name - AcknowledgeHostGroupProblem: - type: object - properties: - acknowledge_type: - type: string - description: The acknowledge host selection type. - enum: *id002 - example: host - sticky: - type: boolean - default: true - description: If set, only a state-change of the host to an UP state will - discard the acknowledgement. Otherwise it will be discarded on any state-change. - Defaults to False. - example: false - persistent: - type: boolean - default: false - description: If set, the comment will persist a restart. Defaults to False. - example: false - notify: - type: boolean - default: true - description: If set, notifications will be sent out to the configured contacts. - Defaults to False. - example: false - comment: - type: string - description: If set, this comment will be stored alongside the acknowledgement. - example: This was expected. - hostgroup_name: - type: string - description: The name of the host group. - example: Servers - required: - - acknowledge_type - - comment - - hostgroup_name - BinaryExpr: - type: object - properties: - op: - type: string - description: The operator. - left: - type: string - description: The LiveStatus column name. - example: name - pattern: ^([a-z]+\.)?[_a-z]+$ - right: - type: string - description: The value to compare the column to. - Expr: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/LogicalExpr' - - $ref: '#/components/schemas/LogicalExpr' - - $ref: '#/components/schemas/NotExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - - $ref: '#/components/schemas/BinaryExpr' - discriminator: - propertyName: op - mapping: - and: '#/components/schemas/LogicalExpr' - or: '#/components/schemas/LogicalExpr' - not: '#/components/schemas/NotExpr' - '=': '#/components/schemas/BinaryExpr' - '~': '#/components/schemas/BinaryExpr' - ~~: '#/components/schemas/BinaryExpr' - <: '#/components/schemas/BinaryExpr' - '>': '#/components/schemas/BinaryExpr' - '>=': '#/components/schemas/BinaryExpr' - <=: '#/components/schemas/BinaryExpr' - '!=': '#/components/schemas/BinaryExpr' - '!~': '#/components/schemas/BinaryExpr' - '!~~': '#/components/schemas/BinaryExpr' - '!<': '#/components/schemas/BinaryExpr' - '!>': '#/components/schemas/BinaryExpr' - '!>=': '#/components/schemas/BinaryExpr' - '!<=': '#/components/schemas/BinaryExpr' - NotExpr: - type: object - properties: - op: - type: string - description: The operator. In this case `not`. - expr: - description: The query expression to negate. - allOf: - - $ref: '#/components/schemas/Expr' - LogicalExpr: - type: object - properties: - op: - type: string - description: The operator. - expr: - type: array - items: - description: A list of query expressions to combine. - allOf: - - $ref: '#/components/schemas/Expr' - AcknowledgeHostQueryProblem: - type: object - properties: - acknowledge_type: - type: string - description: The acknowledge host selection type. - enum: *id002 - example: host - sticky: - type: boolean - default: true - description: If set, only a state-change of the host to an UP state will - discard the acknowledgement. Otherwise it will be discarded on any state-change. - Defaults to False. - example: false - persistent: - type: boolean - default: false - description: If set, the comment will persist a restart. Defaults to False. - example: false - notify: - type: boolean - default: true - description: If set, notifications will be sent out to the configured contacts. - Defaults to False. - example: false - comment: - type: string - description: If set, this comment will be stored alongside the acknowledgement. - example: This was expected. - query: - description: An query expression of the Livestatus 'hosts' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, - {"op": "!=", "left": "state", "right": "0"}]}' - allOf: - - $ref: '#/components/schemas/Expr' - required: - - acknowledge_type - - comment - - query - AcknowledgeHostRelatedProblem: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/AcknowledgeHostProblem' - - $ref: '#/components/schemas/AcknowledgeHostGroupProblem' - - $ref: '#/components/schemas/AcknowledgeHostQueryProblem' - discriminator: - propertyName: acknowledge_type - mapping: - host: '#/components/schemas/AcknowledgeHostProblem' - hostgroup: '#/components/schemas/AcknowledgeHostGroupProblem' - host_by_query: '#/components/schemas/AcknowledgeHostQueryProblem' - ApiError: - type: object - properties: - status: - type: integer - description: The HTTP status code. - example: 404 - detail: - type: string - description: Detailed information on what exactly went wrong. - example: The resource could not be found. - title: - type: string - description: A summary of the problem. - example: Not found - fields: - type: object - description: Detailed error messages on all fields failing validation. - ext: - type: object - description: Additional information about the error. - required: - - detail - - status - - title - AcknowledgeSpecificServiceProblem: - type: object - properties: - acknowledge_type: - type: string - description: The acknowledge service selection type. - enum: &id003 - - service - - servicegroup - - service_by_query - example: service - sticky: - type: boolean - default: true - description: If set, only a state-change of the service to an OK state will - discard the acknowledgement. Otherwise, it will be discarded on any state-change. - Defaults to False. - example: false - persistent: - type: boolean - default: false - description: If set, the comment will persist a restart. Defaults to False. - example: false - notify: - type: boolean - default: true - description: If set, notifications will be sent out to the configured contacts. - Defaults to False. - example: false - comment: - type: string - description: If set, this comment will be stored alongside the acknowledgement. - example: This was expected. - host_name: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - service_description: - type: string - description: The acknowledgement process will be applied to all matching - service descriptions - example: CPU load - required: - - acknowledge_type - - comment - - host_name - - service_description - AcknowledgeServiceGroupProblem: - type: object - properties: - acknowledge_type: - type: string - description: The acknowledge service selection type. - enum: *id003 - example: service - sticky: - type: boolean - default: true - description: If set, only a state-change of the service to an OK state will - discard the acknowledgement. Otherwise, it will be discarded on any state-change. - Defaults to False. - example: false - persistent: - type: boolean - default: false - description: If set, the comment will persist a restart. Defaults to False. - example: false - notify: - type: boolean - default: true - description: If set, notifications will be sent out to the configured contacts. - Defaults to False. - example: false - comment: - type: string - description: If set, this comment will be stored alongside the acknowledgement. - example: This was expected. - servicegroup_name: - type: string - description: The name of the service group. Any host having a service in - this group will be A downtime will be scheduled for all hosts in this - group. - example: windows - required: - - acknowledge_type - - comment - - servicegroup_name - AcknowledgeServiceQueryProblem: - type: object - properties: - acknowledge_type: - type: string - description: The acknowledge service selection type. - enum: *id003 - example: service - sticky: - type: boolean - default: true - description: If set, only a state-change of the service to an OK state will - discard the acknowledgement. Otherwise, it will be discarded on any state-change. - Defaults to False. - example: false - persistent: - type: boolean - default: false - description: If set, the comment will persist a restart. Defaults to False. - example: false - notify: - type: boolean - default: true - description: If set, notifications will be sent out to the configured contacts. - Defaults to False. - example: false - comment: - type: string - description: If set, this comment will be stored alongside the acknowledgement. - example: This was expected. - query: - description: An query expression of the Livestatus 'services' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, - {"op": "!=", "left": "state", "right": "0"}]}' - allOf: - - $ref: '#/components/schemas/Expr' - required: - - acknowledge_type - - comment - - query - AcknowledgeServiceRelatedProblem: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/AcknowledgeSpecificServiceProblem' - - $ref: '#/components/schemas/AcknowledgeServiceGroupProblem' - - $ref: '#/components/schemas/AcknowledgeServiceQueryProblem' - discriminator: - propertyName: acknowledge_type - mapping: - service: '#/components/schemas/AcknowledgeSpecificServiceProblem' - servicegroup: '#/components/schemas/AcknowledgeServiceGroupProblem' - service_by_query: '#/components/schemas/AcknowledgeServiceQueryProblem' - ActivateChanges: - type: object - properties: - redirect: - type: boolean - default: false - description: After starting the activation, redirect immediately to the - 'Wait for completion' endpoint instead of waiting for the completion. - example: false - sites: - type: array - description: The names of the sites on which the configuration shall be - activated. An empty list means all sites which have pending changes. - example: - - production - items: - type: string - force_foreign_changes: - type: boolean - default: false - description: Will activate changes even if the user who made those changes - is not the currently logged in user. - example: false - Link: - type: object - properties: - domainType: - default: link - rel: - type: string - description: Indicates the nature of the relationship of the related resource - to the resource that generated this representation - example: self - href: - type: string - description: The (absolute) address of the related resource. Any characters - that are invalid in URLs must be URL encoded. - example: https://.../api_resource - method: - type: string - description: The HTTP method to use to traverse the link (get, post, put - or delete) - enum: - - GET - - PUT - - POST - - DELETE - example: GET - type: - type: string - description: The content-type that the linked resource will return - example: application/json - title: - type: string - nullable: true - description: string that the consuming application may use to render the - link without having to traverse the link in advance - example: The object itself - body_params: - type: object - description: A map of values that shall be sent in the request body. If - this is present,the request has to be sent with a content-type of 'application/json'. - required: - - domainType - - href - - method - - rel - - type - ChangesFields: - type: object - properties: - id: - type: string - format: uuid - description: The change identifier - example: ad9c9b13-52f2-4fb8-8f4f-7b2ae48c7984 - user_id: - type: string - description: The user who made the change - example: cmkadmin - action_name: - type: string - description: The action carried out - example: edit-host - text: - type: string - description: '' - example: Modified host heute. - time: - type: string - format: date-time - description: The date and time the change was made. - example: '2023-02-21T17:32:28+00:00' - ActivationExtensionFields: - type: object - properties: - sites: - type: array - description: Sites affected by this activation - example: - - site1 - - site2 - items: - type: string - is_running: - type: boolean - description: If the activation is still running - example: false - force_foreign_changes: - type: boolean - description: If the activation is still running - example: false - time_started: - type: string - format: date-time - description: The date and time the activation was started. - example: '2023-02-21T17:34:12+00:00' - changes: - type: array - description: The changes in this activation - items: - $ref: '#/components/schemas/ChangesFields' - ActivationRunResponse: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: activation_run - description: The domain type of the object. - id: - type: string - format: uuid - description: The unique identifier for this activation run. - example: 84b18e42-355e-4f13-80b6-404bd8f21149 - title: - type: string - description: The activation run status. - example: 'Activation status: In progress.' - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: The activation run attributes. - example: &id004 - changes: - - id: da5430a5-6d0a-48ae-9efd-0563482a3b36 - action_name: edit-host - text: Modified host heute. - user_id: cmkadmin - time: '2023-01-20T16:31:51.362057+00:00' - is_running: false - activate_foreign: true - time_started: '2023-01-20T16:31:54.306846+00:00' - sites: - - heute - comment: '' - allOf: - - $ref: '#/components/schemas/ActivationExtensionFields' - required: - - links - ActivationRunCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: - type: string - description: The name of this collection. - domainType: - default: activation_run - description: The domain type of the objects in the collection. - value: - type: array - description: A list of activation runs. - example: - - links: - - domainType: link - rel: self - href: http://localhost/heute/check_mk/api/1.0/objects/activation_run/b0a0bf49-ff5f-454b-a5d5-9731cb0fb5fa - method: GET - type: application/json - domainType: activation_run - id: b0a0bf49-ff5f-454b-a5d5-9731cb0fb5fa - title: test-title - members: {} - extensions: *id004 - items: - $ref: '#/components/schemas/ActivationRunResponse' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - PendingChangesCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: activation_run - description: The domain type of the objects in the collection. - value: - type: array - description: The changes that are pending - example: - - id: da5430a5-6d0a-48ae-9efd-0563482a3b36 - action_name: create-host - text: Created new host foobar. - user_id: cmkadmin - time: '2023-01-20T16:31:51.362057+00:00' - - id: 4ba28393-567e-4a9a-9368-e600d28c2a7e - action_name: edit-host - text: Modified host foobar. - user_id: cmkadmin - time: '2023-01-20T16:32:12.362057+00:00' - items: - $ref: '#/components/schemas/ChangesFields' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - AuxTagAttrsCreate: - type: object - properties: - aux_tag_id: - type: string - description: An auxiliary tag id - example: ip-v4 - pattern: ^[-0-9a-zA-Z_]+\Z - topic: - type: string - description: Different tags can be grouped in topics to make the visualization - and selections in the GUI more comfortable - example: Monitoring agents - minLength: 1 - title: - type: string - description: The title of the Auxiliary tag - example: AuxTagExampleTitle - minLength: 1 - help: - type: string - default: '' - description: The help of the Auxiliary tag - example: AuxTagExampleHelp - required: - - aux_tag_id - - title - - topic - AuxTagAttrsResponse: - type: object - properties: - topic: - type: string - description: Different tags can be grouped in topics to make the visualization - and selections in the GUI more comfortable - example: Monitoring agents - minLength: 1 - help: - type: string - description: The help of the Auxiliary tag - example: AuxTagExampleHelp - required: - - help - - topic - AuxTagResponse: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: aux_tag - description: The domain type of the object. - id: - type: string - description: The unique identifier for this domain-object type. - title: - type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: The Auxiliary Tag attributes. - example: &id005 - id: snmp - title: Monitoring via SNMP - topic: Monitoring agents - help: Your help text - allOf: - - $ref: '#/components/schemas/AuxTagAttrsResponse' - required: - - links - AuxTagAttrsUpdate: - type: object - properties: - topic: - type: string - description: Different tags can be grouped in topics to make the visualization - and selections in the GUI more comfortable - example: Monitoring agents - minLength: 1 - title: - type: string - description: The title of the Auxiliary tag - example: AuxTagExampleTitle - minLength: 1 - help: - type: string - description: The help of the Auxiliary tag - example: AuxTagExampleHelp - AuxTagResponseCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: - type: string - default: all - description: The name of this collection. - domainType: - default: aux_tag - description: The domain type of the objects in the collection. - title: - type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of site configuration objects. - example: - - links: [] - domainType: aux_tag - id: snmp - title: Monitoring via SNMP - members: {} - extensions: *id005 - items: - $ref: '#/components/schemas/AuxTagResponse' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - BIAggregationGroups: - type: object - properties: - names: - type: array - example: - - group1 - - group2 - items: - type: string - paths: - type: array - example: - - - path - - of - - group1 - items: - type: array - items: - type: string - BIEmptySearch: - type: object - properties: - type: - default: empty - required: - - type - BIAllHostsChoice: - type: object - properties: - type: - default: all_hosts - required: - - type - BIHostNameRegexChoice: - type: object - properties: - type: - default: host_name_regex - pattern: - type: string - example: testhostn.* - required: - - pattern - - type - BIHostAliasRegexChoice: - type: object - properties: - type: - default: host_alias_regex - pattern: - type: string - example: testali.* - required: - - pattern - - type - BIHostChoice: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/BIAllHostsChoice' - - $ref: '#/components/schemas/BIHostNameRegexChoice' - - $ref: '#/components/schemas/BIHostAliasRegexChoice' - discriminator: - propertyName: type - mapping: - all_hosts: '#/components/schemas/BIAllHostsChoice' - host_name_regex: '#/components/schemas/BIHostNameRegexChoice' - host_alias_regex: '#/components/schemas/BIHostAliasRegexChoice' - HostConditions: - type: object +components: + parameters: + Accept: + allowEmptyValue: false + description: Media type(s) that is/are acceptable for the response. + example: application/json + in: header + name: Accept + required: false + schema: + type: string + schemas: + AcknowledgeHostGroupProblem: properties: - host_folder: + acknowledge_type: + description: The acknowledge host selection type. + enum: &id001 + - host + - hostgroup + - host_by_query + example: host + type: string + sticky: + default: true + description: If set, only a state-change of the host to an UP state will + discard the acknowledgement. Otherwise it will be discarded on any state-change. + Defaults to False. + example: false + type: boolean + persistent: + default: false + description: If set, the comment will persist a restart. Defaults to False. + example: false + type: boolean + notify: + default: true + description: If set, notifications will be sent out to the configured contacts. + Defaults to False. + example: false + type: boolean + comment: + description: If set, this comment will be stored alongside the acknowledgement. + example: This was expected. + type: string + hostgroup_name: + description: The name of the host group. + example: Servers type: string - example: servers/groupA - host_labels: - type: object - example: &id006 - db: mssql - host_tags: - type: object - example: &id007 {} - host_choice: - example: &id008 - type: all_hosts - allOf: - - $ref: '#/components/schemas/BIHostChoice' - required: - - host_choice - - host_folder - - host_labels - - host_tags - Host: - type: object - properties: - type: - default: host - required: - - type - Parent: - type: object - properties: - type: - default: parent required: - - type - Child: + - acknowledge_type + - comment + - hostgroup_name type: object + AcknowledgeHostProblem: properties: - type: - default: child + acknowledge_type: + description: The acknowledge host selection type. + enum: *id001 + example: host + type: string + sticky: + default: true + description: If set, only a state-change of the host to an UP state will + discard the acknowledgement. Otherwise it will be discarded on any state-change. + Defaults to False. + example: false + type: boolean + persistent: + default: false + description: If set, the comment will persist a restart. Defaults to False. + example: false + type: boolean + notify: + default: true + description: If set, notifications will be sent out to the configured contacts. + Defaults to False. + example: false + type: boolean + comment: + description: If set, this comment will be stored alongside the acknowledgement. + example: This was expected. + type: string + host_name: + description: The name of the host. + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string required: - - type - ChildWith: + - acknowledge_type + - comment + - host_name type: object + AcknowledgeHostQueryProblem: properties: - conditions: - $ref: '#/components/schemas/HostConditions' - host_choice: - example: - type: all_hosts + acknowledge_type: + description: The acknowledge host selection type. + enum: *id001 + example: host + type: string + sticky: + default: true + description: If set, only a state-change of the host to an UP state will + discard the acknowledgement. Otherwise it will be discarded on any state-change. + Defaults to False. + example: false + type: boolean + persistent: + default: false + description: If set, the comment will persist a restart. Defaults to False. + example: false + type: boolean + notify: + default: true + description: If set, notifications will be sent out to the configured contacts. + Defaults to False. + example: false + type: boolean + comment: + description: If set, this comment will be stored alongside the acknowledgement. + example: This was expected. + type: string + query: allOf: - - $ref: '#/components/schemas/BIHostChoice' + - $ref: '#/components/schemas/Expr' + description: An query expression of the Livestatus 'hosts' table in nested + dictionary form. If you want to use multiple expressions, nest them with + the AND/OR operators. + example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, + {"op": "!=", "left": "state", "right": "0"}]}' required: - - conditions - - host_choice - ReferTo: + - acknowledge_type + - comment + - query type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/Host' - - $ref: '#/components/schemas/Parent' - - $ref: '#/components/schemas/Child' - - $ref: '#/components/schemas/ChildWith' + AcknowledgeHostRelatedProblem: discriminator: - propertyName: type mapping: - host: '#/components/schemas/Host' - parent: '#/components/schemas/Parent' - child: '#/components/schemas/Child' - child_with: '#/components/schemas/ChildWith' - BIHostSearch: - type: object - properties: - type: - default: host_search - conditions: - $ref: '#/components/schemas/HostConditions' - refer_to: - $ref: '#/components/schemas/ReferTo' - required: - - conditions - - refer_to - - type - ServiceConditions: + host: '#/components/schemas/AcknowledgeHostProblem' + host_by_query: '#/components/schemas/AcknowledgeHostQueryProblem' + hostgroup: '#/components/schemas/AcknowledgeHostGroupProblem' + propertyName: acknowledge_type + oneOf: + - $ref: '#/components/schemas/AcknowledgeHostProblem' + - $ref: '#/components/schemas/AcknowledgeHostGroupProblem' + - $ref: '#/components/schemas/AcknowledgeHostQueryProblem' + properties: {} type: object + AcknowledgeServiceGroupProblem: properties: - host_folder: + acknowledge_type: + description: The acknowledge service selection type. + enum: &id002 + - service + - servicegroup + - service_by_query + example: service type: string - example: servers/groupA - host_labels: - type: object - example: *id006 - host_tags: - type: object - example: *id007 - host_choice: - example: *id008 - allOf: - - $ref: '#/components/schemas/BIHostChoice' - service_regex: + sticky: + default: true + description: If set, only a state-change of the service to an OK state will + discard the acknowledgement. Otherwise, it will be discarded on any state-change. + Defaults to False. + example: false + type: boolean + persistent: + default: false + description: If set, the comment will persist a restart. Defaults to False. + example: false + type: boolean + notify: + default: true + description: If set, notifications will be sent out to the configured contacts. + Defaults to False. + example: false + type: boolean + comment: + description: If set, this comment will be stored alongside the acknowledgement. + example: This was expected. type: string - example: Filesystem.* - service_labels: - type: object - example: - db: mssql - required: - - host_choice - - host_folder - - host_labels - - host_tags - - service_labels - - service_regex - BIServiceSearch: - type: object - properties: - type: - default: service_search - conditions: - $ref: '#/components/schemas/ServiceConditions' - required: - - conditions - - type - BIFixedArgumentsSearchToken: - type: object - properties: - key: + servicegroup_name: + description: The name of the service group. Any host having a service in + this group will be A downtime will be scheduled for all hosts in this + group. + example: windows type: string - values: - type: array - items: - type: string required: - - key - - values - BIFixedArgumentsSearch: + - acknowledge_type + - comment + - servicegroup_name type: object + AcknowledgeServiceQueryProblem: properties: - type: - default: fixed_arguments - arguments: - type: array - items: - $ref: '#/components/schemas/BIFixedArgumentsSearchToken' + acknowledge_type: + description: The acknowledge service selection type. + enum: *id002 + example: service + type: string + sticky: + default: true + description: If set, only a state-change of the service to an OK state will + discard the acknowledgement. Otherwise, it will be discarded on any state-change. + Defaults to False. + example: false + type: boolean + persistent: + default: false + description: If set, the comment will persist a restart. Defaults to False. + example: false + type: boolean + notify: + default: true + description: If set, notifications will be sent out to the configured contacts. + Defaults to False. + example: false + type: boolean + comment: + description: If set, this comment will be stored alongside the acknowledgement. + example: This was expected. + type: string + query: + allOf: + - $ref: '#/components/schemas/Expr' + description: An query expression of the Livestatus 'services' table in nested + dictionary form. If you want to use multiple expressions, nest them with + the AND/OR operators. + example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, + {"op": "!=", "left": "state", "right": "0"}]}' required: - - arguments - - type - BISearch: + - acknowledge_type + - comment + - query type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/BIEmptySearch' - - $ref: '#/components/schemas/BIHostSearch' - - $ref: '#/components/schemas/BIServiceSearch' - - $ref: '#/components/schemas/BIFixedArgumentsSearch' + AcknowledgeServiceRelatedProblem: discriminator: - propertyName: type mapping: - empty: '#/components/schemas/BIEmptySearch' - host_search: '#/components/schemas/BIHostSearch' - service_search: '#/components/schemas/BIServiceSearch' - fixed_arguments: '#/components/schemas/BIFixedArgumentsSearch' - BIParams: + service: '#/components/schemas/AcknowledgeSpecificServiceProblem' + service_by_query: '#/components/schemas/AcknowledgeServiceQueryProblem' + servicegroup: '#/components/schemas/AcknowledgeServiceGroupProblem' + propertyName: acknowledge_type + oneOf: + - $ref: '#/components/schemas/AcknowledgeSpecificServiceProblem' + - $ref: '#/components/schemas/AcknowledgeServiceGroupProblem' + - $ref: '#/components/schemas/AcknowledgeServiceQueryProblem' + properties: {} type: object + AcknowledgeSpecificServiceProblem: properties: - arguments: - type: array - example: - - testhostParams - items: - type: string + acknowledge_type: + description: The acknowledge service selection type. + enum: *id002 + example: service + type: string + sticky: + default: true + description: If set, only a state-change of the service to an OK state will + discard the acknowledgement. Otherwise, it will be discarded on any state-change. + Defaults to False. + example: false + type: boolean + persistent: + default: false + description: If set, the comment will persist a restart. Defaults to False. + example: false + type: boolean + notify: + default: true + description: If set, notifications will be sent out to the configured contacts. + Defaults to False. + example: false + type: boolean + comment: + description: If set, this comment will be stored alongside the acknowledgement. + example: This was expected. + type: string + host_name: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + service_description: + description: The acknowledgement process will be applied to all matching + service descriptions + example: CPU load + type: string required: - - arguments - BICallARuleAction: + - acknowledge_type + - comment + - host_name + - service_description type: object + ActivateChanges: properties: - type: - default: call_a_rule - rule_id: - type: string - example: test_rule_1 - params: + redirect: + default: false + description: After starting the activation, redirect immediately to the + 'Wait for completion' endpoint instead of waiting for the completion. + example: false + type: boolean + sites: + description: The names of the sites on which the configuration shall be + activated. An empty list means all sites which have pending changes. example: - arguments: [] - allOf: - - $ref: '#/components/schemas/BIParams' - required: - - params - - rule_id - - type - BIStateOfHostAction: + - production + items: + type: string + type: array + force_foreign_changes: + default: false + description: Will activate changes even if the user who made those changes + is not the currently logged in user. + example: false + type: boolean type: object + ApiError: properties: - type: - default: state_of_host - host_regex: + status: + description: The HTTP status code. + example: 404 + type: integer + detail: + description: Detailed information on what exactly went wrong. + example: The resource could not be found. type: string - example: testhost + title: + description: A summary of the problem. + example: Not found + type: string + fields: + description: Detailed error messages on all fields failing validation. + type: object + ext: + description: Additional information about the error. + type: object required: - - host_regex - - type - BIStateOfServiceAction: + - detail + - status + - title + type: object + AuthOption: + discriminator: + mapping: + automation: '#/components/schemas/AuthSecret' + password: '#/components/schemas/AuthPassword' + propertyName: auth_type + oneOf: + - $ref: '#/components/schemas/AuthPassword' + - $ref: '#/components/schemas/AuthSecret' + properties: {} type: object + AuthPassword: properties: - type: - default: state_of_service - host_regex: + password: + description: The password for login + example: password type: string - example: testhost - service_regex: + auth_type: + description: The authentication type + enum: &id003 + - automation + - password + example: password type: string - example: testservice - required: - - host_regex - - service_regex - - type - BIStateOfRemainingServicesAction: + enforce_password_change: + default: false + description: If set to True, the user will be forced to change his password + on the next login or access. Defaults to False + example: false + type: boolean type: object + AuthSecret: properties: - type: - default: state_of_remaining_services - host_regex: + secret: + description: For accounts used by automation processes (such as fetching + data from views for further procession). This is the automation secret + example: DEYQEQQPYCFFBYH@AVMC + type: string + auth_type: + description: The authentication type + enum: *id003 + example: password type: string - example: testhost - required: - - host_regex - - type - BIAction: type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/BICallARuleAction' - - $ref: '#/components/schemas/BIStateOfHostAction' - - $ref: '#/components/schemas/BIStateOfServiceAction' - - $ref: '#/components/schemas/BIStateOfRemainingServicesAction' + AuthUpdateOption: discriminator: - propertyName: type mapping: - call_a_rule: '#/components/schemas/BICallARuleAction' - state_of_host: '#/components/schemas/BIStateOfHostAction' - state_of_service: '#/components/schemas/BIStateOfServiceAction' - state_of_remaining_services: '#/components/schemas/BIStateOfRemainingServicesAction' - BINodeGenerator: + automation: '#/components/schemas/AuthUpdateSecret' + password: '#/components/schemas/AuthUpdatePassword' + remove: '#/components/schemas/AuthUpdateRemove' + propertyName: auth_type + oneOf: + - $ref: '#/components/schemas/AuthUpdatePassword' + - $ref: '#/components/schemas/AuthUpdateSecret' + - $ref: '#/components/schemas/AuthUpdateRemove' + properties: {} type: object + AuthUpdatePassword: properties: - search: - description: Nested dictionary - example: - type: empty - allOf: - - $ref: '#/components/schemas/BISearch' - action: - description: Nested dictionary - example: - type: state_of_host - host_regex: '' - allOf: - - $ref: '#/components/schemas/BIAction' + password: + description: The password for login + example: password + type: string + auth_type: + description: The authentication type + enum: &id004 + - automation + - password + - remove + example: password + type: string + enforce_password_change: + description: If set to True, the user will be forced to change his password + on the next login or access + example: false + type: boolean required: - - action - - search - BIAggregationVisualization: + - auth_type type: object + AuthUpdateRemove: properties: - ignore_rule_styles: - type: boolean - example: false - layout_id: + auth_type: + description: The authentication type + enum: *id004 + example: password + type: string + required: + - auth_type + type: object + AuthUpdateSecret: + properties: + secret: + description: For accounts used by automation processes (such as fetching + data from views for further procession). This is the automation secret + example: DEYQEQQPYCFFBYH@AVMC type: string - example: radial_layout2 - line_style: + auth_type: + description: The authentication type + enum: *id004 + example: password type: string - example: round required: - - ignore_rule_styles - - layout_id - - line_style - BIAggregationComputationOptions: + - auth_type + type: object + BIAction: + discriminator: + mapping: + call_a_rule: '#/components/schemas/BICallARuleAction' + state_of_host: '#/components/schemas/BIStateOfHostAction' + state_of_remaining_services: '#/components/schemas/BIStateOfRemainingServicesAction' + state_of_service: '#/components/schemas/BIStateOfServiceAction' + propertyName: type + oneOf: + - $ref: '#/components/schemas/BICallARuleAction' + - $ref: '#/components/schemas/BIStateOfHostAction' + - $ref: '#/components/schemas/BIStateOfServiceAction' + - $ref: '#/components/schemas/BIStateOfRemainingServicesAction' + properties: {} type: object + BIAggregationComputationOptions: properties: disabled: - type: boolean example: false - use_hard_states: type: boolean + use_hard_states: example: false - escalate_downtimes_as_warn: type: boolean + escalate_downtimes_as_warn: example: false - freeze_aggregations: type: boolean - example: false required: - disabled - escalate_downtimes_as_warn - use_hard_states - BIAggregationEndpoint: type: object + BIAggregationEndpoint: properties: id: - type: string - description: The unique aggregation id + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" example: aggr1 - comment: type: string - nullable: true + comment: description: An optional comment that may be used to explain the purpose of this object. example: Rule comment - customer: - type: string nullable: true + type: string + customer: description: 'CME Edition only: The customer id for this aggregation.' example: customer1 + nullable: true + type: string groups: - description: Nested dictionary + allOf: + - $ref: '#/components/schemas/BIAggregationGroups' + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" example: names: - groupA @@ -24209,39 +502,36 @@ components: - - path - group - b - allOf: - - $ref: '#/components/schemas/BIAggregationGroups' node: - description: Nested dictionary + allOf: + - $ref: '#/components/schemas/BINodeGenerator' + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" example: - search: - type: empty action: - type: state_of_host host_regex: '' - allOf: - - $ref: '#/components/schemas/BINodeGenerator' + type: state_of_host + search: + type: empty aggregation_visualization: - description: Nested dictionary + allOf: + - $ref: '#/components/schemas/BIAggregationVisualization' + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" example: ignore_rule_styles: false layout_id: builtin_default line_style: round - allOf: - - $ref: '#/components/schemas/BIAggregationVisualization' computation_options: - description: Nested dictionary + allOf: + - $ref: '#/components/schemas/BIAggregationComputationOptions' + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" example: disabled: false - use_hard_states: false escalate_downtimes_as_warn: false - freeze_aggregations: false - allOf: - - $ref: '#/components/schemas/BIAggregationComputationOptions' + use_hard_states: false pack_id: - type: string - description: The identifier of the BI pack. + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" example: pack1 + type: string required: - aggregation_visualization - computation_options @@ -24249,151 +539,299 @@ components: - id - node - pack_id - BIAggregationStateRequest: type: object + BIAggregationFunction: + discriminator: + mapping: + best: '#/components/schemas/BIAggregationFunctionBest' + count_ok: '#/components/schemas/BIAggregationFunctionCountOK' + worst: '#/components/schemas/BIAggregationFunctionWorst' + propertyName: type + oneOf: + - $ref: '#/components/schemas/BIAggregationFunctionBest' + - $ref: '#/components/schemas/BIAggregationFunctionWorst' + - $ref: '#/components/schemas/BIAggregationFunctionCountOK' + properties: {} + type: object + BIAggregationFunctionBest: properties: - filter_names: + type: + default: best + count: + type: integer + restrict_state: + enum: + - 0 + - 1 + - 2 + type: integer + required: + - count + - restrict_state + - type + type: object + BIAggregationFunctionCountOK: + properties: + type: + default: count_ok + levels_ok: + $ref: '#/components/schemas/BIAggregationFunctionCountSettings' + levels_warn: + $ref: '#/components/schemas/BIAggregationFunctionCountSettings' + required: + - levels_ok + - levels_warn + - type + type: object + BIAggregationFunctionCountSettings: + properties: + type: + enum: + - count + - percentage + type: string + value: + type: integer + required: + - type + - value + type: object + BIAggregationFunctionWorst: + properties: + type: + default: worst + count: + example: 2 + type: integer + restrict_state: + enum: + - 0 + - 1 + - 2 + type: integer + required: + - count + - restrict_state + - type + type: object + BIAggregationGroups: + properties: + names: + example: + - group1 + - group2 + items: + type: string type: array + paths: + example: + - - path + - of + - group1 + items: + items: + type: string + type: array + type: array + type: object + BIAggregationStateRequest: + properties: + filter_names: description: Filter by names example: - Host foo items: type: string - filter_groups: type: array + filter_groups: description: Filter by group example: - My Group items: type: string - BIAggregationStateResponse: + type: array type: object + BIAggregationStateResponse: properties: aggregations: - type: object description: The Aggregation state example: {} + type: object missing_sites: - type: array description: The missing sites example: - beta - heute items: type: string - missing_aggr: type: array + missing_aggr: description: the missing aggregations example: - Host heute items: type: string - DomainObject: + type: array + type: object + BIAggregationVisualization: + properties: + ignore_rule_styles: + example: false + type: boolean + layout_id: + example: radial_layout2 + type: string + line_style: + example: round + type: string + required: + - ignore_rule_styles + - layout_id + - line_style + type: object + BIAllHostsChoice: + properties: + type: + default: all_hosts + required: + - type + type: object + BICallARuleAction: + properties: + type: + default: call_a_rule + rule_id: + example: test_rule_1 + type: string + params: + allOf: + - $ref: '#/components/schemas/BIParams' + example: + arguments: [] + required: + - params + - rule_id + - type + type: object + BIEmptySearch: + properties: + type: + default: empty + required: + - type + type: object + BIFixedArgumentsSearch: + properties: + type: + default: fixed_arguments + arguments: + items: + $ref: '#/components/schemas/BIFixedArgumentsSearchToken' + type: array + required: + - arguments + - type + type: object + BIFixedArgumentsSearchToken: + properties: + key: + type: string + values: + items: + type: string + type: array + required: + - key + - values type: object + BIHostAliasRegexChoice: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - type: string - description: The "domain-type" of the object. - id: - type: string - description: The unique identifier for this domain-object type. - title: + type: + default: host_alias_regex + pattern: + example: testali.* type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - type: object - description: All the attributes of the domain object. required: - - domainType - - links - CollectionItem: + - pattern + - type type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/Link' + BIHostChoice: discriminator: - propertyName: domainType mapping: - link: '#/components/schemas/Link' - DomainObjectCollection: + all_hosts: '#/components/schemas/BIAllHostsChoice' + host_alias_regex: '#/components/schemas/BIHostAliasRegexChoice' + host_name_regex: '#/components/schemas/BIHostNameRegexChoice' + propertyName: type + oneOf: + - $ref: '#/components/schemas/BIAllHostsChoice' + - $ref: '#/components/schemas/BIHostNameRegexChoice' + - $ref: '#/components/schemas/BIHostAliasRegexChoice' + properties: {} type: object + BIHostNameRegexChoice: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: - type: string - default: all - description: The name of this collection. - domainType: - type: string - description: The domain type of the objects in the collection. - title: + type: + default: host_name_regex + pattern: + example: testhostn.* type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - description: The collection itself. Each entry in here is part of the collection. - type: array - items: - $ref: '#/components/schemas/CollectionItem' - extensions: - type: object - description: Additional attributes alongside the collection. required: - - links - BINodeVisNoneStyle: + - pattern + - type type: object + BIHostSearch: properties: type: - default: none - style_config: - default: {} + default: host_search + conditions: + $ref: '#/components/schemas/HostConditions' + refer_to: + $ref: '#/components/schemas/ReferTo' required: - - style_config + - conditions + - refer_to - type - BINodeVisBlockStyle: type: object + BINodeGenerator: + properties: + search: + allOf: + - $ref: '#/components/schemas/BISearch' + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" + example: + type: empty + action: + allOf: + - $ref: '#/components/schemas/BIAction' + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" + example: + host_regex: '' + type: state_of_host + required: + - action + - search + type: object + BINodeVisBlockStyle: properties: type: default: block style_config: - default: &id009 {} + default: &id005 {} required: - style_config - type - BINodeVisHierarchyStyleConfig: type: object + BINodeVisForceStyle: properties: - layer_height: - type: integer - example: 85 - node_size: - type: integer - example: 40 - rotation: - type: integer - example: 180 + type: + default: force + style_config: + default: {} required: - - layer_height - - node_size - - rotation - BINodeVisHierarchyStyle: + - style_config + - type type: object + BINodeVisHierarchyStyle: properties: type: default: hierarchy @@ -24402,3410 +840,2306 @@ components: required: - style_config - type - BINodeVisRadialStyleConfig: type: object + BINodeVisHierarchyStyleConfig: properties: - degree: + layer_height: + example: 85 type: integer - radius: + node_size: + example: 40 type: integer rotation: + example: 180 type: integer required: - - degree - - radius + - layer_height + - node_size - rotation - BINodeVisRadialStyle: - type: object - properties: - type: - default: radial - style_config: - $ref: '#/components/schemas/BINodeVisRadialStyleConfig' - required: - - style_config - - type - BINodeVisForceStyle: type: object - properties: - type: - default: force - style_config: - default: {} - required: - - style_config - - type BINodeVisLayoutStyle: - type: object - properties: {} + discriminator: + mapping: + block: '#/components/schemas/BINodeVisBlockStyle' + force: '#/components/schemas/BINodeVisForceStyle' + hierarchy: '#/components/schemas/BINodeVisHierarchyStyle' + none: '#/components/schemas/BINodeVisNoneStyle' + radial: '#/components/schemas/BINodeVisRadialStyle' + propertyName: type oneOf: - $ref: '#/components/schemas/BINodeVisNoneStyle' - $ref: '#/components/schemas/BINodeVisBlockStyle' - $ref: '#/components/schemas/BINodeVisHierarchyStyle' - $ref: '#/components/schemas/BINodeVisRadialStyle' - $ref: '#/components/schemas/BINodeVisForceStyle' - discriminator: - propertyName: type - mapping: - none: '#/components/schemas/BINodeVisNoneStyle' - block: '#/components/schemas/BINodeVisBlockStyle' - hierarchy: '#/components/schemas/BINodeVisHierarchyStyle' - radial: '#/components/schemas/BINodeVisRadialStyle' - force: '#/components/schemas/BINodeVisForceStyle' - BIRuleProperties: - type: object - properties: - title: - type: string - example: Rule title - comment: - type: string - example: Rule comment - docu_url: - type: string - example: Rule documentation - icon: - type: string - example: icon1.png - state_messages: - type: object - example: {} - required: - - comment - - docu_url - - icon - - state_messages - - title - BIAggregationFunctionBest: - type: object - properties: - type: - default: best - count: - type: integer - restrict_state: - type: integer - enum: - - 0 - - 1 - - 2 - required: - - count - - restrict_state - - type - BIAggregationFunctionWorst: - type: object - properties: - type: - default: worst - count: - type: integer - example: 2 - restrict_state: - type: integer - enum: - - 0 - - 1 - - 2 - required: - - count - - restrict_state - - type - BIAggregationFunctionCountSettings: + properties: {} type: object + BINodeVisNoneStyle: properties: type: - type: string - enum: - - count - - percentage - value: - type: integer + default: none + style_config: + default: {} required: + - style_config - type - - value - BIAggregationFunctionCountOK: type: object + BINodeVisRadialStyle: properties: type: - default: count_ok - levels_ok: - $ref: '#/components/schemas/BIAggregationFunctionCountSettings' - levels_warn: - $ref: '#/components/schemas/BIAggregationFunctionCountSettings' + default: radial + style_config: + $ref: '#/components/schemas/BINodeVisRadialStyleConfig' required: - - levels_ok - - levels_warn + - style_config - type - BIAggregationFunction: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/BIAggregationFunctionBest' - - $ref: '#/components/schemas/BIAggregationFunctionWorst' - - $ref: '#/components/schemas/BIAggregationFunctionCountOK' - discriminator: - propertyName: type - mapping: - best: '#/components/schemas/BIAggregationFunctionBest' - worst: '#/components/schemas/BIAggregationFunctionWorst' - count_ok: '#/components/schemas/BIAggregationFunctionCountOK' - BIRuleComputationOptions: type: object + BINodeVisRadialStyleConfig: properties: - disabled: - type: boolean - example: false + degree: + type: integer + radius: + type: integer + rotation: + type: integer required: - - disabled - BIRuleEndpoint: + - degree + - radius + - rotation type: object - properties: - id: - type: string - description: The unique rule id - example: rule1 - nodes: - type: array - description: A list of nodes for for this rule - example: [] - items: - $ref: '#/components/schemas/BINodeGenerator' - params: - description: Nested dictionary - example: - arguments: - - foo - - bar - allOf: - - $ref: '#/components/schemas/BIParams' - node_visualization: - description: Nested dictionary - example: - type: block - style_config: *id009 - allOf: - - $ref: '#/components/schemas/BINodeVisLayoutStyle' - properties: - description: Nested dictionary - example: - title: '' - comment: '' - docu_url: '' - icon: '' - state_messages: {} - allOf: - - $ref: '#/components/schemas/BIRuleProperties' - aggregation_function: - description: Nested dictionary - example: - type: best - count: 1 - restrict_state: 2 - allOf: - - $ref: '#/components/schemas/BIAggregationFunction' - computation_options: - description: Nested dictionary - example: - disabled: false - allOf: - - $ref: '#/components/schemas/BIRuleComputationOptions' - pack_id: - type: string - description: The identifier of the BI pack. - example: pack1 - required: - - aggregation_function - - computation_options - - id - - node_visualization - - nodes - - pack_id - - params - - properties BIPackEndpoint: - type: object properties: title: - type: string - description: The title of the BI pack. + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" example: BI Title + type: string contact_groups: - type: array - description: A list of contact group identifiers. + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" example: - contact - contactgroup_b items: - type: string example: important_persons + type: string + type: array public: - type: boolean - description: Should the BI pack be public or not. + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" example: 'false' + type: boolean required: - contact_groups - public - title - AgentControllerCertificateSettings: - type: object - properties: - lifetime_in_months: - type: integer - description: Lifetime of agent controller certificates in months - example: 60 - required: - - lifetime_in_months - X509ReqPEMUUID: - type: object - properties: - csr: - type: string - description: PEM-encoded X.509 CSR. The CN must a valid version-4 UUID. - example: '-----BEGIN CERTIFICATE REQUEST----- - - ... - - -----END CERTIFICATE REQUEST----- - - ' - required: - - csr - X509PEM: - type: object - properties: - cert: - type: string - description: PEM-encoded X.509 certificate. - required: - - cert - CreateHostComment: type: object + BIParams: properties: - comment: - type: string - description: The comment which will be stored for the host. - example: Windows - persistent: - type: boolean - default: false - description: If set, the comment will persist a restart. - example: false - comment_type: - type: string - description: How you would like to leave a comment. - enum: &id010 - - host - - host_by_query - example: host - host_name: - type: string - description: The host name - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z + arguments: + example: + - testhostParams + items: + type: string + type: array required: - - comment - - comment_type - - host_name - CreateHostQueryComment: + - arguments type: object + BIRuleComputationOptions: properties: - comment: - type: string - description: The comment which will be stored for the host. - example: Windows - persistent: - type: boolean - default: false - description: If set, the comment will persist a restart. + disabled: example: false - comment_type: - type: string - description: How you would like to leave a comment. - enum: *id010 - example: host - query: - description: An query expression of the Livestatus 'hosts' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, - {"op": "!=", "left": "state", "right": "0"}]}' - allOf: - - $ref: '#/components/schemas/Expr' - required: - - comment - - comment_type - CreateHostRelatedComment: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/CreateHostComment' - - $ref: '#/components/schemas/CreateHostQueryComment' - discriminator: - propertyName: comment_type - mapping: - host: '#/components/schemas/CreateHostComment' - host_by_query: '#/components/schemas/CreateHostQueryComment' - CreateServiceComment: - type: object - properties: - comment: - type: string - description: The comment which will be stored for the host. - example: Windows - persistent: type: boolean - default: false - description: If set, the comment will persist a restart. - example: false - comment_type: - type: string - description: How you would like to leave a comment. - enum: &id011 - - service - - service_by_query - example: service - host_name: - type: string - description: The host name - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - service_description: - type: string - description: The service description for which the comment is for. No exception - is raised when the specified service description does not exist - example: Memory required: - - comment - - comment_type - - host_name - - service_description - CreateServiceQueryComment: + - disabled type: object + BIRuleEndpoint: properties: - comment: - type: string - description: The comment which will be stored for the host. - example: Windows - persistent: - type: boolean - default: false - description: If set, the comment will persist a restart. - example: false - comment_type: + id: + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" + example: rule1 type: string - description: How you would like to leave a comment. - enum: *id011 - example: service - query: - description: An query expression of the Livestatus 'services' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, - {"op": "!=", "left": "state", "right": "0"}]}' + nodes: + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" + example: [] + items: + $ref: '#/components/schemas/BINodeGenerator' + type: array + params: allOf: - - $ref: '#/components/schemas/Expr' - required: - - comment - - comment_type - - query - CreateServiceRelatedComment: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/CreateServiceComment' - - $ref: '#/components/schemas/CreateServiceQueryComment' - discriminator: - propertyName: comment_type - mapping: - service: '#/components/schemas/CreateServiceComment' - service_by_query: '#/components/schemas/CreateServiceQueryComment' - DeleteCommentById: - type: object - properties: - delete_type: - type: string - description: How you would like to delete comments. - enum: &id012 - - by_id - - query - - params - example: delete_by_query - comment_id: - type: integer - description: An integer representing a comment ID. - example: 21 - site_id: - type: string - description: The ID of an existing site - example: production - required: - - delete_type - - site_id - DeleteCommentsByQuery: - type: object - properties: - delete_type: - type: string - description: How you would like to delete comments. - enum: *id012 - example: delete_by_query - query: - description: An query expression of the Livestatus 'comments' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, - {"op": "!=", "left": "state", "right": "0"}]}' + - $ref: '#/components/schemas/BIParams' + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" + example: + arguments: + - foo + - bar + node_visualization: allOf: - - $ref: '#/components/schemas/Expr' - site_id: + - $ref: '#/components/schemas/BINodeVisLayoutStyle' + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" + example: + style_config: *id005 + type: block + properties: + allOf: + - $ref: '#/components/schemas/BIRuleProperties' + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" + example: + comment: '' + docu_url: '' + icon: '' + state_messages: {} + title: '' + aggregation_function: + allOf: + - $ref: '#/components/schemas/BIAggregationFunction' + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" + example: + count: 1 + restrict_state: 2 + type: best + computation_options: + allOf: + - $ref: '#/components/schemas/BIRuleComputationOptions' + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" + example: + disabled: false + pack_id: + description: "TODO: Hier mu\xDF Andreas noch etwas reinschreiben!" + example: pack1 type: string - description: The ID of an existing site - example: production required: - - delete_type - - site_id - DeleteCommentsByParams: + - aggregation_function + - computation_options + - id + - node_visualization + - nodes + - pack_id + - params + - properties type: object + BIRuleProperties: properties: - delete_type: + title: + example: Rule title type: string - description: How you would like to delete comments. - enum: *id012 - example: delete_by_query - host_name: + comment: + example: Rule comment type: string - description: The host name - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - service_descriptions: - type: array - description: If set, the comments for the listed services of the specified - host will be removed. If a service has multiple comments then all will - be removed - example: - - CPU load - - Memory - items: - type: string - example: CPU utilization - site_id: + docu_url: + example: Rule documentation type: string - description: The ID of an existing site - example: production + icon: + example: icon1.png + type: string + state_messages: + example: {} + type: object required: - - delete_type - - host_name - - site_id - DeleteComments: + - comment + - docu_url + - icon + - state_messages + - title type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/DeleteCommentById' - - $ref: '#/components/schemas/DeleteCommentsByQuery' - - $ref: '#/components/schemas/DeleteCommentsByParams' + BISearch: discriminator: - propertyName: delete_type mapping: - by_id: '#/components/schemas/DeleteCommentById' - query: '#/components/schemas/DeleteCommentsByQuery' - params: '#/components/schemas/DeleteCommentsByParams' - CommentAttributes: + empty: '#/components/schemas/BIEmptySearch' + fixed_arguments: '#/components/schemas/BIFixedArgumentsSearch' + host_search: '#/components/schemas/BIHostSearch' + service_search: '#/components/schemas/BIServiceSearch' + propertyName: type + oneOf: + - $ref: '#/components/schemas/BIEmptySearch' + - $ref: '#/components/schemas/BIHostSearch' + - $ref: '#/components/schemas/BIServiceSearch' + - $ref: '#/components/schemas/BIFixedArgumentsSearch' + properties: {} type: object + BIServiceSearch: properties: - host_name: - type: string - description: The host name. - id: - type: integer - description: The comment ID - author: - type: string - description: The author of the comment - comment: - type: string - description: The comment itself - persistent: - type: boolean - description: If true, the comment will be persisted - entry_time: - type: string - description: The timestamp from when the comment was created. - service_description: - type: string - description: The service description the comment belongs to. - is_service: - type: boolean - description: True if the comment is from a service or else it's False. - site_id: - type: string - description: The site id of the downtime. - example: production + type: + default: service_search + conditions: + $ref: '#/components/schemas/ServiceConditions' required: - - author - - comment - - entry_time - - host_name - - id - - is_service - - persistent - - site_id - CommentObject: + - conditions + - type type: object + BIStateOfHostAction: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: comment - description: The domain type of the object. - id: - type: string - description: The unique identifier for this domain-object type. - title: + type: + default: state_of_host + host_regex: + example: testhost type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: The attributes of a service/host comment. - allOf: - - $ref: '#/components/schemas/CommentAttributes' required: - - links - CommentCollection: + - host_regex + - type type: object + BIStateOfRemainingServicesAction: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: - type: string - default: all - description: The name of this collection. - domainType: - default: comment - description: The domain type of the objects in the collection. - title: + type: + default: state_of_remaining_services + host_regex: + example: testhost type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of comment objects. - items: - $ref: '#/components/schemas/CommentObject' - extensions: - type: object - description: Additional attributes alongside the collection. required: - - links - InputContactGroup: + - host_regex + - type type: object + BIStateOfServiceAction: properties: - name: + type: + default: state_of_service + host_regex: + example: testhost type: string - description: The name of the contact group. - example: OnCall - pattern: ^[-a-z0-9A-Z_\.]*\Z - alias: + service_regex: + example: testservice type: string - description: The name used for displaying in the GUI. - example: Not on Sundays. required: - - alias - - name - BulkInputContactGroup: + - host_regex + - service_regex + - type type: object + BackgroundJobStatus: properties: - entries: - type: array - description: A collection of contact group entries. + active: + description: This field indicates if the background job is active or not. + example: true + type: boolean + state: + description: This field indicates the current state of the background job. + enum: + - initialized + - running + - finished + - stopped + - exception + example: initialized + type: string + logs: + allOf: + - $ref: '#/components/schemas/JobLogs' + description: Logs related to the background job. example: - - name: OnCall - alias: Not on Sundays - uniqueItems: true - items: - $ref: '#/components/schemas/InputContactGroup' + progress: + - progress1 + result: + - result1 required: - - entries - ContactGroup: + - active + - logs + - state type: object + BaseUserAttributes: properties: - links: + fullname: + description: The alias or full name of the user. + type: string + disable_login: + description: This field indicates if the user is allowed to login to the + monitoring. + type: boolean + contact_options: + allOf: + - $ref: '#/components/schemas/ConcreteUserContactOption' + description: Contact settings for the user + idle_timeout: + allOf: + - $ref: '#/components/schemas/UserIdleOption' + description: Idle timeout for the user. Per default, the global configuration + is used. + example: + option: global + roles: + description: The list of assigned roles to the user + items: + type: string type: array - description: list of links to other resources. - example: null + authorized_sites: + description: The names of the sites that this user is authorized to handle items: - $ref: '#/components/schemas/Link' - domainType: - default: contact_group_config - description: The domain type of the object. - id: + type: string + type: array + contactgroups: + description: The contact groups that this user is a member of + items: + type: string + type: array + pager_address: + description: '' type: string - description: The unique identifier for this domain-object type. - title: + disable_notifications: + $ref: '#/components/schemas/ConcreteDisabledNotifications' + language: + description: The language used by the user in the user interface type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - type: object - description: All the attributes of the domain object. + enforce_password_change: + description: This field indicates if the user is forced to change the password + on the next login or access. + type: boolean + interface_options: + $ref: '#/components/schemas/ConcreteUserInterfaceAttributes' required: - - links - ContactGroupCollection: + - fullname type: object + BinaryExpr: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: + op: + description: The operator. type: string - default: all - description: The name of this collection. - domainType: - default: contact_group_config - description: The domain type of the objects in the collection. - title: + left: + description: The LiveStatus column name. + example: name + pattern: ([a-z]+\.)?[_a-z]+ + type: string + right: + description: The value to compare the column to. type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of contact group objects. - items: - $ref: '#/components/schemas/ContactGroup' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - BulkDeleteContactGroup: type: object + BulkCreateHost: properties: entries: + description: A list of host entries. + example: + - attributes: {} + folder: / + host_name: example.com + items: + $ref: '#/components/schemas/CreateHost' type: array + uniqueItems: true + type: object + BulkDeleteContactGroup: + properties: + entries: description: A list of contract group names. example: - windows - panels items: - type: string description: The name of the contact group config example: windows + type: string + type: array required: - entries - UpdateGroup: - type: object - properties: - alias: - type: string - description: The name used for displaying in the GUI. - example: Example Group - required: - - alias - UpdateContactGroup: type: object + BulkDeleteHost: properties: - name: - type: string - description: The name of the contact group. - example: OnCall - attributes: - $ref: '#/components/schemas/UpdateGroup' + entries: + description: A list of host names. + example: + - example + - sample + items: + description: The hostname or IP address itself. + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + type: array required: - - name - BulkUpdateContactGroup: + - entries type: object + BulkDeleteHostGroup: properties: entries: - type: array - description: A list of contact group entries. + description: A list of host group names. example: - - name: OnCall - attributes: - alias: Not on Sundays + - windows + - panels items: - $ref: '#/components/schemas/UpdateContactGroup' + description: The name of the host group config + example: windows + type: string + type: array required: - entries - CreateHostDowntime: type: object + BulkDeleteServiceGroup: properties: - start_time: - type: string - format: iso8601 - description: The start datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - end_time: - type: string - format: iso8601 - description: The end datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - recur: - type: string - default: fixed - description: 'The recurring mode of the new downtime. Available modes are: * - fixed * hour * day * week * second_week * fourth_week * - weekday_start * weekday_end * day_of_month This only works when - using the Enterprise Editions. Defaults to ''fixed''.' - enum: &id013 - - fixed - - hour - - day - - week - - second_week - - fourth_week - - weekday_start - - weekday_end - - day_of_month - example: hour - duration: - type: integer - default: 0 - description: Duration in minutes. When set, the downtime does not begin - automatically at a nominated time, but when a real problem status appears - for the host. Consequencely, the start_time/end_time is only the time - window in which the scheduled downtime can begin. - example: 60 - comment: - type: string - example: Security updates - downtime_type: - type: string - description: The type of downtime to create. - enum: &id014 - - host - - hostgroup - - host_by_query - example: host - host_name: - type: string - description: The hostname or IP address itself. - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z + entries: + description: A list of service group names. + example: + - windows + - panels + items: + description: The name of the service group config + example: windows + type: string + type: array required: - - downtime_type - - end_time - - host_name - - start_time - CreateHostGroupDowntime: + - entries type: object + BulkDiscovery: properties: - start_time: - type: string - format: iso8601 - description: The start datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - end_time: - type: string - format: iso8601 - description: The end datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - recur: - type: string - default: fixed - description: 'The recurring mode of the new downtime. Available modes are: * - fixed * hour * day * week * second_week * fourth_week * - weekday_start * weekday_end * day_of_month This only works when - using the Enterprise Editions. Defaults to ''fixed''.' - enum: *id013 - example: hour - duration: - type: integer - default: 0 - description: Duration in minutes. When set, the downtime does not begin - automatically at a nominated time, but when a real problem status appears - for the host. Consequencely, the start_time/end_time is only the time - window in which the scheduled downtime can begin. - example: 60 - comment: - type: string - example: Security updates - downtime_type: - type: string - description: The type of downtime to create. - enum: *id014 - example: host - hostgroup_name: + hostnames: + description: A list of host names + example: + - example + - sample + items: + description: The hostname or IP address itself. + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + type: array + mode: + default: new + description: "The mode of the discovery action. Can be one of:\n\n *\ + \ `new` - Add undecided services to monitoring\n * `remove` - Remove\ + \ vanished services\n * `fix_all` - Add undecided services and new\ + \ host labels, remove vanished services\n * `refresh` - Update inforomation\ + \ from host, then remove all existing and add all just found services\ + \ and host labels\n * `only_host_labels` - Update host labels\n \ + \ " + enum: + - new + - remove + - fix_all + - refresh + - only_host_labels + example: refresh type: string - description: The name of the host group. A downtime will be scheduled for - all hosts in this host group. - example: windows + do_full_scan: + default: true + description: The option whether to perform a full scan or not. + example: true + type: boolean + bulk_size: + default: 10 + description: The number of hosts to be handled at once. + example: 10 + type: integer + ignore_errors: + default: true + description: The option whether to ignore errors in single check plugins. + example: true + type: boolean required: - - downtime_type - - end_time - - hostgroup_name - - start_time - CreateHostQueryDowntime: + - hostnames type: object + BulkHostActionWithFailedHosts: properties: - start_time: - type: string - format: iso8601 - description: The start datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - end_time: - type: string - format: iso8601 - description: The end datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - recur: - type: string - default: fixed - description: 'The recurring mode of the new downtime. Available modes are: * - fixed * hour * day * week * second_week * fourth_week * - weekday_start * weekday_end * day_of_month This only works when - using the Enterprise Editions. Defaults to ''fixed''.' - enum: *id013 - example: hour - duration: + status: + description: The HTTP status code. + example: 404 type: integer - default: 0 - description: Duration in minutes. When set, the downtime does not begin - automatically at a nominated time, but when a real problem status appears - for the host. Consequencely, the start_time/end_time is only the time - window in which the scheduled downtime can begin. - example: 60 - comment: + detail: + description: Detailed information on what exactly went wrong. + example: The resource could not be found. type: string - example: Security updates - downtime_type: + title: + description: A summary of the problem. + example: Not found type: string - description: The type of downtime to create. - enum: *id014 - example: host - query: - description: An query expression of the Livestatus 'hosts' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, - {"op": "!=", "left": "state", "right": "0"}]}' + fields: + description: Detailed error messages on all fields failing validation. + type: object + ext: allOf: - - $ref: '#/components/schemas/Expr' + - $ref: '#/components/schemas/FailedHosts' + description: Details for which hosts have failed required: - - downtime_type - - end_time - - query - - start_time - CreateHostRelatedDowntime: + - detail + - status + - title type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/CreateHostDowntime' - - $ref: '#/components/schemas/CreateHostGroupDowntime' - - $ref: '#/components/schemas/CreateHostQueryDowntime' - discriminator: - propertyName: downtime_type - mapping: - host: '#/components/schemas/CreateHostDowntime' - hostgroup: '#/components/schemas/CreateHostGroupDowntime' - host_by_query: '#/components/schemas/CreateHostQueryDowntime' - CreateServiceDowntime: + BulkInputContactGroup: + properties: + entries: + description: A collection of contact group entries. + example: + - alias: Not on Sundays + name: OnCall + items: + $ref: '#/components/schemas/InputContactGroup' + type: array + uniqueItems: true type: object + BulkInputHostGroup: properties: - start_time: - type: string - format: iso8601 - description: The start datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - end_time: - type: string - format: iso8601 - description: The end datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - recur: - type: string - default: fixed - description: 'The recurring mode of the new downtime. Available modes are: * - fixed * hour * day * week * second_week * fourth_week * - weekday_start * weekday_end * day_of_month This only works when - using the Enterprise Editions. Defaults to ''fixed''.' - enum: *id013 - example: hour - duration: - type: integer - default: 0 - description: Duration in minutes. When set, the downtime does not begin - automatically at a nominated time, but when a real problem status appears - for the service. Consequencely, the start_time/end_time is only the time - window in which the scheduled downtime can begin. - example: 60 - comment: - type: string - example: Security updates - downtime_type: - type: string - description: The type of downtime to create. - enum: &id015 - - service - - servicegroup - - service_by_query - example: service - host_name: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - service_descriptions: + entries: + description: A list of host group entries. + example: + - alias: Windows Servers + name: windows + items: + $ref: '#/components/schemas/InputHostGroup' type: array - description: The service description of the service, whose problems shall - be acknowledged. + uniqueItems: true + type: object + BulkInputServiceGroup: + properties: + entries: + description: A list of service group entries. example: - - CPU utilization - - Memory + - alias: Environment Sensors + name: environment + items: + $ref: '#/components/schemas/InputServiceGroup' + type: array uniqueItems: true + type: object + BulkUpdateContactGroup: + properties: + entries: + description: A list of contact group entries. + example: + - attributes: + alias: Not on Sundays + name: OnCall items: - type: string - required: - - downtime_type - - end_time - - host_name - - service_descriptions - - start_time - CreateServiceGroupDowntime: + $ref: '#/components/schemas/UpdateContactGroup' + type: array type: object + BulkUpdateFolder: properties: - start_time: - type: string - format: iso8601 - description: The start datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - end_time: - type: string - format: iso8601 - description: The end datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - recur: - type: string - default: fixed - description: 'The recurring mode of the new downtime. Available modes are: * - fixed * hour * day * week * second_week * fourth_week * - weekday_start * weekday_end * day_of_month This only works when - using the Enterprise Editions. Defaults to ''fixed''.' - enum: *id013 - example: hour - duration: - type: integer - default: 0 - description: Duration in minutes. When set, the downtime does not begin - automatically at a nominated time, but when a real problem status appears - for the host. Consequencely, the start_time/end_time is only the time - window in which the scheduled downtime can begin. - example: 60 - comment: - type: string - example: Security updates - downtime_type: - type: string - description: The type of downtime to create. - enum: *id015 - example: service - servicegroup_name: - type: string - description: The name of the service group. Any host having a service in - this group will be A downtime will be scheduled for all hosts in this - group. - example: windows - required: - - downtime_type - - end_time - - servicegroup_name - - start_time - CreateServiceQueryDowntime: + entries: + description: A list of folder entries. + example: + - remove_attributes: + - tag_foobar + items: + $ref: '#/components/schemas/UpdateFolderEntry' + type: array + type: object + BulkUpdateHost: + properties: + entries: + description: A list of host entries. + example: + - attributes: {} + host_name: example.com + items: + $ref: '#/components/schemas/UpdateHostEntry' + type: array + type: object + BulkUpdateHostGroup: + properties: + entries: + description: A list of host group entries. + example: + - attributes: + alias: Windows Servers + name: windows + items: + $ref: '#/components/schemas/UpdateHostGroup' + type: array + type: object + BulkUpdateServiceGroup: + properties: + entries: + description: A list of service group entries. + example: + - attributes: + alias: Windows Servers + name: windows + items: + $ref: '#/components/schemas/UpdateServiceGroup' + type: array type: object + Child: properties: - start_time: - type: string - format: iso8601 - description: The start datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - end_time: - type: string - format: iso8601 - description: The end datetime of the new downtime. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - recur: - type: string - default: fixed - description: 'The recurring mode of the new downtime. Available modes are: * - fixed * hour * day * week * second_week * fourth_week * - weekday_start * weekday_end * day_of_month This only works when - using the Enterprise Editions. Defaults to ''fixed''.' - enum: *id013 - example: hour - duration: - type: integer - default: 0 - description: Duration in minutes. When set, the downtime does not begin - automatically at a nominated time, but when a real problem status appears - for the service. Consequencely, the start_time/end_time is only the time - window in which the scheduled downtime can begin. - example: 60 - comment: - type: string - example: Security updates - downtime_type: - type: string - description: The type of downtime to create. - enum: *id015 - example: service - query: - description: An query expression of the Livestatus 'services' table in nested - dictionary form. If you want to use multiple expressions, nest them with - the AND/OR operators. - example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, - {"op": "!=", "left": "state", "right": "0"}]}' - allOf: - - $ref: '#/components/schemas/Expr' + type: + default: child required: - - downtime_type - - end_time - - query - - start_time - CreateServiceRelatedDowntime: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/CreateServiceDowntime' - - $ref: '#/components/schemas/CreateServiceGroupDowntime' - - $ref: '#/components/schemas/CreateServiceQueryDowntime' - discriminator: - propertyName: downtime_type - mapping: - service: '#/components/schemas/CreateServiceDowntime' - servicegroup: '#/components/schemas/CreateServiceGroupDowntime' - service_by_query: '#/components/schemas/CreateServiceQueryDowntime' - DeleteDowntimeById: + - type type: object + ChildWith: properties: - site_id: - type: string - description: The site from which you want to delete a downtime. - example: heute - delete_type: - type: string - description: The option how to delete a downtime. - enum: &id016 - - params - - query - - by_id - example: params - downtime_id: - type: string - description: The id of the downtime - example: '54' + conditions: + $ref: '#/components/schemas/HostConditions' + host_choice: + allOf: + - $ref: '#/components/schemas/BIHostChoice' + example: + type: all_hosts required: - - delete_type - - downtime_id - - site_id - DeleteDowntimeByName: + - conditions + - host_choice type: object + ClusterCreateAttribute: properties: - site_id: + alias: + description: A comment or description of this host type: string - description: The site from which you want to delete a downtime. - example: heute - delete_type: + site: + description: The site that should monitor this host. type: string - description: The option how to delete a downtime. - enum: *id016 - example: params - host_name: + contactgroups: + allOf: + - $ref: '#/components/schemas/HostContactGroup' + description: Only members of the contact groups listed here have WATO permission + to the host / folder. If you want, you can make those contact groups automatically + also monitoring contacts. This is completely optional. Assignment + of host to contact groups can be done by rules + as well. + parents: + description: A list of parents of this host. + items: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + type: array + ipaddress: + description: An IPv4 address. type: string - description: If set alone, then all downtimes of the host will be removed. - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - service_descriptions: + ipv6address: + description: An IPv6 address. + type: string + additional_ipv4addresses: + description: A list of IPv4 addresses. + items: + type: string type: array - description: If set, the downtimes of the listed services of the specified - host will be removed. If a service has multiple downtimes then all will - be removed - example: - - CPU load - - Memory + additional_ipv6addresses: + description: A list of IPv6 addresses. items: type: string - example: CPU utilization - required: - - delete_type - - host_name - - site_id - DeleteDowntimeByQuery: - type: object - properties: - site_id: + type: array + snmp_community: + allOf: + - $ref: '#/components/schemas/SNMPCredentials' + description: The SNMP access configuration. A configured SNMP v1/v2 community + here will have precedence over any configured SNMP community rule. For + this attribute to take effect, the attribute `tag_snmp_ds` needs to be + set first. + labels: + additionalProperties: + description: The host label value + type: string + description: With the help of labels you can flexibly group your hosts in + order to refer to them later at other places in Check_MK, e.g. in rule + chains. A label always consists of a combination of key and value in the + format "key:value". A host can only have one value per key. Check_MK will + not perform any validation on the labels you use. + type: object + network_scan: + allOf: + - $ref: '#/components/schemas/NetworkScan' + description: Configuration for automatic network scan. Pings will besent + to each IP address in the configured ranges to checkif a host is up or + down. Each found host will be added tothe folder by it's hostname (if + possible) or IP address. + management_protocol: + description: "The protocol used to connect to the management board.\n\n\ + Valid options are:\n\n * `none` - No management board\n * `snmp` - Connect\ + \ using SNMP\n * `ipmi` - Connect using IPMI\n" + enum: + - none + - snmp + - ipmi type: string - description: The site from which you want to delete a downtime. - example: heute - delete_type: + management_address: + description: Address (IPv4, IPv6 or hostname) under which the management + board can be reached. type: string - description: The option how to delete a downtime. - enum: *id016 - example: params - query: - description: An query expression of the Livestatus 'downtimes' table in - nested dictionary form. If you want to use multiple expressions, nest - them with the AND/OR operators. - example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, - {"op": "!=", "left": "state", "right": "0"}]}' + management_snmp_community: allOf: - - $ref: '#/components/schemas/Expr' - required: - - delete_type - - query - - site_id - DeleteDowntime: + - $ref: '#/components/schemas/SNMPCredentials' + description: SNMP credentials + nullable: true + management_ipmi_credentials: + allOf: + - $ref: '#/components/schemas/IPMIParameters' + description: IPMI credentials + locked_by: + allOf: + - $ref: '#/components/schemas/LockedBy' + description: Identity of the entity which locked the locked_attributes. + The identity is built out of the Site ID, the program name and the connection + ID. + locked_attributes: + description: Name of host attributes which are locked in the UI. + items: + type: string + type: array + inventory_failed: + description: Whether or not the last bulk discovery failed. It is set to + True once it fails and unset in case a later discovery succeeds. + example: false + type: boolean + tag_criticality: + description: "Choices:\n\n * `\"prod\"`: Productive system\n\n * `\"critical\"\ + `: Business critical\n\n * `\"test\"`: Test system\n\n * `\"offline\"\ + `: Do not monitor this host" + enum: + - prod + - critical + - test + - offline + type: string + tag_networking: + description: "Choices:\n\n * `\"lan\"`: Local network (low latency)\n\n\ + \ * `\"wan\"`: WAN (high latency)\n\n * `\"dmz\"`: DMZ (low latency, secure\ + \ access)" + enum: + - lan + - wan + - dmz + type: string + tag_agent: + description: "Choices:\n\n * `\"cmk-agent\"`: API integrations if configured,\ + \ else Checkmk agent\n\n * `\"all-agents\"`: Configured API integrations\ + \ and Checkmk agent\n\n * `\"special-agents\"`: Configured API integrations,\ + \ no Checkmk agent\n\n * `\"no-agent\"`: No API integrations, no Checkmk\ + \ agent" + enum: + - cmk-agent + - all-agents + - special-agents + - no-agent + type: string + tag_piggyback: + description: "By default every host has the piggyback data source Use\ + \ piggyback data from other hosts if present. In this case the Check_MK\ + \ service of this host processes the piggyback data but does not warn\ + \ if no piggyback data is available. The related discovered services would\ + \ become stale. If a host has configured Always use and expect piggyback\ + \ data for the piggyback data source then this host expects piggyback\ + \ data and the Check_MK service of this host warns if no piggyback\ + \ data is available. In the last case, ie. Never use piggyback data,\ + \ the Check_MK service does not process piggyback data at all\ + \ and ignores it if available.\n\nChoices:\n\n * `\"auto-piggyback\"`:\ + \ Use piggyback data from other hosts if present\n\n * `\"piggyback\"\ + `: Always use and expect piggyback data\n\n * `\"no-piggyback\"`: Never\ + \ use piggyback data" + enum: + - auto-piggyback + - piggyback + - no-piggyback + type: string + tag_snmp_ds: + description: "Choices:\n\n * `\"no-snmp\"`: No SNMP\n\n * `\"snmp-v2\"`:\ + \ SNMP v2 or v3\n\n * `\"snmp-v1\"`: SNMP v1" + enum: + - no-snmp + - snmp-v2 + - snmp-v1 + type: string + tag_address_family: + description: "Choices:\n\n * `\"ip-v4-only\"`: IPv4 only\n\n * `\"ip-v6-only\"\ + `: IPv6 only\n\n * `\"ip-v4v6\"`: IPv4/IPv6 dual-stack\n\n * `\"no-ip\"\ + `: No IP" + enum: + - ip-v4-only + - ip-v6-only + - ip-v4v6 + - no-ip + type: string type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/DeleteDowntimeById' - - $ref: '#/components/schemas/DeleteDowntimeByName' - - $ref: '#/components/schemas/DeleteDowntimeByQuery' + CollectionItem: discriminator: - propertyName: delete_type mapping: - by_id: '#/components/schemas/DeleteDowntimeById' - params: '#/components/schemas/DeleteDowntimeByName' - query: '#/components/schemas/DeleteDowntimeByQuery' - DowntimeAttributes: + link: '#/components/schemas/Link' + propertyName: domainType + oneOf: + - $ref: '#/components/schemas/Link' + properties: {} type: object + ConcreteDisabledNotifications: properties: - site_id: - type: string - description: The site id of the downtime. - example: heute - host_name: - type: string - description: The host name. - example: cmk.abc.ch - pattern: ^[-0-9a-zA-Z_.]+\Z - author: - type: string - description: The author of the downtime. - example: Mr Bojangles - is_service: - type: string - description: yes, if this entry is for a service, no if it is for a host. - example: 'yes' - start_time: - type: string - format: date-time - description: The start time of the downtime. - example: '2023-08-04T08:58:01+00:00' - end_time: - type: string - format: date-time - description: The end time of the downtime. - example: '2023-08-04T09:18:01+00:00' - recurring: - type: string - description: yes if the downtime is recurring, no if it is not. - example: 'yes' - comment: - type: string - description: A comment text. - example: Down for update - required: - - author - - comment - - end_time - - host_name - - is_service - - recurring - - site_id - - start_time - DowntimeObject: + disable: + description: Option if all notifications should be temporarily disabled + type: boolean + timerange: + allOf: + - $ref: '#/components/schemas/DateTimeRange' + description: A custom timerange during which notifications are disabled type: object + ConcreteHostTagGroup: properties: links: - type: array description: list of links to other resources. example: null items: $ref: '#/components/schemas/Link' + type: array domainType: - default: downtime + default: host_tag_group description: The domain type of the object. id: - type: string description: The unique identifier for this domain-object type. - title: type: string + title: description: A human readable title of this object. Can be used for user interfaces. + type: string members: - type: object description: The container for external resources, like linked foreign objects or actions. + type: object extensions: - description: The attributes of a downtime. allOf: - - $ref: '#/components/schemas/DowntimeAttributes' + - $ref: '#/components/schemas/HostTagExtensions' + description: Additional fields for objects of this type. required: + - domainType - links - DowntimeCollection: type: object + ConcreteTimePeriod: properties: - links: + alias: + description: The alias of the time period + example: alias + type: string + active_time_ranges: + description: The days for which time ranges were specified + example: + day: all + time_ranges: + - end: '14:00' + start: '12:00' + items: + $ref: '#/components/schemas/ConcreteTimeRangeActive' type: array - description: list of links to other resources. - example: null + exceptions: + description: Specific day exclusions with their list of time ranges + example: + - date: '2020-01-01' + time_ranges: + - end: '18:00' + start: '14:00' items: - $ref: '#/components/schemas/Link' - id: - type: string - default: all - description: The name of this collection. - domainType: - default: downtime - description: The domain type of the objects in the collection. - title: - type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: + $ref: '#/components/schemas/ConcreteTimePeriodException' type: array - description: A list of downtime objects. + exclude: + description: The collection of time period aliases whose periods are excluded items: - $ref: '#/components/schemas/DowntimeObject' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - FilterById: + description: Name of excluding time period + example: holidays + type: string + type: array type: object + ConcreteTimePeriodException: properties: - site_id: - type: string - description: An existing site id - example: heute - filter_type: + date: + description: The date of the time period exception.8601 profile + example: '2020-01-01' + format: date type: string - description: The way you would like to filter events. - enum: &id017 - - by_id - - query - - params - example: by_id - event_id: - type: integer - description: The event console ID - example: 1 - required: - - event_id - - filter_type - - site_id - FilterByQuery: + time_ranges: + example: '[{''start'': ''14:00'', ''end'': ''18:00''}]' + items: + $ref: '#/components/schemas/ConcreteTimeRange' + type: array type: object + ConcreteTimeRange: properties: - site_id: + start: + description: The hour of the time period. + example: '14:00' + format: time type: string - description: An existing site id - example: heute - filter_type: + end: + description: The hour of the time period. + example: '14:00' + format: time type: string - description: The way you would like to filter events. - enum: *id017 - example: by_id - query: - description: An query expression of the Livestatus 'eventconsoleevents' - table in nested dictionary form. If you want to use multiple expressions, - nest them with the AND/OR operators. - example: '{"op": "=", "left": "eventconsoleevents.event_host", "right": - "test_host"}' - allOf: - - $ref: '#/components/schemas/Expr' - required: - - filter_type - - query - - site_id - FilterParams: type: object + ConcreteTimeRangeActive: properties: - state: - type: string - description: The state - enum: - - ok - - warning - - critical - - unknown - example: ok - host: - type: string - description: The host name. No exception is raised when the specified host - name does not exist - example: host_1 - pattern: ^[-0-9a-zA-Z_.]+\Z - phase: + day: + description: The day for which the time ranges are specified + pattern: monday|tuesday|wednesday|thursday|friday|saturday|sunday type: string - description: The event phase, open or ack - enum: - - open - - ack - example: open - application: - type: string - description: Show events that originated from this app. - example: app_1 - FilterByParams: + time_ranges: + items: + $ref: '#/components/schemas/ConcreteTimeRange' + type: array type: object + ConcreteUserContactOption: properties: - site_id: - type: string - description: An existing site id - example: heute - filter_type: + email: + description: The mail address of the user. + example: user@example.com type: string - description: The way you would like to filter events. - enum: *id017 - example: by_id - filters: - $ref: '#/components/schemas/FilterParams' + fallback_contact: + description: In case none of the notification rules handle a certain event + a notification will be sent to the specified email + type: boolean required: - - filter_type - - filters - - site_id - DeleteECEvents: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/FilterById' - - $ref: '#/components/schemas/FilterByQuery' - - $ref: '#/components/schemas/FilterByParams' - discriminator: - propertyName: filter_type - mapping: - by_id: '#/components/schemas/FilterById' - query: '#/components/schemas/FilterByQuery' - params: '#/components/schemas/FilterByParams' - ChangeEventState: + - email type: object + ConcreteUserInterfaceAttributes: properties: - site_id: - type: string - description: An existing site id - example: heute - new_state: - type: string - description: The state + interface_theme: + description: The theme of the interface enum: - - ok - - warning - - critical - - unknown - example: ok - required: - - new_state - - site_id - ChangeStateWithQuery: - type: object - properties: - filter_type: - type: string - description: The way you would like to filter events. - enum: &id018 - - query - - params - example: params - site_id: - type: string - description: An existing site id - example: heute - new_state: - type: string - description: The state - enum: &id019 - - ok - - warning - - critical - - unknown - example: ok - query: - description: An query expression of the Livestatus 'eventconsoleevents' - table in nested dictionary form. If you want to use multiple expressions, - nest them with the AND/OR operators. - example: '{"op": "=", "left": "eventconsoleevents.event_host", "right": - "test_host"}' - allOf: - - $ref: '#/components/schemas/Expr' - required: - - filter_type - - new_state - - query - ChangeStateWithParams: - type: object - properties: - filter_type: - type: string - description: The way you would like to filter events. - enum: *id018 - example: params - site_id: - type: string - description: An existing site id - example: heute - new_state: - type: string - description: The state - enum: *id019 - example: ok - filters: - $ref: '#/components/schemas/FilterParams' - required: - - filter_type - - filters - - new_state - ChangeEventStateSelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/ChangeStateWithQuery' - - $ref: '#/components/schemas/ChangeStateWithParams' - discriminator: - propertyName: filter_type - mapping: - query: '#/components/schemas/ChangeStateWithQuery' - params: '#/components/schemas/ChangeStateWithParams' - ECEventAttributes: - type: object - properties: - site_id: - type: string - description: The site id of the EC event. - example: heute - state: + - default + - dark + - light + example: default type: string - description: The state + sidebar_position: + description: The position of the sidebar enum: - - ok - - warning - - critical - - unknown - example: ok - service_level: + - left + - right + example: right type: string - description: The service level for this event. + navigation_bar_icons: + description: This option decides if icons in the navigation bar should show/hide + the respective titles enum: - - no_service_level - - silver - - gold - - platinum - example: gold - host: - type: string - description: The host name. No exception is raised when the specified host - name does not exist - example: host_1 - pattern: ^[-0-9a-zA-Z_.]+\Z - rule_id: - type: string - description: The ID of the rule. - example: rule_1 - application: - type: string - description: The syslog tag/application this event originated from. - example: app_1 - comment: - type: string - description: The event comment. - example: Example comment - contact: - type: string - description: The event contact information. - example: Mr Monitor - ipaddress: - type: string - description: The IP address where the event originated. - example: 127.0.0.1 - facility: + - hide + - show + example: hide type: string - description: The syslog facility. - enum: - - kern - - user - - mail - - daemon - - auth - - syslog - - lpr - - news - - uucp - - cron - - authpriv - - ftp - - ntp - - logaudit - - logalert - - clock - - local0 - - local1 - - local2 - - local3 - - local4 - - local5 - - local6 - - local7 - - logfile - - snmptrap - example: kern - priority: - type: string - description: The syslog priority. - enum: - - emerg - - alert - - crit - - err - - warning - - notice - - info - - debug - example: warning - phase: - type: string - description: The event phase, open or ack + mega_menu_icons: + description: This option decides if colored icon should be shown foe every + entry in the mega menus or alternatively only for the headlines (the 'topics') enum: - - open - - ack - example: open - last: - type: string - format: date-time - example: '2017-11-09T17:32:28Z' - first: + - topic + - entry + example: topic type: string - format: date-time - example: '2022-11-09T16:12:12Z' - count: - type: integer - description: The number of occurrences of this event within a period. - example: 1 - text: + show_mode: + description: This option decides what show mode should be used for unvisited + menus. Alternatively, this option can also be used to enforce show more + removing the three dots for all menus. + enum: + - default + - default_show_less + - default_show_more + - enforce_show_more + example: default type: string - description: The event message text - example: Sample message text - required: - - application - - comment - - contact - - count - - facility - - first - - host - - ipaddress - - last - - phase - - priority - - rule_id - - service_level - - site_id - - state - - text - ECEventResponse: type: object + ContactGroup: properties: links: - type: array description: list of links to other resources. example: null items: $ref: '#/components/schemas/Link' + type: array domainType: - default: event_console + default: contact_group description: The domain type of the object. id: - type: string description: The unique identifier for this domain-object type. - title: type: string + title: description: A human readable title of this object. Can be used for user interfaces. + type: string members: - type: object description: The container for external resources, like linked foreign objects or actions. + type: object extensions: - description: The configuration attributes of a site. - example: - state: okay - service_level: gold - host: host_1 - rule_id: rule_1 - application: app_1 - comment: example_comment - contact: Mr Monitor - ipaddress: 127.0.0.1 - facility: kern - priority: warning - phase: open - last: Oct 21 2022 09:11:12 - first: Oct 26 2022 07:51:25 - count: 1 - text: Sample message text. - allOf: - - $ref: '#/components/schemas/ECEventAttributes' + description: All the attributes of the domain object. + type: object required: + - domainType - links - EventConsoleResponseCollection: type: object + CreateClusterHost: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: + folder: + description: 'The path name of the folder. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most + appropriate for your quoting/escaping needs. A good default choice is + `~`.' + example: / + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - default: all - description: The name of this collection. - domainType: - default: event_console - description: The domain type of the objects in the collection. - title: + host_name: + description: The hostname of the cluster host. + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of site configuration objects. + attributes: + anyOf: + - $ref: '#/components/schemas/ClusterCreateAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Attributes to set on the newly created host. + example: + ipaddress: 192.168.0.123 + nodes: + description: Nodes where the newly created host should be the cluster-container + of. example: - - links: [] - domainType: event_console - id: '1' - title: Sample message text - members: {} - extensions: - state: okay - service_level: gold - host: host_1 - rule_id: rule_1 - application: app_1 - comment: example_comment - contact: Mr Monitor - ipaddress: 127.0.0.1 - facility: kern - priority: warning - phase: open - last: Oct 21 2022 09:11:12 - first: Oct 26 2022 07:51:25 - count: 1 - text: Sample message text + - host1 + - host2 + - host3 items: - $ref: '#/components/schemas/ECEventResponse' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - UpdateAndAcknowledeEventSiteIDRequired: - type: object - properties: - phase: - type: string - default: ack - description: To change the phase of an event - enum: &id020 - - ack - - open - example: ack - change_comment: - type: string - description: Event comment. - example: Comment now acked - change_contact: - type: string - description: Contact information. - example: Mr Monitor - site_id: - type: string - description: An existing site id - example: heute + description: The hostname or IP address itself. + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + type: array required: - - site_id - UpdateAndAcknowledgeWithQuery: + - folder + - host_name + - nodes type: object + CreateFolder: properties: - phase: - type: string - default: ack - description: To change the phase of an event - enum: *id020 - example: ack - change_comment: - type: string - description: Event comment. - example: Comment now acked - change_contact: + name: + description: The filesystem directory name (not path!) of the folder. No + slashes are allowed. + example: production + pattern: '[^/]+' type: string - description: Contact information. - example: Mr Monitor - filter_type: + title: + description: The folder title as displayed in the user interface. + example: Production Hosts type: string - description: The way you would like to filter events. - enum: &id021 - - query - - params - - all - example: all - site_id: + parent: + description: 'The folder in which the new folder shall be placed in. The + root-folder is specified by ''/''. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most + appropriate for your quoting/escaping needs. A good default choice is + `~`.' + example: / + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - description: An existing site id - example: heute - query: - description: An query expression of the Livestatus 'eventconsoleevents' - table in nested dictionary form. If you want to use multiple expressions, - nest them with the AND/OR operators. - example: '{"op": "=", "left": "eventconsoleevents.event_host", "right": - "test_host"}' - allOf: - - $ref: '#/components/schemas/Expr' + attributes: + anyOf: + - $ref: '#/components/schemas/FolderCreateAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Specific attributes to apply for all hosts in this folder (among + other things). + example: + tag_criticality: prod required: - - filter_type - - query - FilterParamsUpdateAndAcknowledge: - type: object - properties: - state: - type: string - description: The state - enum: - - ok - - warning - - critical - - unknown - example: ok - host: - type: string - description: The host name. No exception is raised when the specified host - name does not exist - example: host_1 - pattern: ^[-0-9a-zA-Z_.]+\Z - application: - type: string - description: Show events that originated from this app. - example: app_1 - UpdateAndAcknowledgeWithParams: + - name + - parent + - title type: object + CreateHost: properties: - phase: - type: string - default: ack - description: To change the phase of an event - enum: *id020 - example: ack - change_comment: - type: string - description: Event comment. - example: Comment now acked - change_contact: - type: string - description: Contact information. - example: Mr Monitor - filter_type: + folder: + description: 'The path name of the folder. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most + appropriate for your quoting/escaping needs. A good default choice is + `~`.' + example: / + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - description: The way you would like to filter events. - enum: *id021 - example: all - site_id: + host_name: + description: The hostname or IP address of the host to be created. + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: An existing site id - example: heute - filters: - $ref: '#/components/schemas/FilterParamsUpdateAndAcknowledge' + attributes: + anyOf: + - $ref: '#/components/schemas/HostCreateAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Attributes to set on the newly created host. + example: + ipaddress: 192.168.0.123 required: - - filter_type - - filters - UpdateAndAcknowledgeFilter: + - folder + - host_name type: object + CreateHostDowntime: properties: - phase: - type: string - default: ack - description: To change the phase of an event - enum: *id020 - example: ack - change_comment: - type: string - description: Event comment. - example: Comment now acked - change_contact: - type: string - description: Contact information. - example: Mr Monitor - filter_type: - type: string - description: The way you would like to filter events. - enum: *id021 - example: all - site_id: + start_time: + description: The start datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - description: An existing site id - example: heute - required: - - filter_type - UpdateAndAcknowledgeSelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/UpdateAndAcknowledgeWithQuery' - - $ref: '#/components/schemas/UpdateAndAcknowledgeWithParams' - - $ref: '#/components/schemas/UpdateAndAcknowledgeFilter' - discriminator: - propertyName: filter_type - mapping: - query: '#/components/schemas/UpdateAndAcknowledgeWithQuery' - params: '#/components/schemas/UpdateAndAcknowledgeWithParams' - all: '#/components/schemas/UpdateAndAcknowledgeFilter' - HostContactGroup: - type: object - properties: - groups: - type: array - description: A list of contact groups. - items: - type: string - example: all - use: - type: boolean - default: false - description: Add these contact groups to the host. - use_for_services: - type: boolean - default: false - description:

Always add host contact groups also to its services.

With - this option contact groups that are added to hosts are always being added - to services, as well. This only makes a difference if you have assigned - other contact groups to services via rules in Host & Service Parameters. - As long as you do not have any such rule a service always inherits all - contact groups from its host. - recurse_use: - type: boolean - default: false - description: Add these groups as contacts to all hosts in all sub-folders - of this folder. - recurse_perms: - type: boolean - default: false - description: Give these groups also permission on all sub-folders. - required: - - groups - SNMPCommunity: - type: object - properties: - type: - default: v1_v2_community - community: + end_time: + description: The end datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - description: SNMP community (SNMP Versions 1 and 2c) - required: - - community - SNMPv3NoAuthNoPrivacy: - type: object - properties: - type: - default: noAuthNoPriv - description: The type of credentials to use. - security_name: + recur: + default: fixed + description: 'The recurring mode of the new downtime. Available modes are: * + fixed * hour * day * week * second_week * fourth_week * + weekday_start * weekday_end * day_of_month This only works when + using the Enterprise Editions. Defaults to ''fixed''.' + enum: &id006 + - fixed + - hour + - day + - week + - second_week + - fourth_week + - weekday_start + - weekday_end + - day_of_month + example: hour type: string - description: Security name - required: - - security_name - SNMPv3AuthNoPrivacy: - type: object - properties: - type: - default: authNoPriv - description: The type of credentials to use. - auth_protocol: + duration: + default: 0 + description: Duration in seconds. When set, the downtime does not begin + automatically at a nominated time, but when a real problem status appears + for the host. Consequencely, the start_time/end_time is only the time + window in which the scheduled downtime can begin. + example: 3600 + type: integer + comment: + example: Security updates type: string - description: Authentication protocol. - enum: - - MD5-96 - - SHA-1-96 - - SHA-2-224 - - SHA-2-256 - - SHA-2-384 - - SHA-2-512 - security_name: + downtime_type: + description: The type of downtime to create. + enum: &id007 + - host + - hostgroup + - host_by_query + example: host type: string - description: Security name - auth_password: + host_name: + description: The hostname or IP address itself. + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: Authentication pass phrase. - minLength: 8 required: - - auth_password - - auth_protocol - - security_name - SNMPv3AuthPrivacy: + - downtime_type + - end_time + - host_name + - start_time type: object + CreateHostGroupDowntime: properties: - type: - default: authPriv - description: SNMPv3 with authentication and privacy. - auth_protocol: + start_time: + description: The start datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - description: Authentication protocol. - enum: - - MD5-96 - - SHA-1-96 - - SHA-2-224 - - SHA-2-256 - - SHA-2-384 - - SHA-2-512 - security_name: + end_time: + description: The end datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - description: Security name - auth_password: + recur: + default: fixed + description: 'The recurring mode of the new downtime. Available modes are: * + fixed * hour * day * week * second_week * fourth_week * + weekday_start * weekday_end * day_of_month This only works when + using the Enterprise Editions. Defaults to ''fixed''.' + enum: *id006 + example: hour type: string - description: Authentication pass phrase. - minLength: 8 - privacy_protocol: + duration: + default: 0 + description: Duration in seconds. When set, the downtime does not begin + automatically at a nominated time, but when a real problem status appears + for the host. Consequencely, the start_time/end_time is only the time + window in which the scheduled downtime can begin. + example: 3600 + type: integer + comment: + example: Security updates type: string - description: The privacy protocol. The only supported values in the Raw - Edition are CBC-DES and AES-128. If selected, privacy_password needs to - be supplied as well. - enum: - - CBC-DES - - AES-128 - - 3DES-EDE - - AES-192 - - AES-256 - - AES-192-Blumenthal - - AES-256-Blumenthal - privacy_password: + downtime_type: + description: The type of downtime to create. + enum: *id007 + example: host + type: string + hostgroup_name: + description: The name of the host group. A downtime will be scheduled for + all hosts in this host group. + example: windows type: string - description: Privacy pass phrase. If filled, privacy_protocol needs to be - selected as well. - minLength: 8 required: - - auth_password - - auth_protocol - - privacy_password - - privacy_protocol - - security_name - SNMPCredentials: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/SNMPCommunity' - - $ref: '#/components/schemas/SNMPv3NoAuthNoPrivacy' - - $ref: '#/components/schemas/SNMPv3AuthNoPrivacy' - - $ref: '#/components/schemas/SNMPv3AuthPrivacy' - discriminator: - propertyName: type - mapping: - v1_v2_community: '#/components/schemas/SNMPCommunity' - v3_no_auth_no_privacy: '#/components/schemas/SNMPv3NoAuthNoPrivacy' - v3_auth_no_privacy: '#/components/schemas/SNMPv3AuthNoPrivacy' - v3_auth_privacy: '#/components/schemas/SNMPv3AuthPrivacy' - IPAddressRange: + - downtime_type + - end_time + - hostgroup_name + - start_time type: object + CreateHostQueryDowntime: properties: - type: - default: ip_range - description: A range of addresses. - from_address: + start_time: + description: The start datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - description: The first IPv4 address of this range. - to_address: + end_time: + description: The end datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - description: The last IPv4 address of this range. - IPNetwork: - type: object - properties: - type: - default: ip_network - description: A single IPv4 network in CIDR notation. - network: + recur: + default: fixed + description: 'The recurring mode of the new downtime. Available modes are: * + fixed * hour * day * week * second_week * fourth_week * + weekday_start * weekday_end * day_of_month This only works when + using the Enterprise Editions. Defaults to ''fixed''.' + enum: *id006 + example: hour type: string - description: "A IPv4 network in CIDR notation. Minimum prefix length is\ - \ 8 bit, maximum prefix length is 30 bit.\n\nValid examples:\n\n * `192.168.0.0/24`\n\ - \ * `192.168.0.0/255.255.255.0`" - IPAddresses: - type: object - properties: - type: - default: ip_list - description: A list of single IPv4 addresses. - addresses: - type: array - items: - type: string - IPRegexp: - type: object - properties: - type: - default: ip_regex_list - description: IPv4 addresses which match a regexp pattern - regexp_list: - type: array - description: A list of regular expressions which are matched against the - found IP addresses. The matches will be excluded from the result. - items: - type: string - IPRangeWithRegexp: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/IPAddressRange' - - $ref: '#/components/schemas/IPNetwork' - - $ref: '#/components/schemas/IPAddresses' - - $ref: '#/components/schemas/IPRegexp' - discriminator: - propertyName: type - mapping: - address_range: '#/components/schemas/IPAddressRange' - network_range: '#/components/schemas/IPNetwork' - explicit_addresses: '#/components/schemas/IPAddresses' - exclude_by_regexp: '#/components/schemas/IPRegexp' - TimeAllowedRange: - type: object - properties: - start: + duration: + default: 0 + description: Duration in seconds. When set, the downtime does not begin + automatically at a nominated time, but when a real problem status appears + for the host. Consequencely, the start_time/end_time is only the time + window in which the scheduled downtime can begin. + example: 3600 + type: integer + comment: + example: Security updates type: string - description: The start time of day. Inclusive. Use ISO8601 format. Seconds - are stripped. - pattern: ^\d\d\:\d\d\(:\d\d)?$ - end: + downtime_type: + description: The type of downtime to create. + enum: *id007 + example: host type: string - description: The end time of day. Inclusive. Use ISO8601 format. Seconds - are stripped. - pattern: ^\d\d\:\d\d\(:\d\d)?$ + query: + allOf: + - $ref: '#/components/schemas/Expr' + description: An query expression of the Livestatus 'hosts' table in nested + dictionary form. If you want to use multiple expressions, nest them with + the AND/OR operators. + example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, + {"op": "!=", "left": "state", "right": "0"}]}' required: - - end - - start - RegexpRewrites: + - downtime_type + - end_time + - query + - start_time type: object - properties: - search: - type: string - description: "The search regexp. May contain match-groups, conditional matches,\ - \ etc. This follows the Python regular expression syntax.\n\nFor details\ - \ see:\n\n * https://docs.python.org/3/library/re.html" - maxLength: 30 - replace_with: - type: string - description: The replacement string. Match-groups can only be identified - by `\1`, `\2`, etc. Highest supported match group is `\99`. Named lookups - are not supported. - maxLength: 30 - required: - - replace_with - - search - DirectMapping: + CreateHostRelatedDowntime: + discriminator: + mapping: + host: '#/components/schemas/CreateHostDowntime' + host_by_query: '#/components/schemas/CreateHostQueryDowntime' + hostgroup: '#/components/schemas/CreateHostGroupDowntime' + propertyName: downtime_type + oneOf: + - $ref: '#/components/schemas/CreateHostDowntime' + - $ref: '#/components/schemas/CreateHostGroupDowntime' + - $ref: '#/components/schemas/CreateHostQueryDowntime' + properties: {} type: object + CreateServiceDowntime: properties: - hostname: + start_time: + description: The start datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - description: The hostname to be replaced. - replace_with: + end_time: + description: The end datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - description: The replacement string. - required: - - hostname - - replace_with - TranslateNames: - type: object - properties: - convert_case: + recur: + default: fixed + description: 'The recurring mode of the new downtime. Available modes are: * + fixed * hour * day * week * second_week * fourth_week * + weekday_start * weekday_end * day_of_month This only works when + using the Enterprise Editions. Defaults to ''fixed''.' + enum: *id006 + example: hour type: string - default: nop - description: "Convert all detected hostnames to upper- or lower-case.\n\n\ - \ * `nop` - Do not convert anything\n * `lower` - Convert all hostnames\ - \ to lowercase.\n * `upper` - Convert all hostnames to uppercase." - enum: - - nop - - lower - - upper - drop_domain: - type: boolean - description: "Drop the rest of the domain, only keep the hostname. Will\ - \ not affect IP addresses.\n\nExamples:\n\n * `192.168.0.1` -> `192.168.0.1`\n\ - \ * `foobar.example.com` -> `foobar`\n * `example.com` -> `example`\n\ - \ * `example` -> `example`\n\nThis will be executed **after**:\n\n * `convert_case`\n" - regexp_rewrites: - type: array - description: "Rewrite discovered hostnames with multiple regular expressions.\ - \ The replacements will be done one after another in the order they appear\ - \ in the list. If not anchored at the end by a `$` character, the regexpwill\ - \ be anchored at the end implicitly by adding a `$` character.\n\nThese\ - \ will be executed **after**:\n\n * `convert_case`\n * `drop_domain`\n" - items: - $ref: '#/components/schemas/RegexpRewrites' - hostname_replacement: - type: array - description: "Replace one value with another.\n\nThese will be executed\ - \ **after**:\n\n * `convert_case`\n * `drop_domain`\n * `regexp_rewrites`\n" - items: - $ref: '#/components/schemas/DirectMapping' - NetworkScan: - type: object - properties: - addresses: - type: array - description: IPv4 addresses to include. - items: - $ref: '#/components/schemas/IPRangeWithRegexp' - exclude_addresses: - type: array - description: IPv4 addresses to exclude. - items: - $ref: '#/components/schemas/IPRangeWithRegexp' - scan_interval: - type: integer - default: 86400 - description: Scan interval in seconds. Default is 1 day, minimum is 1 hour. - minimum: 3600 - time_allowed: - type: array - description: Only execute the discovery during this time range each day.. - items: - $ref: '#/components/schemas/TimeAllowedRange' - set_ip_address: - type: boolean - default: true - description: When set, the found IPv4 address is set on the discovered host. - max_parallel_pings: + duration: + default: 0 + description: Duration in seconds. When set, the downtime does not begin + automatically at a nominated time, but when a real problem status appears + for the service. Consequencely, the start_time/end_time is only the time + window in which the scheduled downtime can begin. + example: 3600 type: integer - default: 100 - description: Set the maximum number of concurrent pings sent to target IP - addresses. - maximum: 200 - minimum: 1 - run_as: + comment: + example: Security updates type: string - description: Execute the network scan in the Checkmk user context of the - chosen user. This user needs the permission to add new hosts to this folder. - tag_criticality: + downtime_type: + description: The type of downtime to create. + enum: &id008 + - service + - servicegroup + - service_by_query + example: service type: string - description: Specify which criticality tag to set on the host created by - the network scan. This field is required if the criticality tag group - exists, otherwise it as to be omitted. - translate_names: - $ref: '#/components/schemas/TranslateNames' + host_name: + description: The hostname or IP address itself. + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + service_descriptions: + description: The service description of the service, whose problems shall + be acknowledged. + example: + - CPU utilization + - Memory + items: + type: string + type: array + uniqueItems: true required: - - addresses - - time_allowed - IPMIParameters: + - downtime_type + - end_time + - host_name + - service_descriptions + - start_time type: object + CreateServiceGroupDowntime: properties: - username: + start_time: + description: The start datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - password: + end_time: + description: The end datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - required: - - password - - username - FolderUpdateAttribute: - type: object - properties: - site: + recur: + default: fixed + description: 'The recurring mode of the new downtime. Available modes are: * + fixed * hour * day * week * second_week * fourth_week * + weekday_start * weekday_end * day_of_month This only works when + using the Enterprise Editions. Defaults to ''fixed''.' + enum: *id006 + example: hour type: string - description: The site that should monitor this host. - contactgroups: - description: Only members of the contact groups listed here have Setup permission - for the host/folder. Optionally, you can make these contact groups automatically - monitor contacts. The assignment of hosts to contact groups can also be - defined by rules. - allOf: - - $ref: '#/components/schemas/HostContactGroup' - parents: - type: array - description: A list of parents of this host. - items: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - snmp_community: - description: The SNMP access configuration. A configured SNMP v1/v2 community - here will have precedence over any configured SNMP community rule. For - this attribute to take effect, the attribute `tag_snmp_ds` needs to be - set first. - allOf: - - $ref: '#/components/schemas/SNMPCredentials' - labels: - type: object - description: Labels allow you to flexibly group your hosts in order to refer - to them later at other places in Checkmk, e.g. in rule chains.
Label - format: key:value

Checkmk does not perform any validation - on the labels you use. - additionalProperties: - type: string - description: The host label value - network_scan: - description: Configuration for automatic network scan. Pings will besent - to each IP address in the configured ranges to checkif a host is up or - down. Each found host will be added tothe folder by it's hostname (if - possible) or IP address. - allOf: - - $ref: '#/components/schemas/NetworkScan' - management_protocol: + duration: + default: 0 + description: Duration in seconds. When set, the downtime does not begin + automatically at a nominated time, but when a real problem status appears + for the host. Consequencely, the start_time/end_time is only the time + window in which the scheduled downtime can begin. + example: 3600 + type: integer + comment: + example: Security updates type: string - description: "The protocol used to connect to the management board.\n\n\ - Valid options are:\n\n * `none` - No management board\n * `snmp` - Connect\ - \ using SNMP\n * `ipmi` - Connect using IPMI\n" - enum: - - none - - snmp - - ipmi - management_snmp_community: - nullable: true - description: SNMP credentials - allOf: - - $ref: '#/components/schemas/SNMPCredentials' - management_ipmi_credentials: - description: IPMI credentials - allOf: - - $ref: '#/components/schemas/IPMIParameters' - tag_criticality: + downtime_type: + description: The type of downtime to create. + enum: *id008 + example: service type: string - description: "Choices:\n\n * `\"prod\"`: Productive system\n\n * `\"critical\"\ - `: Business critical\n\n * `\"test\"`: Test system\n\n * `\"offline\"\ - `: Do not monitor this host" - enum: - - prod - - critical - - test - - offline - tag_networking: + servicegroup_name: + description: The name of the service group. Any host having a service in + this group will be A downtime will be scheduled for all hosts in this + group. + example: windows type: string - description: "Choices:\n\n * `\"lan\"`: Local network (low latency)\n\n\ - \ * `\"wan\"`: WAN (high latency)\n\n * `\"dmz\"`: DMZ (low latency, secure\ - \ access)" - enum: - - lan - - wan - - dmz - tag_agent: + required: + - downtime_type + - end_time + - servicegroup_name + - start_time + type: object + CreateServiceQueryDowntime: + properties: + start_time: + description: The start datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - description: "Choices:\n\n * `\"cmk-agent\"`: API integrations if configured,\ - \ else Checkmk agent\n\n * `\"all-agents\"`: Configured API integrations\ - \ and Checkmk agent\n\n * `\"special-agents\"`: Configured API integrations,\ - \ no Checkmk agent\n\n * `\"no-agent\"`: No API integrations, no Checkmk\ - \ agent" - enum: - - cmk-agent - - all-agents - - special-agents - - no-agent - tag_piggyback: + end_time: + description: The end datetime of the new downtime. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - description: "By default, each host has a piggyback data source.

Use\ - \ piggyback data from other hosts if present:
If selected, the\ - \ Check_MK service of this host will process the piggyback data,\ - \ but will not warn if no piggyback data is available. The associated\ - \ discovered services would become stale.

Always use and expect\ - \ piggyback data:
The host will expect piggyback data, and the\ - \ Check_MK service of this host will warn if no piggyback data\ - \ is available.

Never use piggyback data:
The Check_MK\ - \ service does not process piggybacking data at all, and will ignore it\ - \ if it's available.\n\nChoices:\n\n * `\"auto-piggyback\"`: Use piggyback\ - \ data from other hosts if present\n\n * `\"piggyback\"`: Always use and\ - \ expect piggyback data\n\n * `\"no-piggyback\"`: Never use piggyback\ - \ data" - enum: - - auto-piggyback - - piggyback - - no-piggyback - tag_snmp_ds: + recur: + default: fixed + description: 'The recurring mode of the new downtime. Available modes are: * + fixed * hour * day * week * second_week * fourth_week * + weekday_start * weekday_end * day_of_month This only works when + using the Enterprise Editions. Defaults to ''fixed''.' + enum: *id006 + example: hour type: string - description: "Choices:\n\n * `\"no-snmp\"`: No SNMP\n\n * `\"snmp-v2\"`:\ - \ SNMP v2 or v3\n\n * `\"snmp-v1\"`: SNMP v1" - enum: - - no-snmp - - snmp-v2 - - snmp-v1 - tag_address_family: + duration: + default: 0 + description: Duration in seconds. When set, the downtime does not begin + automatically at a nominated time, but when a real problem status appears + for the service. Consequencely, the start_time/end_time is only the time + window in which the scheduled downtime can begin. + example: 3600 + type: integer + comment: + example: Security updates type: string - description: "Choices:\n\n * `\"ip-v4-only\"`: IPv4 only\n\n * `\"ip-v6-only\"\ - `: IPv6 only\n\n * `\"ip-v4v6\"`: IPv4/IPv6 dual-stack\n\n * `\"no-ip\"\ - `: No IP" - enum: - - ip-v4-only - - ip-v6-only - - ip-v4v6 - - no-ip - CustomHostAttributes: - type: object - properties: {} - additionalProperties: - type: string - description: Each tag is a mapping of string to string - TagGroupAttributes: + downtime_type: + description: The type of downtime to create. + enum: *id008 + example: service + type: string + query: + allOf: + - $ref: '#/components/schemas/Expr' + description: An query expression of the Livestatus 'services' table in nested + dictionary form. If you want to use multiple expressions, nest them with + the AND/OR operators. + example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, + {"op": "!=", "left": "state", "right": "0"}]}' + required: + - downtime_type + - end_time + - query + - start_time type: object + CreateServiceRelatedDowntime: + discriminator: + mapping: + service: '#/components/schemas/CreateServiceDowntime' + service_by_query: '#/components/schemas/CreateServiceQueryDowntime' + servicegroup: '#/components/schemas/CreateServiceGroupDowntime' + propertyName: downtime_type + oneOf: + - $ref: '#/components/schemas/CreateServiceDowntime' + - $ref: '#/components/schemas/CreateServiceGroupDowntime' + - $ref: '#/components/schemas/CreateServiceQueryDowntime' properties: {} - additionalProperties: - type: string - description: The value of the tag-group attribute. Each tag is a mapping of - string to string, where the tag name must start with `tag_`. - UpdateFolderEntry: type: object + CreateUser: + additionalProperties: true properties: - title: + username: + description: An unique username for the user + example: cmkuser type: string - description: The title of the folder. Used in the GUI. - example: Virtual Servers. - attributes: - anyOf: - - $ref: '#/components/schemas/FolderUpdateAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: Replace all attributes with the ones given in this field. Already - setattributes, not given here, will be removed. Can't be used together - with update_attributes or remove_attributes fields. - example: &id023 - tag_networking: wan - update_attributes: - anyOf: - - $ref: '#/components/schemas/FolderUpdateAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: Only set the attributes which are given in this field. Already - set attributes will not be touched. Can't be used together with attributes - or remove_attributes fields. - example: &id024 - tag_criticality: prod - remove_attributes: - type: array - description: A list of attributes which should be removed. Can't be used - together with attributes or update_attributes fields. - example: &id025 - - tag_foobar - items: - type: string - folder: + fullname: + description: The alias or full name of the user + example: Mathias Kettner type: string - description: 'The path name of the folder. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - example: / - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - required: - - folder - BulkUpdateFolder: - type: object - properties: - entries: - description: A list of folder entries. + auth_option: + allOf: + - $ref: '#/components/schemas/AuthOption' + description: Authentication option for the user example: - - remove_attributes: - - tag_foobar - type: array + auth_type: password + password: password + disable_login: + default: false + description: The user can be blocked from login but will remain part of + the site. The disabling does not affect notification and alerts. + example: false + type: boolean + contact_options: + allOf: + - $ref: '#/components/schemas/UserContactOption' + description: Contact settings for the user + example: + email: user@example.com + pager_address: + default: '' + description: '' + example: '' + type: string + idle_timeout: + allOf: + - $ref: '#/components/schemas/IdleOption' + description: Idle timeout for the user. Per default, the global configuration + is used. + example: + option: global + roles: + description: The list of assigned roles to the user + example: + - user items: - $ref: '#/components/schemas/UpdateFolderEntry' - required: - - entries - ObjectCollectionMember: - type: object - properties: - links: + description: A user role + example: user + type: string type: array - description: list of links to other resources. - example: null + authorized_sites: + description: The names of the sites the user is authorized to handle + example: + - heute items: - $ref: '#/components/schemas/Link' - id: - type: string - disabledReason: - type: string - nullable: true - description: Provides the reason (or the literal "disabled") why an object - property or collection is un-modifiable, or, in the case of an action, - unusable (and hence no links to mutate that member's state, or invoke - the action, are provided). - invalidReason: - type: string - nullable: true - description: Provides the reason (or the literal "invalid") why a proposed - value for a property, collection or action argument is invalid. Appears - within an argument representation 2.9 returned as a response. - example: invalid - x-ro-invalidReason: - type: string - nullable: true - description: Provides the reason why a SET OF proposed values for properties - or arguments is invalid. - memberType: - default: collection - value: + type: string type: array + contactgroups: + description: Assign the user to one or multiple contact groups. If no contact + group is specified then no monitoring contact will be created for the + user. + example: + - all items: - $ref: '#/components/schemas/Link' - name: - type: string - example: important_values - title: + description: Assign the user to one or multiple contact groups + example: all + type: string + type: array + disable_notifications: + allOf: + - $ref: '#/components/schemas/DisabledNotifications' + description: '' + example: + disable: false + language: + description: Configure the language to be used by the user in the user interface. + Omitting this will configure the default language. + enum: + - de + - en + - ro + example: en type: string - description: A human readable title of this object. Can be used for user - interfaces. + interface_options: + allOf: + - $ref: '#/components/schemas/UserInterfaceAttributes' + default: + interface_theme: default + sidebar_position: right + navigation_bar_icons: hide + mega_menu_icons: topic + show_mode: default + description: '' + example: + interface_theme: dark required: - - id - - links - ObjectActionMember: + - fullname + - username type: object + CustomAttributes: + additionalProperties: + description: Each tag is a mapping of string to string + type: string + properties: {} + type: object + CustomTimeRange: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: - type: string - disabledReason: - type: string - nullable: true - description: Provides the reason (or the literal "disabled") why an object - property or collection is un-modifiable, or, in the case of an action, - unusable (and hence no links to mutate that member's state, or invoke - the action, are provided). - invalidReason: - type: string - nullable: true - description: Provides the reason (or the literal "invalid") why a proposed - value for a property, collection or action argument is invalid. Appears - within an argument representation 2.9 returned as a response. - example: invalid - x-ro-invalidReason: - type: string - nullable: true - description: Provides the reason why a SET OF proposed values for properties - or arguments is invalid. - memberType: - default: action - parameters: - type: object - name: + start_time: + description: The start datetime of the time period. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - example: frobnicate_foo - title: + end_time: + description: The end datetime of the time period. The format has to conform + to the ISO 8601 profile + example: '2017-07-21T17:32:28Z' + format: iso8601 type: string - description: A human readable title of this object. Can be used for user - interfaces. required: - - id - - links - FolderMembers: + - end_time + - start_time type: object - properties: - hosts: - description: A list of links pointing to the actual host-resources. - allOf: - - $ref: '#/components/schemas/ObjectCollectionMember' - move: - description: An action which triggers the move of this folder to another - folder. - allOf: - - $ref: '#/components/schemas/ObjectActionMember' - NetworkScanResult: + CustomUserAttributes: + additionalProperties: + description: Each tag is a mapping of string to string + type: string + properties: {} type: object + DateTimeRange: properties: - start: - type: string - format: date-time - description: When the scan started - end: - type: string + start_time: + description: The start datetime of the time period. The format conforms + to the ISO 8601 profile + example: '2017-07-21T17:32:28+00:00' format: date-time - nullable: true - description: When the scan finished. Will be Null if not yet run. - state: type: string - description: Last scan result - enum: - - running - - succeeded - - failed - output: + end_time: + description: The end datetime of the time period. The format conforms to + the ISO 8601 profile + example: '2017-07-21T17:32:28+00:00' + format: iso8601 type: string - description: Short human readable description of what is happening. - MetaData: + required: + - start_time + type: object + DeleteDowntime: + discriminator: + mapping: + by_id: '#/components/schemas/DeleteDowntimeById' + params: '#/components/schemas/DeleteDowntimeByName' + query: '#/components/schemas/DeleteDowntimeByQuery' + propertyName: delete_type + oneOf: + - $ref: '#/components/schemas/DeleteDowntimeById' + - $ref: '#/components/schemas/DeleteDowntimeByName' + - $ref: '#/components/schemas/DeleteDowntimeByQuery' + properties: {} type: object + DeleteDowntimeById: properties: - created_at: - type: string - format: date-time - nullable: true - description: When has this object been created. - updated_at: + delete_type: + description: The option how to delete a downtime. + enum: &id009 + - params + - query + - by_id + example: params type: string - format: date-time - nullable: true - description: When this object was last changed. - created_by: + downtime_id: + description: The id of the downtime + example: '54' type: string - nullable: true - description: The user id under which this object has been created. - FolderViewAttribute: + required: + - delete_type + - downtime_id type: object + DeleteDowntimeByName: properties: - site: + delete_type: + description: The option how to delete a downtime. + enum: *id009 + example: params type: string - description: The site that should monitor this host. - contactgroups: - description: Only members of the contact groups listed here have Setup permission - for the host/folder. Optionally, you can make these contact groups automatically - monitor contacts. The assignment of hosts to contact groups can also be - defined by rules. - allOf: - - $ref: '#/components/schemas/HostContactGroup' - parents: - type: array - description: A list of parents of this host. + host_name: + description: If set alone, then all downtimes of the host will be removed. + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + service_descriptions: + description: If set, the downtimes of the listed services of the specified + host will be removed. If a service has multiple downtimes then all will + be removed + example: + - CPU load + - Memory items: + example: CPU utilization type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - snmp_community: - description: The SNMP access configuration. A configured SNMP v1/v2 community - here will have precedence over any configured SNMP community rule. For - this attribute to take effect, the attribute `tag_snmp_ds` needs to be - set first. - allOf: - - $ref: '#/components/schemas/SNMPCredentials' - labels: - type: object - description: Labels allow you to flexibly group your hosts in order to refer - to them later at other places in Checkmk, e.g. in rule chains.
Label - format: key:value

Checkmk does not perform any validation - on the labels you use. - additionalProperties: - type: string - description: The host label value - network_scan: - description: Configuration for automatic network scan. Pings will besent - to each IP address in the configured ranges to checkif a host is up or - down. Each found host will be added tothe folder by it's hostname (if - possible) or IP address. - allOf: - - $ref: '#/components/schemas/NetworkScan' - network_scan_result: - description: Read only access to the network scan result - allOf: - - $ref: '#/components/schemas/NetworkScanResult' - management_protocol: + type: array + required: + - delete_type + - host_name + type: object + DeleteDowntimeByQuery: + properties: + delete_type: + description: The option how to delete a downtime. + enum: *id009 + example: params type: string - description: "The protocol used to connect to the management board.\n\n\ - Valid options are:\n\n * `none` - No management board\n * `snmp` - Connect\ - \ using SNMP\n * `ipmi` - Connect using IPMI\n" - enum: - - none - - snmp - - ipmi - management_snmp_community: - nullable: true - description: SNMP credentials - allOf: - - $ref: '#/components/schemas/SNMPCredentials' - management_ipmi_credentials: - description: IPMI credentials - allOf: - - $ref: '#/components/schemas/IPMIParameters' - meta_data: - description: Read only access to configured metadata. + query: allOf: - - $ref: '#/components/schemas/MetaData' - tag_criticality: - type: string - description: '' - tag_networking: - type: string - description: '' - tag_agent: - type: string - description: '' - tag_piggyback: - type: string - description: By default, each host has a piggyback data source.

Use - piggyback data from other hosts if present:
If selected, the Check_MK - service of this host will process the piggyback data, but will not warn - if no piggyback data is available. The associated discovered services - would become stale.

Always use and expect piggyback data:
The - host will expect piggyback data, and the Check_MK service of - this host will warn if no piggyback data is available.

Never - use piggyback data:
The Check_MK service does not process - piggybacking data at all, and will ignore it if it's available. - tag_snmp_ds: + - $ref: '#/components/schemas/Expr' + description: An query expression of the Livestatus 'downtimes' table in + nested dictionary form. If you want to use multiple expressions, nest + them with the AND/OR operators. + example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, + {"op": "!=", "left": "state", "right": "0"}]}' + required: + - delete_type + - query + type: object + DirectMapping: + properties: + hostname: + description: The hostname to be replaced. type: string - description: '' - tag_address_family: + replace_with: + description: The replacement string. type: string - description: '' - FolderExtensions: + required: + - hostname + - replace_with type: object + DisabledNotifications: properties: - path: - type: string - description: The full path of this folder, slash delimited. - attributes: - anyOf: - - $ref: '#/components/schemas/FolderViewAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: The folder's attributes. Hosts placed in this folder will inherit - these attributes. - example: null - Folder: + disable: + description: Option if all notifications should be temporarily disabled + example: false + type: boolean + timerange: + allOf: + - $ref: '#/components/schemas/CustomTimeRange' + description: A custom timerange during which notifications are disabled + example: + end_time: '2017-07-21T18:32:28Z' + start_time: '2017-07-21T17:32:28Z' type: object + DiscoverServices: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: folder_config - description: The domain type of the object. - id: + host_name: + description: The host of the service which shall be updated. + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: The full path of the folder, tilde-separated. - title: + mode: + default: fix_all + description: "The mode of the discovery action. Can be one of:\n\n *\ + \ `new` - Add undecided services to monitoring\n * `remove` - Remove\ + \ vanished services\n * `fix_all` - Add undecided services and new\ + \ host labels, remove vanished services\n * `refresh` - Update inforomation\ + \ from host, then remove all existing and add all just found services\ + \ and host labels\n * `only_host_labels` - Update host labels\n \ + \ " + enum: + - new + - remove + - fix_all + - refresh + - only_host_labels + example: refresh type: string - description: The human readable title for this folder. - members: - description: Specific collections or actions applicable to this object. - allOf: - - $ref: '#/components/schemas/FolderMembers' - extensions: - description: Data and Meta-Data of this object. - allOf: - - $ref: '#/components/schemas/FolderExtensions' required: - - links - FolderCollection: + - host_name + type: object + DiscoverServicesDeprecated: + properties: + mode: + default: fix_all + description: "The mode of the discovery action. Can be one of:\n\n *\ + \ `new` - Add undecided services to monitoring\n * `remove` - Remove\ + \ vanished services\n * `fix_all` - Add undecided services and new\ + \ host labels, remove vanished services\n * `refresh` - Update inforomation\ + \ from host, then remove all existing and add all just found services\ + \ and host labels\n * `only_host_labels` - Update host labels\n \ + \ " + enum: + - new + - remove + - fix_all + - refresh + - only_host_labels + example: refresh + type: string type: object + DiscoveryBackgroundJobStatusObject: properties: links: - type: array description: list of links to other resources. example: null items: $ref: '#/components/schemas/Link' + type: array + domainType: + default: discovery_run + description: The domain type of the object id: + description: The unique identifier for this domain-object type. type: string - default: all - description: The name of this collection. - domainType: - default: folder_config - description: The domain type of the objects in the collection. title: - type: string description: A human readable title of this object. Can be used for user interfaces. - value: - type: array - description: A list of folder objects. - items: - $ref: '#/components/schemas/Folder' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - FolderCreateAttribute: - type: object - properties: - site: type: string - description: The site that should monitor this host. - contactgroups: - description: Only members of the contact groups listed here have Setup permission - for the host/folder. Optionally, you can make these contact groups automatically - monitor contacts. The assignment of hosts to contact groups can also be - defined by rules. - allOf: - - $ref: '#/components/schemas/HostContactGroup' - parents: - type: array - description: A list of parents of this host. - items: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - snmp_community: - description: The SNMP access configuration. A configured SNMP v1/v2 community - here will have precedence over any configured SNMP community rule. For - this attribute to take effect, the attribute `tag_snmp_ds` needs to be - set first. - allOf: - - $ref: '#/components/schemas/SNMPCredentials' - labels: + members: + description: The container for external resources, like linked foreign objects + or actions. type: object - description: Labels allow you to flexibly group your hosts in order to refer - to them later at other places in Checkmk, e.g. in rule chains.
Label - format: key:value

Checkmk does not perform any validation - on the labels you use. - additionalProperties: - type: string - description: The host label value - network_scan: - description: Configuration for automatic network scan. Pings will besent - to each IP address in the configured ranges to checkif a host is up or - down. Each found host will be added tothe folder by it's hostname (if - possible) or IP address. - allOf: - - $ref: '#/components/schemas/NetworkScan' - management_protocol: - type: string - description: "The protocol used to connect to the management board.\n\n\ - Valid options are:\n\n * `none` - No management board\n * `snmp` - Connect\ - \ using SNMP\n * `ipmi` - Connect using IPMI\n" - enum: - - none - - snmp - - ipmi - management_snmp_community: - nullable: true - description: SNMP credentials - allOf: - - $ref: '#/components/schemas/SNMPCredentials' - management_ipmi_credentials: - description: IPMI credentials - allOf: - - $ref: '#/components/schemas/IPMIParameters' - tag_criticality: - type: string - description: "Choices:\n\n * `\"prod\"`: Productive system\n\n * `\"critical\"\ - `: Business critical\n\n * `\"test\"`: Test system\n\n * `\"offline\"\ - `: Do not monitor this host" - enum: - - prod - - critical - - test - - offline - tag_networking: - type: string - description: "Choices:\n\n * `\"lan\"`: Local network (low latency)\n\n\ - \ * `\"wan\"`: WAN (high latency)\n\n * `\"dmz\"`: DMZ (low latency, secure\ - \ access)" - enum: - - lan - - wan - - dmz - tag_agent: - type: string - description: "Choices:\n\n * `\"cmk-agent\"`: API integrations if configured,\ - \ else Checkmk agent\n\n * `\"all-agents\"`: Configured API integrations\ - \ and Checkmk agent\n\n * `\"special-agents\"`: Configured API integrations,\ - \ no Checkmk agent\n\n * `\"no-agent\"`: No API integrations, no Checkmk\ - \ agent" - enum: - - cmk-agent - - all-agents - - special-agents - - no-agent - tag_piggyback: - type: string - description: "By default, each host has a piggyback data source.

Use\ - \ piggyback data from other hosts if present:
If selected, the\ - \ Check_MK service of this host will process the piggyback data,\ - \ but will not warn if no piggyback data is available. The associated\ - \ discovered services would become stale.

Always use and expect\ - \ piggyback data:
The host will expect piggyback data, and the\ - \ Check_MK service of this host will warn if no piggyback data\ - \ is available.

Never use piggyback data:
The Check_MK\ - \ service does not process piggybacking data at all, and will ignore it\ - \ if it's available.\n\nChoices:\n\n * `\"auto-piggyback\"`: Use piggyback\ - \ data from other hosts if present\n\n * `\"piggyback\"`: Always use and\ - \ expect piggyback data\n\n * `\"no-piggyback\"`: Never use piggyback\ - \ data" - enum: - - auto-piggyback - - piggyback - - no-piggyback - tag_snmp_ds: - type: string - description: "Choices:\n\n * `\"no-snmp\"`: No SNMP\n\n * `\"snmp-v2\"`:\ - \ SNMP v2 or v3\n\n * `\"snmp-v1\"`: SNMP v1" - enum: - - no-snmp - - snmp-v2 - - snmp-v1 - tag_address_family: - type: string - description: "Choices:\n\n * `\"ip-v4-only\"`: IPv4 only\n\n * `\"ip-v6-only\"\ - `: IPv6 only\n\n * `\"ip-v4v6\"`: IPv4/IPv6 dual-stack\n\n * `\"no-ip\"\ - `: No IP" - enum: - - ip-v4-only - - ip-v6-only - - ip-v4v6 - - no-ip - CreateFolder: - type: object - properties: - name: - type: string - description: The filesystem directory name (not path!) of the folder. No - slashes are allowed. - example: production - minLength: 1 - pattern: ^[-\w]*\Z - title: - type: string - description: The folder title as displayed in the user interface. - example: Production Hosts - parent: - type: string - description: 'The folder in which the new folder shall be placed in. The - root-folder is specified by ''/''. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - example: / - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - attributes: - anyOf: - - $ref: '#/components/schemas/FolderCreateAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: Specific attributes to apply for all hosts in this folder (among - other things). - example: - tag_criticality: prod - required: - - parent - - title - HostMembers: - type: object - properties: - folder_config: - description: The folder in which this host resides. It is represented by - a hexadecimal identifier which is it's 'primary key'. The folder can be - accessed via the `self`-link provided in the links array. + extensions: allOf: - - $ref: '#/components/schemas/Folder' - LockedBy: + - $ref: '#/components/schemas/BackgroundJobStatus' + description: The attributes of the background job + required: + - links type: object + DomainObject: properties: - site_id: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + domainType: + description: The "domain-type" of the object. type: string - description: Site ID - program_id: + id: + description: The unique identifier for this domain-object type. type: string - description: Program ID - instance_id: + title: + description: A human readable title of this object. Can be used for user + interfaces. type: string - description: Instance ID + members: + description: The container for external resources, like linked foreign objects + or actions. + type: object + extensions: + description: All the attributes of the domain object. + type: object required: - - instance_id - - program_id - - site_id - HostExtensionsEffectiveAttributes: + - domainType + - links type: object + DomainObjectCollection: properties: - alias: - type: string - description: Add a comment or describe this host - site: - type: string - description: The site that should monitor this host. - contactgroups: - description: Only members of the contact groups listed here have Setup permission - for the host/folder. Optionally, you can make these contact groups automatically - monitor contacts. The assignment of hosts to contact groups can also be - defined by rules. - allOf: - - $ref: '#/components/schemas/HostContactGroup' - parents: - type: array - description: A list of parents of this host. + links: + description: list of links to other resources. + example: null items: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - ipaddress: + $ref: '#/components/schemas/Link' + type: array + id: + default: all + description: The name of this collection. type: string - description: An IPv4 address. - ipv6address: + domainType: + description: The domain type of the objects in the collection. type: string - description: An IPv6 address. - additional_ipv4addresses: - type: array - description: A list of IPv4 addresses. + title: + description: A human readable title of this object. Can be used for user + interfaces. + type: string + value: + description: The collection itself. Each entry in here is part of the collection. items: - type: string - additional_ipv6addresses: + $ref: '#/components/schemas/CollectionItem' type: array - description: A list of IPv6 addresses. - items: - type: string - snmp_community: - description: The SNMP access configuration. A configured SNMP v1/v2 community - here will have precedence over any configured SNMP community rule. For - this attribute to take effect, the attribute `tag_snmp_ds` needs to be - set first. - allOf: - - $ref: '#/components/schemas/SNMPCredentials' - labels: + extensions: + description: Additional attributes alongside the collection. type: object - description: Labels allow you to flexibly group your hosts in order to refer - to them later at other places in Checkmk, e.g. in rule chains.
Label - format: key:value

Checkmk does not perform any validation - on the labels you use. - additionalProperties: - type: string - description: The host label value - network_scan: - description: Configuration for automatic network scan. Pings will besent - to each IP address in the configured ranges to checkif a host is up or - down. Each found host will be added tothe folder by it's hostname (if - possible) or IP address. - allOf: - - $ref: '#/components/schemas/NetworkScan' - network_scan_result: - description: Read only access to the network scan result + required: + - links + type: object + Expr: + discriminator: + mapping: + '!<': '#/components/schemas/BinaryExpr' + '!<=': '#/components/schemas/BinaryExpr' + '!=': '#/components/schemas/BinaryExpr' + '!>': '#/components/schemas/BinaryExpr' + '!>=': '#/components/schemas/BinaryExpr' + '!~': '#/components/schemas/BinaryExpr' + '!~~': '#/components/schemas/BinaryExpr' + <: '#/components/schemas/BinaryExpr' + <=: '#/components/schemas/BinaryExpr' + '=': '#/components/schemas/BinaryExpr' + '>': '#/components/schemas/BinaryExpr' + '>=': '#/components/schemas/BinaryExpr' + and: '#/components/schemas/LogicalExpr' + not: '#/components/schemas/NotExpr' + or: '#/components/schemas/LogicalExpr' + '~': '#/components/schemas/BinaryExpr' + ~~: '#/components/schemas/BinaryExpr' + propertyName: op + oneOf: + - $ref: '#/components/schemas/LogicalExpr' + - $ref: '#/components/schemas/LogicalExpr' + - $ref: '#/components/schemas/NotExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + - $ref: '#/components/schemas/BinaryExpr' + properties: {} + type: object + FailedHosts: + properties: + succeeded_hosts: allOf: - - $ref: '#/components/schemas/NetworkScanResult' - management_protocol: + - $ref: '#/components/schemas/HostConfigCollection' + description: The list of succeeded host objects + failed_hosts: + additionalProperties: + items: + description: The error messages + type: string + type: array + description: Detailed error messages on hosts failing the action + type: object + type: object + Folder: + properties: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + domainType: + default: folder_config + description: The domain type of the object. + id: + description: The full path of the folder, tilde-separated. type: string - description: "The protocol used to connect to the management board.\n\n\ - Valid options are:\n\n * `none` - No management board\n * `snmp` - Connect\ - \ using SNMP\n * `ipmi` - Connect using IPMI\n" - enum: &id022 - - none - - snmp - - ipmi - management_address: + title: + description: The human readable title for this folder. type: string - description: Address (IPv4, IPv6 or hostname) under which the management - board can be reached. - management_snmp_community: - nullable: true - description: SNMP credentials - allOf: - - $ref: '#/components/schemas/SNMPCredentials' - management_ipmi_credentials: - description: IPMI credentials - allOf: - - $ref: '#/components/schemas/IPMIParameters' - meta_data: - description: Read only access to configured metadata. + members: allOf: - - $ref: '#/components/schemas/MetaData' - locked_by: - description: Identity of the entity which locked the locked_attributes. - The identity is built out of the Site ID, the program name and the connection - ID. + - $ref: '#/components/schemas/FolderMembers' + description: Specific collections or actions applicable to this object. + extensions: allOf: - - $ref: '#/components/schemas/LockedBy' - locked_attributes: - type: array - description: Name of host attributes which are locked in the UI. + - $ref: '#/components/schemas/FolderExtensions' + description: Data and Meta-Data of this object. + required: + - links + type: object + FolderCollection: + properties: + links: + description: list of links to other resources. + example: null items: - type: string - inventory_failed: - type: boolean - description: Whether or not the last bulk discovery failed. It is set to - True once it fails and unset in case a later discovery succeeds. - example: false - tag_criticality: - type: string - description: '' - tag_networking: - type: string - description: '' - tag_agent: - type: string - description: '' - tag_piggyback: - type: string - description: By default, each host has a piggyback data source.

Use - piggyback data from other hosts if present:
If selected, the Check_MK - service of this host will process the piggyback data, but will not warn - if no piggyback data is available. The associated discovered services - would become stale.

Always use and expect piggyback data:
The - host will expect piggyback data, and the Check_MK service of - this host will warn if no piggyback data is available.

Never - use piggyback data:
The Check_MK service does not process - piggybacking data at all, and will ignore it if it's available. - tag_snmp_ds: + $ref: '#/components/schemas/Link' + type: array + id: + default: all + description: The name of this collection. type: string - description: '' - tag_address_family: + domainType: + default: folder_config + description: The domain type of the objects in the collection. + title: + description: A human readable title of this object. Can be used for user + interfaces. type: string - description: '' - HostViewAttribute: + value: + description: A list of folder objects. + items: + $ref: '#/components/schemas/Folder' + type: array + extensions: + description: Additional attributes alongside the collection. + type: object + required: + - links type: object + FolderCreateAttribute: properties: - alias: - type: string - description: Add a comment or describe this host site: - type: string description: The site that should monitor this host. + type: string contactgroups: - description: Only members of the contact groups listed here have Setup permission - for the host/folder. Optionally, you can make these contact groups automatically - monitor contacts. The assignment of hosts to contact groups can also be - defined by rules. allOf: - $ref: '#/components/schemas/HostContactGroup' + description: Only members of the contact groups listed here have WATO permission + to the host / folder. If you want, you can make those contact groups automatically + also monitoring contacts. This is completely optional. Assignment + of host to contact groups can be done by rules + as well. parents: - type: array description: A list of parents of this host. items: - type: string example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - ipaddress: - type: string - description: An IPv4 address. - ipv6address: - type: string - description: An IPv6 address. - additional_ipv4addresses: - type: array - description: A list of IPv4 addresses. - items: + pattern: '[-0-9a-zA-Z_.]+' type: string - additional_ipv6addresses: type: array - description: A list of IPv6 addresses. - items: - type: string snmp_community: + allOf: + - $ref: '#/components/schemas/SNMPCredentials' description: The SNMP access configuration. A configured SNMP v1/v2 community here will have precedence over any configured SNMP community rule. For this attribute to take effect, the attribute `tag_snmp_ds` needs to be set first. - allOf: - - $ref: '#/components/schemas/SNMPCredentials' labels: - type: object - description: Labels allow you to flexibly group your hosts in order to refer - to them later at other places in Checkmk, e.g. in rule chains.
Label - format: key:value

Checkmk does not perform any validation - on the labels you use. additionalProperties: - type: string description: The host label value + type: string + description: With the help of labels you can flexibly group your hosts in + order to refer to them later at other places in Check_MK, e.g. in rule + chains. A label always consists of a combination of key and value in the + format "key:value". A host can only have one value per key. Check_MK will + not perform any validation on the labels you use. + type: object network_scan: + allOf: + - $ref: '#/components/schemas/NetworkScan' description: Configuration for automatic network scan. Pings will besent to each IP address in the configured ranges to checkif a host is up or down. Each found host will be added tothe folder by it's hostname (if possible) or IP address. - allOf: - - $ref: '#/components/schemas/NetworkScan' - network_scan_result: - description: Read only access to the network scan result - allOf: - - $ref: '#/components/schemas/NetworkScanResult' management_protocol: - type: string description: "The protocol used to connect to the management board.\n\n\ Valid options are:\n\n * `none` - No management board\n * `snmp` - Connect\ \ using SNMP\n * `ipmi` - Connect using IPMI\n" - enum: *id022 - management_address: + enum: + - none + - snmp + - ipmi type: string - description: Address (IPv4, IPv6 or hostname) under which the management - board can be reached. management_snmp_community: - nullable: true - description: SNMP credentials allOf: - $ref: '#/components/schemas/SNMPCredentials' + description: SNMP credentials + nullable: true management_ipmi_credentials: - description: IPMI credentials allOf: - $ref: '#/components/schemas/IPMIParameters' - meta_data: - description: Read only access to configured metadata. - allOf: - - $ref: '#/components/schemas/MetaData' - locked_by: - description: Identity of the entity which locked the locked_attributes. - The identity is built out of the Site ID, the program name and the connection - ID. - allOf: - - $ref: '#/components/schemas/LockedBy' - locked_attributes: - type: array - description: Name of host attributes which are locked in the UI. - items: - type: string - inventory_failed: - type: boolean - description: Whether or not the last bulk discovery failed. It is set to - True once it fails and unset in case a later discovery succeeds. - example: false + description: IPMI credentials tag_criticality: + description: "Choices:\n\n * `\"prod\"`: Productive system\n\n * `\"critical\"\ + `: Business critical\n\n * `\"test\"`: Test system\n\n * `\"offline\"\ + `: Do not monitor this host" + enum: + - prod + - critical + - test + - offline type: string - description: '' tag_networking: + description: "Choices:\n\n * `\"lan\"`: Local network (low latency)\n\n\ + \ * `\"wan\"`: WAN (high latency)\n\n * `\"dmz\"`: DMZ (low latency, secure\ + \ access)" + enum: + - lan + - wan + - dmz type: string - description: '' tag_agent: + description: "Choices:\n\n * `\"cmk-agent\"`: API integrations if configured,\ + \ else Checkmk agent\n\n * `\"all-agents\"`: Configured API integrations\ + \ and Checkmk agent\n\n * `\"special-agents\"`: Configured API integrations,\ + \ no Checkmk agent\n\n * `\"no-agent\"`: No API integrations, no Checkmk\ + \ agent" + enum: + - cmk-agent + - all-agents + - special-agents + - no-agent type: string - description: '' tag_piggyback: + description: "By default every host has the piggyback data source Use\ + \ piggyback data from other hosts if present. In this case the Check_MK\ + \ service of this host processes the piggyback data but does not warn\ + \ if no piggyback data is available. The related discovered services would\ + \ become stale. If a host has configured Always use and expect piggyback\ + \ data for the piggyback data source then this host expects piggyback\ + \ data and the Check_MK service of this host warns if no piggyback\ + \ data is available. In the last case, ie. Never use piggyback data,\ + \ the Check_MK service does not process piggyback data at all\ + \ and ignores it if available.\n\nChoices:\n\n * `\"auto-piggyback\"`:\ + \ Use piggyback data from other hosts if present\n\n * `\"piggyback\"\ + `: Always use and expect piggyback data\n\n * `\"no-piggyback\"`: Never\ + \ use piggyback data" + enum: + - auto-piggyback + - piggyback + - no-piggyback type: string - description: By default, each host has a piggyback data source.

Use - piggyback data from other hosts if present:
If selected, the Check_MK - service of this host will process the piggyback data, but will not warn - if no piggyback data is available. The associated discovered services - would become stale.

Always use and expect piggyback data:
The - host will expect piggyback data, and the Check_MK service of - this host will warn if no piggyback data is available.

Never - use piggyback data:
The Check_MK service does not process - piggybacking data at all, and will ignore it if it's available. tag_snmp_ds: + description: "Choices:\n\n * `\"no-snmp\"`: No SNMP\n\n * `\"snmp-v2\"`:\ + \ SNMP v2 or v3\n\n * `\"snmp-v1\"`: SNMP v1" + enum: + - no-snmp + - snmp-v2 + - snmp-v1 type: string - description: '' tag_address_family: + description: "Choices:\n\n * `\"ip-v4-only\"`: IPv4 only\n\n * `\"ip-v6-only\"\ + `: IPv6 only\n\n * `\"ip-v4v6\"`: IPv4/IPv6 dual-stack\n\n * `\"no-ip\"\ + `: No IP" + enum: + - ip-v4-only + - ip-v6-only + - ip-v4v6 + - no-ip type: string - description: '' - HostExtensions: type: object + FolderExtensions: properties: - folder: + path: + description: The full path of this folder, slash delimited. type: string - description: 'The folder, in which this host resides. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ attributes: anyOf: - - $ref: '#/components/schemas/HostViewAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' + - $ref: '#/components/schemas/FolderViewAttribute' + - $ref: '#/components/schemas/CustomAttributes' - $ref: '#/components/schemas/TagGroupAttributes' - description: Attributes of this host. - example: - ipaddress: 192.168.0.123 - effective_attributes: - description: All attributes of this host and all parent folders. - example: - tag_snmp_ds: null - allOf: - - $ref: '#/components/schemas/HostExtensionsEffectiveAttributes' - is_cluster: - type: boolean - description: If this is a cluster host, i.e. a container for other hosts. - is_offline: - type: boolean - description: Whether the host is offline - cluster_nodes: - type: array - default: null - nullable: true - description: In the case this is a cluster host, these are the cluster nodes. - items: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - HostConfig: + description: The folder's attributes. Hosts placed in this folder will inherit + these attributes. + example: null type: object + FolderMembers: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: host_config - description: The domain type of the object. - id: - type: string - description: The unique identifier for this domain-object type. - title: - type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - description: All the members of the host object. + hosts: allOf: - - $ref: '#/components/schemas/HostMembers' - extensions: - description: All the data and metadata of this host. + - $ref: '#/components/schemas/ObjectCollectionMember' + description: A list of links pointing to the actual host-resources. + move: allOf: - - $ref: '#/components/schemas/HostExtensions' - required: - - domainType - - links - HostConfigCollection: + - $ref: '#/components/schemas/ObjectActionMember' + description: An action which triggers the move of this folder to another + folder. type: object + FolderUpdateAttribute: properties: - links: - type: array - description: list of links to other resources. - example: null + site: + description: The site that should monitor this host. + type: string + contactgroups: + allOf: + - $ref: '#/components/schemas/HostContactGroup' + description: Only members of the contact groups listed here have WATO permission + to the host / folder. If you want, you can make those contact groups automatically + also monitoring contacts. This is completely optional. Assignment + of host to contact groups can be done by rules + as well. + parents: + description: A list of parents of this host. items: - $ref: '#/components/schemas/Link' - id: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + type: array + snmp_community: + allOf: + - $ref: '#/components/schemas/SNMPCredentials' + description: The SNMP access configuration. A configured SNMP v1/v2 community + here will have precedence over any configured SNMP community rule. For + this attribute to take effect, the attribute `tag_snmp_ds` needs to be + set first. + labels: + additionalProperties: + description: The host label value + type: string + description: With the help of labels you can flexibly group your hosts in + order to refer to them later at other places in Check_MK, e.g. in rule + chains. A label always consists of a combination of key and value in the + format "key:value". A host can only have one value per key. Check_MK will + not perform any validation on the labels you use. + type: object + network_scan: + allOf: + - $ref: '#/components/schemas/NetworkScan' + description: Configuration for automatic network scan. Pings will besent + to each IP address in the configured ranges to checkif a host is up or + down. Each found host will be added tothe folder by it's hostname (if + possible) or IP address. + management_protocol: + description: "The protocol used to connect to the management board.\n\n\ + Valid options are:\n\n * `none` - No management board\n * `snmp` - Connect\ + \ using SNMP\n * `ipmi` - Connect using IPMI\n" + enum: + - none + - snmp + - ipmi + type: string + management_snmp_community: + allOf: + - $ref: '#/components/schemas/SNMPCredentials' + description: SNMP credentials + nullable: true + management_ipmi_credentials: + allOf: + - $ref: '#/components/schemas/IPMIParameters' + description: IPMI credentials + tag_criticality: + description: "Choices:\n\n * `\"prod\"`: Productive system\n\n * `\"critical\"\ + `: Business critical\n\n * `\"test\"`: Test system\n\n * `\"offline\"\ + `: Do not monitor this host" + enum: + - prod + - critical + - test + - offline type: string - default: all - description: The name of this collection. - domainType: - default: host_config - description: The domain type of the objects in the collection. - title: + tag_networking: + description: "Choices:\n\n * `\"lan\"`: Local network (low latency)\n\n\ + \ * `\"wan\"`: WAN (high latency)\n\n * `\"dmz\"`: DMZ (low latency, secure\ + \ access)" + enum: + - lan + - wan + - dmz type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of host objects. - items: - $ref: '#/components/schemas/HostConfig' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - MoveFolder: - type: object - properties: - destination: + tag_agent: + description: "Choices:\n\n * `\"cmk-agent\"`: API integrations if configured,\ + \ else Checkmk agent\n\n * `\"all-agents\"`: Configured API integrations\ + \ and Checkmk agent\n\n * `\"special-agents\"`: Configured API integrations,\ + \ no Checkmk agent\n\n * `\"no-agent\"`: No API integrations, no Checkmk\ + \ agent" + enum: + - cmk-agent + - all-agents + - special-agents + - no-agent type: string - description: 'Where the folder has to be moved to. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - example: ~my~fine/folder - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - required: - - destination - UpdateFolder: - type: object - properties: - title: + tag_piggyback: + description: "By default every host has the piggyback data source Use\ + \ piggyback data from other hosts if present. In this case the Check_MK\ + \ service of this host processes the piggyback data but does not warn\ + \ if no piggyback data is available. The related discovered services would\ + \ become stale. If a host has configured Always use and expect piggyback\ + \ data for the piggyback data source then this host expects piggyback\ + \ data and the Check_MK service of this host warns if no piggyback\ + \ data is available. In the last case, ie. Never use piggyback data,\ + \ the Check_MK service does not process piggyback data at all\ + \ and ignores it if available.\n\nChoices:\n\n * `\"auto-piggyback\"`:\ + \ Use piggyback data from other hosts if present\n\n * `\"piggyback\"\ + `: Always use and expect piggyback data\n\n * `\"no-piggyback\"`: Never\ + \ use piggyback data" + enum: + - auto-piggyback + - piggyback + - no-piggyback + type: string + tag_snmp_ds: + description: "Choices:\n\n * `\"no-snmp\"`: No SNMP\n\n * `\"snmp-v2\"`:\ + \ SNMP v2 or v3\n\n * `\"snmp-v1\"`: SNMP v1" + enum: + - no-snmp + - snmp-v2 + - snmp-v1 + type: string + tag_address_family: + description: "Choices:\n\n * `\"ip-v4-only\"`: IPv4 only\n\n * `\"ip-v6-only\"\ + `: IPv6 only\n\n * `\"ip-v4v6\"`: IPv4/IPv6 dual-stack\n\n * `\"no-ip\"\ + `: No IP" + enum: + - ip-v4-only + - ip-v6-only + - ip-v4v6 + - no-ip type: string - description: The title of the folder. Used in the GUI. - example: Virtual Servers. - attributes: - anyOf: - - $ref: '#/components/schemas/FolderUpdateAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: Replace all attributes with the ones given in this field. Already - setattributes, not given here, will be removed. Can't be used together - with update_attributes or remove_attributes fields. - example: *id023 - update_attributes: - anyOf: - - $ref: '#/components/schemas/FolderUpdateAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: Only set the attributes which are given in this field. Already - set attributes will not be touched. Can't be used together with attributes - or remove_attributes fields. - example: *id024 - remove_attributes: - type: array - description: A list of attributes which should be removed. Can't be used - together with attributes or update_attributes fields. - example: *id025 - items: - type: string - HostCreateAttribute: type: object + FolderViewAttribute: properties: - alias: - type: string - description: Add a comment or describe this host site: - type: string description: The site that should monitor this host. + type: string contactgroups: - description: Only members of the contact groups listed here have Setup permission - for the host/folder. Optionally, you can make these contact groups automatically - monitor contacts. The assignment of hosts to contact groups can also be - defined by rules. allOf: - $ref: '#/components/schemas/HostContactGroup' + description: Only members of the contact groups listed here have WATO permission + to the host / folder. If you want, you can make those contact groups automatically + also monitoring contacts. This is completely optional. Assignment + of host to contact groups can be done by rules + as well. parents: - type: array description: A list of parents of this host. items: - type: string example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - ipaddress: - type: string - description: An IPv4 address. - ipv6address: - type: string - description: An IPv6 address. - additional_ipv4addresses: - type: array - description: A list of IPv4 addresses. - items: + pattern: '[-0-9a-zA-Z_.]+' type: string - additional_ipv6addresses: type: array - description: A list of IPv6 addresses. - items: - type: string snmp_community: + allOf: + - $ref: '#/components/schemas/SNMPCredentials' description: The SNMP access configuration. A configured SNMP v1/v2 community here will have precedence over any configured SNMP community rule. For this attribute to take effect, the attribute `tag_snmp_ds` needs to be set first. - allOf: - - $ref: '#/components/schemas/SNMPCredentials' labels: - type: object - description: Labels allow you to flexibly group your hosts in order to refer - to them later at other places in Checkmk, e.g. in rule chains.
Label - format: key:value

Checkmk does not perform any validation - on the labels you use. additionalProperties: - type: string description: The host label value + type: string + description: With the help of labels you can flexibly group your hosts in + order to refer to them later at other places in Check_MK, e.g. in rule + chains. A label always consists of a combination of key and value in the + format "key:value". A host can only have one value per key. Check_MK will + not perform any validation on the labels you use. + type: object network_scan: + allOf: + - $ref: '#/components/schemas/NetworkScan' description: Configuration for automatic network scan. Pings will besent to each IP address in the configured ranges to checkif a host is up or down. Each found host will be added tothe folder by it's hostname (if possible) or IP address. + network_scan_result: allOf: - - $ref: '#/components/schemas/NetworkScan' + - $ref: '#/components/schemas/NetworkScanResult' + description: Read only access to the network scan result management_protocol: - type: string description: "The protocol used to connect to the management board.\n\n\ Valid options are:\n\n * `none` - No management board\n * `snmp` - Connect\ \ using SNMP\n * `ipmi` - Connect using IPMI\n" @@ -27813,37 +3147,21 @@ components: - none - snmp - ipmi - management_address: type: string - description: Address (IPv4, IPv6 or hostname) under which the management - board can be reached. management_snmp_community: - nullable: true - description: SNMP credentials allOf: - $ref: '#/components/schemas/SNMPCredentials' + description: SNMP credentials + nullable: true management_ipmi_credentials: - description: IPMI credentials allOf: - $ref: '#/components/schemas/IPMIParameters' - locked_by: - description: Identity of the entity which locked the locked_attributes. - The identity is built out of the Site ID, the program name and the connection - ID. + description: IPMI credentials + meta_data: allOf: - - $ref: '#/components/schemas/LockedBy' - locked_attributes: - type: array - description: Name of host attributes which are locked in the UI. - items: - type: string - inventory_failed: - type: boolean - description: Whether or not the last bulk discovery failed. It is set to - True once it fails and unset in case a later discovery succeeds. - example: false + - $ref: '#/components/schemas/MetaData' + description: Read only access to configured metadata. tag_criticality: - type: string description: "Choices:\n\n * `\"prod\"`: Productive system\n\n * `\"critical\"\ `: Business critical\n\n * `\"test\"`: Test system\n\n * `\"offline\"\ `: Do not monitor this host" @@ -27852,8 +3170,8 @@ components: - critical - test - offline - tag_networking: type: string + tag_networking: description: "Choices:\n\n * `\"lan\"`: Local network (low latency)\n\n\ \ * `\"wan\"`: WAN (high latency)\n\n * `\"dmz\"`: DMZ (low latency, secure\ \ access)" @@ -27861,8 +3179,8 @@ components: - lan - wan - dmz - tag_agent: type: string + tag_agent: description: "Choices:\n\n * `\"cmk-agent\"`: API integrations if configured,\ \ else Checkmk agent\n\n * `\"all-agents\"`: Configured API integrations\ \ and Checkmk agent\n\n * `\"special-agents\"`: Configured API integrations,\ @@ -27873,35 +3191,35 @@ components: - all-agents - special-agents - no-agent - tag_piggyback: type: string - description: "By default, each host has a piggyback data source.

Use\ - \ piggyback data from other hosts if present:
If selected, the\ - \ Check_MK service of this host will process the piggyback data,\ - \ but will not warn if no piggyback data is available. The associated\ - \ discovered services would become stale.

Always use and expect\ - \ piggyback data:
The host will expect piggyback data, and the\ - \ Check_MK service of this host will warn if no piggyback data\ - \ is available.

Never use piggyback data:
The Check_MK\ - \ service does not process piggybacking data at all, and will ignore it\ - \ if it's available.\n\nChoices:\n\n * `\"auto-piggyback\"`: Use piggyback\ - \ data from other hosts if present\n\n * `\"piggyback\"`: Always use and\ - \ expect piggyback data\n\n * `\"no-piggyback\"`: Never use piggyback\ - \ data" + tag_piggyback: + description: "By default every host has the piggyback data source Use\ + \ piggyback data from other hosts if present. In this case the Check_MK\ + \ service of this host processes the piggyback data but does not warn\ + \ if no piggyback data is available. The related discovered services would\ + \ become stale. If a host has configured Always use and expect piggyback\ + \ data for the piggyback data source then this host expects piggyback\ + \ data and the Check_MK service of this host warns if no piggyback\ + \ data is available. In the last case, ie. Never use piggyback data,\ + \ the Check_MK service does not process piggyback data at all\ + \ and ignores it if available.\n\nChoices:\n\n * `\"auto-piggyback\"`:\ + \ Use piggyback data from other hosts if present\n\n * `\"piggyback\"\ + `: Always use and expect piggyback data\n\n * `\"no-piggyback\"`: Never\ + \ use piggyback data" enum: - auto-piggyback - piggyback - no-piggyback - tag_snmp_ds: type: string + tag_snmp_ds: description: "Choices:\n\n * `\"no-snmp\"`: No SNMP\n\n * `\"snmp-v2\"`:\ \ SNMP v2 or v3\n\n * `\"snmp-v1\"`: SNMP v1" enum: - no-snmp - snmp-v2 - snmp-v1 - tag_address_family: type: string + tag_address_family: description: "Choices:\n\n * `\"ip-v4-only\"`: IPv4 only\n\n * `\"ip-v6-only\"\ `: IPv6 only\n\n * `\"ip-v4v6\"`: IPv4/IPv6 dual-stack\n\n * `\"no-ip\"\ `: No IP" @@ -27910,169 +3228,207 @@ components: - ip-v6-only - ip-v4v6 - no-ip - CreateHost: + type: string type: object + Host: properties: - folder: - type: string - description: 'The path name of the folder. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - example: / - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - host_name: - type: string - description: The hostname or IP address of the host to be created. - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - attributes: - anyOf: - - $ref: '#/components/schemas/HostCreateAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: Attributes to set on the newly created host. - example: - ipaddress: 192.168.0.123 + type: + default: host required: - - folder - - host_name - BulkCreateHost: + - type type: object + HostConditions: properties: - entries: - type: array - description: A list of host entries. - example: - - host_name: example.com - folder: / - attributes: {} - uniqueItems: true - items: - $ref: '#/components/schemas/CreateHost' + host_folder: + example: servers/groupA + type: string + host_labels: + example: &id010 + db: mssql + type: object + host_tags: + example: &id011 {} + type: object + host_choice: + allOf: + - $ref: '#/components/schemas/BIHostChoice' + example: &id012 + type: all_hosts required: - - entries - FailedHosts: + - host_choice + - host_folder + - host_labels + - host_tags type: object + HostConfig: properties: - succeeded_hosts: - description: The list of succeeded host objects + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + domainType: + default: host_config + description: The domain type of the object. + id: + description: The unique identifier for this domain-object type. + type: string + title: + description: A human readable title of this object. Can be used for user + interfaces. + type: string + members: allOf: - - $ref: '#/components/schemas/HostConfigCollection' - failed_hosts: - type: object - description: Detailed error messages on hosts failing the action - additionalProperties: - type: string - description: The error message - BulkHostActionWithFailedHosts: + - $ref: '#/components/schemas/HostMembers' + description: All the members of the host object. + extensions: + allOf: + - $ref: '#/components/schemas/HostExtensions' + description: All the data and metadata of this host. + required: + - domainType + - links type: object + HostConfigCollection: properties: - status: - type: integer - description: The HTTP status code. - example: 404 - detail: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + id: + default: all + description: The name of this collection. type: string - description: Detailed information on what exactly went wrong. - example: The resource could not be found. + domainType: + default: host_config + description: The domain type of the objects in the collection. title: + description: A human readable title of this object. Can be used for user + interfaces. type: string - description: A summary of the problem. - example: Not found - fields: + value: + description: A list of host objects. + items: + $ref: '#/components/schemas/HostConfig' + type: array + extensions: + description: Additional attributes alongside the collection. type: object - description: Detailed error messages on all fields failing validation. - ext: - description: Details for which hosts have failed - allOf: - - $ref: '#/components/schemas/FailedHosts' required: - - detail - - status - - title - BulkDeleteHost: + - links type: object + HostConfigSchemaInternal: properties: - entries: - type: array - description: A list of host names. - example: - - example - - sample + site: + description: The site the host is monitored on. + type: string + is_cluster: + description: Indicates if the host is a cluster host. + type: boolean + required: + - is_cluster + - site + type: object + HostContactGroup: + properties: + groups: + description: A list of contact groups. items: + example: all type: string - description: The hostname or IP address itself. - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z + type: array + use: + default: false + description: Add these contact groups to the host. + type: boolean + use_for_services: + default: false + description:

Always add host contact groups also to its services.

With + this option contact groups that are added to hosts are always being added + to services, as well. This only makes a difference if you have assigned + other contact groups to services via rules in Host & Service Parameters. + As long as you do not have any such rule a service always inherits all + contact groups from its host. + type: boolean + recurse_use: + default: false + description: Add these groups as contacts to all hosts in all sub-folders + of this folder. + type: boolean + recurse_perms: + default: false + description: Give these groups also permission on all sub-folders. + type: boolean required: - - entries - HostUpdateAttribute: + - groups type: object + HostCreateAttribute: properties: alias: + description: A comment or description of this host type: string - description: Add a comment or describe this host site: - type: string description: The site that should monitor this host. + type: string contactgroups: - description: Only members of the contact groups listed here have Setup permission - for the host/folder. Optionally, you can make these contact groups automatically - monitor contacts. The assignment of hosts to contact groups can also be - defined by rules. allOf: - $ref: '#/components/schemas/HostContactGroup' + description: Only members of the contact groups listed here have WATO permission + to the host / folder. If you want, you can make those contact groups automatically + also monitoring contacts. This is completely optional. Assignment + of host to contact groups can be done by rules + as well. parents: - type: array description: A list of parents of this host. items: - type: string example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z + pattern: '[-0-9a-zA-Z_.]+' + type: string + type: array ipaddress: - type: string description: An IPv4 address. - ipv6address: type: string + ipv6address: description: An IPv6 address. + type: string additional_ipv4addresses: - type: array description: A list of IPv4 addresses. items: type: string - additional_ipv6addresses: type: array + additional_ipv6addresses: description: A list of IPv6 addresses. items: type: string + type: array snmp_community: + allOf: + - $ref: '#/components/schemas/SNMPCredentials' description: The SNMP access configuration. A configured SNMP v1/v2 community here will have precedence over any configured SNMP community rule. For this attribute to take effect, the attribute `tag_snmp_ds` needs to be set first. - allOf: - - $ref: '#/components/schemas/SNMPCredentials' labels: - type: object - description: Labels allow you to flexibly group your hosts in order to refer - to them later at other places in Checkmk, e.g. in rule chains.
Label - format: key:value

Checkmk does not perform any validation - on the labels you use. additionalProperties: - type: string description: The host label value + type: string + description: With the help of labels you can flexibly group your hosts in + order to refer to them later at other places in Check_MK, e.g. in rule + chains. A label always consists of a combination of key and value in the + format "key:value". A host can only have one value per key. Check_MK will + not perform any validation on the labels you use. + type: object network_scan: + allOf: + - $ref: '#/components/schemas/NetworkScan' description: Configuration for automatic network scan. Pings will besent to each IP address in the configured ranges to checkif a host is up or down. Each found host will be added tothe folder by it's hostname (if possible) or IP address. - allOf: - - $ref: '#/components/schemas/NetworkScan' management_protocol: - type: string description: "The protocol used to connect to the management board.\n\n\ Valid options are:\n\n * `none` - No management board\n * `snmp` - Connect\ \ using SNMP\n * `ipmi` - Connect using IPMI\n" @@ -28080,37 +3436,37 @@ components: - none - snmp - ipmi - management_address: type: string + management_address: description: Address (IPv4, IPv6 or hostname) under which the management board can be reached. + type: string management_snmp_community: - nullable: true - description: SNMP credentials allOf: - $ref: '#/components/schemas/SNMPCredentials' + description: SNMP credentials + nullable: true management_ipmi_credentials: - description: IPMI credentials allOf: - $ref: '#/components/schemas/IPMIParameters' + description: IPMI credentials locked_by: + allOf: + - $ref: '#/components/schemas/LockedBy' description: Identity of the entity which locked the locked_attributes. The identity is built out of the Site ID, the program name and the connection ID. - allOf: - - $ref: '#/components/schemas/LockedBy' locked_attributes: - type: array description: Name of host attributes which are locked in the UI. items: type: string + type: array inventory_failed: - type: boolean description: Whether or not the last bulk discovery failed. It is set to True once it fails and unset in case a later discovery succeeds. example: false + type: boolean tag_criticality: - type: string description: "Choices:\n\n * `\"prod\"`: Productive system\n\n * `\"critical\"\ `: Business critical\n\n * `\"test\"`: Test system\n\n * `\"offline\"\ `: Do not monitor this host" @@ -28119,8 +3475,8 @@ components: - critical - test - offline - tag_networking: type: string + tag_networking: description: "Choices:\n\n * `\"lan\"`: Local network (low latency)\n\n\ \ * `\"wan\"`: WAN (high latency)\n\n * `\"dmz\"`: DMZ (low latency, secure\ \ access)" @@ -28128,8 +3484,8 @@ components: - lan - wan - dmz - tag_agent: type: string + tag_agent: description: "Choices:\n\n * `\"cmk-agent\"`: API integrations if configured,\ \ else Checkmk agent\n\n * `\"all-agents\"`: Configured API integrations\ \ and Checkmk agent\n\n * `\"special-agents\"`: Configured API integrations,\ @@ -28140,35 +3496,35 @@ components: - all-agents - special-agents - no-agent - tag_piggyback: type: string - description: "By default, each host has a piggyback data source.

Use\ - \ piggyback data from other hosts if present:
If selected, the\ - \ Check_MK service of this host will process the piggyback data,\ - \ but will not warn if no piggyback data is available. The associated\ - \ discovered services would become stale.

Always use and expect\ - \ piggyback data:
The host will expect piggyback data, and the\ - \ Check_MK service of this host will warn if no piggyback data\ - \ is available.

Never use piggyback data:
The Check_MK\ - \ service does not process piggybacking data at all, and will ignore it\ - \ if it's available.\n\nChoices:\n\n * `\"auto-piggyback\"`: Use piggyback\ - \ data from other hosts if present\n\n * `\"piggyback\"`: Always use and\ - \ expect piggyback data\n\n * `\"no-piggyback\"`: Never use piggyback\ - \ data" + tag_piggyback: + description: "By default every host has the piggyback data source Use\ + \ piggyback data from other hosts if present. In this case the Check_MK\ + \ service of this host processes the piggyback data but does not warn\ + \ if no piggyback data is available. The related discovered services would\ + \ become stale. If a host has configured Always use and expect piggyback\ + \ data for the piggyback data source then this host expects piggyback\ + \ data and the Check_MK service of this host warns if no piggyback\ + \ data is available. In the last case, ie. Never use piggyback data,\ + \ the Check_MK service does not process piggyback data at all\ + \ and ignores it if available.\n\nChoices:\n\n * `\"auto-piggyback\"`:\ + \ Use piggyback data from other hosts if present\n\n * `\"piggyback\"\ + `: Always use and expect piggyback data\n\n * `\"no-piggyback\"`: Never\ + \ use piggyback data" enum: - auto-piggyback - piggyback - no-piggyback - tag_snmp_ds: type: string + tag_snmp_ds: description: "Choices:\n\n * `\"no-snmp\"`: No SNMP\n\n * `\"snmp-v2\"`:\ \ SNMP v2 or v3\n\n * `\"snmp-v1\"`: SNMP v1" enum: - no-snmp - snmp-v2 - snmp-v1 - tag_address_family: type: string + tag_address_family: description: "Choices:\n\n * `\"ip-v4-only\"`: IPv4 only\n\n * `\"ip-v6-only\"\ `: IPv6 only\n\n * `\"ip-v4v6\"`: IPv4/IPv6 dual-stack\n\n * `\"no-ip\"\ `: No IP" @@ -28177,122 +3533,249 @@ components: - ip-v6-only - ip-v4v6 - no-ip - UpdateHostEntry: + type: string + type: object + HostExtensions: + properties: + folder: + description: 'The folder, in which this host resides. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most + appropriate for your quoting/escaping needs. A good default choice is + `~`.' + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) + type: string + attributes: + anyOf: + - $ref: '#/components/schemas/HostViewAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Attributes of this host. + example: + ipaddress: 192.168.0.123 + effective_attributes: + description: All attributes of this host and all parent folders. Format + may change! + example: + tag_snmp_ds: null + nullable: true + type: object + is_cluster: + description: If this is a cluster host, i.e. a container for other hosts. + type: boolean + is_offline: + description: Whether the host is offline + type: boolean + cluster_nodes: + default: null + description: In the case this is a cluster host, these are the cluster nodes. + items: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + nullable: true + type: array + type: object + HostGroup: + properties: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + domainType: + default: host_group + description: The domain type of the object. + id: + description: The unique identifier for this domain-object type. + type: string + title: + description: A human readable title of this object. Can be used for user + interfaces. + type: string + members: + description: The container for external resources, like linked foreign objects + or actions. + type: object + extensions: + description: All the attributes of the domain object. + type: object + required: + - domainType + - links + type: object + HostMembers: + properties: + folder_config: + allOf: + - $ref: '#/components/schemas/Folder' + description: The folder in which this host resides. It is represented by + a hexadecimal identifier which is it's 'primary key'. The folder can be + accessed via the `self`-link provided in the links array. + type: object + HostOrServiceCondition: + properties: + match_on: + description: A list of string matching regular expressions. + items: + type: string + type: array + operator: + description: "How the hosts or services should be matched.\n * one_of -\ + \ will match if any of the hosts or services is matched\n * none_of -\ + \ will match if none of the hosts are matched. In other words: will match\ + \ all hosts or services which are not specified.\n" + enum: + - one_of + - none_of + type: string + type: object + HostTag: + properties: + id: + description: The unique identifier of this host tag + type: string + title: + description: The title of this host tag + type: string + aux_tags: + description: The auxiliary tags this tag included in. + items: + type: string + type: array type: object + HostTag1: properties: - attributes: - anyOf: - - $ref: '#/components/schemas/HostUpdateAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: Replace all currently set attributes on the host, with these - attributes. Any previously set attributes which are not given here will - be removed. Can't be used together with update_attributes or remove_attributes - fields. - example: &id026 - ipaddress: 192.168.0.123 - update_attributes: - anyOf: - - $ref: '#/components/schemas/HostUpdateAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: Just update the hosts attributes with these attributes. The - previously set attributes will be overwritten. Can't be used together - with attributes or remove_attributes fields. - example: &id027 - ipaddress: 192.168.0.123 - remove_attributes: - type: array - description: A list of attributes which should be removed. Can't be used - together with attributes or update attributes fields. - example: &id028 - - tag_foobar + ident: + default: null + description: An unique id for the tag + example: tag_id + nullable: true + type: string + title: + description: The title of the tag + example: Tag + type: string + aux_tags: + description: The list of auxiliary tag ids. Built-in tags (ip-v4, ip-v6, + snmp, tcp, ping) and custom defined tags are allowed. + example: + - ip-v4, ip-v6 items: + description: An auxiliary tag id + example: ip-v4 type: string - host_name: - type: string - description: The hostname or IP address itself. - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z + type: array required: - - host_name - BulkUpdateHost: + - title type: object + HostTagExtensions: properties: - entries: + topic: + description: The topic this host tag group is organized in. + type: string + tags: + description: The list of tags in this group. + items: + $ref: '#/components/schemas/HostTag' type: array - description: A list of host entries. - example: - - host_name: example.com - attributes: {} + type: object + HostTagGroupCollection: + properties: + links: + description: list of links to other resources. + example: null items: - $ref: '#/components/schemas/UpdateHostEntry' + $ref: '#/components/schemas/Link' + type: array + id: + default: all + description: The name of this collection. + type: string + domainType: + default: host_tag_group + description: The domain type of the objects in the collection. + title: + description: A human readable title of this object. Can be used for user + interfaces. + type: string + value: + description: A list of host tag group objects. + items: + $ref: '#/components/schemas/ConcreteHostTagGroup' + type: array + extensions: + description: Additional attributes alongside the collection. + type: object required: - - entries - ClusterCreateAttribute: + - links type: object + HostUpdateAttribute: properties: alias: + description: A comment or description of this host type: string - description: Add a comment or describe this host site: - type: string description: The site that should monitor this host. + type: string contactgroups: - description: Only members of the contact groups listed here have Setup permission - for the host/folder. Optionally, you can make these contact groups automatically - monitor contacts. The assignment of hosts to contact groups can also be - defined by rules. allOf: - $ref: '#/components/schemas/HostContactGroup' + description: Only members of the contact groups listed here have WATO permission + to the host / folder. If you want, you can make those contact groups automatically + also monitoring contacts. This is completely optional. Assignment + of host to contact groups can be done by rules + as well. parents: - type: array description: A list of parents of this host. items: - type: string example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z + pattern: '[-0-9a-zA-Z_.]+' + type: string + type: array ipaddress: - type: string description: An IPv4 address. - ipv6address: type: string + ipv6address: description: An IPv6 address. + type: string additional_ipv4addresses: - type: array description: A list of IPv4 addresses. items: type: string - additional_ipv6addresses: type: array + additional_ipv6addresses: description: A list of IPv6 addresses. items: type: string + type: array snmp_community: + allOf: + - $ref: '#/components/schemas/SNMPCredentials' description: The SNMP access configuration. A configured SNMP v1/v2 community here will have precedence over any configured SNMP community rule. For this attribute to take effect, the attribute `tag_snmp_ds` needs to be set first. - allOf: - - $ref: '#/components/schemas/SNMPCredentials' labels: - type: object - description: Labels allow you to flexibly group your hosts in order to refer - to them later at other places in Checkmk, e.g. in rule chains.
Label - format: key:value

Checkmk does not perform any validation - on the labels you use. additionalProperties: - type: string description: The host label value + type: string + description: With the help of labels you can flexibly group your hosts in + order to refer to them later at other places in Check_MK, e.g. in rule + chains. A label always consists of a combination of key and value in the + format "key:value". A host can only have one value per key. Check_MK will + not perform any validation on the labels you use. + type: object network_scan: + allOf: + - $ref: '#/components/schemas/NetworkScan' description: Configuration for automatic network scan. Pings will besent to each IP address in the configured ranges to checkif a host is up or down. Each found host will be added tothe folder by it's hostname (if possible) or IP address. - allOf: - - $ref: '#/components/schemas/NetworkScan' management_protocol: - type: string description: "The protocol used to connect to the management board.\n\n\ Valid options are:\n\n * `none` - No management board\n * `snmp` - Connect\ \ using SNMP\n * `ipmi` - Connect using IPMI\n" @@ -28300,37 +3783,37 @@ components: - none - snmp - ipmi - management_address: type: string + management_address: description: Address (IPv4, IPv6 or hostname) under which the management board can be reached. + type: string management_snmp_community: - nullable: true - description: SNMP credentials allOf: - $ref: '#/components/schemas/SNMPCredentials' + description: SNMP credentials + nullable: true management_ipmi_credentials: - description: IPMI credentials allOf: - $ref: '#/components/schemas/IPMIParameters' + description: IPMI credentials locked_by: + allOf: + - $ref: '#/components/schemas/LockedBy' description: Identity of the entity which locked the locked_attributes. The identity is built out of the Site ID, the program name and the connection ID. - allOf: - - $ref: '#/components/schemas/LockedBy' locked_attributes: - type: array description: Name of host attributes which are locked in the UI. items: type: string + type: array inventory_failed: - type: boolean description: Whether or not the last bulk discovery failed. It is set to True once it fails and unset in case a later discovery succeeds. example: false + type: boolean tag_criticality: - type: string description: "Choices:\n\n * `\"prod\"`: Productive system\n\n * `\"critical\"\ `: Business critical\n\n * `\"test\"`: Test system\n\n * `\"offline\"\ `: Do not monitor this host" @@ -28339,8 +3822,8 @@ components: - critical - test - offline - tag_networking: type: string + tag_networking: description: "Choices:\n\n * `\"lan\"`: Local network (low latency)\n\n\ \ * `\"wan\"`: WAN (high latency)\n\n * `\"dmz\"`: DMZ (low latency, secure\ \ access)" @@ -28348,8 +3831,8 @@ components: - lan - wan - dmz - tag_agent: type: string + tag_agent: description: "Choices:\n\n * `\"cmk-agent\"`: API integrations if configured,\ \ else Checkmk agent\n\n * `\"all-agents\"`: Configured API integrations\ \ and Checkmk agent\n\n * `\"special-agents\"`: Configured API integrations,\ @@ -28360,6885 +3843,17599 @@ components: - all-agents - special-agents - no-agent - tag_piggyback: type: string - description: "By default, each host has a piggyback data source.

Use\ - \ piggyback data from other hosts if present:
If selected, the\ - \ Check_MK service of this host will process the piggyback data,\ - \ but will not warn if no piggyback data is available. The associated\ - \ discovered services would become stale.

Always use and expect\ - \ piggyback data:
The host will expect piggyback data, and the\ - \ Check_MK service of this host will warn if no piggyback data\ - \ is available.

Never use piggyback data:
The Check_MK\ - \ service does not process piggybacking data at all, and will ignore it\ - \ if it's available.\n\nChoices:\n\n * `\"auto-piggyback\"`: Use piggyback\ - \ data from other hosts if present\n\n * `\"piggyback\"`: Always use and\ - \ expect piggyback data\n\n * `\"no-piggyback\"`: Never use piggyback\ - \ data" + tag_piggyback: + description: "By default every host has the piggyback data source Use\ + \ piggyback data from other hosts if present. In this case the Check_MK\ + \ service of this host processes the piggyback data but does not warn\ + \ if no piggyback data is available. The related discovered services would\ + \ become stale. If a host has configured Always use and expect piggyback\ + \ data for the piggyback data source then this host expects piggyback\ + \ data and the Check_MK service of this host warns if no piggyback\ + \ data is available. In the last case, ie. Never use piggyback data,\ + \ the Check_MK service does not process piggyback data at all\ + \ and ignores it if available.\n\nChoices:\n\n * `\"auto-piggyback\"`:\ + \ Use piggyback data from other hosts if present\n\n * `\"piggyback\"\ + `: Always use and expect piggyback data\n\n * `\"no-piggyback\"`: Never\ + \ use piggyback data" enum: - auto-piggyback - piggyback - no-piggyback - tag_snmp_ds: type: string + tag_snmp_ds: description: "Choices:\n\n * `\"no-snmp\"`: No SNMP\n\n * `\"snmp-v2\"`:\ \ SNMP v2 or v3\n\n * `\"snmp-v1\"`: SNMP v1" enum: - no-snmp - snmp-v2 - snmp-v1 - tag_address_family: type: string + tag_address_family: description: "Choices:\n\n * `\"ip-v4-only\"`: IPv4 only\n\n * `\"ip-v6-only\"\ `: IPv6 only\n\n * `\"ip-v4v6\"`: IPv4/IPv6 dual-stack\n\n * `\"no-ip\"\ `: No IP" - enum: - - ip-v4-only - - ip-v6-only - - ip-v4v6 - - no-ip - CreateClusterHost: - type: object - properties: - folder: - type: string - description: 'The path name of the folder. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - example: / - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - host_name: - type: string - description: The hostname of the cluster host. - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - attributes: - anyOf: - - $ref: '#/components/schemas/ClusterCreateAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: Attributes to set on the newly created host. - example: - ipaddress: 192.168.0.123 - nodes: - type: array - description: Nodes where the newly created host should be the cluster-container - of. - example: - - host1 - - host2 - - host3 - items: - type: string - description: The hostname or IP address itself. - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - required: - - folder - - host_name - - nodes - MoveHost: - type: object - properties: - target_folder: - type: string - description: 'The path of the target folder where the host is supposed to - be moved to. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - example: ~my~fine~folder - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - required: - - target_folder - RenameHost: - type: object - properties: - new_name: - type: string - description: The new name of the existing host. - example: newhost - pattern: ^[-0-9a-zA-Z_.]+\Z - required: - - new_name - UpdateHost: - type: object - properties: - attributes: - anyOf: - - $ref: '#/components/schemas/HostUpdateAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: Replace all currently set attributes on the host, with these - attributes. Any previously set attributes which are not given here will - be removed. Can't be used together with update_attributes or remove_attributes - fields. - example: *id026 - update_attributes: - anyOf: - - $ref: '#/components/schemas/HostUpdateAttribute' - - $ref: '#/components/schemas/CustomHostAttributes' - - $ref: '#/components/schemas/TagGroupAttributes' - description: Just update the hosts attributes with these attributes. The - previously set attributes will be overwritten. Can't be used together - with attributes or remove_attributes fields. - example: *id027 - remove_attributes: - type: array - description: A list of attributes which should be removed. Can't be used - together with attributes or update attributes fields. - example: *id028 - items: - type: string - UpdateNodes: - type: object - properties: - nodes: - type: array - description: Nodes where the newly created host should be the cluster-container - of. - example: - - host1 - - host2 - - host3 - items: - type: string - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - required: - - nodes - ObjectProperty: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: + enum: + - ip-v4-only + - ip-v6-only + - ip-v4v6 + - no-ip type: string - description: The unique name of this property, local to this domain type. - value: - type: array - description: The value of the property. In this case a list. - items: - type: string - extensions: - type: object - description: Additional attributes alongside the property. - required: - - links - InputHostGroup: type: object + HostViewAttribute: properties: - name: - type: string - description: A name used as identifier - example: windows - pattern: ^[-a-z0-9A-Z_\.]*\Z alias: + description: A comment or description of this host type: string - description: The name used for displaying in the GUI. - example: Windows Servers - required: - - alias - - name - BulkInputHostGroup: - type: object - properties: - entries: - type: array - description: A list of host group entries. - example: - - name: windows - alias: Windows Servers - uniqueItems: true + site: + description: The site that should monitor this host. + type: string + contactgroups: + allOf: + - $ref: '#/components/schemas/HostContactGroup' + description: Only members of the contact groups listed here have WATO permission + to the host / folder. If you want, you can make those contact groups automatically + also monitoring contacts. This is completely optional. Assignment + of host to contact groups can be done by rules + as well. + parents: + description: A list of parents of this host. items: - $ref: '#/components/schemas/InputHostGroup' - required: - - entries - HostGroup: - type: object - properties: - links: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: host_group_config - description: The domain type of the object. - id: + ipaddress: + description: An IPv4 address. type: string - description: The unique identifier for this domain-object type. - title: + ipv6address: + description: An IPv6 address. type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - type: object - description: All the attributes of the domain object. - required: - - links - HostGroupCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null + additional_ipv4addresses: + description: A list of IPv4 addresses. items: - $ref: '#/components/schemas/Link' - id: - type: string - default: all - description: The name of this collection. - domainType: - default: host_group_config - description: The domain type of the objects in the collection. - title: - type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: + type: string type: array - description: A list of host group objects. + additional_ipv6addresses: + description: A list of IPv6 addresses. items: - $ref: '#/components/schemas/HostGroup' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - BulkDeleteHostGroup: - type: object - properties: - entries: + type: string type: array - description: A list of host group names. - example: - - windows - - panels - items: + snmp_community: + allOf: + - $ref: '#/components/schemas/SNMPCredentials' + description: The SNMP access configuration. A configured SNMP v1/v2 community + here will have precedence over any configured SNMP community rule. For + this attribute to take effect, the attribute `tag_snmp_ds` needs to be + set first. + labels: + additionalProperties: + description: The host label value type: string - description: The name of the host group config - example: windows - required: - - entries - UpdateGroup1: - type: object - properties: - alias: + description: With the help of labels you can flexibly group your hosts in + order to refer to them later at other places in Check_MK, e.g. in rule + chains. A label always consists of a combination of key and value in the + format "key:value". A host can only have one value per key. Check_MK will + not perform any validation on the labels you use. + type: object + network_scan: + allOf: + - $ref: '#/components/schemas/NetworkScan' + description: Configuration for automatic network scan. Pings will besent + to each IP address in the configured ranges to checkif a host is up or + down. Each found host will be added tothe folder by it's hostname (if + possible) or IP address. + network_scan_result: + allOf: + - $ref: '#/components/schemas/NetworkScanResult' + description: Read only access to the network scan result + management_protocol: + description: "The protocol used to connect to the management board.\n\n\ + Valid options are:\n\n * `none` - No management board\n * `snmp` - Connect\ + \ using SNMP\n * `ipmi` - Connect using IPMI\n" + enum: + - none + - snmp + - ipmi type: string - description: The name used for displaying in the GUI. - example: Example Group - required: - - alias - UpdateHostGroup: - type: object - properties: - name: + management_address: + description: Address (IPv4, IPv6 or hostname) under which the management + board can be reached. type: string - description: The name of the host group. - example: windows - attributes: - $ref: '#/components/schemas/UpdateGroup1' - required: - - name - BulkUpdateHostGroup: - type: object - properties: - entries: - type: array - description: A list of host group entries. - example: - - name: windows - attributes: - alias: Windows Servers + management_snmp_community: + allOf: + - $ref: '#/components/schemas/SNMPCredentials' + description: SNMP credentials + nullable: true + management_ipmi_credentials: + allOf: + - $ref: '#/components/schemas/IPMIParameters' + description: IPMI credentials + meta_data: + allOf: + - $ref: '#/components/schemas/MetaData' + description: Read only access to configured metadata. + locked_by: + allOf: + - $ref: '#/components/schemas/LockedBy' + description: Identity of the entity which locked the locked_attributes. + The identity is built out of the Site ID, the program name and the connection + ID. + locked_attributes: + description: Name of host attributes which are locked in the UI. items: - $ref: '#/components/schemas/UpdateHostGroup' - required: - - entries - LinkHostUUID: - type: object - properties: - uuid: + type: string + type: array + inventory_failed: + description: Whether or not the last bulk discovery failed. It is set to + True once it fails and unset in case a later discovery succeeds. + example: false + type: boolean + tag_criticality: + description: "Choices:\n\n * `\"prod\"`: Productive system\n\n * `\"critical\"\ + `: Business critical\n\n * `\"test\"`: Test system\n\n * `\"offline\"\ + `: Do not monitor this host" + enum: + - prod + - critical + - test + - offline type: string - format: uuid - description: A valid UUID. - example: 34e4c967-1591-4883-8cdf-0e335b09618d - required: - - uuid - RegisterHost: - type: object - properties: - uuid: + tag_networking: + description: "Choices:\n\n * `\"lan\"`: Local network (low latency)\n\n\ + \ * `\"wan\"`: WAN (high latency)\n\n * `\"dmz\"`: DMZ (low latency, secure\ + \ access)" + enum: + - lan + - wan + - dmz type: string - format: uuid - description: A valid UUID. - example: 34e4c967-1591-4883-8cdf-0e335b09618d - required: - - uuid - ConnectionMode: - type: object - properties: - connection_mode: + tag_agent: + description: "Choices:\n\n * `\"cmk-agent\"`: API integrations if configured,\ + \ else Checkmk agent\n\n * `\"all-agents\"`: Configured API integrations\ + \ and Checkmk agent\n\n * `\"special-agents\"`: Configured API integrations,\ + \ no Checkmk agent\n\n * `\"no-agent\"`: No API integrations, no Checkmk\ + \ agent" + enum: + - cmk-agent + - all-agents + - special-agents + - no-agent + type: string + tag_piggyback: + description: "By default every host has the piggyback data source Use\ + \ piggyback data from other hosts if present. In this case the Check_MK\ + \ service of this host processes the piggyback data but does not warn\ + \ if no piggyback data is available. The related discovered services would\ + \ become stale. If a host has configured Always use and expect piggyback\ + \ data for the piggyback data source then this host expects piggyback\ + \ data and the Check_MK service of this host warns if no piggyback\ + \ data is available. In the last case, ie. Never use piggyback data,\ + \ the Check_MK service does not process piggyback data at all\ + \ and ignores it if available.\n\nChoices:\n\n * `\"auto-piggyback\"`:\ + \ Use piggyback data from other hosts if present\n\n * `\"piggyback\"\ + `: Always use and expect piggyback data\n\n * `\"no-piggyback\"`: Never\ + \ use piggyback data" + enum: + - auto-piggyback + - piggyback + - no-piggyback type: string - description: "This configures the communication direction of this host.\n\ - \ * `pull-agent` (default) - The server will try to contact the monitored\ - \ host and pull the data by initializing a TCP connection\n * `push-agent`\ - \ - the host is expected to send the data to the monitoring server without\ - \ being triggered\n" + tag_snmp_ds: + description: "Choices:\n\n * `\"no-snmp\"`: No SNMP\n\n * `\"snmp-v2\"`:\ + \ SNMP v2 or v3\n\n * `\"snmp-v1\"`: SNMP v1" enum: - - pull-agent - - push-agent - HostConfigSchemaInternal: - type: object - properties: - site: + - no-snmp + - snmp-v2 + - snmp-v1 + type: string + tag_address_family: + description: "Choices:\n\n * `\"ip-v4-only\"`: IPv4 only\n\n * `\"ip-v6-only\"\ + `: IPv6 only\n\n * `\"ip-v4v6\"`: IPv4/IPv6 dual-stack\n\n * `\"no-ip\"\ + `: No IP" + enum: + - ip-v4-only + - ip-v6-only + - ip-v4v6 + - no-ip type: string - description: The site the host is monitored on. - is_cluster: - type: boolean - description: Indicates if the host is a cluster host. - required: - - is_cluster - - site - HostTag: type: object + IPAddressRange: properties: - ident: + type: + default: ip_range + description: A range of addresses. + from_address: + description: The first IPv4 address of this range. type: string - default: null - nullable: true - description: An unique id for the tag - example: tag_id - title: + to_address: + description: The last IPv4 address of this range. type: string - description: The title of the tag - example: Tag - aux_tags: - type: array - description: The list of auxiliary tag ids. Built-in tags (ip-v4, ip-v6, - snmp, tcp, ping) and custom defined tags are allowed. - example: - - ip-v4, ip-v6 + type: object + IPAddresses: + properties: + type: + default: ip_list + description: A list of single IPv4 addresses. + addresses: items: type: string - description: An auxiliary tag id - example: ip-v4 - pattern: ^[-0-9a-zA-Z_]+\Z - required: - - title - InputHostTagGroup: + type: array type: object + IPMIParameters: properties: - ident: - type: string - description: An id for the host tag group - example: group_id - pattern: ^[^\d\W][-\w]*\Z - title: - type: string - description: A title for the host tag - example: Kubernetes - topic: + username: type: string - description: Different tags can be grouped in a topic - example: Data Sources - help: + password: type: string - default: '' - description: A help description for the tag group - example: Kubernetes Pods - tags: - type: array - description: A list of host tags belonging to the host tag group - example: - - ident: pod - title: Pod - minLength: 1 - items: - $ref: '#/components/schemas/HostTag' required: - - ident - - tags - - title - HostTag1: + - password + - username type: object + IPNetwork: properties: - id: - type: string - nullable: true - description: The unique identifier of this host tag - title: + type: + default: ip_network + description: A single IPv4 network in CIDR notation. + network: + description: "A IPv4 network in CIDR notation. Minimum prefix length is\ + \ 8 bit, maximum prefix length is 30 bit.\n\nValid examples:\n\n * `192.168.0.0/24`\n\ + \ * `192.168.0.0/255.255.255.0`" type: string - description: The title of this host tag - aux_tags: - type: array - description: The auxiliary tags this tag included in. + type: object + IPRangeWithRegexp: + discriminator: + mapping: + address_range: '#/components/schemas/IPAddressRange' + exclude_by_regexp: '#/components/schemas/IPRegexp' + explicit_addresses: '#/components/schemas/IPAddresses' + network_range: '#/components/schemas/IPNetwork' + propertyName: type + oneOf: + - $ref: '#/components/schemas/IPAddressRange' + - $ref: '#/components/schemas/IPNetwork' + - $ref: '#/components/schemas/IPAddresses' + - $ref: '#/components/schemas/IPRegexp' + properties: {} + type: object + IPRegexp: + properties: + type: + default: ip_regex_list + description: IPv4 addresses which match a regexp pattern + regexp_list: + description: A list of regular expressions which are matched against the + found IP addresses. The matches will be excluded from the result. items: type: string - HostTagExtensions: + type: array type: object + IdleOption: properties: - topic: + option: + description: Specify if the idle timeout should use the global configuration, + be disabled or use an individual duration + enum: + - global + - disable + - individual + example: false type: string - description: The topic this host tag group is organized in. - tags: - type: array - description: The list of tags in this group. - items: - $ref: '#/components/schemas/HostTag1' - ConcreteHostTagGroup: + duration: + default: 3600 + description: The duration in seconds of the individual idle timeout if individual + is selected as idle timeout option. + example: 3600 + type: integer + required: + - option type: object + InputContactGroup: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: host_tag_group - description: The domain type of the object. - id: + name: + description: The name of the contact group. + example: OnCall type: string - description: The unique identifier for this domain-object type. - title: + alias: + description: The name used for displaying in the GUI. + example: Not on Sundays. type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: Additional fields for objects of this type. - allOf: - - $ref: '#/components/schemas/HostTagExtensions' required: - - domainType - - links - HostTagGroupCollection: + - name type: object + InputHostGroup: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: + name: + description: A name used as identifier + example: windows type: string - default: all - description: The name of this collection. - domainType: - default: host_tag_group - description: The domain type of the objects in the collection. - title: + alias: + description: The name used for displaying in the GUI. + example: Windows Servers type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of host tag group objects. - items: - $ref: '#/components/schemas/ConcreteHostTagGroup' - extensions: - type: object - description: Additional attributes alongside the collection. required: - - links - UpdateHostTagGroup: + - name type: object + InputHostTagGroup: properties: - title: + ident: + description: An id for the host tag group + example: group_id + pattern: '[a-zA-Z_]+[-0-9a-zA-Z_]*' type: string + title: description: A title for the host tag example: Kubernetes - topic: type: string + topic: description: Different tags can be grouped in a topic example: Data Sources - help: type: string + help: + default: '' description: A help description for the tag group example: Kubernetes Pods + type: string tags: - type: array description: A list of host tags belonging to the host tag group example: - ident: pod title: Pod - minLength: 1 items: - $ref: '#/components/schemas/HostTag' - repair: - type: boolean - default: false - description: The host tag group can be in use by other hosts. Setting repair - to True gives permission to automatically update the tag from the affected - hosts. - example: false - TimeRange: + $ref: '#/components/schemas/HostTag1' + type: array + required: + - tags + - title + - topic type: object + InputPassword: properties: - start: + ident: + description: An unique identifier for the password + example: pass type: string - format: date-time - description: The approximate time of the first sample. - example: '2023-11-15 12:02:54.159803' - end: + title: + description: A title for the password + example: Kubernetes login type: string - format: date-time - description: The approximate time of the last sample. - example: '2023-11-15 12:17:54.159832' - required: - - end - - start - GetGraph: - type: object - properties: - time_range: - description: The time range from which to source the metrics. - example: &id029 - start: '2023-11-15 12:02:54.160009' - end: '2023-11-15 12:17:54.160014' - allOf: - - $ref: '#/components/schemas/TimeRange' - reduce: - type: string - default: average - description: Specify how to reduce a segment of data points to a single - data point of the output metric. This can be useful to find spikes in - your data that would be smoothed out by computing the average. - enum: &id030 - - min - - max - - average - example: max - site: + comment: + default: '' + description: A comment for the password + example: Kommentar type: string - description: The name of the site. Even though this is optional, specifying - a site will greatly improve performance in large distributed systems. - example: heute - host_name: + documentation_url: + default: '' + description: An optional URL pointing to documentation or any other page. + You can use either global URLs (beginning with http://), absolute local + urls (beginning with /) or relative URLs (that are relative to check_mk/). + example: localhost type: string - description: The hostname to use. - example: my.cool.host - pattern: ^[-0-9a-zA-Z_.]+\Z - service_description: + password: + description: The password string + example: password type: string - description: The service, whose data to request. - example: Check_MK - type: + owner: + description: Each password is owned by a group of users which are able to + edit, delete and use existing passwords. + example: admin type: string - description: Specify whether you want to receive a single metric (via metric_id), - or a predefined graph containing multiple metrics (via graph_id). - enum: &id031 - - predefined_graph - - single_metric - example: single_metric - graph_id: - type: string - pattern: ^\w[_\-\w\d]*$ - description: The ID of the predefined graph. After activating the "Show - internal IDs" in the "display options" of the Service view, you can see - the ID of a predefined graph in the title of the graph. - example: cmk_cpu_time_by_phase + shared: + description: The list of members to share the password with + example: + - all + items: + description: By default only the members of the owner contact group are + permitted to use a a configured password. It is possible to share a + password with other groups of users to make them able to use a password + in checks. + example: all + type: string + type: array required: - - graph_id - - host_name - - service_description - - time_range - - type - GetMetric: + - ident + - owner + - password + - title type: object + InputRuleObject: properties: - time_range: - description: The time range from which to source the metrics. - example: *id029 - allOf: - - $ref: '#/components/schemas/TimeRange' - reduce: - type: string - default: average - description: Specify how to reduce a segment of data points to a single - data point of the output metric. This can be useful to find spikes in - your data that would be smoothed out by computing the average. - enum: *id030 - example: max - site: - type: string - description: The name of the site. Even though this is optional, specifying - a site will greatly improve performance in large distributed systems. - example: heute - host_name: + ruleset: + description: Name of rule set. + example: host_config type: string - description: The hostname to use. - example: my.cool.host - pattern: ^[-0-9a-zA-Z_.]+\Z - service_description: + folder: + description: 'The path name of the folder. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most + appropriate for your quoting/escaping needs. A good default choice is + `~`.' + example: ~router + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - description: The service, whose data to request. - example: Check_MK - type: + properties: + allOf: + - $ref: '#/components/schemas/RuleProperties' + description: Configuration values for rules. + example: + disabled: false + value_raw: + description: The raw parameter value for this rule. To create the correct + structure, for now use the 'export for API' menu item in the Rule Editor + of the GUI. The value is expected to be a valid Python type. + example: '{"ignore_fs_types": ["tmpfs"]}' type: string - description: Specify whether you want to receive a single metric (via metric_id), - or a predefined graph containing multiple metrics (via graph_id). - enum: *id031 - example: single_metric - metric_id: - type: string - pattern: ^\w[_\-\w\d]*$ - description: The ID of the single metric.After activating the "Show internal - IDs" in the "display options" of the Service view, you can see the ID - of a single metric in the legend of the graph. - example: cmk_time_agent + conditions: + allOf: + - $ref: '#/components/schemas/RuleConditions' + description: Conditions. + example: {} required: - - host_name - - metric_id - - service_description - - time_range - - type - Get: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/GetGraph' - - $ref: '#/components/schemas/GetMetric' - discriminator: - propertyName: type - mapping: - predefined_graph: '#/components/schemas/GetGraph' - single_metric: '#/components/schemas/GetMetric' - Metric: + - folder + - ruleset type: object + InputServiceGroup: properties: - color: - type: string - description: The color of the metric as displayed in Checkmk. Color is in - HTML notation. - example: '#80ff40' - data_points: - type: array - description: The samples of the metric. - example: - - 3752390000.0 - - 3746380000.0 - - 3770930000.0 - - 3773230000.0 - - 3796020000.0 - - 3787010000.0 - - 3777880000.0 - - 3781040000.0 - - 3798920000.0 - - 3805910000.0 - items: - type: number - line_type: + name: + description: A name used as identifier + example: windows type: string - description: The line type to use. - example: area - title: + alias: + description: The name used for displaying in the GUI. + example: Environment Sensors type: string - description: The title of the graph. - example: RAM used required: - - data_points - - line_type - - title - GraphCollection: + - name type: object + InputTimePeriod: properties: - time_range: - description: The time range withing the samples of the response lie. + name: + description: A unique name for the time period. + example: first + type: string + alias: + description: An alias for the time period. + example: alias + type: string + active_time_ranges: + description: The list of active time ranges. example: - time_range: - start: '1970-01-01T00:00:00Z' - end: '1970-01-01T00:00:30Z' - allOf: - - $ref: '#/components/schemas/TimeRange' - step: - type: integer - description: The interval between two samples in seconds. - example: 60 - metrics: - description: The actual graph data. + - day: monday + time_ranges: + - end: '14:00' + start: '12:00' + items: + $ref: '#/components/schemas/TimeRangeActive' + type: array + exceptions: + description: A list of additional time ranges to be added. example: - - color: '#ffffff' - data_points: - - 1.0 - - 2.0 - - 3.0 - - 1.0 - line_type: area - title: RAM used + - date: '2020-01-01' + time_ranges: + - end: '18:00' + start: '14:00' + items: + $ref: '#/components/schemas/TimePeriodException' type: array + exclude: + description: A list of time period aliases whose periods are excluded. + example: + - alias items: - $ref: '#/components/schemas/Metric' - required: - - metrics - - step - - time_range - Checkbox: - type: object - properties: - state: - type: string - description: '' - enum: &id032 - - enabled - - disabled - example: '' + description: The alias for a time period. + example: alias + type: string + type: array required: - - state - RuleProperties: + - active_time_ranges + - alias + - name type: object + InstalledVersions: properties: - description: - type: string - description: A description or title of this rule. - example: Notify all contacts of a host/service via HTML email - comment: + site: + description: The site where this API call was made on. + example: production type: string - description: An optional comment that may be used to explain the purpose - of this object. - example: An example comment - documentation_url: + group: + description: The Apache WSGI application group this call was made on. + example: de type: string - description: An optional URL pointing to documentation or any other page. - This will be displayed as an icon and open a new page when clicked. - example: http://link/to/documentation - do_not_apply_this_rule: - description: Disabled rules are kept in the configuration but are not applied. + rest_api: + description: The REST-API version example: - state: enabled - allOf: - - $ref: '#/components/schemas/Checkbox' - allow_users_to_deactivate: - description: If you set this option then users are allowed to deactivate - notifications that are created by this rule. + revision: 1.0.0 + type: object + versions: + description: Some version numbers example: - state: enabled - allOf: - - $ref: '#/components/schemas/Checkbox' - required: - - allow_users_to_deactivate - - comment - - description - - do_not_apply_this_rule - - documentation_url - PluginName: - type: object - properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: &id033 - - asciimail - - cisco_webex_teams - - mkeventd - - mail - - ilert - - jira_issues - - opsgenie_issues - - pagerduty - - pushover - - servicenow - - signl4 - - slack - - sms_api - - sms - - spectrum - - victorops - - msteams - example: mail - required: - - plugin_name - PluginBase: - type: object - properties: - option: + checkmk: 1.8.0p1 + type: object + edition: + description: The Checkmk edition. + example: raw type: string - description: Create notifications with parameters or cancel previous notifications - enum: &id036 - - cancel_previous_notifications - - create_notification_with_the_following_parameters - example: cancel_previous_notifications - plugin_params: - $ref: '#/components/schemas/PluginName' - required: - - plugin_params - EmailAndDisplayName: + demo: + description: Whether this is a demo version or not. + example: false + type: boolean type: object + JobLogs: properties: - address: - type: string - description: '' - example: mat@tribe29.com - display_name: - type: string - description: '' - example: '' - FromEmailAndNameCheckbox: + result: + description: The list of result related logs + items: + type: string + type: array + progress: + description: The list of progress related logs + items: + type: string + type: array type: object + LabelCondition: properties: - state: + key: + description: The key of the label. e.g. 'os' in 'os:windows' + type: string + operator: + description: How the label should be matched. + enum: + - is + - is_not type: string - description: '' - enum: *id032 - example: '' value: - description: The email address and visible name used in the From header - of notifications messages. If no email address is specified the default - address is OMD_SITE@FQDN is used. If the environment variable OMD_SITE - is not set it defaults to checkmk - allOf: - - $ref: '#/components/schemas/EmailAndDisplayName' - required: - - state - CheckboxOneOf: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/Checkbox' - - $ref: '#/components/schemas/FromEmailAndNameCheckbox' - discriminator: - propertyName: state - mapping: - disabled: '#/components/schemas/Checkbox' - enabled: '#/components/schemas/FromEmailAndNameCheckbox' - AsciiMailPluginCreate: - type: object - properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - from_details: - $ref: '#/components/schemas/CheckboxOneOf' - reply_to: - $ref: '#/components/schemas/CheckboxOneOf' - subject_for_host_notifications: - $ref: '#/components/schemas/CheckboxOneOf' - subject_for_service_notifications: - $ref: '#/components/schemas/CheckboxOneOf' - send_separate_notification_to_every_recipient: - $ref: '#/components/schemas/Checkbox' - sort_order_for_bulk_notificaions: - $ref: '#/components/schemas/CheckboxOneOf' - body_head_for_both_host_and_service_notifications: - $ref: '#/components/schemas/CheckboxOneOf' - body_tail_for_host_notifications: - $ref: '#/components/schemas/CheckboxOneOf' - body_tail_for_service_notifications: - $ref: '#/components/schemas/CheckboxOneOf' - required: - - body_head_for_both_host_and_service_notifications - - body_tail_for_host_notifications - - body_tail_for_service_notifications - - from_details - - plugin_name - - reply_to - - send_separate_notification_to_every_recipient - - sort_order_for_bulk_notificaions - - subject_for_host_notifications - - subject_for_service_notifications - HTMLMailPluginCreate: - type: object - properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - from_details: - $ref: '#/components/schemas/CheckboxOneOf' - reply_to: - $ref: '#/components/schemas/CheckboxOneOf' - subject_for_host_notifications: - $ref: '#/components/schemas/CheckboxOneOf' - subject_for_service_notifications: - $ref: '#/components/schemas/CheckboxOneOf' - send_separate_notification_to_every_recipient: - $ref: '#/components/schemas/Checkbox' - sort_order_for_bulk_notificaions: - $ref: '#/components/schemas/CheckboxOneOf' - url_prefix_for_links_to_checkmk: - $ref: '#/components/schemas/CheckboxOneOf' - info_to_be_displayed_in_the_email_body: - $ref: '#/components/schemas/CheckboxOneOf' - insert_html_section_between_body_and_table: - $ref: '#/components/schemas/CheckboxOneOf' - display_graphs_among_each_other: - $ref: '#/components/schemas/Checkbox' - enable_sync_smtp: - $ref: '#/components/schemas/CheckboxOneOf' - graphs_per_notification: - $ref: '#/components/schemas/CheckboxOneOf' - bulk_notifications_with_graphs: - $ref: '#/components/schemas/CheckboxOneOf' + description: The value of the label. e.g. 'windows' in 'os:windows' + type: string required: - - bulk_notifications_with_graphs - - display_graphs_among_each_other - - enable_sync_smtp - - from_details - - graphs_per_notification - - info_to_be_displayed_in_the_email_body - - insert_html_section_between_body_and_table - - plugin_name - - reply_to - - send_separate_notification_to_every_recipient - - sort_order_for_bulk_notificaions - - subject_for_host_notifications - - subject_for_service_notifications - - url_prefix_for_links_to_checkmk - CiscoExplicitWebhookUrl: + - key + - value type: object + Link: properties: - option: + domainType: + default: link + rel: + description: Indicates the nature of the relationship of the related resource + to the resource that generated this representation + example: self + type: string + href: + description: The (absolute) address of the related resource. Any characters + that are invalid in URLs must be URL encoded. + example: https://.../api_resource type: string - enum: &id034 - - store - - explicit - example: store - url: + method: + description: The HTTP method to use to traverse the link (get, post, put + or delete) + example: GET + pattern: GET|PUT|POST|DELETE type: string - format: url - example: http://example_webhook_url.com - required: - - option - - url - CiscoPasswordStore: - type: object - properties: - option: + type: + description: The content-type that the linked resource will return + example: application/json type: string - enum: *id034 - example: store - store_id: + title: + description: string that the consuming application may use to render the + link without having to traverse the link in advance + example: The object itself + nullable: true type: string - description: A password store ID - example: stored_password_1 + body_params: + description: A map of values that shall be sent in the request body. If + this is present,the request has to be sent with a content-type of 'application/json'. + type: object required: - - option - - store_id - CiscoUrlOrStoreSelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/CiscoExplicitWebhookUrl' - - $ref: '#/components/schemas/CiscoPasswordStore' - discriminator: - propertyName: option - mapping: - explicit: '#/components/schemas/CiscoExplicitWebhookUrl' - store: '#/components/schemas/CiscoPasswordStore' - CiscoWebexPluginCreate: + - domainType + - href + - method + - rel + - type type: object + LinkHostUUID: properties: - plugin_name: + uuid: + description: A valid UUID. + example: 34e4c967-1591-4883-8cdf-0e335b09618d + format: uuid type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - disable_ssl_cert_verification: - description: Ignore unverified HTTPS request warnings. Use with caution. - allOf: - - $ref: '#/components/schemas/Checkbox' - http_proxy: - description: Use the proxy settings from the environment variables. The - variables NO_PROXY, HTTP_PROXY and HTTPS_PROXY are taken into account - during execution. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - url_prefix_for_links_to_checkmk: - $ref: '#/components/schemas/CheckboxOneOf' - webhook_url: - $ref: '#/components/schemas/CiscoUrlOrStoreSelector' - required: - - disable_ssl_cert_verification - - http_proxy - - plugin_name - - url_prefix_for_links_to_checkmk - MkEventDPluginCreate: - type: object - properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - syslog_facility_to_use: - $ref: '#/components/schemas/CheckboxOneOf' - ip_address_of_remote_event_console: - $ref: '#/components/schemas/CheckboxOneOf' required: - - ip_address_of_remote_event_console - - plugin_name - - syslog_facility_to_use - IlertAPIKey: + - uuid type: object + LinkedValueDomainObjectCollection: properties: - option: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + domainType: + description: The "domain-type" of the object. type: string - enum: *id034 - example: store - key: + id: + description: The unique identifier for this domain-object type. + type: string + title: + description: A human readable title of this object. Can be used for user + interfaces. type: string - example: example_api_key + members: + description: The container for external resources, like linked foreign objects + or actions. + type: object + extensions: + description: All the attributes of the domain object. + type: object + value: + description: The collection itself, as links. Each entry in here is part + of the collection. + items: + $ref: '#/components/schemas/Link' + type: array required: - - key - - option - IlertPasswordStoreID: + - domainType + - links type: object + LockedBy: properties: - option: + site_id: + description: Site ID + type: string + program_id: + description: Program ID type: string - enum: *id034 - example: store - store_id: + instance_id: + description: Instance ID type: string - description: A password store ID - example: stored_password_1 required: - - option - - store_id - IlertKeyOrStoreSelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/IlertAPIKey' - - $ref: '#/components/schemas/IlertPasswordStoreID' - discriminator: - propertyName: option - mapping: - explicit: '#/components/schemas/IlertAPIKey' - store: '#/components/schemas/IlertPasswordStoreID' - IlertPluginCreate: + - instance_id + - program_id + - site_id type: object + LogicalExpr: properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - disable_ssl_cert_verification: - description: Ignore unverified HTTPS request warnings. Use with caution. - allOf: - - $ref: '#/components/schemas/Checkbox' - notification_priority: + op: + description: The operator. type: string - description: HIGH - with escalation, LOW - without escalation - enum: - - HIGH - - LOW - example: HIGH - custom_summary_for_host_alerts: - type: string - description: A custom summary for host alerts - example: '$NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ - $HOSTOUTPUT$' - custom_summary_for_service_alerts: - type: string - description: A custom summary for service alerts - example: '$NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is - $SERVICESTATE$ - $SERVICEOUTPUT$' - http_proxy: - description: Use the proxy settings from the environment variables. The - variables NO_PROXY, HTTP_PROXY and HTTPS_PROXY are taken into account - during execution. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - url_prefix_for_links_to_checkmk: - $ref: '#/components/schemas/CheckboxOneOf' - api_key: - $ref: '#/components/schemas/IlertKeyOrStoreSelector' - required: - - api_key - - custom_summary_for_host_alerts - - custom_summary_for_service_alerts - - disable_ssl_cert_verification - - http_proxy - - notification_priority - - plugin_name - - url_prefix_for_links_to_checkmk - JiraPluginCreate: + expr: + items: + allOf: + - $ref: '#/components/schemas/Expr' + description: A list of query expressions to combine. + type: array type: object + MetaData: properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - disable_ssl_cert_verification: - description: Ignore unverified HTTPS request warnings. Use with caution. - allOf: - - $ref: '#/components/schemas/Checkbox' - username: - type: string - description: Configure the user name here - example: username_a - jira_url: - type: string - description: Configure the JIRA URL here - example: http://jira_url_example.com - password: - type: string - description: The password entered here is stored in plain text within the - monitoring site. This usually needed because the monitoring process needs - to have access to the unencrypted password because it needs to submit - it to authenticate with remote systems - example: example_pass_123&* - project_id: - type: string - description: The numerical JIRA project ID. If not set, it will be retrieved - from a custom user attribute named jiraproject. If that is not set, the - notification will fail - example: '' - issue_type_id: - type: string - description: The numerical JIRA issue type ID. If not set, it will be retrieved - from a custom user attribute named jiraissuetype. If that is not set, - the notification will fail - example: '' - host_custom_id: + created_at: + description: When has this object been created. + format: date-time + nullable: true type: string - description: The numerical JIRA custom field ID for host problems - example: '' - service_custom_id: + updated_at: + description: When this object was last changed. + format: date-time + nullable: true type: string - description: The numerical JIRA custom field ID for service problems - example: '' - monitoring_url: + created_by: + description: The user id under which this object has been created. + nullable: true type: string - description: Configure the base URL for the Monitoring Web-GUI here. Include - the site name. Used for link to check_mk out of jira - example: '' - site_custom_id: - description: The numerical ID of the JIRA custom field for sites. Please - use this option if you have multiple sites in a distributed setup which - send their notifications to the same JIRA instance - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - priority_id: - description: The numerical JIRA priority ID. If not set, it will be retrieved - from a custom user attribute named jirapriority. If that is not set, the - standard priority will be used - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - host_summary: - description: Here you are allowed to use all macros that are defined in - the notification context - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - service_summary: - description: Here you are allowed to use all macros that are defined in - the notification context - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - label: - description: Here you can set a custom label for new issues. If not set, - 'monitoring' will be used - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - resolution_id: - description: The numerical JIRA resolution transition ID. 11 - 'To Do', - 21 - 'In Progress', 31 - 'Done' - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - optional_timeout: - description: Here you can configure timeout settings. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - required: - - disable_ssl_cert_verification - - host_custom_id - - host_summary - - issue_type_id - - label - - monitoring_url - - optional_timeout - - password - - plugin_name - - priority_id - - project_id - - resolution_id - - service_custom_id - - service_summary - - site_custom_id - - username - OpsGenieExplicitKey: type: object + MoveFolder: properties: - option: - type: string - enum: *id034 - example: store - key: + destination: + description: 'Where the folder has to be moved to. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most + appropriate for your quoting/escaping needs. A good default choice is + `~`.' + example: '%2Fmy%2Ffine%2Ffolder' + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - example: example_api_key required: - - key - - option - OpsGenieStoreID: + - destination type: object + MoveHost: properties: - option: - type: string - enum: *id034 - example: store - store_id: + target_folder: + description: 'The path of the target folder where the host is supposed to + be moved to. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most + appropriate for your quoting/escaping needs. A good default choice is + `~`.' + example: '%2Fmy%2Ffine%2Ffolder' + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - description: A password store ID - example: stored_password_1 required: - - option - - store_id - OpsGenisStoreOrExplicitKeySelector: + - target_folder type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/OpsGenieExplicitKey' - - $ref: '#/components/schemas/OpsGenieStoreID' + MoveRuleTo: discriminator: - propertyName: option mapping: - explicit: '#/components/schemas/OpsGenieExplicitKey' - store: '#/components/schemas/OpsGenieStoreID' - OpsGeniePluginCreate: + after_specific_rule: '#/components/schemas/MoveToSpecificRule' + before_specific_rule: '#/components/schemas/MoveToSpecificRule' + bottom_of_folder: '#/components/schemas/MoveToFolder' + top_of_folder: '#/components/schemas/MoveToFolder' + propertyName: position + oneOf: + - $ref: '#/components/schemas/MoveToFolder' + - $ref: '#/components/schemas/MoveToFolder' + - $ref: '#/components/schemas/MoveToSpecificRule' + - $ref: '#/components/schemas/MoveToSpecificRule' + properties: {} type: object + MoveToFolder: properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - http_proxy: - description: Use the proxy settings from the environment variables. The - variables NO_PROXY, HTTP_PROXY and HTTPS_PROXY are taken into account - during execution. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - api_key: - $ref: '#/components/schemas/OpsGenisStoreOrExplicitKeySelector' - domain: - description: If you have an european account, please set the domain of your - opsgenie. Specify an absolute URL like https://api.eu.opsgenie.com - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - owner: - description: Sets the user of the alert. Display name of the request owner - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - source: - description: Source field of the alert. Default value is IP address of the - incoming request - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - priority: - $ref: '#/components/schemas/CheckboxOneOf' - note_while_creating: - description: Additional note that will be added while creating the alert - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - note_while_closing: - description: Additional note that will be added while closing the alert - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - desc_for_host_alerts: - description: Description field of host alert that is generally used to provide - a detailed information about the alert - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - desc_for_service_alerts: - description: Description field of service alert that is generally used to - provide a detailed information about the alert - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - message_for_host_alerts: - description: '' - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - message_for_service_alerts: - description: '' - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - responsible_teams: - description: Team names which will be responsible for the alert. If the - API Key belongs to a team integration, this field will be overwritten - with the owner team. You may paste a text from your clipboard which contains - several parts separated by ';' characters into the last input field. The - text will then be split by these separators and the single parts are added - into dedicated input fields - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - actions: - description: Custom actions that will be available for the alert. You may - paste a text from your clipboard which contains several parts separated - by ';' characters into the last input field. The text will then be split - by these separators and the single parts are added into dedicated input - fields - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - tags: - description: Tags of the alert. You may paste a text from your clipboard - which contains several parts separated by ';' characters into the last - input field. The text will then be split by these separators and the single - parts are added into dedicated input fields - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - entity: - description: Is used to specify which domain the alert is related to - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - required: - - actions - - api_key - - desc_for_host_alerts - - desc_for_service_alerts - - domain - - entity - - http_proxy - - message_for_host_alerts - - message_for_service_alerts - - note_while_closing - - note_while_creating - - owner - - plugin_name - - priority - - responsible_teams - - source - - tags - PagerDutyExplicitKey: + position: + description: The type of position to move to. + example: top_of_folder + type: string + folder: + description: 'The path name of the folder. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most + appropriate for your quoting/escaping needs. A good default choice is + `~`.' + example: / + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) + type: string type: object + MoveToSpecificRule: properties: - option: + position: + description: The type of position to move to. + example: after_specific_rule + type: string + rule_id: + description: The UUID of the rule to move after/before. + example: f8b74720-a454-4242-99c4-62994ef0f2bf + type: string + type: object + NetworkScan: + properties: + addresses: + description: IPv4 addresses to include. + items: + $ref: '#/components/schemas/IPRangeWithRegexp' + type: array + exclude_addresses: + description: IPv4 addresses to exclude. + items: + $ref: '#/components/schemas/IPRangeWithRegexp' + type: array + scan_interval: + default: 86400 + description: Scan interval in seconds. Default is 1 day, minimum is 1 hour. + minimum: 3600 + type: integer + time_allowed: + description: Only execute the discovery during this time range each day.. + items: + $ref: '#/components/schemas/TimeAllowedRange' + type: array + set_ip_address: + default: true + description: When set, the found IPv4 address is set on the discovered host. + type: boolean + max_parallel_pings: + default: 100 + description: Set the maximum number of concurrent pings sent to target IP + addresses. + maximum: 200 + minimum: 1 + type: integer + run_as: + description: Execute the network scan in the Checkmk user context of the + chosen user. This user needs the permission to add new hosts to this folder. type: string - enum: *id034 - example: store - key: + tag_criticality: + description: Specify which criticality tag to set on the host created by + the network scan. This field is required if the criticality tag group + exists, otherwise it as to be omitted. type: string - example: some_key_example + translate_names: + $ref: '#/components/schemas/TranslateNames' required: - - key - - option - PagerDutyAPIKeyStoreID: + - addresses + - time_allowed type: object + NetworkScanResult: properties: - option: + start: + description: When the scan started + format: date-time type: string - enum: *id034 - example: store - store_id: + end: + description: When the scan finished. Will be Null if not yet run. + format: date-time + nullable: true type: string - description: A password store ID - example: stored_password_1 - required: - - option - - store_id - PagerDutyStoreOrIntegrationKeySelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/PagerDutyExplicitKey' - - $ref: '#/components/schemas/PagerDutyAPIKeyStoreID' - discriminator: - propertyName: option - mapping: - explicit: '#/components/schemas/PagerDutyExplicitKey' - store: '#/components/schemas/PagerDutyAPIKeyStoreID' - PagerDutyPluginCreate: - type: object - properties: - plugin_name: + state: + description: Last scan result + enum: + - running + - succeeded + - failed + type: string + output: + description: Short human readable description of what is happening. type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - disable_ssl_cert_verification: - description: Ignore unverified HTTPS request warnings. Use with caution. - allOf: - - $ref: '#/components/schemas/Checkbox' - http_proxy: - description: Use the proxy settings from the environment variables. The - variables NO_PROXY, HTTP_PROXY and HTTPS_PROXY are taken into account - during execution. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - url_prefix_for_links_to_checkmk: - $ref: '#/components/schemas/CheckboxOneOf' - integration_key: - $ref: '#/components/schemas/PagerDutyStoreOrIntegrationKeySelector' - required: - - disable_ssl_cert_verification - - http_proxy - - integration_key - - plugin_name - - url_prefix_for_links_to_checkmk - PushOverPluginCreate: type: object + NotExpr: properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - api_key: - type: string - description: You need to provide a valid API key to be able to send push - notifications using Pushover. Register and login to Pushover, thn create - your Check_MK installation as application and obtain your API key - example: azGDORePK8gMaC0QOYAMyEEuzJnyUi - pattern: ^[a-zA-Z0-9]{30,40}$ - user_group_key: - type: string - description: Configure the user or group to receive the notifications by - providing the user or group key here. The key can be obtained from the - Pushover website. - example: azGDORePK8gMaC0QOYAMyEEuzJnyUi - pattern: ^[a-zA-Z0-9]{30,40}$ - http_proxy: - description: Use the proxy settings from the environment variables. The - variables NO_PROXY, HTTP_PROXY and HTTPS_PROXY are taken into account - during execution. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - url_prefix_for_links_to_checkmk: - description: If you specify an URL prefix here, then several parts of the - email body are armed with hyperlinks to your Check_MK GUI, so that the - recipient of the email can directly visit the host or service in question - in Check_MK. Specify an absolute URL including the .../check_mk/ + op: + description: The operator. In this case `not`. + type: string + expr: allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - priority: - $ref: '#/components/schemas/CheckboxOneOf' - sound: - $ref: '#/components/schemas/CheckboxOneOf' - required: - - api_key - - http_proxy - - plugin_name - - priority - - sound - - url_prefix_for_links_to_checkmk - - user_group_key - ServiceNowExplicitPassword: + - $ref: '#/components/schemas/Expr' + description: The query expression to negate. type: object + ObjectActionMember: properties: - option: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + id: type: string - enum: *id034 - example: store - password: + disabledReason: + description: Provides the reason (or the literal "disabled") why an object + property or collection is un-modifiable, or, in the case of an action, + unusable (and hence no links to mutate that member's state, or invoke + the action, are provided). + nullable: true type: string - example: password_example - required: - - option - - password - ServiceNowPasswordStoreID: - type: object - properties: - option: + invalidReason: + description: Provides the reason (or the literal "invalid") why a proposed + value for a property, collection or action argument is invalid. Appears + within an argument representation 2.9 returned as a response. + example: invalid + nullable: true type: string - enum: *id034 - example: store - store_id: + x-ro-invalidReason: + description: Provides the reason why a SET OF proposed values for properties + or arguments is invalid. + nullable: true type: string - description: A password store ID - example: stored_password_1 - required: - - option - - store_id - ServiceNowPasswordSelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/ServiceNowExplicitPassword' - - $ref: '#/components/schemas/ServiceNowPasswordStoreID' - discriminator: - propertyName: option - mapping: - explicit: '#/components/schemas/ServiceNowExplicitPassword' - store: '#/components/schemas/ServiceNowPasswordStoreID' - CaseParams: - type: object - properties: - host_description: - $ref: '#/components/schemas/CheckboxOneOf' - service_description: - $ref: '#/components/schemas/CheckboxOneOf' - host_short_description: - $ref: '#/components/schemas/CheckboxOneOf' - service_short_description: - $ref: '#/components/schemas/CheckboxOneOf' - priority: - $ref: '#/components/schemas/CheckboxOneOf' - state_recovery: - $ref: '#/components/schemas/CheckboxOneOf' - MgmntTypeCaseParams: - type: object - properties: - option: + memberType: + default: action + parameters: + type: object + name: + example: frobnicate_foo type: string - enum: &id035 - - case - - incident - example: case - params: - $ref: '#/components/schemas/CaseParams' - required: - - option - IncidentParams: - type: object - properties: - host_description: - $ref: '#/components/schemas/CheckboxOneOf' - service_description: - $ref: '#/components/schemas/CheckboxOneOf' - host_short_description: - $ref: '#/components/schemas/CheckboxOneOf' - service_short_description: - $ref: '#/components/schemas/CheckboxOneOf' - caller: - type: string - description: Caller is the user on behalf of whom the incident is being - reported within ServiceNow. - example: Alice - urgency: - $ref: '#/components/schemas/CheckboxOneOf' - impact: - $ref: '#/components/schemas/CheckboxOneOf' - state_acknowledgement: - $ref: '#/components/schemas/CheckboxOneOf' - state_downtime: - $ref: '#/components/schemas/CheckboxOneOf' - state_recovery: - $ref: '#/components/schemas/CheckboxOneOf' - required: - - caller - MgmntTypeIncidentParams: - type: object - properties: - option: + title: + description: A human readable title of this object. Can be used for user + interfaces. type: string - enum: *id035 - example: case - params: - $ref: '#/components/schemas/IncidentParams' required: - - option - MgmntTypeSelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/MgmntTypeCaseParams' - - $ref: '#/components/schemas/MgmntTypeIncidentParams' - discriminator: - propertyName: option - mapping: - case: '#/components/schemas/MgmntTypeCaseParams' - incident: '#/components/schemas/MgmntTypeIncidentParams' - ServiceNowPluginCreate: + - id + - links type: object + ObjectCollectionMember: properties: - plugin_name: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + id: type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - username: + disabledReason: + description: Provides the reason (or the literal "disabled") why an object + property or collection is un-modifiable, or, in the case of an action, + unusable (and hence no links to mutate that member's state, or invoke + the action, are provided). + nullable: true type: string - description: Configure the user name here - example: username_a - servicenow_url: + invalidReason: + description: Provides the reason (or the literal "invalid") why a proposed + value for a property, collection or action argument is invalid. Appears + within an argument representation 2.9 returned as a response. + example: invalid + nullable: true type: string - description: Configure your ServiceNow URL here - example: https://myservicenow.com - http_proxy: - description: Use the proxy settings from the environment variables. The - variables NO_PROXY, HTTP_PROXY and HTTPS_PROXY are taken into account - during execution. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - user_password: - $ref: '#/components/schemas/ServiceNowPasswordSelector' - use_site_id_prefix: - $ref: '#/components/schemas/CheckboxOneOf' - optional_timeout: - $ref: '#/components/schemas/CheckboxOneOf' - management_type: - $ref: '#/components/schemas/MgmntTypeSelector' - required: - - http_proxy - - optional_timeout - - plugin_name - - servicenow_url - - use_site_id_prefix - - user_password - - username - SignL4TeamSecret: - type: object - properties: - option: + x-ro-invalidReason: + description: Provides the reason why a SET OF proposed values for properties + or arguments is invalid. + nullable: true type: string - enum: *id034 - example: store - secret: + memberType: + default: collection + value: + items: + $ref: '#/components/schemas/Link' + type: array + name: + example: important_values + type: string + title: + description: A human readable title of this object. Can be used for user + interfaces. type: string - example: team_secret_example required: - - option - - secret - SignL4TeamSecretStoreID: + - id + - links type: object + ObjectProperty: properties: - option: - type: string - enum: *id034 - example: store - store_id: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + id: + description: The unique name of this property, local to this domain type. type: string - description: A password store ID - example: stored_password_1 + value: + description: The value of the property. In this case a list. + items: + type: string + type: array + extensions: + description: Additional attributes alongside the property. + type: object required: - - option - - store_id - SignL4ExplicitOrStoreSelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/SignL4TeamSecret' - - $ref: '#/components/schemas/SignL4TeamSecretStoreID' - discriminator: - propertyName: option - mapping: - explicit: '#/components/schemas/SignL4TeamSecret' - store: '#/components/schemas/SignL4TeamSecretStoreID' - Signl4PluginCreate: + - links type: object + Parent: properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - disable_ssl_cert_verification: - description: Ignore unverified HTTPS request warnings. Use with caution. - allOf: - - $ref: '#/components/schemas/Checkbox' - http_proxy: - description: Use the proxy settings from the environment variables. The - variables NO_PROXY, HTTP_PROXY and HTTPS_PROXY are taken into account - during execution. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - url_prefix_for_links_to_checkmk: - $ref: '#/components/schemas/CheckboxOneOf' - team_secret: - $ref: '#/components/schemas/SignL4ExplicitOrStoreSelector' + type: + default: parent required: - - disable_ssl_cert_verification - - http_proxy - - plugin_name - - team_secret - - url_prefix_for_links_to_checkmk - SlackWebhookURL: + - type type: object + PasswordExtension: properties: - option: + ident: + description: The unique identifier for the password + example: pass + type: string + title: + description: The title for the password + example: Kubernetes login + type: string + comment: + description: A comment for the password + example: Kommentar type: string - enum: *id034 - example: store - url: + documentation_url: + description: The URL pointing to documentation or any other page. + example: localhost + type: string + password: + description: The password string + example: password + type: string + owned_by: + description: The owner of the password who is able to edit, delete and use + existing passwords. + example: admin type: string - example: https://example_webhook_url.com + shared: + description: The list of members the password is shared with + example: + - all + items: + description: The member the password is shared with + example: all + type: string + type: array required: - - option - - url - SlackWebhookStore: + - password type: object + PasswordObject: properties: - option: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + domainType: + default: password + description: The type of the domain-object. + id: + description: The unique identifier for this domain-object type. type: string - enum: *id034 - example: store - store_id: + title: + description: A human readable title of this object. Can be used for user + interfaces. type: string - description: A password store ID - example: stored_password_1 + members: + description: The container for external resources, like linked foreign objects + or actions. + type: object + extensions: + allOf: + - $ref: '#/components/schemas/PasswordExtension' + description: All the attributes of the domain object. required: - - option - - store_id - SlackStoreOrExplicitURLSelector: + - links type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/SlackWebhookURL' - - $ref: '#/components/schemas/SlackWebhookStore' + ReferTo: discriminator: - propertyName: option mapping: - explicit: '#/components/schemas/SlackWebhookURL' - store: '#/components/schemas/SlackWebhookStore' - SlackPluginCreate: - type: object - properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - disable_ssl_cert_verification: - description: Ignore unverified HTTPS request warnings. Use with caution. - allOf: - - $ref: '#/components/schemas/Checkbox' - http_proxy: - description: Use the proxy settings from the environment variables. The - variables NO_PROXY, HTTP_PROXY and HTTPS_PROXY are taken into account - during execution. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - url_prefix_for_links_to_checkmk: - $ref: '#/components/schemas/CheckboxOneOf' - webhook_url: - $ref: '#/components/schemas/SlackStoreOrExplicitURLSelector' - required: - - disable_ssl_cert_verification - - http_proxy - - plugin_name - - url_prefix_for_links_to_checkmk - - webhook_url - SMSAPIExplicitPassword: + child: '#/components/schemas/Child' + child_with: '#/components/schemas/ChildWith' + host: '#/components/schemas/Host' + parent: '#/components/schemas/Parent' + propertyName: type + oneOf: + - $ref: '#/components/schemas/Host' + - $ref: '#/components/schemas/Parent' + - $ref: '#/components/schemas/Child' + - $ref: '#/components/schemas/ChildWith' + properties: {} type: object + RegexpRewrites: properties: - option: + search: + description: "The search regexp. May contain match-groups, conditional matches,\ + \ etc. This follows the Python regular expression syntax.\n\nFor details\ + \ see:\n\n * https://docs.python.org/3/library/re.html" + maxLength: 30 type: string - enum: *id034 - example: store - password: + replace_with: + description: The replacement string. Match-groups can only be identified + by `\1`, `\2`, etc. Highest supported match group is `\99`. Named lookups + are not supported. + maxLength: 30 type: string - example: https://example_webhook_url.com required: - - option - - password - SMSAPIPStoreID: + - replace_with + - search type: object + RenameHost: properties: - option: - type: string - enum: *id034 - example: store - store_id: + new_name: + description: The new name of the existing host. + example: newhost + pattern: '[-0-9a-zA-Z_.]+' type: string - description: A password store ID - example: stored_password_1 required: - - option - - store_id - SMSAPIPasswordSelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/SMSAPIExplicitPassword' - - $ref: '#/components/schemas/SMSAPIPStoreID' - discriminator: - propertyName: option - mapping: - explicit: '#/components/schemas/SMSAPIExplicitPassword' - store: '#/components/schemas/SMSAPIPStoreID' - SMSAPIPluginCreate: + - new_name type: object + RuleCollection: properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - disable_ssl_cert_verification: - description: Ignore unverified HTTPS request warnings. Use with caution. - allOf: - - $ref: '#/components/schemas/Checkbox' - username: - type: string - description: Configure the user name here - example: username_a - modem_type: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + id: + default: all + description: The name of this collection. type: string - description: Choose what modem is used. Currently supported is only Teltonika-TRB140. - enum: - - trb140 - example: trb140 - modem_url: + domainType: + default: rule + description: Domain type of this object. + title: + description: A human readable title of this object. Can be used for user + interfaces. type: string - format: url - description: Configure your modem URL here - example: https://mymodem.mydomain.example - timeout: - type: string - description: Here you can configure timeout settings - example: '10' - http_proxy: - description: Use the proxy settings from the environment variables. The - variables NO_PROXY, HTTP_PROXY and HTTPS_PROXY are taken into account - during execution. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - user_password: - $ref: '#/components/schemas/SMSAPIPasswordSelector' + value: + description: The collection itself. Each entry in here is part of the collection. + items: + $ref: '#/components/schemas/RuleObject' + type: array + extensions: + description: Additional attributes alongside the collection. + type: object required: - - disable_ssl_cert_verification - - http_proxy - - modem_type - - modem_url - - plugin_name - - timeout - - user_password - - username - SMSPluginBase: + - links type: object + RuleConditions: properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - params: + host_name: + allOf: + - $ref: '#/components/schemas/HostOrServiceCondition' + description: Here you can enter a list of explicit host names that the rule + should or should not apply to. Leave this option disabled if you want + the rule to apply for all hosts specified by the given tags. The names + that you enter here are compared with case sensitive exact matching. Alternatively + you can use regular expressions if you enter a tilde `~` as the first + character. That regular expression must match the beginning of the host + names in question. + example: + match_on: + - host1 + - host2 + operator: one_of + host_tags: + description: The rule will only be applied to hosts fulfilling all the host + tag conditions listed here, even if they appear in the list of explicit + host names. + example: + - key: criticality + operator: is + value: prod + items: + $ref: '#/components/schemas/TagCondition' type: array - description: The given parameters are available in scripts as NOTIFY_PARAMETER_1, - NOTIFY_PARAMETER_2, etc. You may paste a text from your clipboard which - contains several parts separated by ';' characters into the last input - field. The text will then be split by these separators and the single - parts are added into dedicated input fields. + host_labels: + description: Further restrict this rule by applying host label conditions. example: - - NOTIFY_PARAMETER_1 - - NOTIFY_PARAMETER_1 - uniqueItems: true + - key: os + operator: is + value: windows items: - type: string - required: - - params - - plugin_name - SpectrumPluginBase: + $ref: '#/components/schemas/LabelCondition' + type: array + service_labels: + description: Restrict the application of the rule, by checking against service + label conditions. + example: + - key: os + operator: is + value: windows + items: + $ref: '#/components/schemas/LabelCondition' + type: array + service_description: + allOf: + - $ref: '#/components/schemas/HostOrServiceCondition' + description: "Specify a list of service patterns this rule shall apply to.\n\ + \ * The patterns must match the beginning of the service in question.\n\ + \ * Adding a `$` to the end forces an exact match.\n * Pattern use regular\ + \ expressions. e.g. a `.*` will match an arbitrary text.\n * The text\ + \ entered here is handled as a regular expression pattern.\n * The pattern\ + \ is matched from the beginning.\n * The match is performed case sensitive.\n\ + BE AWARE: Depending on the service ruleset the service_description of\ + \ the rules is only a check item or a full service description. For example\ + \ the check parameters rulesets only use the item, and other service rulesets\ + \ like disabled services ruleset use full servicedescriptions." + example: + match_on: + - foo1 + - bar2 + operator: none_of type: object + RuleExtensions: properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - destination_ip: + ruleset: + description: The name of the ruleset. type: string - description: IP Address of the Spectrum server receiving the SNMP trap - example: 127.0.0.1 - snmp_community: + folder: + description: 'The path name of the folder. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most + appropriate for your quoting/escaping needs. A good default choice is + `~`.' + example: ~router + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - description: SNMP Community for the SNMP trap. The password entered here - is stored in plain text within the monitoring site. This usually needed - because the monitoring process needs to have access to the unencrypted - password because it needs to submit it to authenticate with remote systems - example: '' - base_oid: + folder_index: + description: The position of this rule in the chain in this folder. + type: integer + properties: + allOf: + - $ref: '#/components/schemas/RuleProperties' + description: Property values of this rule. + example: {} + value_raw: + description: The raw parameter value for this rule. + example: '{"ignore_fs_types": ["tmpfs"]}' type: string - description: The base OID for the trap content - example: 1.3.6.1.4.1.1234 + conditions: + allOf: + - $ref: '#/components/schemas/RuleConditions' + description: Conditions. required: - - base_oid - - destination_ip - - plugin_name - - snmp_community - SplunkURLExplicit: + - folder type: object + RuleObject: properties: - option: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + domainType: + default: rule + description: Domain type of this object. + example: rule + id: + description: The unique identifier for this domain-object type. type: string - enum: *id034 - example: store - url: + title: + description: A human readable title of this object. Can be used for user + interfaces. type: string - format: url - description: A valid splunk webhook URL - example: https://alert.victorops.com/integrations/example + members: + description: The container for external resources, like linked foreign objects + or actions. + type: object + extensions: + allOf: + - $ref: '#/components/schemas/RuleExtensions' + description: Attributes specific to rule objects. required: - - option - - url - SplunkStoreID: + - links type: object + RuleProperties: properties: - option: + description: + description: A description for this rule to inform other users about its + intent. + example: This rule is here to foo the bar hosts. type: string - enum: *id034 - example: store - store_id: + comment: + description: Any comment string. + example: Created yesterday due to foo hosts behaving weird. type: string - description: A password store ID - example: stored_password_1 - required: - - option - - store_id - SplunkRESTEndpointSelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/SplunkURLExplicit' - - $ref: '#/components/schemas/SplunkStoreID' - discriminator: - propertyName: option - mapping: - explicit: '#/components/schemas/SplunkURLExplicit' - store: '#/components/schemas/SplunkStoreID' - VictoropsPluginCreate: + documentation_url: + description: An URL (e.g. an internal Wiki entry) which explains this rule. + example: http://example.com/wiki/ConfiguringFooBarHosts + format: url + type: string + disabled: + default: false + description: When set to False, the rule will be evaluated. Default is False. + example: false + type: boolean type: object + RulesetCollection: properties: - plugin_name: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + id: + default: all + description: The name of this collection. type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - disable_ssl_cert_verification: - description: Ignore unverified HTTPS request warnings. Use with caution. - allOf: - - $ref: '#/components/schemas/Checkbox' - http_proxy: - description: Use the proxy settings from the environment variables. The - variables NO_PROXY, HTTP_PROXY and HTTPS_PROXY are taken into account - during execution. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - url_prefix_for_links_to_checkmk: - $ref: '#/components/schemas/CheckboxOneOf' - splunk_on_call_rest_endpoint: - $ref: '#/components/schemas/SplunkRESTEndpointSelector' + domainType: + default: ruleset + description: Domain type of this object. + example: ruleset + title: + description: A human readable title of this object. Can be used for user + interfaces. + type: string + value: + description: The collection itself. Each entry in here is part of the collection. + items: + $ref: '#/components/schemas/CollectionItem' + type: array + extensions: + description: Additional attributes alongside the collection. + type: object required: - - disable_ssl_cert_verification - - http_proxy - - plugin_name - - splunk_on_call_rest_endpoint - - url_prefix_for_links_to_checkmk - MSTeamsExplicitWebhookUrl: + - links type: object + RulesetExtensions: properties: - option: + name: + description: The name of the ruleset + example: host_groups type: string - enum: *id034 - example: store - url: + folder: + description: 'The path name of the folder. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most + appropriate for your quoting/escaping needs. A good default choice is + `~`.' + example: ~router + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - format: url - example: http://example_webhook_url.com + number_of_rules: + description: The number of rules of this ruleset. + example: 5 + type: integer required: - - option - - url - MSTeamsURLResponse: + - folder type: object + RulesetObject: properties: - option: - type: string - enum: *id034 - example: store - store_id: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + domainType: + default: ruleset + description: Domain type of this object. + example: ruleset + id: + description: The unique identifier for this domain-object type. type: string - description: A password store ID - example: stored_password_1 - url: + title: + description: A human readable title of this object. Can be used for user + interfaces. type: string - example: http://example_webhook_url.com - required: - - option - - store_id - MSTeamsUrlOrStoreSelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/MSTeamsExplicitWebhookUrl' - - $ref: '#/components/schemas/MSTeamsURLResponse' - discriminator: - propertyName: option - mapping: - explicit: '#/components/schemas/MSTeamsExplicitWebhookUrl' - store: '#/components/schemas/MSTeamsURLResponse' - MSTeamsPluginCreate: - type: object - properties: - plugin_name: - type: string - description: The plugin name. Built-in plugins only. - enum: *id033 - example: mail - http_proxy: - description: Use the proxy settings from the environment variables. The - variables NO_PROXY, HTTP_PROXY and HTTPS_PROXY are taken into account - during execution. - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - url_prefix_for_links_to_checkmk: - $ref: '#/components/schemas/CheckboxOneOf' - affected_host_groups: - description: Enable/disable if we show affected host groups in the created - message - allOf: - - $ref: '#/components/schemas/Checkbox' - host_details: - description: Enable/disable the details for host notifications - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - service_details: - description: Enable/disable the details for service notifications - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - host_summary: - description: Enable/disable the summary for host notifications - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - service_summary: - description: Enable/disable the summary for service notifications - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - host_title: - description: Enable/disable the title for host notifications - allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - service_title: - description: Enable/disable the title for service notifications + members: + description: The container for external resources, like linked foreign objects + or actions. + type: object + extensions: allOf: - - $ref: '#/components/schemas/CheckboxOneOf' - webhook_url: - $ref: '#/components/schemas/MSTeamsUrlOrStoreSelector' + - $ref: '#/components/schemas/RulesetExtensions' + description: Specific attributes related to rulesets. required: - - affected_host_groups - - host_details - - host_summary - - host_title - - http_proxy - - plugin_name - - service_details - - service_summary - - service_title - - url_prefix_for_links_to_checkmk - - webhook_url - PluginSelector: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/AsciiMailPluginCreate' - - $ref: '#/components/schemas/HTMLMailPluginCreate' - - $ref: '#/components/schemas/CiscoWebexPluginCreate' - - $ref: '#/components/schemas/MkEventDPluginCreate' - - $ref: '#/components/schemas/IlertPluginCreate' - - $ref: '#/components/schemas/JiraPluginCreate' - - $ref: '#/components/schemas/OpsGeniePluginCreate' - - $ref: '#/components/schemas/PagerDutyPluginCreate' - - $ref: '#/components/schemas/PushOverPluginCreate' - - $ref: '#/components/schemas/ServiceNowPluginCreate' - - $ref: '#/components/schemas/Signl4PluginCreate' - - $ref: '#/components/schemas/SlackPluginCreate' - - $ref: '#/components/schemas/SMSAPIPluginCreate' - - $ref: '#/components/schemas/SMSPluginBase' - - $ref: '#/components/schemas/SpectrumPluginBase' - - $ref: '#/components/schemas/VictoropsPluginCreate' - - $ref: '#/components/schemas/MSTeamsPluginCreate' - discriminator: - propertyName: plugin_name - mapping: - asciimail: '#/components/schemas/AsciiMailPluginCreate' - mail: '#/components/schemas/HTMLMailPluginCreate' - cisco_webex_teams: '#/components/schemas/CiscoWebexPluginCreate' - mkeventd: '#/components/schemas/MkEventDPluginCreate' - ilert: '#/components/schemas/IlertPluginCreate' - jira_issues: '#/components/schemas/JiraPluginCreate' - opsgenie_issues: '#/components/schemas/OpsGeniePluginCreate' - pagerduty: '#/components/schemas/PagerDutyPluginCreate' - pushover: '#/components/schemas/PushOverPluginCreate' - servicenow: '#/components/schemas/ServiceNowPluginCreate' - signl4: '#/components/schemas/Signl4PluginCreate' - slack: '#/components/schemas/SlackPluginCreate' - sms_api: '#/components/schemas/SMSAPIPluginCreate' - sms: '#/components/schemas/SMSPluginBase' - spectrum: '#/components/schemas/SpectrumPluginBase' - victorops: '#/components/schemas/VictoropsPluginCreate' - msteams: '#/components/schemas/MSTeamsPluginCreate' - PluginWithParams: + - links type: object + SNMPCommunity: properties: - option: + type: + default: v1_v2_community + community: + description: SNMP community (SNMP Versions 1 and 2c) type: string - description: Create notifications with parameters or cancel previous notifications - enum: *id036 - example: cancel_previous_notifications - plugin_params: - $ref: '#/components/schemas/PluginSelector' required: - - plugin_params - PluginOptionsSelector: + - community type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/PluginBase' - - $ref: '#/components/schemas/PluginWithParams' + SNMPCredentials: discriminator: - propertyName: option mapping: - cancel_previous_notifications: '#/components/schemas/PluginBase' - create_notification_with_the_following_parameters: '#/components/schemas/PluginWithParams' - RuleNotificationMethod: - type: object - properties: - notify_plugin: - $ref: '#/components/schemas/PluginOptionsSelector' - notification_bulking: - $ref: '#/components/schemas/CheckboxOneOf' - required: - - notification_bulking - - notify_plugin - ContactSelection: - type: object - properties: - all_contacts_of_the_notified_object: - $ref: '#/components/schemas/Checkbox' - all_users: - $ref: '#/components/schemas/Checkbox' - all_users_with_an_email_address: - $ref: '#/components/schemas/Checkbox' - the_following_users: - $ref: '#/components/schemas/CheckboxOneOf' - members_of_contact_groups: - $ref: '#/components/schemas/CheckboxOneOf' - explicit_email_addresses: - $ref: '#/components/schemas/CheckboxOneOf' - restrict_by_contact_groups: - $ref: '#/components/schemas/CheckboxOneOf' - restrict_by_custom_macros: - $ref: '#/components/schemas/CheckboxOneOf' - required: - - all_contacts_of_the_notified_object - - all_users - - all_users_with_an_email_address - - explicit_email_addresses - - members_of_contact_groups - - restrict_by_contact_groups - - restrict_by_custom_macros - - the_following_users - RuleConditions: - type: object - properties: - match_sites: - $ref: '#/components/schemas/CheckboxOneOf' - match_folder: - $ref: '#/components/schemas/CheckboxOneOf' - match_host_tags: - $ref: '#/components/schemas/CheckboxOneOf' - match_host_labels: - $ref: '#/components/schemas/CheckboxOneOf' - match_host_groups: - $ref: '#/components/schemas/CheckboxOneOf' - match_hosts: - $ref: '#/components/schemas/CheckboxOneOf' - match_exclude_hosts: - $ref: '#/components/schemas/CheckboxOneOf' - match_service_labels: - $ref: '#/components/schemas/CheckboxOneOf' - match_service_groups: - $ref: '#/components/schemas/CheckboxOneOf' - match_exclude_service_groups: - $ref: '#/components/schemas/CheckboxOneOf' - match_service_groups_regex: - $ref: '#/components/schemas/CheckboxOneOf' - match_exclude_service_groups_regex: - $ref: '#/components/schemas/CheckboxOneOf' - match_services: - $ref: '#/components/schemas/CheckboxOneOf' - match_exclude_services: - $ref: '#/components/schemas/CheckboxOneOf' - match_check_types: - $ref: '#/components/schemas/CheckboxOneOf' - match_plugin_output: - $ref: '#/components/schemas/CheckboxOneOf' - match_contact_groups: - $ref: '#/components/schemas/CheckboxOneOf' - match_service_levels: - $ref: '#/components/schemas/CheckboxOneOf' - match_only_during_time_period: - $ref: '#/components/schemas/CheckboxOneOf' - match_host_event_type: - $ref: '#/components/schemas/CheckboxOneOf' - match_service_event_type: - $ref: '#/components/schemas/CheckboxOneOf' - restrict_to_notification_numbers: - $ref: '#/components/schemas/CheckboxOneOf' - throttle_periodic_notifications: - $ref: '#/components/schemas/CheckboxOneOf' - match_notification_comment: - $ref: '#/components/schemas/CheckboxOneOf' - event_console_alerts: - $ref: '#/components/schemas/CheckboxOneOf' - required: - - event_console_alerts - - match_check_types - - match_contact_groups - - match_exclude_hosts - - match_exclude_service_groups - - match_exclude_service_groups_regex - - match_exclude_services - - match_folder - - match_host_event_type - - match_host_groups - - match_host_labels - - match_host_tags - - match_hosts - - match_notification_comment - - match_only_during_time_period - - match_plugin_output - - match_service_event_type - - match_service_groups - - match_service_groups_regex - - match_service_labels - - match_service_levels - - match_services - - match_sites - - restrict_to_notification_numbers - - throttle_periodic_notifications - RuleNotification: - type: object - properties: - rule_properties: - $ref: '#/components/schemas/RuleProperties' - notification_method: - $ref: '#/components/schemas/RuleNotificationMethod' - contact_selection: - $ref: '#/components/schemas/ContactSelection' - conditions: - $ref: '#/components/schemas/RuleConditions' - required: - - conditions - - contact_selection - - notification_method - - rule_properties - NotificationRuleRequest: - type: object - properties: - rule_config: - description: '' - example: - rule_properties: - description: A description or title of this rule. - comment: A example comment. - documentation_url: http://link/to/documentation - do_not_apply_this_rule: - state: disabled - allow_users_to_deactivate: - state: enabled - notification_method: - notify_plugin: - option: create_notification_with_the_following_parameters - plugin_params: - plugin_name: mail - from_details: - state: disabled - reply_to: - state: disabled - subject_for_host_notifications: - state: disabled - subject_for_service_notifications: - state: disabled - info_to_be_displayed_in_the_email_body: - state: disabled - insert_html_section_between_body_and_table: - state: disabled - url_prefix_for_links_to_checkmk: - state: disabled - sort_order_for_bulk_notificaions: - state: disabled - send_separate_notification_to_every_recipient: - state: disabled - enable_sync_smtp: - state: disabled - display_graphs_among_each_other: - state: disabled - graphs_per_notification: - state: disabled - bulk_notifications_with_graphs: - state: disabled - notification_bulking: - state: disabled - contact_selection: - all_contacts_of_the_notified_object: - state: disabled - all_users: - state: disabled - all_users_with_an_email_address: - state: disabled - the_following_users: - state: disabled - members_of_contact_groups: - state: disabled - explicit_email_addresses: - state: disabled - restrict_by_custom_macros: - state: disabled - restrict_by_contact_groups: - state: disabled - conditions: - match_sites: - state: disabled - match_folder: - state: disabled - match_host_tags: - state: disabled - match_host_labels: - state: disabled - match_host_groups: - state: disabled - match_hosts: - state: disabled - match_exclude_hosts: - state: disabled - match_service_labels: - state: disabled - match_service_groups: - state: disabled - match_exclude_service_groups: - state: disabled - match_service_groups_regex: - state: disabled - match_exclude_service_groups_regex: - state: disabled - match_services: - state: disabled - match_exclude_services: - state: disabled - match_check_types: - state: disabled - match_plugin_output: - state: disabled - match_contact_groups: - state: disabled - match_service_levels: - state: disabled - match_only_during_time_period: - state: disabled - match_host_event_type: - state: disabled - match_service_event_type: - state: disabled - restrict_to_notification_numbers: - state: disabled - throttle_periodic_notifications: - state: disabled - match_notification_comment: - state: disabled - event_console_alerts: - state: disabled - allOf: - - $ref: '#/components/schemas/RuleNotification' - required: - - rule_config - RulePropertiesAttributes: + v1_v2_community: '#/components/schemas/SNMPCommunity' + v3_auth_no_privacy: '#/components/schemas/SNMPv3AuthNoPrivacy' + v3_auth_privacy: '#/components/schemas/SNMPv3AuthPrivacy' + v3_no_auth_no_privacy: '#/components/schemas/SNMPv3NoAuthNoPrivacy' + propertyName: type + oneOf: + - $ref: '#/components/schemas/SNMPCommunity' + - $ref: '#/components/schemas/SNMPv3NoAuthNoPrivacy' + - $ref: '#/components/schemas/SNMPv3AuthNoPrivacy' + - $ref: '#/components/schemas/SNMPv3AuthPrivacy' + properties: {} type: object + SNMPv3AuthNoPrivacy: properties: - description: + type: + default: authNoPriv + description: The type of credentials to use. + auth_protocol: + description: Authentication protocol. + enum: + - MD5-96 + - SHA-1-96 + - SHA-2-224 + - SHA-2-256 + - SHA-2-384 + - SHA-2-512 type: string - description: A description or title of this rule. - example: Notify all contacts of a host/service via HTML email - comment: + security_name: + description: Security name type: string - description: An optional comment that may be used to explain the purpose - of this object. - example: An example comment - documentation_url: + auth_password: + description: Authentication pass phrase. + minLength: 8 type: string - description: An optional URL pointing to documentation or any other page. - This will be displayed as an icon and open a new page when clicked. - example: http://link/to/documentation - do_not_apply_this_rule: - description: Disabled rules are kept in the configuration but are not applied. - example: - state: enabled - allOf: - - $ref: '#/components/schemas/Checkbox' - allow_users_to_deactivate: - description: If you set this option then users are allowed to deactivate - notifications that are created by this rule. - example: - state: enabled - allOf: - - $ref: '#/components/schemas/Checkbox' required: - - allow_users_to_deactivate - - comment - - description - - do_not_apply_this_rule - - documentation_url - PluginBase1: + - auth_password + - auth_protocol + - security_name type: object + SNMPv3AuthPrivacy: properties: - option: - type: string + type: + default: authPriv + description: SNMPv3 with authentication and privacy. + auth_protocol: + description: Authentication protocol. enum: - - cancel_previous_notifications - - create_notification_with_the_following_parameters - required: - - option - CheckboxWithStrValue: - type: object - properties: - state: + - MD5-96 + - SHA-1-96 + - SHA-2-224 + - SHA-2-256 + - SHA-2-384 + - SHA-2-512 type: string - description: '' - enum: *id032 - example: '' - value: + security_name: + description: Security name type: string - required: - - state - - value - NotificationBulkingCommonAttributes: - type: object - properties: - state: + auth_password: + description: Authentication pass phrase. + minLength: 8 type: string - description: '' - enum: *id032 - example: '' - time_horizon: - type: integer - description: Notifications are kept back for bulking at most for this time - (seconds) - example: 60 - notification_bulks_based_on: - type: array - uniqueItems: true - items: - type: string - enum: &id037 - - folder - - host - - service - - sl - - check_type - - state - - ec_contact - - ec_comment - notification_bulks_based_on_custom_macros: - type: array - items: - type: string - description: 'If you enter the names of host/service-custom macros here - then for each different combination of values of those macros a separate - bulk will be created. Service macros match first, if no service macro - is found, the host macros are searched. This can be used in combination - with the grouping by folder, host etc. Omit any leading underscore. - Note: If you are using Nagios as a core you need to make sure that the - values of the required macros are present in the notification context. - This is done in check_mk_templates.cfg. If you macro is _FOO then you - need to add the variables NOTIFY_HOST_FOO and NOTIFY_SERVICE_FOO. You - may paste a text from your clipboard which contains several parts separated - by '';'' characters into the last input field. The text will then be - split by these separators and the single parts are added into dedicated - input fields' - example: '' - max_bulk_size: - type: integer - description: At most that many Notifications are kept back for bulking. - A value of 1 essentially turns off notification bulking. - example: '1000' - subject_for_bulk_notifications: - $ref: '#/components/schemas/CheckboxWithStrValue' - required: - - max_bulk_size - - notification_bulks_based_on - - state - - time_horizon - BulkOutsideTimePeriodValue: - type: object - properties: - state: + privacy_protocol: + description: The privacy protocol. The only supported values in the Raw + Edition are CBC-DES and AES-128. If selected, privacy_password needs to + be supplied as well. + enum: + - CBC-DES + - AES-128 + - 3DES-EDE + - AES-192 + - AES-256 + - AES-192-Blumenthal + - AES-256-Blumenthal + type: string + privacy_password: + description: Privacy pass phrase. If filled, privacy_protocol needs to be + selected as well. + minLength: 8 type: string - description: '' - enum: *id032 - example: '' - value: - $ref: '#/components/schemas/NotificationBulkingCommonAttributes' required: - - state - NotificationBulking: + - auth_password + - auth_protocol + - privacy_password + - privacy_protocol + - security_name type: object + SNMPv3NoAuthNoPrivacy: properties: - state: - type: string - description: '' - enum: *id032 - example: '' - time_horizon: - type: integer - description: Notifications are kept back for bulking at most for this time - (seconds) - example: 60 - notification_bulks_based_on: - type: array - uniqueItems: true - items: - type: string - enum: *id037 - notification_bulks_based_on_custom_macros: - type: array - items: - type: string - description: 'If you enter the names of host/service-custom macros here - then for each different combination of values of those macros a separate - bulk will be created. Service macros match first, if no service macro - is found, the host macros are searched. This can be used in combination - with the grouping by folder, host etc. Omit any leading underscore. - Note: If you are using Nagios as a core you need to make sure that the - values of the required macros are present in the notification context. - This is done in check_mk_templates.cfg. If you macro is _FOO then you - need to add the variables NOTIFY_HOST_FOO and NOTIFY_SERVICE_FOO. You - may paste a text from your clipboard which contains several parts separated - by '';'' characters into the last input field. The text will then be - split by these separators and the single parts are added into dedicated - input fields' - example: '' - max_bulk_size: - type: integer - description: At most that many Notifications are kept back for bulking. - A value of 1 essentially turns off notification bulking. - example: '1000' - subject_for_bulk_notifications: - $ref: '#/components/schemas/CheckboxWithStrValue' - time_period: + type: + default: noAuthNoPriv + description: The type of credentials to use. + security_name: + description: Security name type: string - description: '' - example: 24X7 - bulk_outside_timeperiod: - $ref: '#/components/schemas/BulkOutsideTimePeriodValue' required: - - bulk_outside_timeperiod - - max_bulk_size - - notification_bulks_based_on - - state - - time_horizon - - time_period - WhenToBulk: + - security_name type: object + ServiceConditions: properties: - when_to_bulk: + host_folder: + example: servers/groupA type: string - description: Bulking can always happen or during a set time period - enum: - - always - - timeperiod - example: always - params: - $ref: '#/components/schemas/NotificationBulking' + host_labels: + example: *id010 + type: object + host_tags: + example: *id011 + type: object + host_choice: + allOf: + - $ref: '#/components/schemas/BIHostChoice' + example: *id012 + service_regex: + example: Filesystem.* + type: string + service_labels: + example: + db: mssql + type: object required: - - params - - when_to_bulk - NotificationBulkingCheckbox: + - host_choice + - host_folder + - host_labels + - host_tags + - service_labels + - service_regex type: object + ServiceGroup: properties: - state: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + domainType: + default: service_group + description: The domain type of the object. + id: + description: The unique identifier for this domain-object type. type: string - description: '' - enum: *id032 - example: '' - value: - $ref: '#/components/schemas/WhenToBulk' + title: + description: A human readable title of this object. Can be used for user + interfaces. + type: string + members: + description: The container for external resources, like linked foreign objects + or actions. + type: object + extensions: + description: All the attributes of the domain object. + type: object required: - - state - - value - NotificationPlugin: + - domainType + - links type: object - properties: - notify_plugin: - $ref: '#/components/schemas/PluginBase1' - notification_bulking: - $ref: '#/components/schemas/NotificationBulkingCheckbox' - CheckboxWithListOfStr: + TagCondition: + discriminator: + mapping: + is: '#/components/schemas/TagConditionScalarSchemaBase' + is_not: '#/components/schemas/TagConditionScalarSchemaBase' + none_of: '#/components/schemas/TagConditionConditionSchemaBase' + one_of: '#/components/schemas/TagConditionConditionSchemaBase' + propertyName: operator + oneOf: + - $ref: '#/components/schemas/TagConditionScalarSchemaBase' + - $ref: '#/components/schemas/TagConditionScalarSchemaBase' + - $ref: '#/components/schemas/TagConditionConditionSchemaBase' + - $ref: '#/components/schemas/TagConditionConditionSchemaBase' + properties: {} type: object + TagConditionConditionSchemaBase: properties: - state: + key: + description: The name of the tag. + type: string + operator: + description: If the matched tag should be one of the given values, or not. + enum: + - one_of + - none_of type: string - description: '' - enum: *id032 - example: '' value: - type: array + description: A list of values for the tag. items: + description: The value of a tag. type: string - required: - - state - - value - CustomMacro: + type: array type: object + TagConditionScalarSchemaBase: properties: - macro_name: - type: string - description: The name of the macro - example: macro_1 - match_regex: + key: + description: The name of the tag. type: string - description: The text entered here is handled as a regular expression pattern - example: '[A-Z]+' - required: - - macro_name - - match_regex - MatchCustomMacros: - type: object - properties: - state: + operator: + description: If the tag's value should match what is given under the field + `value`. + enum: + - is + - is_not type: string - description: '' - enum: *id032 - example: '' value: - type: array - items: - $ref: '#/components/schemas/CustomMacro' - required: - - state - ContactSelectionAttributes: + description: The value of a tag. + type: string type: object - properties: - all_contacts_of_the_notified_object: - $ref: '#/components/schemas/Checkbox' - all_users: - $ref: '#/components/schemas/Checkbox' - all_users_with_an_email_address: - $ref: '#/components/schemas/Checkbox' - the_following_users: - $ref: '#/components/schemas/CheckboxWithListOfStr' - members_of_contact_groups: - $ref: '#/components/schemas/CheckboxWithListOfStr' - explicit_email_addresses: - $ref: '#/components/schemas/CheckboxWithListOfStr' - restrict_by_custom_macros: - $ref: '#/components/schemas/MatchCustomMacros' - restrict_by_contact_groups: - $ref: '#/components/schemas/CheckboxWithListOfStr' - CheckboxWithFolderStr: + TagGroupAttributes: + additionalProperties: + description: The value of the tag-group attribute. Each tag is a mapping of + string to string, where the tag name must start with `tag_`. + type: string + properties: {} type: object + TimeAllowedRange: properties: - state: + start: + description: The start time of day. Inclusive. Use ISO8601 format. Seconds + are stripped. type: string - description: '' - enum: *id032 - example: '' - value: + end: + description: The end time of day. Inclusive. Use ISO8601 format. Seconds + are stripped. type: string - description: 'This condition makes the rule match only hosts that are managed - via WATO and that are contained in this folder - either directly or in - one of its subfolders. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - required: - - state - - value - HostTagValues: type: object + TimePeriodException: properties: - ip_address_family: - type: string - enum: - - ip-v4-only - - ip-v6-only - - ip-v4v6 - - no-ip - - '!ip-v4-only' - - '!ip-v6-only' - - '!ip-v4v6' - - '!no-ip' - - ignore - example: no-ip - ip_v4: - type: string - enum: - - ip-v4 - - '!ip-v4' - - ignore - example: ip-v4 - ip_v6: - type: string - enum: - - ip-v6 - - '!ip-v6' - - ignore - example: '!ip-v6' - checkmk_agent_api_integration: - type: string - enum: - - cmk-agent - - '!cmk-agent' - - all-agents - - '!all-agents' - - special-agents - - '!special-agents' - - no-agent - - '!no-agent' - - ignore - example: special-agents - piggyback: - type: string - enum: - - auto-piggyback - - '!auto-piggyback' - - piggyback - - '!piggyback' - - no-piggyback - - '!no-piggyback' - - ignore - example: auto-piggyback - snmp: - type: string - enum: - - no-snmp - - '!no-snmp' - - snmp-v1 - - '!snmp-v1' - - snmp-v2 - - '!snmp-v2' - - ignore - example: snmp-v2 - monitor_via_snmp: - type: string - enum: - - snmp - - '!snmp' - - ignore - example: snmp - monitor_via_checkmkagent_or_specialagent: - type: string - enum: - - tcp - - '!tcp' - - ignore - example: tcp - monitor_via_checkmkagent: - type: string - enum: - - checkmk-agent - - '!checkmk-agent' - - ignore - example: checkmk-agent - only_ping_this_device: - type: string - enum: - - ping - - '!ping' - - ignore - example: ping - criticality: - type: string - enum: - - prod - - critical - - test - - offline - - '!prod' - - '!critical' - - '!test' - - '!offline' - - ignore - example: critical - networking_segment: + date: + description: The date of the time period exception.8601 profile + example: '2020-01-01' + format: date type: string - enum: - - lan - - wan - - dmz - - ignore - - '!lan' - - '!wan' - - '!dmz' - example: lan + time_ranges: + example: + - end: '18:00' + start: '14:00' + items: + $ref: '#/components/schemas/TimeRange' + type: array required: - - checkmk_agent_api_integration - - criticality - - ip_address_family - - ip_v4 - - ip_v6 - - monitor_via_checkmkagent - - monitor_via_checkmkagent_or_specialagent - - monitor_via_snmp - - networking_segment - - only_ping_this_device - - piggyback - - snmp - CheckboxMatchHostTags: + - date type: object + TimeRange: properties: - state: + start: + description: The start time of the period's time range + example: '14:00' + format: time + type: string + end: + description: The end time of the period's time range + example: '16:00' + format: time type: string - description: '' - enum: *id032 - example: '' - value: - description: Match host tags with the following parameters - allOf: - - $ref: '#/components/schemas/HostTagValues' required: - - state - - value - CheckboxLabel: + - end + - start type: object + TimeRangeActive: properties: - key: - type: string - example: cmk/os_family - value: + day: + description: The day for which time ranges are to be specified. The 'all' + option allows to specify time ranges for all days. + pattern: all|monday|tuesday|wednesday|thursday|friday|saturday|sunday type: string - example: linux - required: - - key - - value - CheckboxWithListOfLabels: + time_ranges: + items: + $ref: '#/components/schemas/TimeRange' + type: array type: object + TranslateNames: properties: - state: + convert_case: + default: nop + description: "Convert all detected hostnames to upper- or lower-case.\n\n\ + \ * `nop` - Do not convert anything\n * `lower` - Convert all hostnames\ + \ to lowercase.\n * `upper` - Convert all hostnames to uppercase." + enum: + - nop + - lower + - upper type: string - description: '' - enum: *id032 - example: '' - value: + drop_domain: + description: "Drop the rest of the domain, only keep the hostname. Will\ + \ not affect IP addresses.\n\nExamples:\n\n * `192.168.0.1` -> `192.168.0.1`\n\ + \ * `foobar.example.com` -> `foobar`\n * `example.com` -> `example`\n\ + \ * `example` -> `example`\n\nThis will be executed **after**:\n\n * `convert_case`\n" + type: boolean + regexp_rewrites: + description: "Rewrite discovered hostnames with multiple regular expressions.\ + \ The replacements will be done one after another in the order they appear\ + \ in the list. If not anchored at the end by a `$` character, the regexpwill\ + \ be anchored at the end implicitly by adding a `$` character.\n\nThese\ + \ will be executed **after**:\n\n * `convert_case`\n * `drop_domain`\n" + items: + $ref: '#/components/schemas/RegexpRewrites' type: array - description: A list of key, value label pairs + hostname_replacement: + description: "Replace one value with another.\n\nThese will be executed\ + \ **after**:\n\n * `convert_case`\n * `drop_domain`\n * `regexp_rewrites`\n" items: - $ref: '#/components/schemas/CheckboxLabel' - required: - - state - - value - ServiceGroupsRegex: - type: object - properties: - match_type: - type: string - enum: - - match_id - - match_alias - example: match_alias - regex_list: + $ref: '#/components/schemas/DirectMapping' type: array - description: The text entered in this list is handled as a regular expression - pattern - example: - - '[A-Z]+123' - - '[A-Z]+456' - uniqueItems: true - items: - type: string - required: - - match_type - - regex_list - CheckboxWithListOfServiceGroupsRegex: type: object + UpdateContactGroup: properties: - state: + name: + description: The name of the contact group. + example: OnCall type: string - description: '' - enum: *id032 - example: '' - value: - description: The service group alias must not match one of the following - regular expressions. For host events this condition is simply ignored. - The text entered here is handled as a regular expression pattern. The - pattern is applied as infix search. Add a leading ^ to make it match from - the beginning and/or a tailing $ to match till the end of the text. The - match is performed case sensitive. Read more about regular expression - matching in Checkmk in our user guide. You may paste a text from your - clipboard which contains several parts separated by ';' characters into - the last input field. The text will then be split by these separators - and the single parts are added into dedicated input field - allOf: - - $ref: '#/components/schemas/ServiceGroupsRegex' + attributes: + $ref: '#/components/schemas/UpdateGroup' required: - - state - - value - CheckboxWithStr: + - name type: object + UpdateDiscoveryPhase: properties: - state: - type: string - description: '' - enum: *id032 - example: '' - value: + check_type: + description: The name of the check which this service uses. + example: df type: string - required: - - state - - value - FromToServiceLevels: - type: object - properties: - from_level: + service_item: + description: The value uniquely identifying the service on a given host. + example: /home + nullable: true type: string + target_phase: + description: The target phase of the service. enum: - - no_service_level - - silver - - gold - - platinum - example: gold - to_level: + - active + - active_ignored + - clustered_ignored + - clustered_monitored + - clustered_undecided + - clustered_vanished + - custom + - custom_ignored + - ignored + - legacy + - legacy_ignored + - manual + - monitored + - removed + - undecided + - vanished + example: monitored type: string - enum: - - no_service_level - - silver - - gold - - platinum - example: gold required: - - from_level - - to_level - CheckboxWithFromToServiceLevels: + - check_type + - service_item + - target_phase type: object + UpdateFolder: properties: - state: + title: + description: The title of the folder. Used in the GUI. + example: Virtual Servers. type: string - description: '' - enum: *id032 - example: '' - value: - description: Host or service must be in the following service level to get - notification - allOf: - - $ref: '#/components/schemas/FromToServiceLevels' - required: - - state - - value - HostEventType: + attributes: + anyOf: + - $ref: '#/components/schemas/FolderUpdateAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Replace all attributes with the ones given in this field. Already + setattributes, not given here, will be removed. + example: &id013 + networking: wan + update_attributes: + anyOf: + - $ref: '#/components/schemas/FolderUpdateAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Only set the attributes which are given in this field. Already + set attributes will not be touched. + example: &id014 + tag_criticality: prod + remove_attributes: + description: A list of attributes which should be removed. + example: &id015 + - tag_foobar + items: + type: string + type: array type: object + UpdateFolderEntry: properties: - start_or_end_of_flapping_state: - type: boolean - example: true - start_or_end_of_scheduled_downtime: - type: boolean - example: true - acknowledgement_of_problem: - type: boolean - example: false - alert_handler_execution_successful: - type: boolean - example: true - alert_handler_execution_failed: - type: boolean - example: false - up_down: - type: boolean - example: true - up_unreachable: - type: boolean - example: false - down_up: - type: boolean - example: true - down_unreachable: - type: boolean - example: false - unreachable_down: - type: boolean - example: false - unreachable_up: - type: boolean - example: false - any_up: - type: boolean - example: false - any_down: - type: boolean - example: true - any_unreachable: - type: boolean - example: true + title: + description: The title of the folder. Used in the GUI. + example: Virtual Servers. + type: string + attributes: + anyOf: + - $ref: '#/components/schemas/FolderUpdateAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Replace all attributes with the ones given in this field. Already + setattributes, not given here, will be removed. + example: *id013 + update_attributes: + anyOf: + - $ref: '#/components/schemas/FolderUpdateAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Only set the attributes which are given in this field. Already + set attributes will not be touched. + example: *id014 + remove_attributes: + description: A list of attributes which should be removed. + example: *id015 + items: + type: string + type: array + folder: + description: 'The path name of the folder. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most + appropriate for your quoting/escaping needs. A good default choice is + `~`.' + example: / + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) + type: string required: - - acknowledgement_of_problem - - alert_handler_execution_failed - - alert_handler_execution_successful - - any_down - - any_unreachable - - any_up - - down_unreachable - - down_up - - start_or_end_of_flapping_state - - start_or_end_of_scheduled_downtime - - unreachable_down - - unreachable_up - - up_down - - up_unreachable - CheckboxHostEventType: + - folder type: object + UpdateGroup: properties: - state: + alias: + description: The name used for displaying in the GUI. + example: Example Group type: string - description: '' - enum: *id032 - example: '' - value: - description: 'Select the host event types and transitions this rule should - handle. Note: If you activate this option and do not also specify service - event types then this rule will never hold for service notifications! - Note: You can only match on event types created by the core.' - allOf: - - $ref: '#/components/schemas/HostEventType' required: - - state - - value - ServiceEventType: + - alias type: object + UpdateHost: properties: - start_or_end_of_flapping_state: - type: boolean - example: true - start_or_end_of_scheduled_downtime: - type: boolean - example: true - acknowledgement_of_problem: - type: boolean - example: false - alert_handler_execution_successful: - type: boolean - example: true - alert_handler_execution_failed: - type: boolean - example: false - ok_warn: - type: boolean - example: true - ok_ok: - type: boolean - example: true - ok_crit: - type: boolean - example: false - ok_unknown: - type: boolean - example: true - warn_ok: - type: boolean - example: false - warn_crit: - type: boolean - example: false - warn_unknown: - type: boolean - example: false - crit_ok: - type: boolean - example: true - crit_warn: - type: boolean - example: true - crit_unknown: - type: boolean - example: true - unknown_ok: - type: boolean - example: true - unknown_warn: - type: boolean - example: true - unknown_crit: - type: boolean - example: true - any_ok: - type: boolean - example: false - any_warn: - type: boolean - example: false - any_crit: - type: boolean - example: true - any_unknown: - type: boolean - example: false - required: - - acknowledgement_of_problem - - alert_handler_execution_failed - - alert_handler_execution_successful - - any_crit - - any_ok - - any_unknown - - any_warn - - crit_ok - - crit_unknown - - crit_warn - - ok_crit - - ok_ok - - ok_unknown - - ok_warn - - start_or_end_of_flapping_state - - start_or_end_of_scheduled_downtime - - unknown_crit - - unknown_ok - - unknown_warn - - warn_crit - - warn_ok - - warn_unknown - CheckboxServiceEventType: + attributes: + anyOf: + - $ref: '#/components/schemas/HostUpdateAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Replace all currently set attributes on the host, with these + attributes. Any previously set attributes which are not given here will + be removed. + example: &id016 + ipaddress: 192.168.0.123 + update_attributes: + anyOf: + - $ref: '#/components/schemas/HostUpdateAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Just update the hosts attributes with these attributes. The + previously set attributes will not be touched. + example: &id017 + ipaddress: 192.168.0.123 + remove_attributes: + description: A list of attributes which should be removed. + example: &id018 + - tag_foobar + items: + type: string + type: array type: object + UpdateHostEntry: properties: - state: - type: string - description: '' - enum: *id032 - example: '' - value: - description: 'Select the service event types and transitions this rule should - handle. Note: If you activate this option and do not also specify host - event types then this rule will never hold for host notifications! Note: - You can only match on event types created by the core' - allOf: - - $ref: '#/components/schemas/ServiceEventType' + attributes: + anyOf: + - $ref: '#/components/schemas/HostUpdateAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Replace all currently set attributes on the host, with these + attributes. Any previously set attributes which are not given here will + be removed. + example: *id016 + update_attributes: + anyOf: + - $ref: '#/components/schemas/HostUpdateAttribute' + - $ref: '#/components/schemas/CustomAttributes' + - $ref: '#/components/schemas/TagGroupAttributes' + description: Just update the hosts attributes with these attributes. The + previously set attributes will not be touched. + example: *id017 + remove_attributes: + description: A list of attributes which should be removed. + example: *id018 + items: + type: string + type: array + host_name: + description: The hostname or IP address itself. + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string required: - - state - - value - FromToNotificationNumbers: + - host_name type: object + UpdateHostGroup: properties: - beginning_from: - type: integer - description: Let through notifications counting from this number. The first - notification always has the number 1 - example: 1 - up_to: - type: integer - description: Let through notifications counting upto this number - example: 999999 + name: + description: The name of the host group. + example: windows + type: string + attributes: + $ref: '#/components/schemas/UpdateGroup' required: - - beginning_from - - up_to - CheckboxRestrictNotificationNumbers: + - name type: object + UpdateHostTagGroup: properties: - state: + title: + description: A title for the host tag + example: Kubernetes type: string - description: '' - enum: *id032 - example: '' - value: - $ref: '#/components/schemas/FromToNotificationNumbers' - required: - - state - - value - ThrottlePeriodicNotifications: + topic: + description: Different tags can be grouped in a topic + example: Data Sources + type: string + help: + description: A help description for the tag group + example: Kubernetes Pods + type: string + tags: + description: A list of host tags belonging to the host tag group + example: + - ident: pod + title: Pod + items: + $ref: '#/components/schemas/HostTag1' + type: array + repair: + default: false + description: The host tag group can be in use by other hosts. Setting repair + to True gives permission to automatically update the tag from the affected + hosts. + example: false + type: boolean type: object + UpdateNodes: properties: - beginning_from: - type: integer - description: Beginning notification number - example: 10 - send_every_nth_notification: - type: integer - description: The rate then you will receive the notification 1 through 10 - and then 15, 20, 25... and so on - example: 5 + nodes: + description: Nodes where the newly created host should be the cluster-container + of. + example: + - host1 + - host2 + - host3 + items: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + type: array required: - - beginning_from - - send_every_nth_notification - CheckboxThrottlePeriodicNotifcations: + - nodes type: object + UpdatePassword: properties: - state: + title: + description: A title for the password + example: Kubernetes login type: string - description: '' - enum: *id032 - example: '' - value: - $ref: '#/components/schemas/ThrottlePeriodicNotifications' - required: - - state - - value - SysLogToFromPriorities: - type: object - properties: - from_priority: + comment: + description: A comment for the password + example: Kommentar type: string - description: '' - enum: - - emerg - - alert - - crit - - err - - warning - - notice - - info - - debug - example: warning - to_priority: + documentation_url: + description: An optional URL pointing to documentation or any other page. + You can use either global URLs (beginning with http://), absolute local + urls (beginning with /) or relative URLs (that are relative to check_mk/). + example: localhost type: string - description: '' - enum: - - emerg - - alert - - crit - - err - - warning - - notice - - info - - debug - example: warning - required: - - from_priority - - to_priority - CheckboxWithSysLogPriority: + password: + description: The password string + example: password + type: string + owner: + description: Each password is owned by a group of users which are able to + edit, delete and use existing passwords. + example: admin + type: string + shared: + description: The list of members to share the password with + example: + - all + items: + description: By default only the members of the owner contact group are + permitted to use a a configured password. It is possible to share a + password with other groups of users to make them able to use a password + in checks. + example: all + type: string + type: array type: object + UpdateServiceGroup: properties: - state: + name: + description: The name of the service group. + example: windows type: string - description: '' - enum: *id032 - example: '' - value: - $ref: '#/components/schemas/SysLogToFromPriorities' + attributes: + $ref: '#/components/schemas/UpdateGroup' required: - - state - EventConsoleAlertAttrsResponse: - type: object - properties: - match_rule_ids: - $ref: '#/components/schemas/CheckboxWithListOfStr' - match_syslog_priority: - $ref: '#/components/schemas/CheckboxWithSysLogPriority' - match_syslog_facility: - $ref: '#/components/schemas/CheckboxWithStr' - match_event_comment: - $ref: '#/components/schemas/CheckboxWithStr' - EventConsoleAlertsResponse: + - name type: object + UpdateTimePeriod: properties: - state: - type: string - description: '' - enum: *id032 - example: '' - match_type: + alias: + description: An alias for the time period + example: alias type: string - description: '' - enum: - - match_only_event_console_alerts - - do_not_match_event_console_alerts - example: match_only_event_console_events - values: - $ref: '#/components/schemas/EventConsoleAlertAttrsResponse' - required: - - match_type - - state - MatchEventConsoleAlertsResponse: + active_time_ranges: + description: The list of active time ranges which replaces the existing + list of time ranges + example: + - day: monday + time_ranges: + - end: '14:00' + start: '12:00' + items: + $ref: '#/components/schemas/TimeRangeActive' + type: array + exceptions: + description: A list of additional time ranges to be added. + example: + - date: '2020-01-01' + time_ranges: + - end: '18:00' + start: '14:00' + items: + $ref: '#/components/schemas/TimePeriodException' + type: array type: object + UpdateUser: properties: - state: + fullname: + description: The alias or full name of the user + example: Mathias Kettner type: string + auth_option: + allOf: + - $ref: '#/components/schemas/AuthUpdateOption' + description: Authentication option for the user + example: + auth_type: password + password: password + disable_login: + description: The user can be blocked from login but will remain part of + the site. The disabling does not affect notification and alerts. + example: false + type: boolean + contact_options: + allOf: + - $ref: '#/components/schemas/UserContactOption' + description: Contact settings for the user + example: + email: user@example.com + pager_address: description: '' - enum: *id032 example: '' - value: - $ref: '#/components/schemas/EventConsoleAlertsResponse' - required: - - state - ConditionsAttributes: - type: object - properties: - match_sites: - $ref: '#/components/schemas/CheckboxWithListOfStr' - match_folder: - $ref: '#/components/schemas/CheckboxWithFolderStr' - match_host_tags: - $ref: '#/components/schemas/CheckboxMatchHostTags' - match_host_labels: - $ref: '#/components/schemas/CheckboxWithListOfLabels' - match_host_groups: - $ref: '#/components/schemas/CheckboxWithListOfStr' - match_hosts: - $ref: '#/components/schemas/CheckboxWithListOfStr' - match_exclude_hosts: - $ref: '#/components/schemas/CheckboxWithListOfStr' - match_service_labels: - $ref: '#/components/schemas/CheckboxWithListOfLabels' - match_service_groups: - $ref: '#/components/schemas/CheckboxWithListOfStr' - match_exclude_service_groups: - $ref: '#/components/schemas/CheckboxWithListOfStr' - match_service_groups_regex: - $ref: '#/components/schemas/CheckboxWithListOfServiceGroupsRegex' - match_exclude_service_groups_regex: - $ref: '#/components/schemas/CheckboxWithListOfServiceGroupsRegex' - match_services: - $ref: '#/components/schemas/CheckboxWithListOfStr' - match_exclude_services: - $ref: '#/components/schemas/CheckboxWithListOfStr' - match_check_types: - $ref: '#/components/schemas/CheckboxWithListOfStr' - match_plugin_output: - $ref: '#/components/schemas/CheckboxWithStr' - match_contact_groups: - $ref: '#/components/schemas/CheckboxWithListOfStr' - match_service_levels: - $ref: '#/components/schemas/CheckboxWithFromToServiceLevels' - match_only_during_time_period: - $ref: '#/components/schemas/CheckboxWithStr' - match_host_event_type: - $ref: '#/components/schemas/CheckboxHostEventType' - match_service_event_type: - $ref: '#/components/schemas/CheckboxServiceEventType' - restrict_to_notification_numbers: - $ref: '#/components/schemas/CheckboxRestrictNotificationNumbers' - throttle_periodic_notifications: - $ref: '#/components/schemas/CheckboxThrottlePeriodicNotifcations' - match_notification_comment: - $ref: '#/components/schemas/CheckboxWithStr' - event_console_alerts: - $ref: '#/components/schemas/MatchEventConsoleAlertsResponse' - NotificationRuleAttributes: - type: object - properties: - rule_properties: - $ref: '#/components/schemas/RulePropertiesAttributes' - notification_method: - $ref: '#/components/schemas/NotificationPlugin' - contact_selection: - $ref: '#/components/schemas/ContactSelectionAttributes' - conditions: - $ref: '#/components/schemas/ConditionsAttributes' - NotificationRuleConfig: - type: object - properties: - rule_config: - $ref: '#/components/schemas/NotificationRuleAttributes' - NotificationRuleResponse: - type: object - properties: - links: + type: string + idle_timeout: + allOf: + - $ref: '#/components/schemas/IdleOption' + description: Idle timeout for the user + example: {} + roles: + description: The list of assigned roles to the user + example: + - user + items: + description: A user role + example: user + type: string type: array - description: list of links to other resources. - example: null + authorized_sites: + description: The names of the sites the user is authorized to handle + example: + - heute items: - $ref: '#/components/schemas/Link' - domainType: - default: rule_notifications - description: The domain type of the object. - id: - type: string - description: The unique identifier for this domain-object type. - title: + type: string + type: array + contactgroups: + description: Assign the user to one or multiple contact groups. If no contact + group is specified then no monitoring contact will be created for the + user. + example: + - all + items: + description: Assign the user to one or multiple contact groups + example: all + type: string + type: array + disable_notifications: + allOf: + - $ref: '#/components/schemas/DisabledNotifications' + description: '' + example: + disabled: false + language: + description: Configure the language to be used by the user in the user interface. + Omitting this will configure the default language + enum: + - de + - en + - ro + example: en type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: The configuration attributes of a notification rule. + interface_options: + allOf: + - $ref: '#/components/schemas/UserInterfaceUpdateAttributes' + description: '' example: - rule_config: - rule_properties: - description: A description or title of this rule. - comment: A example comment. - documentation_url: http://link/to/documentation - do_not_apply_this_rule: - state: disabled - allow_users_to_deactivate: - state: enabled - notification_method: - notify_plugin: - option: create_notification_with_the_following_parameters - plugin_params: - plugin_name: mail - from_details: - state: disabled - reply_to: - state: disabled - subject_for_host_notifications: - state: disabled - subject_for_service_notifications: - state: disabled - info_to_be_displayed_in_the_email_body: - state: disabled - insert_html_section_between_body_and_table: - state: disabled - url_prefix_for_links_to_checkmk: - state: disabled - sort_order_for_bulk_notificaions: - state: disabled - send_separate_notification_to_every_recipient: - state: disabled - enable_sync_smtp: - state: disabled - display_graphs_among_each_other: - state: disabled - graphs_per_notification: - state: disabled - bulk_notifications_with_graphs: - state: disabled - notification_bulking: - state: disabled - contact_selection: - all_contacts_of_the_notified_object: - state: disabled - all_users: - state: disabled - all_users_with_an_email_address: - state: disabled - the_following_users: - state: disabled - members_of_contact_groups: - state: disabled - explicit_email_addresses: - state: disabled - restrict_by_custom_macros: - state: disabled - restrict_by_contact_groups: - state: disabled - conditions: - match_sites: - state: disabled - match_folder: - state: disabled - match_host_tags: - state: disabled - match_host_labels: - state: disabled - match_host_groups: - state: disabled - match_hosts: - state: disabled - match_exclude_hosts: - state: disabled - match_service_labels: - state: disabled - match_service_groups: - state: disabled - match_exclude_service_groups: - state: disabled - match_service_groups_regex: - state: disabled - match_exclude_service_groups_regex: - state: disabled - match_services: - state: disabled - match_exclude_services: - state: disabled - match_check_types: - state: disabled - match_plugin_output: - state: disabled - match_contact_groups: - state: disabled - match_service_levels: - state: disabled - match_only_during_time_period: - state: disabled - match_host_event_type: - state: disabled - match_service_event_type: - state: disabled - restrict_to_notification_numbers: - state: disabled - throttle_periodic_notifications: - state: disabled - match_notification_comment: - state: disabled - event_console_alerts: - state: disabled - allOf: - - $ref: '#/components/schemas/NotificationRuleConfig' - required: - - links - NotificationRuleResponseCollection: + interface_theme: dark type: object + UserCollection: properties: links: - type: array description: list of links to other resources. example: null items: $ref: '#/components/schemas/Link' + type: array id: - type: string default: all description: The name of this collection. + type: string domainType: - default: rule_notifications + default: user_config description: The domain type of the objects in the collection. title: - type: string description: A human readable title of this object. Can be used for user interfaces. + type: string value: - type: array - description: A list of notification rule objects. - example: - - links: [] - domainType: rule_notifications - id: '1' - title: Rule Description - members: {} - extensions: - rule_config: - rule_properties: - description: A description or title of this rule. - comment: A example comment. - documentation_url: http://link/to/documentation - do_not_apply_this_rule: - state: disabled - allow_users_to_deactivate: - state: enabled - notification_method: - notify_plugin: - option: create_notification_with_the_following_parameters - plugin_params: - plugin_name: mail - from_details: - state: disabled - reply_to: - state: disabled - subject_for_host_notifications: - state: disabled - subject_for_service_notifications: - state: disabled - info_to_be_displayed_in_the_email_body: - state: disabled - insert_html_section_between_body_and_table: - state: disabled - url_prefix_for_links_to_checkmk: - state: disabled - sort_order_for_bulk_notificaions: - state: disabled - send_separate_notification_to_every_recipient: - state: disabled - enable_sync_smtp: - state: disabled - display_graphs_among_each_other: - state: disabled - graphs_per_notification: - state: disabled - bulk_notifications_with_graphs: - state: disabled - notification_bulking: - state: disabled - contact_selection: - all_contacts_of_the_notified_object: - state: disabled - all_users: - state: disabled - all_users_with_an_email_address: - state: disabled - the_following_users: - state: disabled - members_of_contact_groups: - state: disabled - explicit_email_addresses: - state: disabled - restrict_by_custom_macros: - state: disabled - restrict_by_contact_groups: - state: disabled - conditions: - match_sites: - state: disabled - match_folder: - state: disabled - match_host_tags: - state: disabled - match_host_labels: - state: disabled - match_host_groups: - state: disabled - match_hosts: - state: disabled - match_exclude_hosts: - state: disabled - match_service_labels: - state: disabled - match_service_groups: - state: disabled - match_exclude_service_groups: - state: disabled - match_service_groups_regex: - state: disabled - match_exclude_service_groups_regex: - state: disabled - match_services: - state: disabled - match_exclude_services: - state: disabled - match_check_types: - state: disabled - match_plugin_output: - state: disabled - match_contact_groups: - state: disabled - match_service_levels: - state: disabled - match_only_during_time_period: - state: disabled - match_host_event_type: - state: disabled - match_service_event_type: - state: disabled - restrict_to_notification_numbers: - state: disabled - throttle_periodic_notifications: - state: disabled - match_notification_comment: - state: disabled - event_console_alerts: - state: disabled + description: A list of user objects. items: - $ref: '#/components/schemas/NotificationRuleResponse' + $ref: '#/components/schemas/UserObject' + type: array extensions: - type: object description: Additional attributes alongside the collection. + type: object required: - links - InputPassword: type: object + UserContactOption: properties: - ident: - type: string - description: An unique identifier for the password - example: pass - title: - type: string - description: A title for the password - example: Kubernetes login - comment: - type: string - default: '' - description: A comment for the password - example: Kommentar - documentation_url: - type: string - default: '' - description: An optional URL pointing to documentation or any other page. - You can use either global URLs (beginning with http://), absolute local - urls (beginning with /) or relative URLs (that are relative to check_mk/). - example: localhost - password: - type: string - description: The password string - example: password - minLength: 1 - owner: + email: + description: The mail address of the user. Required if the user is a monitoringcontact + and receives notifications via mail. + example: user@example.com type: string - description: Each password is owned by a group of users which are able to - edit, delete and use existing passwords. - example: admin - shared: - type: array - description: The list of members to share the password with - example: - - all - items: - type: string - description: By default only the members of the owner contact group are - permitted to use a a configured password. It is possible to share a - password with other groups of users to make them able to use a password - in checks. - example: all + fallback_contact: + default: false + description: In case none of your notification rules handles a certain event + a notification will be sent to the specified email + example: false + type: boolean required: - - ident - - owner - - password - - title - PasswordExtension: + - email type: object + UserIdleOption: properties: - ident: - type: string - description: The unique identifier for the password - example: pass - title: - type: string - description: The title for the password - example: Kubernetes login - comment: - type: string - description: A comment for the password - example: Kommentar - documentation_url: - type: string - description: The URL pointing to documentation or any other page. - example: localhost - owned_by: + option: + description: This field indicates if the idle timeout uses the global configuration, + is disabled or uses an individual duration + enum: + - global + - disable + - individual type: string - description: The owner of the password who is able to edit, delete and use - existing passwords. - example: admin - shared: - type: array - description: The list of members the password is shared with - example: - - all - items: - type: string - description: The member the password is shared with - example: all - PasswordObject: + duration: + description: The duration in seconds of the individual idle timeout if individual + is selected as idle timeout option. + example: 3600 + type: integer + required: + - option type: object + UserInterfaceAttributes: properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: password - description: The type of the domain-object. - id: + interface_theme: + default: default + description: The theme of the interface + enum: + - default + - dark + - light type: string - description: The unique identifier for this domain-object type. - title: + sidebar_position: + default: right + description: The position of the sidebar + enum: + - left + - right type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: All the attributes of the domain object. - allOf: - - $ref: '#/components/schemas/PasswordExtension' - required: - - links - PasswordCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: + navigation_bar_icons: + default: hide + description: This option decides if icons in the navigation bar should show/hide + the respective titles + enum: + - hide + - show type: string - default: all - description: The name of this collection. - domainType: - default: password - description: The domain type of the objects in the collection. - title: + mega_menu_icons: + default: topic + description: This option decides if colored icon should be shown foe every + entry in the mega menus or alternatively only for the headlines (the 'topics') + enum: + - topic + - entry + type: string + show_mode: + default: default + description: This option decides what show mode should be used for unvisited + menus. Alternatively, this option can also be used to enforce show more + removing the three dots for all menus. + enum: + - default + - default_show_less + - default_show_more + - enforce_show_more type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of password objects. - items: - $ref: '#/components/schemas/PasswordObject' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - UpdatePassword: type: object + UserInterfaceUpdateAttributes: properties: - title: + interface_theme: + description: The theme of the interface + enum: + - default + - dark + - light type: string - description: A title for the password - example: Kubernetes login - comment: + sidebar_position: + description: The position of the sidebar + enum: + - left + - right type: string - description: A comment for the password - example: Kommentar - documentation_url: + navigation_bar_icons: + description: This option decides if icons in the navigation bar should show/hide + the respective titles + enum: + - hide + - show type: string - description: An optional URL pointing to documentation or any other page. - You can use either global URLs (beginning with http://), absolute local - urls (beginning with /) or relative URLs (that are relative to check_mk/). - example: localhost - password: + mega_menu_icons: + description: This option decides if colored icon should be shown foe every + entry in the mega menus or alternatively only for the headlines (the 'topics') + enum: + - topic + - entry type: string - description: The password string - example: password - minLength: 1 - owner: + show_mode: + description: This option decides what show mode should be used for unvisited + menus. Alternatively, this option can also be used to enforce show more + removing the three dots for all menus. + enum: + - default + - default_show_less + - default_show_more + - enforce_show_more type: string - description: Each password is owned by a group of users which are able to - edit, delete and use existing passwords. - example: admin - shared: - type: array - description: The list of members to share the password with - example: - - all - items: - type: string - description: By default only the members of the owner contact group are - permitted to use a a configured password. It is possible to share a - password with other groups of users to make them able to use a password - in checks. - example: all - RuleProperties1: type: object + UserObject: properties: - description: - type: string - description: A description for this rule to inform other users about its - intent. - example: This rule is here to foo the bar hosts. - comment: + links: + description: list of links to other resources. + example: null + items: + $ref: '#/components/schemas/Link' + type: array + domainType: + default: user_config + description: The domain type of the object. + id: + description: The unique identifier for this domain-object type. type: string - description: Any comment string. - example: Created yesterday due to foo hosts behaving weird. - documentation_url: + title: + description: A human readable title of this object. Can be used for user + interfaces. type: string - format: url - description: An URL (e.g. an internal Wiki entry) which explains this rule. - example: http://example.com/wiki/ConfiguringFooBarHosts - disabled: - type: boolean - default: false - description: When set to False, the rule will be evaluated. Default is False. - example: false - HostOrServiceCondition: + members: + description: The container for external resources, like linked foreign objects + or actions. + type: object + extensions: + anyOf: + - $ref: '#/components/schemas/BaseUserAttributes' + - $ref: '#/components/schemas/CustomUserAttributes' + description: The attributes of the user + example: null + required: + - links type: object + X509PEM: properties: - match_on: - type: array - description: A list of string matching regular expressions. - items: - type: string - operator: + cert: + description: PEM-encoded X.509 certificate. type: string - description: "How the hosts or services should be matched.\n * one_of -\ - \ will match if any of the hosts or services is matched\n * none_of -\ - \ will match if none of the hosts are matched. In other words: will match\ - \ all hosts or services which are not specified.\n" - enum: - - one_of - - none_of - TagConditionScalarSchemaBase: + required: + - cert type: object + X509ReqPEMUUID: properties: - key: + csr: + description: PEM-encoded X.509 CSR. The CN must a valid version-4 UUID. + example: '-----BEGIN CERTIFICATE REQUEST----- + + ... + + -----END CERTIFICATE REQUEST----- + + ' + type: string + required: + - csr + type: object + securitySchemes: + cookieAuth: + description: Any user of Checkmk, who has already logged in, and thus got a + cookie assigned, can use the REST API. Some actions may or may not succeed + due to group and permission restrictions. This authentication method has theleast + precedence. + in: cookie + name: auth_cmk + type: apiKey + headerAuth: + bearerFormat: username password + description: Use user credentials in the `Authorization` HTTP header. The format + of the header value is `$user $password`. This method has the highest precedence. + If it succeeds, all other authentication methods are skipped. + scheme: bearer + type: http + webserverAuth: + description: Use the authentication method of the webserver ('basic' or 'digest'). + To use this, you'll either have to re-configure the site's Apache instance + yourself, or disable multi-site logins via `omd config`. This method takes + precedence over the `cookieAuth` method. + scheme: basic + type: http +externalDocs: + description: User guide + url: https://docs.checkmk.com/master +info: + contact: + email: feedback@checkmk.com + name: Contact the Checkmk Team + url: https://checkmk.com/contact.php + description: "# Introduction\n\nWith the Checkmk REST-API you can transfer and execute\ + \ the tasks you normally perform\nmanually in Checkmk's GUI to the Checkmk server\ + \ via command or script.\n\nREST stands for REpresentational State Transfer and\ + \ describes an architecture for the exchange of\ndata on distributed systems -\ + \ especially for Web services. The implementation of this REST-API is\ndone via\ + \ the HTTP/1.1 protocol, where resources are addressed via URIs and accessed with\ + \ HTTP\nmethods (GET, POST, PUT, DELETE).\n\nThe API is documented in a machine-readable\ + \ schema and a human-readable format in English, with all\nresources, their input\ + \ and output parameters and the associated value ranges. The API is created\n\ + with the OpenAPI specification 3.x, an API description format especially for REST\ + \ APIs.\n\nThe API documentation created with this specification is displayed\ + \ to you with ReDoc (a\nresponsive Web design for an OpenAPI document) or with\ + \ Swagger UI (an OpenAPI document\nvisualization for direct interaction with the\ + \ API's resources).\n\n\n# Prerequisites\n\n* You know Checkmk and its principles\ + \ of setup and configuration.\n* You are experienced in using an API, preferably\ + \ a REST-API.\n* You are familiar with at least one of the applications for which\ + \ sample code is available.\n* It helps if you have already worked with ReDoc\ + \ and/or Swagger UI.\n\n# Responses\n\nAs specified by the `Content-Type` of `application/json`,\ + \ the response payload is serialized with\nJSON and encoded in UTF-8.\n\n## JSON\ + \ envelope attributes for objects\n\nAll objects are wrapped in a JSON structure\ + \ called a \"Domain Object\" which take the following\nform:\n\n {\n \ + \ \"domainType\": ,\n \"instanceId\": ,\n \"title\": ,\n \ + \ \"links\": [, ...],\n \"extensions\": {\n \ + \ : ,\n ...\n },\n \ + \ \"members\": {\n : ,\n \ + \ ...\n }\n }\n\nThe collections `members`, `extensions` and `links`\ + \ are defined as such:\n\n * domainType - The type of object this refers to, e.g.\ + \ `host`, and `service`.\n * instanceId - The globally unique identifier for this\ + \ particular object.\n * title - A human readable string which is only relevant\ + \ for user interfaces.\n * links - A collection of links to other resources or\ + \ actions.\n * extensions - The data container for all direct attributes of the\ + \ object.\n * members - The container for external resources, like linked foreign\ + \ objects or actions.\n\n### Note\n\nPreviously, an attribute called `members`\ + \ has been used in these objects, but it will no longer be\nused. All relations\ + \ to other objects will be listed in the `links` attribute.\n\n## JSON envelope\ + \ for collections\n\nFor collections, the JSON envelope looks slightly different.\n\ + \n {\n \"domainType\": ,\n \"instanceId\": ,\n \"title\": ,\n\ + \ \"links\": [, ...],\n \"extensions\": {\n \ + \ : ,\n ...\n },\n \ + \ \"value\": [, , ...],\n }\n\n## Link\ + \ relations\n\nEvery response comes with a collection of `links` to inform the\ + \ API client on possible\nfollow-up actions. For example, a folder response can\ + \ have links to resources for updating,\ndeleting and moving the folder. The client\ + \ does not have to know about the URL structure, it\njust needs to follow the\ + \ link. In this sense, the API is quasi self-documenting.\nThis provision of additional\ + \ information as a REST-API principle is also called\n[HATEOAS](https://en.wikipedia.org/wiki/HATEOAS).\ + \ In this context,\na `rel` specifies the type of relationship of the concerning\ + \ resource to the resource that generated\nthis representation. The rel attribute\ + \ is only of informational nature for the client.\n\nObjects may have these possible\ + \ generic link relations:\n\n * self - The API location of the current object\n\ + \ * help - Documentation for the currently requested endpoint\n * collection -\ + \ The API location for a list of object of the current objects' type\n * edit\ + \ - The API location to update the current object\n * edit-form - The GUI location\ + \ to edit the current object\n * delete - The API location to delete the current\ + \ object\n\nMembers of collections have also:\n\n * item - The API location of\ + \ a member of the current collection\n\nPlease note that these (except for self)\ + \ are completely optional and may or may not be available on\ncertain endpoints.\ + \ More specialized link relations are also available:\n\n * invoke - The API location\ + \ to invoke an action\n * start - The API location to start a long running process,\ + \ which the current object represents\n * cancel - The API location to abort the\ + \ long running process, which the current object represents\n * download - The\ + \ URL to download the object described by the current endpoint\n * move - The\ + \ API location to move the current object to another destination\n\nEndpoint specific\ + \ link relations are also possible.\n\n# Updating values\n\nWhen an object is\ + \ updated by multiple requests at the same time, it can happen that the second\n\ + request will overwrite important values from the first request. This is known\ + \ as the \"lost update\nproblem\" and can be prevented by a locking scheme. The\ + \ scheme that Checkmk uses for this is called\nan \"optimistic lock\" and allows\ + \ read access even when writes are happening. It works as follows:\n\n1. The user\ + \ fetches the object to be modified.\n2. The server responds with the data and\ + \ an HTTP `ETag` header containing a value which is something\n like the \"\ + checksum\" of the object.\n3. In order to modify the object, the user sends an\ + \ update request with an HTTP `If-Match` header\n which contains the value of\ + \ the previously fetched `ETag`. This ensures that the writer has seen\n the\ + \ object to be modified. If any modifications by someone else were to happen between\ + \ the\n request (1) and the update (3) these values would not match and the\ + \ update would fail.\n\nThis scheme is used for most `PUT` requests throughout\ + \ the REST API and always works the same way.\nDetailed documentation of the various\ + \ involved fields as well as the possible error messages can\nbe found on the\ + \ documentation of each affected endpoint.\n\n# Querying Status Data\n\nThe endpoints\ + \ in the category \"Monitoring\" support arbitrary Livestatus expressions (including\ + \ And,\nOr combinators) and all columns of some specific tables can be queried.\n\ + \n### Note\n\nYou can find an introduction to basic monitoring principles including\ + \ host and service status in the\n[Checkmk guide](https://docs.checkmk.com/latest/en/monitoring_basics.html).\n\ + \n## Filter expressions\n\nA *filter expression* is a recursively defined structure\ + \ containing *binary expression nodes*,\n*negation nodes* or *combination nodes*.\ + \ With *filter expressions*, very complex Livestatus queries\ncan be constructed.\n\ + \n## Binary expression node\n\nA *binary expression node* represents one condition\ + \ on which to filter. `left` is always a\nLivestatus column name, `right` is always\ + \ a value.\n\n### Definition\n\n {'op': , 'left': , 'right': }\n\n### Operators\n\nA list of all list of all possible\n\ + [Livestatus filter operators](https://docs.checkmk.com/latest/en/livestatus_references.html#heading_filter),\n\ + can be found in the Checkmk documentation.\n\n### Example\n\nThis example filters\ + \ for an entry where the host_name equals to \"example.com\".\n\n {'op': '=',\ + \ 'left': 'host_name', 'right': 'example.com'}\n\n### Note\n\nFor the specific\ + \ table used, please consult the endpoint documentation.\n\n## Negation node\n\ + \nThere is only one negation node, the `not` expression, which logically negates\ + \ a *filter\nexpression*. `expr` is a valid *filter expression*, so any *binary\ + \ expression node*, *negation\nnode* or *combination node* may be used here.\n\ + \n### Definition\n\n {'op': 'not', 'expr': }\n\n### Example\n\ + \nThis example filters for hosts which **do not** have the host_name \"example.com\"\ + .\n\n {'op': 'not', 'expr': {'op': '=', 'left': 'host_name', 'right': 'example.com'}}\n\ + \nThis is equivalent to\n\n {'op': '!=', 'left': 'host_name', 'right': 'example.com'}\n\ + \n## Combination nodes\n\n`and` and `or` combinators are supported. They can be\ + \ nested arbitrarily. `expr` is a list of\nvalid *filter expressions*, so any\ + \ number of *binary nodes*, *negation nodes* or *combination nodes*\nmay be used\ + \ there. These expression do not have to all be of the same type, so a mix of\ + \ *binary\nexpression nodes*, *negation nodes* and *combination nodes* is also\ + \ possible.\n\n### Definition\n\nThis results in a *filter expression* in which\ + \ all the contained expression must be true:\n\n {'op': 'and', 'expr': [, ...]}\n\nThis results in a *filter expression* in which only one\ + \ of the contained expression needs to\nbe true:\n\n {'op': 'or', 'expr': [, ...]}\n\n### Example\n\nThis example filters for the host \"example.com\"\ + \ only when the `state` column is set to `0`, which\nmeans the state is OK.\n\n\ + \ {'op': 'and', 'expr': [{'op': '=', 'left': 'host_name', 'right': 'example.com'},\n\ + \ {'op': '=', 'left': 'state', 'right': 0}]}\n\n# Table\ + \ definitions\n\nThe following Livestatus tables can be queried through the REST-API.\ + \ Which table is being used\nin a particular endpoint can be seen in the endpoint\ + \ documentation.\n\n## Downtimes Table\n\n### Columns:\n\n| Column name | Type\ + \ | Description |\n| - | - | - |\n|author | string | The contact that scheduled\ + \ the downtime |\n|comment | string | A comment text |\n|duration | int | The\ + \ duration of the downtime in seconds |\n|end_time | time | The end time of the\ + \ downtime as UNIX timestamp |\n|entry_time | time | The time the entry was made\ + \ as UNIX timestamp |\n|fixed | int | A 1 if the downtime is fixed, a 0 if it\ + \ is flexible |\n|id | int | The id of the downtime |\n|is_pending | int | 1 if\ + \ the downtime is currently pending **(not active)**, 0 if it is active |\n|is_service\ + \ | int | 0, if this entry is for a host, 1 if it is for a service |\n|origin\ + \ | int | A 0 if the downtime has been set by a command, a 1 if it has been configured\ + \ by a rule |\n|recurring | int | For recurring downtimes: 1: hourly, 2: daily,\ + \ 3: weekly, 4: two-weekly, 5: four-weekly. Otherwise 0 |\n|start_time | time\ + \ | The start time of the downtime as UNIX timestamp |\n|triggered_by | int |\ + \ The id of the downtime this downtime was triggered by or 0 if it was not triggered\ + \ by another downtime |\n|type | int | The type of the downtime: 0 if it is active,\ + \ 1 if it is pending |\n\n### Adjacent columns:\n\n| Column name | Type | Description\ + \ |\n| - | - | - |\n|host_accept_passive_checks | int | Whether passive host checks\ + \ are accepted **(0/1)** |\n|host_acknowledged | int | Whether the current problem\ + \ has been acknowledged **(0/1)** |\n|host_acknowledgement_type | int | Type of\ + \ acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|host_action_url | string\ + \ | An optional URL to custom actions or information about this host |\n|host_action_url_expanded\ + \ | string | The same as action_url, but with the most important macros expanded\ + \ |\n|host_active_checks_enabled | int | Whether active checks of the object are\ + \ enabled **(0/1)** |\n|host_address | string | IP address |\n|host_alias | string\ + \ | An alias name for the host |\n|host_check_command | string | Logical command\ + \ name for active checks |\n|host_check_command_expanded | string | Logical command\ + \ name for active checks, with macros expanded |\n|host_check_flapping_recovery_notification\ + \ | int | Whether to check to send a recovery notification when flapping stops\ + \ **(0/1)** |\n|host_check_freshness | int | Whether freshness checks are enabled\ + \ **(0/1)** |\n|host_check_interval | float | Number of basic interval lengths\ + \ between two scheduled checks |\n|host_check_options | int | The current check\ + \ option, forced, normal, freshness **(0-2)** |\n|host_check_period | string |\ + \ Time period in which this object will be checked. If empty then the check will\ + \ always be executed. |\n|host_check_type | int | Type of check **(0: active,\ + \ 1: passive)** |\n|host_checks_enabled | int | Whether checks of the object are\ + \ enabled **(0/1)** |\n|host_childs | list | A list of all direct children of\ + \ the host |\n|host_comments | list | A list of the ids of all comments |\n|host_comments_with_extra_info\ + \ | list | A list of all comments with id, author, comment, entry type and entry\ + \ time |\n|host_comments_with_info | list | A list of all comments with id, author\ + \ and comment |\n|host_contact_groups | list | A list of all contact groups this\ + \ object is in |\n|host_contacts | list | A list of all contacts of this object\ + \ |\n|host_current_attempt | int | Number of the current check attempts |\n|host_current_notification_number\ + \ | int | Number of the current notification |\n|host_custom_variable_names |\ + \ list | A list of the names of the custom variables |\n|host_custom_variable_values\ + \ | list | A list of the values of the custom variables |\n|host_custom_variables\ + \ | dict | A dictionary of the custom variables |\n|host_display_name | string\ + \ | Optional display name |\n|host_downtimes | list | A list of the ids of all\ + \ scheduled downtimes of this object |\n|host_downtimes_with_extra_info | list\ + \ | A list of the scheduled downtimes with id, author, comment, origin, entry_time,\ + \ start_time, end_time, fixed, duration, recurring and is_pending |\n|host_downtimes_with_info\ + \ | list | A list of the scheduled downtimes with id, author and comment |\n|host_event_handler\ + \ | string | Command used as event handler |\n|host_event_handler_enabled | int\ + \ | Whether event handling is enabled **(0/1)** |\n|host_execution_time | float\ + \ | Time the check needed for execution |\n|host_filename | string | The value\ + \ of the custom variable FILENAME |\n|host_first_notification_delay | float |\ + \ Delay before the first notification |\n|host_flap_detection_enabled | int |\ + \ Whether flap detection is enabled **(0/1)** |\n|host_flappiness | float | The\ + \ current level of flappiness, this corresponds with the recent frequency of state\ + \ changes |\n|host_groups | list | A list of all host groups this object is in\ + \ |\n|host_hard_state | int | The effective hard state of this object |\n|host_has_been_checked\ + \ | int | Whether a check has already been executed **(0/1)** |\n|host_high_flap_threshold\ + \ | float | High threshold of flap detection |\n|host_icon_image | string | The\ + \ name of an image file to be used in the web pages |\n|host_icon_image_alt |\ + \ string | Alternative text for the icon_image |\n|host_icon_image_expanded |\ + \ string | The same as icon_image, but with the most important macros expanded\ + \ |\n|host_in_check_period | int | Whether this object is currently in its check\ + \ period **(0/1)** |\n|host_in_notification_period | int | Whether this object\ + \ is currently in its notification period **(0/1)** |\n|host_in_service_period\ + \ | int | Whether this object is currently in its service period **(0/1)** |\n\ + |host_initial_state | int | Initial state |\n|host_is_executing | int | is there\ + \ a check currently running **(0/1)** |\n|host_is_flapping | int | Whether the\ + \ state is flapping **(0/1)** |\n|host_label_names | list | A list of the names\ + \ of the labels |\n|host_label_source_names | list | A list of the names of the\ + \ label sources |\n|host_label_source_values | list | A list of the values of\ + \ the label sources |\n|host_label_sources | dict | A dictionary of the label\ + \ sources |\n|host_label_values | list | A list of the values of the labels |\n\ + |host_labels | dict | A dictionary of the labels |\n|host_last_check | time |\ + \ Time of the last check **(Unix timestamp)** |\n|host_last_hard_state | int |\ + \ Last hard state |\n|host_last_hard_state_change | time | Time of the last hard\ + \ state change - soft or hard **(Unix timestamp)** |\n|host_last_notification\ + \ | time | Time of the last notification **(Unix timestamp)** |\n|host_last_state\ + \ | int | State before last state change |\n|host_last_state_change | time | Time\ + \ of the last state change - soft or hard **(Unix timestamp)** |\n|host_last_time_down\ + \ | time | The last time the host was DOWN **(Unix timestamp)** |\n|host_last_time_unreachable\ + \ | time | The last time the host was UNREACHABLE **(Unix timestamp)** |\n|host_last_time_up\ + \ | time | The last time the host was UP **(Unix timestamp)** |\n|host_latency\ + \ | float | Time difference between scheduled check time and actual check time\ + \ |\n|host_long_plugin_output | string | Long **(extra)** output of the last check\ + \ |\n|host_low_flap_threshold | float | Low threshold of flap detection |\n|host_max_check_attempts\ + \ | int | Maximum attempts for active checks before a hard state |\n|host_metrics\ + \ | list | A list of all metrics of this object that historically existed |\n\ + |host_mk_inventory | blob | The file content of the Check_MK HW/SW-Inventory |\n\ + |host_mk_inventory_gz | blob | The gzipped file content of the Check_MK HW/SW-Inventory\ + \ |\n|host_mk_inventory_last | time | The timestamp of the last Check_MK HW/SW-Inventory\ + \ for this host. 0 means that no inventory data is present |\n|host_mk_logwatch_files\ + \ | list | This list of logfiles with problems fetched via mk_logwatch |\n|host_modified_attributes\ + \ | int | A bitmask specifying which attributes have been modified |\n|host_modified_attributes_list\ + \ | list | A list of all modified attributes |\n|host_name | string | Host name\ + \ |\n|host_next_check | time | Scheduled time for the next check **(Unix timestamp)**\ + \ |\n|host_next_notification | time | Time of the next notification **(Unix timestamp)**\ + \ |\n|host_no_more_notifications | int | Whether to stop sending notifications\ + \ **(0/1)** |\n|host_notes | string | Optional notes for this object, with macros\ + \ not expanded |\n|host_notes_expanded | string | The same as notes, but with\ + \ the most important macros expanded |\n|host_notes_url | string | An optional\ + \ URL with further information about the object |\n|host_notes_url_expanded |\ + \ string | Same es notes_url, but with the most important macros expanded |\n\ + |host_notification_interval | float | Interval of periodic notification in minutes\ + \ or 0 if its off |\n|host_notification_period | string | Time period in which\ + \ problems of this object will be notified. If empty then notification will be\ + \ always |\n|host_notification_postponement_reason | string | reason for postponing\ + \ the pending notification, empty if nothing is postponed |\n|host_notifications_enabled\ + \ | int | Whether notifications of the host are enabled **(0/1)** |\n|host_num_services\ + \ | int | The total number of services of the host |\n|host_num_services_crit\ + \ | int | The number of the host's services with the soft state CRIT |\n|host_num_services_handled_problems\ + \ | int | The number of the host's services which have handled problems |\n|host_num_services_hard_crit\ + \ | int | The number of the host's services with the hard state CRIT |\n|host_num_services_hard_ok\ + \ | int | The number of the host's services with the hard state OK |\n|host_num_services_hard_unknown\ + \ | int | The number of the host's services with the hard state UNKNOWN |\n|host_num_services_hard_warn\ + \ | int | The number of the host's services with the hard state WARN |\n|host_num_services_ok\ + \ | int | The number of the host's services with the soft state OK |\n|host_num_services_pending\ + \ | int | The number of the host's services which have not been checked yet **(pending)**\ + \ |\n|host_num_services_unhandled_problems | int | The number of the host's services\ + \ which have unhandled problems |\n|host_num_services_unknown | int | The number\ + \ of the host's services with the soft state UNKNOWN |\n|host_num_services_warn\ + \ | int | The number of the host's services with the soft state WARN |\n|host_obsess_over_host\ + \ | int | The current obsess_over_host setting **(0/1)** |\n|host_parents | list\ + \ | A list of all direct parents of the host |\n|host_pending_flex_downtime |\ + \ int | Number of pending flexible downtimes |\n|host_percent_state_change | float\ + \ | Percent state change |\n|host_perf_data | string | Optional performance data\ + \ of the last check |\n|host_plugin_output | string | Output of the last check\ + \ |\n|host_pnpgraph_present | int | Whether there is a PNP4Nagios graph present\ + \ for this object **(-1/0/1)** |\n|host_previous_hard_state | int | Previous hard\ + \ state **(that hard state before the current/last hard state)** |\n|host_process_performance_data\ + \ | int | Whether processing of performance data is enabled **(0/1)** |\n|host_retry_interval\ + \ | float | Number of basic interval lengths between checks when retrying after\ + \ a soft error |\n|host_scheduled_downtime_depth | int | The number of downtimes\ + \ this object is currently in |\n|host_service_period | string | Time period during\ + \ which the object is expected to be available |\n|host_services | list | A list\ + \ of all services of the host |\n|host_services_with_fullstate | list | A list\ + \ of all services including full state information. The list of entries can grow\ + \ in future versions. |\n|host_services_with_info | list | A list of all services\ + \ including detailed information about each service |\n|host_services_with_state\ + \ | list | A list of all services of the host together with state and has_been_checked\ + \ |\n|host_smartping_timeout | int | Maximum expected time between two received\ + \ packets in ms |\n|host_staleness | float | The staleness of this object |\n\ + |host_state | int | The current state of the object, for hosts: 0/1/2 for UP/DOWN/UNREACH,\ + \ for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN |\n|host_state_type | int | Type\ + \ of the current state **(0: soft, 1: hard)** |\n|host_statusmap_image | string\ + \ | The name of in image file for the status map |\n|host_structured_status |\ + \ blob | The file content of the structured status of the Check_MK HW/SW-Inventory\ + \ |\n|host_tag_names | list | A list of the names of the tags |\n|host_tag_values\ + \ | list | A list of the values of the tags |\n|host_tags | dict | A dictionary\ + \ of the tags |\n|host_total_services | int | The total number of services of\ + \ the host |\n|host_worst_service_hard_state | int | The worst hard state of all\ + \ of the host's services **(OK <= WARN <= UNKNOWN <= CRIT)** |\n|host_worst_service_state\ + \ | int | The worst soft state of all of the host's services **(OK <= WARN <=\ + \ UNKNOWN <= CRIT)** |\n|host_x_3d | float | 3D-Coordinates: X |\n|host_y_3d |\ + \ float | 3D-Coordinates: Y |\n|host_z_3d | float | 3D-Coordinates: Z |\n|service_accept_passive_checks\ + \ | int | Whether passive host checks are accepted **(0/1)** |\n|service_acknowledged\ + \ | int | Whether the current problem has been acknowledged **(0/1)** |\n|service_acknowledgement_type\ + \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|service_action_url\ + \ | string | An optional URL to custom actions or information about this host\ + \ |\n|service_action_url_expanded | string | The same as action_url, but with\ + \ the most important macros expanded |\n|service_active_checks_enabled | int |\ + \ Whether active checks of the object are enabled **(0/1)** |\n|service_cache_interval\ + \ | int | For checks that base on cached agent data the interval in that this\ + \ cache is recreated. 0 for other services. |\n|service_cached_at | time | For\ + \ checks that base on cached agent data the time when this data was created. 0\ + \ for other services. |\n|service_check_command | string | Logical command name\ + \ for active checks |\n|service_check_command_expanded | string | Logical command\ + \ name for active checks, with macros expanded |\n|service_check_flapping_recovery_notification\ + \ | int | Whether to check to send a recovery notification when flapping stops\ + \ **(0/1)** |\n|service_check_freshness | int | Whether freshness checks are enabled\ + \ **(0/1)** |\n|service_check_interval | float | Number of basic interval lengths\ + \ between two scheduled checks |\n|service_check_options | int | The current check\ + \ option, forced, normal, freshness **(0-2)** |\n|service_check_period | string\ + \ | Time period in which this object will be checked. If empty then the check\ + \ will always be executed. |\n|service_check_type | int | Type of check **(0:\ + \ active, 1: passive)** |\n|service_checks_enabled | int | Whether checks of the\ + \ object are enabled **(0/1)** |\n|service_comments | list | A list of the ids\ + \ of all comments |\n|service_comments_with_extra_info | list | A list of all\ + \ comments with id, author, comment, entry type and entry time |\n|service_comments_with_info\ + \ | list | A list of all comments with id, author and comment |\n|service_contact_groups\ + \ | list | A list of all contact groups this object is in |\n|service_contacts\ + \ | list | A list of all contacts of this object |\n|service_current_attempt |\ + \ int | Number of the current check attempts |\n|service_current_notification_number\ + \ | int | Number of the current notification |\n|service_custom_variable_names\ + \ | list | A list of the names of the custom variables |\n|service_custom_variable_values\ + \ | list | A list of the values of the custom variables |\n|service_custom_variables\ + \ | dict | A dictionary of the custom variables |\n|service_description | string\ + \ | Service description |\n|service_display_name | string | Optional display name\ + \ |\n|service_downtimes | list | A list of the ids of all scheduled downtimes\ + \ of this object |\n|service_downtimes_with_extra_info | list | A list of the\ + \ scheduled downtimes with id, author, comment, origin, entry_time, start_time,\ + \ end_time, fixed, duration, recurring and is_pending |\n|service_downtimes_with_info\ + \ | list | A list of the scheduled downtimes with id, author and comment |\n|service_event_handler\ + \ | string | Command used as event handler |\n|service_event_handler_enabled |\ + \ int | Whether event handling is enabled **(0/1)** |\n|service_execution_time\ + \ | float | Time the check needed for execution |\n|service_first_notification_delay\ + \ | float | Delay before the first notification |\n|service_flap_detection_enabled\ + \ | int | Whether flap detection is enabled **(0/1)** |\n|service_flappiness |\ + \ float | The current level of flappiness, this corresponds with the recent frequency\ + \ of state changes |\n|service_groups | list | A list of all service groups this\ + \ object is in |\n|service_hard_state | int | The effective hard state of this\ + \ object |\n|service_has_been_checked | int | Whether a check has already been\ + \ executed **(0/1)** |\n|service_high_flap_threshold | float | High threshold\ + \ of flap detection |\n|service_icon_image | string | The name of an image file\ + \ to be used in the web pages |\n|service_icon_image_alt | string | Alternative\ + \ text for the icon_image |\n|service_icon_image_expanded | string | The same\ + \ as icon_image, but with the most important macros expanded |\n|service_in_check_period\ + \ | int | Whether this object is currently in its check period **(0/1)** |\n|service_in_notification_period\ + \ | int | Whether this object is currently in its notification period **(0/1)**\ + \ |\n|service_in_passive_check_period | int | Whether this service is currently\ + \ in its passive check period **(0/1)** |\n|service_in_service_period | int |\ + \ Whether this object is currently in its service period **(0/1)** |\n|service_initial_state\ + \ | int | Initial state |\n|service_is_executing | int | is there a check currently\ + \ running **(0/1)** |\n|service_is_flapping | int | Whether the state is flapping\ + \ **(0/1)** |\n|service_label_names | list | A list of the names of the labels\ + \ |\n|service_label_source_names | list | A list of the names of the label sources\ + \ |\n|service_label_source_values | list | A list of the values of the label sources\ + \ |\n|service_label_sources | dict | A dictionary of the label sources |\n|service_label_values\ + \ | list | A list of the values of the labels |\n|service_labels | dict | A dictionary\ + \ of the labels |\n|service_last_check | time | Time of the last check **(Unix\ + \ timestamp)** |\n|service_last_hard_state | int | Last hard state |\n|service_last_hard_state_change\ + \ | time | Time of the last hard state change - soft or hard **(Unix timestamp)**\ + \ |\n|service_last_notification | time | Time of the last notification **(Unix\ + \ timestamp)** |\n|service_last_state | int | State before last state change |\n\ + |service_last_state_change | time | Time of the last state change - soft or hard\ + \ **(Unix timestamp)** |\n|service_last_time_critical | time | The last time the\ + \ service was CRIT **(Unix timestamp)** |\n|service_last_time_ok | time | The\ + \ last time the service was OK **(Unix timestamp)** |\n|service_last_time_unknown\ + \ | time | The last time the service was UNKNOWN **(Unix timestamp)** |\n|service_last_time_warning\ + \ | time | The last time the service was WARN **(Unix timestamp)** |\n|service_latency\ + \ | float | Time difference between scheduled check time and actual check time\ + \ |\n|service_long_plugin_output | string | Long **(extra)** output of the last\ + \ check |\n|service_low_flap_threshold | float | Low threshold of flap detection\ + \ |\n|service_max_check_attempts | int | Maximum attempts for active checks before\ + \ a hard state |\n|service_metrics | list | A list of all metrics of this object\ + \ that historically existed |\n|service_modified_attributes | int | A bitmask\ + \ specifying which attributes have been modified |\n|service_modified_attributes_list\ + \ | list | A list of all modified attributes |\n|service_next_check | time | Scheduled\ + \ time for the next check **(Unix timestamp)** |\n|service_next_notification |\ + \ time | Time of the next notification **(Unix timestamp)** |\n|service_no_more_notifications\ + \ | int | Whether to stop sending notifications **(0/1)** |\n|service_notes |\ + \ string | Optional notes for this object, with macros not expanded |\n|service_notes_expanded\ + \ | string | The same as notes, but with the most important macros expanded |\n\ + |service_notes_url | string | An optional URL with further information about the\ + \ object |\n|service_notes_url_expanded | string | Same es notes_url, but with\ + \ the most important macros expanded |\n|service_notification_interval | float\ + \ | Interval of periodic notification in minutes or 0 if its off |\n|service_notification_period\ + \ | string | Time period in which problems of this object will be notified. If\ + \ empty then notification will be always |\n|service_notification_postponement_reason\ + \ | string | reason for postponing the pending notification, empty if nothing\ + \ is postponed |\n|service_notifications_enabled | int | Whether notifications\ + \ of the host are enabled **(0/1)** |\n|service_obsess_over_service | int | The\ + \ current obsess_over_service setting **(0/1)** |\n|service_passive_check_period\ + \ | string | Time period in which this **(passive)** service will be checked.\ + \ |\n|service_pending_flex_downtime | int | Number of pending flexible downtimes\ + \ |\n|service_percent_state_change | float | Percent state change |\n|service_perf_data\ + \ | string | Optional performance data of the last check |\n|service_plugin_output\ + \ | string | Output of the last check |\n|service_pnpgraph_present | int | Whether\ + \ there is a PNP4Nagios graph present for this object **(-1/0/1)** |\n|service_previous_hard_state\ + \ | int | Previous hard state **(that hard state before the current/last hard\ + \ state)** |\n|service_process_performance_data | int | Whether processing of\ + \ performance data is enabled **(0/1)** |\n|service_retry_interval | float | Number\ + \ of basic interval lengths between checks when retrying after a soft error |\n\ + |service_robotmk_last_error_log | blob | The file content of the Robotmk error\ + \ log |\n|service_robotmk_last_error_log_gz | blob | The gzipped file content\ + \ of the Robotmk error log |\n|service_robotmk_last_log | blob | The file content\ + \ of the Robotmk log |\n|service_robotmk_last_log_gz | blob | The gzipped file\ + \ content of the Robotmk log |\n|service_scheduled_downtime_depth | int | The\ + \ number of downtimes this object is currently in |\n|service_service_period |\ + \ string | Time period during which the object is expected to be available |\n\ + |service_staleness | float | The staleness of this object |\n|service_state |\ + \ int | The current state of the object, for hosts: 0/1/2 for UP/DOWN/UNREACH,\ + \ for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN |\n|service_state_type | int\ + \ | Type of the current state **(0: soft, 1: hard)** |\n|service_tag_names | list\ + \ | A list of the names of the tags |\n|service_tag_values | list | A list of\ + \ the values of the tags |\n|service_tags | dict | A dictionary of the tags |\n\ + \n## Hostgroups Table\n\n### Columns:\n\n| Column name | Type | Description |\n\ + | - | - | - |\n|action_url | string | An optional URL to custom notes or actions\ + \ on the host group |\n|alias | string | An alias of the hostgroup |\n|members\ + \ | list | A list of all host names that are members of the hostgroup |\n|members_with_state\ + \ | list | A list of all host names that are members of the hostgroup together\ + \ with state and has_been_checked |\n|name | string | Name of the hostgroup |\n\ + |notes | string | Optional additional notes about the host group |\n|notes_url\ + \ | string | An optional URL to further notes on the host group |\n|num_hosts\ + \ | int | The total number of hosts in the group |\n|num_hosts_down | int | The\ + \ number of hosts in the group that are down |\n|num_hosts_handled_problems |\ + \ int | The total number of hosts in this group with handled problems |\n|num_hosts_pending\ + \ | int | The number of hosts in the group that are pending |\n|num_hosts_unhandled_problems\ + \ | int | The total number of hosts in this group with unhandled problems |\n\ + |num_hosts_unreach | int | The number of hosts in the group that are unreachable\ + \ |\n|num_hosts_up | int | The number of hosts in the group that are up |\n|num_services\ + \ | int | The total number of services of hosts in this group |\n|num_services_crit\ + \ | int | The total number of services with the state CRIT of hosts in this group\ + \ |\n|num_services_handled_problems | int | The total number of services of hosts\ + \ in this group with handled problems |\n|num_services_hard_crit | int | The total\ + \ number of services with the state CRIT of hosts in this group |\n|num_services_hard_ok\ + \ | int | The total number of services with the state OK of hosts in this group\ + \ |\n|num_services_hard_unknown | int | The total number of services with the\ + \ state UNKNOWN of hosts in this group |\n|num_services_hard_warn | int | The\ + \ total number of services with the state WARN of hosts in this group |\n|num_services_ok\ + \ | int | The total number of services with the state OK of hosts in this group\ + \ |\n|num_services_pending | int | The total number of services with the state\ + \ Pending of hosts in this group |\n|num_services_unhandled_problems | int | The\ + \ total number of services of hosts in this group with unhandled problems |\n\ + |num_services_unknown | int | The total number of services with the state UNKNOWN\ + \ of hosts in this group |\n|num_services_warn | int | The total number of services\ + \ with the state WARN of hosts in this group |\n|worst_host_state | int | The\ + \ worst state of all of the groups' hosts **(UP <= UNREACHABLE <= DOWN)** |\n\ + |worst_service_hard_state | int | The worst state of all services that belong\ + \ to a host of this group **(OK <= WARN <= UNKNOWN <= CRIT)** |\n|worst_service_state\ + \ | int | The worst state of all services that belong to a host of this group\ + \ **(OK <= WARN <= UNKNOWN <= CRIT)** |\n\n## Hosts Table\n\n### Columns:\n\n\ + | Column name | Type | Description |\n| - | - | - |\n|accept_passive_checks |\ + \ int | Whether passive host checks are accepted **(0/1)** |\n|acknowledged |\ + \ int | Whether the current problem has been acknowledged **(0/1)** |\n|acknowledgement_type\ + \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|action_url\ + \ | string | An optional URL to custom actions or information about this host\ + \ |\n|action_url_expanded | string | The same as action_url, but with the most\ + \ important macros expanded |\n|active_checks_enabled | int | Whether active checks\ + \ of the object are enabled **(0/1)** |\n|address | string | IP address |\n|alias\ + \ | string | An alias name for the host |\n|check_command | string | Logical command\ + \ name for active checks |\n|check_command_expanded | string | Logical command\ + \ name for active checks, with macros expanded |\n|check_flapping_recovery_notification\ + \ | int | Whether to check to send a recovery notification when flapping stops\ + \ **(0/1)** |\n|check_freshness | int | Whether freshness checks are enabled **(0/1)**\ + \ |\n|check_interval | float | Number of basic interval lengths between two scheduled\ + \ checks |\n|check_options | int | The current check option, forced, normal, freshness\ + \ **(0-2)** |\n|check_period | string | Time period in which this object will\ + \ be checked. If empty then the check will always be executed. |\n|check_type\ + \ | int | Type of check **(0: active, 1: passive)** |\n|checks_enabled | int |\ + \ Whether checks of the object are enabled **(0/1)** |\n|childs | list | A list\ + \ of all direct children of the host |\n|comments | list | A list of the ids of\ + \ all comments |\n|comments_with_extra_info | list | A list of all comments with\ + \ id, author, comment, entry type and entry time |\n|comments_with_info | list\ + \ | A list of all comments with id, author and comment |\n|contact_groups | list\ + \ | A list of all contact groups this object is in |\n|contacts | list | A list\ + \ of all contacts of this object |\n|current_attempt | int | Number of the current\ + \ check attempts |\n|current_notification_number | int | Number of the current\ + \ notification |\n|custom_variable_names | list | A list of the names of the custom\ + \ variables |\n|custom_variable_values | list | A list of the values of the custom\ + \ variables |\n|custom_variables | dict | A dictionary of the custom variables\ + \ |\n|display_name | string | Optional display name |\n|downtimes | list | A list\ + \ of the ids of all scheduled downtimes of this object |\n|downtimes_with_extra_info\ + \ | list | A list of the scheduled downtimes with id, author, comment, origin,\ + \ entry_time, start_time, end_time, fixed, duration, recurring and is_pending\ + \ |\n|downtimes_with_info | list | A list of the scheduled downtimes with id,\ + \ author and comment |\n|event_handler | string | Command used as event handler\ + \ |\n|event_handler_enabled | int | Whether event handling is enabled **(0/1)**\ + \ |\n|execution_time | float | Time the check needed for execution |\n|filename\ + \ | string | The value of the custom variable FILENAME |\n|first_notification_delay\ + \ | float | Delay before the first notification |\n|flap_detection_enabled | int\ + \ | Whether flap detection is enabled **(0/1)** |\n|flappiness | float | The current\ + \ level of flappiness, this corresponds with the recent frequency of state changes\ + \ |\n|groups | list | A list of all host groups this object is in |\n|hard_state\ + \ | int | The effective hard state of this object |\n|has_been_checked | int |\ + \ Whether a check has already been executed **(0/1)** |\n|high_flap_threshold\ + \ | float | High threshold of flap detection |\n|icon_image | string | The name\ + \ of an image file to be used in the web pages |\n|icon_image_alt | string | Alternative\ + \ text for the icon_image |\n|icon_image_expanded | string | The same as icon_image,\ + \ but with the most important macros expanded |\n|in_check_period | int | Whether\ + \ this object is currently in its check period **(0/1)** |\n|in_notification_period\ + \ | int | Whether this object is currently in its notification period **(0/1)**\ + \ |\n|in_service_period | int | Whether this object is currently in its service\ + \ period **(0/1)** |\n|initial_state | int | Initial state |\n|is_executing |\ + \ int | is there a check currently running **(0/1)** |\n|is_flapping | int | Whether\ + \ the state is flapping **(0/1)** |\n|label_names | list | A list of the names\ + \ of the labels |\n|label_source_names | list | A list of the names of the label\ + \ sources |\n|label_source_values | list | A list of the values of the label sources\ + \ |\n|label_sources | dict | A dictionary of the label sources |\n|label_values\ + \ | list | A list of the values of the labels |\n|labels | dict | A dictionary\ + \ of the labels |\n|last_check | time | Time of the last check **(Unix timestamp)**\ + \ |\n|last_hard_state | int | Last hard state |\n|last_hard_state_change | time\ + \ | Time of the last hard state change - soft or hard **(Unix timestamp)** |\n\ + |last_notification | time | Time of the last notification **(Unix timestamp)**\ + \ |\n|last_state | int | State before last state change |\n|last_state_change\ + \ | time | Time of the last state change - soft or hard **(Unix timestamp)** |\n\ + |last_time_down | time | The last time the host was DOWN **(Unix timestamp)**\ + \ |\n|last_time_unreachable | time | The last time the host was UNREACHABLE **(Unix\ + \ timestamp)** |\n|last_time_up | time | The last time the host was UP **(Unix\ + \ timestamp)** |\n|latency | float | Time difference between scheduled check time\ + \ and actual check time |\n|long_plugin_output | string | Long **(extra)** output\ + \ of the last check |\n|low_flap_threshold | float | Low threshold of flap detection\ + \ |\n|max_check_attempts | int | Maximum attempts for active checks before a hard\ + \ state |\n|metrics | list | A list of all metrics of this object that historically\ + \ existed |\n|mk_inventory | blob | The file content of the Check_MK HW/SW-Inventory\ + \ |\n|mk_inventory_gz | blob | The gzipped file content of the Check_MK HW/SW-Inventory\ + \ |\n|mk_inventory_last | time | The timestamp of the last Check_MK HW/SW-Inventory\ + \ for this host. 0 means that no inventory data is present |\n|mk_logwatch_files\ + \ | list | This list of logfiles with problems fetched via mk_logwatch |\n|modified_attributes\ + \ | int | A bitmask specifying which attributes have been modified |\n|modified_attributes_list\ + \ | list | A list of all modified attributes |\n|name | string | Host name |\n\ + |next_check | time | Scheduled time for the next check **(Unix timestamp)** |\n\ + |next_notification | time | Time of the next notification **(Unix timestamp)**\ + \ |\n|no_more_notifications | int | Whether to stop sending notifications **(0/1)**\ + \ |\n|notes | string | Optional notes for this object, with macros not expanded\ + \ |\n|notes_expanded | string | The same as notes, but with the most important\ + \ macros expanded |\n|notes_url | string | An optional URL with further information\ + \ about the object |\n|notes_url_expanded | string | Same es notes_url, but with\ + \ the most important macros expanded |\n|notification_interval | float | Interval\ + \ of periodic notification in minutes or 0 if its off |\n|notification_period\ + \ | string | Time period in which problems of this object will be notified. If\ + \ empty then notification will be always |\n|notification_postponement_reason\ + \ | string | reason for postponing the pending notification, empty if nothing\ + \ is postponed |\n|notifications_enabled | int | Whether notifications of the\ + \ host are enabled **(0/1)** |\n|num_services | int | The total number of services\ + \ of the host |\n|num_services_crit | int | The number of the host's services\ + \ with the soft state CRIT |\n|num_services_handled_problems | int | The number\ + \ of the host's services which have handled problems |\n|num_services_hard_crit\ + \ | int | The number of the host's services with the hard state CRIT |\n|num_services_hard_ok\ + \ | int | The number of the host's services with the hard state OK |\n|num_services_hard_unknown\ + \ | int | The number of the host's services with the hard state UNKNOWN |\n|num_services_hard_warn\ + \ | int | The number of the host's services with the hard state WARN |\n|num_services_ok\ + \ | int | The number of the host's services with the soft state OK |\n|num_services_pending\ + \ | int | The number of the host's services which have not been checked yet **(pending)**\ + \ |\n|num_services_unhandled_problems | int | The number of the host's services\ + \ which have unhandled problems |\n|num_services_unknown | int | The number of\ + \ the host's services with the soft state UNKNOWN |\n|num_services_warn | int\ + \ | The number of the host's services with the soft state WARN |\n|obsess_over_host\ + \ | int | The current obsess_over_host setting **(0/1)** |\n|parents | list |\ + \ A list of all direct parents of the host |\n|pending_flex_downtime | int | Number\ + \ of pending flexible downtimes |\n|percent_state_change | float | Percent state\ + \ change |\n|perf_data | string | Optional performance data of the last check\ + \ |\n|plugin_output | string | Output of the last check |\n|pnpgraph_present |\ + \ int | Whether there is a PNP4Nagios graph present for this object **(-1/0/1)**\ + \ |\n|previous_hard_state | int | Previous hard state **(that hard state before\ + \ the current/last hard state)** |\n|process_performance_data | int | Whether\ + \ processing of performance data is enabled **(0/1)** |\n|retry_interval | float\ + \ | Number of basic interval lengths between checks when retrying after a soft\ + \ error |\n|scheduled_downtime_depth | int | The number of downtimes this object\ + \ is currently in |\n|service_period | string | Time period during which the object\ + \ is expected to be available |\n|services | list | A list of all services of\ + \ the host |\n|services_with_fullstate | list | A list of all services including\ + \ full state information. The list of entries can grow in future versions. |\n\ + |services_with_info | list | A list of all services including detailed information\ + \ about each service |\n|services_with_state | list | A list of all services of\ + \ the host together with state and has_been_checked |\n|smartping_timeout | int\ + \ | Maximum expected time between two received packets in ms |\n|staleness | float\ + \ | The staleness of this object |\n|state | int | The current state of the object,\ + \ for hosts: 0/1/2 for UP/DOWN/UNREACH, for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN\ + \ |\n|state_type | int | Type of the current state **(0: soft, 1: hard)** |\n\ + |statusmap_image | string | The name of in image file for the status map |\n|structured_status\ + \ | blob | The file content of the structured status of the Check_MK HW/SW-Inventory\ + \ |\n|tag_names | list | A list of the names of the tags |\n|tag_values | list\ + \ | A list of the values of the tags |\n|tags | dict | A dictionary of the tags\ + \ |\n|total_services | int | The total number of services of the host |\n|worst_service_hard_state\ + \ | int | The worst hard state of all of the host's services **(OK <= WARN <=\ + \ UNKNOWN <= CRIT)** |\n|worst_service_state | int | The worst soft state of all\ + \ of the host's services **(OK <= WARN <= UNKNOWN <= CRIT)** |\n|x_3d | float\ + \ | 3D-Coordinates: X |\n|y_3d | float | 3D-Coordinates: Y |\n|z_3d | float |\ + \ 3D-Coordinates: Z |\n\n## Servicegroups Table\n\n### Columns:\n\n| Column name\ + \ | Type | Description |\n| - | - | - |\n|action_url | string | An optional URL\ + \ to custom notes or actions on the service group |\n|alias | string | An alias\ + \ of the servicegroup |\n|members | list | A list of all members of the service\ + \ group as host/service pairs |\n|members_with_state | list | A list of all members\ + \ of the service group with state and has_been_checked |\n|name | string | Name\ + \ of the servicegroup |\n|notes | string | Optional additional notes about the\ + \ service group |\n|notes_url | string | An optional URL to further notes on the\ + \ service group |\n|num_services | int | The total number of services in the group\ + \ |\n|num_services_crit | int | The number of services in the group that are CRIT\ + \ |\n|num_services_handled_problems | int | The number of services in the group\ + \ that have handled problems |\n|num_services_hard_crit | int | The number of\ + \ services in the group that are CRIT |\n|num_services_hard_ok | int | The number\ + \ of services in the group that are OK |\n|num_services_hard_unknown | int | The\ + \ number of services in the group that are UNKNOWN |\n|num_services_hard_warn\ + \ | int | The number of services in the group that are WARN |\n|num_services_ok\ + \ | int | The number of services in the group that are OK |\n|num_services_pending\ + \ | int | The number of services in the group that are PENDING |\n|num_services_unhandled_problems\ + \ | int | The number of services in the group that have unhandled problems |\n\ + |num_services_unknown | int | The number of services in the group that are UNKNOWN\ + \ |\n|num_services_warn | int | The number of services in the group that are WARN\ + \ |\n|worst_service_state | int | The worst soft state of all of the groups services\ + \ **(OK <= WARN <= UNKNOWN <= CRIT)** |\n\n## Services Table\n\n### Columns:\n\ + \n| Column name | Type | Description |\n| - | - | - |\n|accept_passive_checks\ + \ | int | Whether passive host checks are accepted **(0/1)** |\n|acknowledged\ + \ | int | Whether the current problem has been acknowledged **(0/1)** |\n|acknowledgement_type\ + \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|action_url\ + \ | string | An optional URL to custom actions or information about this host\ + \ |\n|action_url_expanded | string | The same as action_url, but with the most\ + \ important macros expanded |\n|active_checks_enabled | int | Whether active checks\ + \ of the object are enabled **(0/1)** |\n|cache_interval | int | For checks that\ + \ base on cached agent data the interval in that this cache is recreated. 0 for\ + \ other services. |\n|cached_at | time | For checks that base on cached agent\ + \ data the time when this data was created. 0 for other services. |\n|check_command\ + \ | string | Logical command name for active checks |\n|check_command_expanded\ + \ | string | Logical command name for active checks, with macros expanded |\n\ + |check_flapping_recovery_notification | int | Whether to check to send a recovery\ + \ notification when flapping stops **(0/1)** |\n|check_freshness | int | Whether\ + \ freshness checks are enabled **(0/1)** |\n|check_interval | float | Number of\ + \ basic interval lengths between two scheduled checks |\n|check_options | int\ + \ | The current check option, forced, normal, freshness **(0-2)** |\n|check_period\ + \ | string | Time period in which this object will be checked. If empty then the\ + \ check will always be executed. |\n|check_type | int | Type of check **(0: active,\ + \ 1: passive)** |\n|checks_enabled | int | Whether checks of the object are enabled\ + \ **(0/1)** |\n|comments | list | A list of the ids of all comments |\n|comments_with_extra_info\ + \ | list | A list of all comments with id, author, comment, entry type and entry\ + \ time |\n|comments_with_info | list | A list of all comments with id, author\ + \ and comment |\n|contact_groups | list | A list of all contact groups this object\ + \ is in |\n|contacts | list | A list of all contacts of this object |\n|current_attempt\ + \ | int | Number of the current check attempts |\n|current_notification_number\ + \ | int | Number of the current notification |\n|custom_variable_names | list\ + \ | A list of the names of the custom variables |\n|custom_variable_values | list\ + \ | A list of the values of the custom variables |\n|custom_variables | dict |\ + \ A dictionary of the custom variables |\n|description | string | Service description\ + \ |\n|display_name | string | Optional display name |\n|downtimes | list | A list\ + \ of the ids of all scheduled downtimes of this object |\n|downtimes_with_extra_info\ + \ | list | A list of the scheduled downtimes with id, author, comment, origin,\ + \ entry_time, start_time, end_time, fixed, duration, recurring and is_pending\ + \ |\n|downtimes_with_info | list | A list of the scheduled downtimes with id,\ + \ author and comment |\n|event_handler | string | Command used as event handler\ + \ |\n|event_handler_enabled | int | Whether event handling is enabled **(0/1)**\ + \ |\n|execution_time | float | Time the check needed for execution |\n|first_notification_delay\ + \ | float | Delay before the first notification |\n|flap_detection_enabled | int\ + \ | Whether flap detection is enabled **(0/1)** |\n|flappiness | float | The current\ + \ level of flappiness, this corresponds with the recent frequency of state changes\ + \ |\n|groups | list | A list of all service groups this object is in |\n|hard_state\ + \ | int | The effective hard state of this object |\n|has_been_checked | int |\ + \ Whether a check has already been executed **(0/1)** |\n|high_flap_threshold\ + \ | float | High threshold of flap detection |\n|icon_image | string | The name\ + \ of an image file to be used in the web pages |\n|icon_image_alt | string | Alternative\ + \ text for the icon_image |\n|icon_image_expanded | string | The same as icon_image,\ + \ but with the most important macros expanded |\n|in_check_period | int | Whether\ + \ this object is currently in its check period **(0/1)** |\n|in_notification_period\ + \ | int | Whether this object is currently in its notification period **(0/1)**\ + \ |\n|in_passive_check_period | int | Whether this service is currently in its\ + \ passive check period **(0/1)** |\n|in_service_period | int | Whether this object\ + \ is currently in its service period **(0/1)** |\n|initial_state | int | Initial\ + \ state |\n|is_executing | int | is there a check currently running **(0/1)**\ + \ |\n|is_flapping | int | Whether the state is flapping **(0/1)** |\n|label_names\ + \ | list | A list of the names of the labels |\n|label_source_names | list | A\ + \ list of the names of the label sources |\n|label_source_values | list | A list\ + \ of the values of the label sources |\n|label_sources | dict | A dictionary of\ + \ the label sources |\n|label_values | list | A list of the values of the labels\ + \ |\n|labels | dict | A dictionary of the labels |\n|last_check | time | Time\ + \ of the last check **(Unix timestamp)** |\n|last_hard_state | int | Last hard\ + \ state |\n|last_hard_state_change | time | Time of the last hard state change\ + \ - soft or hard **(Unix timestamp)** |\n|last_notification | time | Time of the\ + \ last notification **(Unix timestamp)** |\n|last_state | int | State before last\ + \ state change |\n|last_state_change | time | Time of the last state change -\ + \ soft or hard **(Unix timestamp)** |\n|last_time_critical | time | The last time\ + \ the service was CRIT **(Unix timestamp)** |\n|last_time_ok | time | The last\ + \ time the service was OK **(Unix timestamp)** |\n|last_time_unknown | time |\ + \ The last time the service was UNKNOWN **(Unix timestamp)** |\n|last_time_warning\ + \ | time | The last time the service was WARN **(Unix timestamp)** |\n|latency\ + \ | float | Time difference between scheduled check time and actual check time\ + \ |\n|long_plugin_output | string | Long **(extra)** output of the last check\ + \ |\n|low_flap_threshold | float | Low threshold of flap detection |\n|max_check_attempts\ + \ | int | Maximum attempts for active checks before a hard state |\n|metrics |\ + \ list | A list of all metrics of this object that historically existed |\n|modified_attributes\ + \ | int | A bitmask specifying which attributes have been modified |\n|modified_attributes_list\ + \ | list | A list of all modified attributes |\n|next_check | time | Scheduled\ + \ time for the next check **(Unix timestamp)** |\n|next_notification | time |\ + \ Time of the next notification **(Unix timestamp)** |\n|no_more_notifications\ + \ | int | Whether to stop sending notifications **(0/1)** |\n|notes | string |\ + \ Optional notes for this object, with macros not expanded |\n|notes_expanded\ + \ | string | The same as notes, but with the most important macros expanded |\n\ + |notes_url | string | An optional URL with further information about the object\ + \ |\n|notes_url_expanded | string | Same es notes_url, but with the most important\ + \ macros expanded |\n|notification_interval | float | Interval of periodic notification\ + \ in minutes or 0 if its off |\n|notification_period | string | Time period in\ + \ which problems of this object will be notified. If empty then notification will\ + \ be always |\n|notification_postponement_reason | string | reason for postponing\ + \ the pending notification, empty if nothing is postponed |\n|notifications_enabled\ + \ | int | Whether notifications of the host are enabled **(0/1)** |\n|obsess_over_service\ + \ | int | The current obsess_over_service setting **(0/1)** |\n|passive_check_period\ + \ | string | Time period in which this **(passive)** service will be checked.\ + \ |\n|pending_flex_downtime | int | Number of pending flexible downtimes |\n|percent_state_change\ + \ | float | Percent state change |\n|perf_data | string | Optional performance\ + \ data of the last check |\n|plugin_output | string | Output of the last check\ + \ |\n|pnpgraph_present | int | Whether there is a PNP4Nagios graph present for\ + \ this object **(-1/0/1)** |\n|previous_hard_state | int | Previous hard state\ + \ **(that hard state before the current/last hard state)** |\n|process_performance_data\ + \ | int | Whether processing of performance data is enabled **(0/1)** |\n|retry_interval\ + \ | float | Number of basic interval lengths between checks when retrying after\ + \ a soft error |\n|robotmk_last_error_log | blob | The file content of the Robotmk\ + \ error log |\n|robotmk_last_error_log_gz | blob | The gzipped file content of\ + \ the Robotmk error log |\n|robotmk_last_log | blob | The file content of the\ + \ Robotmk log |\n|robotmk_last_log_gz | blob | The gzipped file content of the\ + \ Robotmk log |\n|scheduled_downtime_depth | int | The number of downtimes this\ + \ object is currently in |\n|service_period | string | Time period during which\ + \ the object is expected to be available |\n|staleness | float | The staleness\ + \ of this object |\n|state | int | The current state of the object, for hosts:\ + \ 0/1/2 for UP/DOWN/UNREACH, for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN |\n\ + |state_type | int | Type of the current state **(0: soft, 1: hard)** |\n|tag_names\ + \ | list | A list of the names of the tags |\n|tag_values | list | A list of the\ + \ values of the tags |\n|tags | dict | A dictionary of the tags |\n\n### Adjacent\ + \ columns:\n\n| Column name | Type | Description |\n| - | - | - |\n|host_accept_passive_checks\ + \ | int | Whether passive host checks are accepted **(0/1)** |\n|host_acknowledged\ + \ | int | Whether the current problem has been acknowledged **(0/1)** |\n|host_acknowledgement_type\ + \ | int | Type of acknowledgement **(0: none, 1: normal, 2: sticky)** |\n|host_action_url\ + \ | string | An optional URL to custom actions or information about this host\ + \ |\n|host_action_url_expanded | string | The same as action_url, but with the\ + \ most important macros expanded |\n|host_active_checks_enabled | int | Whether\ + \ active checks of the object are enabled **(0/1)** |\n|host_address | string\ + \ | IP address |\n|host_alias | string | An alias name for the host |\n|host_check_command\ + \ | string | Logical command name for active checks |\n|host_check_command_expanded\ + \ | string | Logical command name for active checks, with macros expanded |\n\ + |host_check_flapping_recovery_notification | int | Whether to check to send a\ + \ recovery notification when flapping stops **(0/1)** |\n|host_check_freshness\ + \ | int | Whether freshness checks are enabled **(0/1)** |\n|host_check_interval\ + \ | float | Number of basic interval lengths between two scheduled checks |\n\ + |host_check_options | int | The current check option, forced, normal, freshness\ + \ **(0-2)** |\n|host_check_period | string | Time period in which this object\ + \ will be checked. If empty then the check will always be executed. |\n|host_check_type\ + \ | int | Type of check **(0: active, 1: passive)** |\n|host_checks_enabled |\ + \ int | Whether checks of the object are enabled **(0/1)** |\n|host_childs | list\ + \ | A list of all direct children of the host |\n|host_comments | list | A list\ + \ of the ids of all comments |\n|host_comments_with_extra_info | list | A list\ + \ of all comments with id, author, comment, entry type and entry time |\n|host_comments_with_info\ + \ | list | A list of all comments with id, author and comment |\n|host_contact_groups\ + \ | list | A list of all contact groups this object is in |\n|host_contacts |\ + \ list | A list of all contacts of this object |\n|host_current_attempt | int\ + \ | Number of the current check attempts |\n|host_current_notification_number\ + \ | int | Number of the current notification |\n|host_custom_variable_names |\ + \ list | A list of the names of the custom variables |\n|host_custom_variable_values\ + \ | list | A list of the values of the custom variables |\n|host_custom_variables\ + \ | dict | A dictionary of the custom variables |\n|host_display_name | string\ + \ | Optional display name |\n|host_downtimes | list | A list of the ids of all\ + \ scheduled downtimes of this object |\n|host_downtimes_with_extra_info | list\ + \ | A list of the scheduled downtimes with id, author, comment, origin, entry_time,\ + \ start_time, end_time, fixed, duration, recurring and is_pending |\n|host_downtimes_with_info\ + \ | list | A list of the scheduled downtimes with id, author and comment |\n|host_event_handler\ + \ | string | Command used as event handler |\n|host_event_handler_enabled | int\ + \ | Whether event handling is enabled **(0/1)** |\n|host_execution_time | float\ + \ | Time the check needed for execution |\n|host_filename | string | The value\ + \ of the custom variable FILENAME |\n|host_first_notification_delay | float |\ + \ Delay before the first notification |\n|host_flap_detection_enabled | int |\ + \ Whether flap detection is enabled **(0/1)** |\n|host_flappiness | float | The\ + \ current level of flappiness, this corresponds with the recent frequency of state\ + \ changes |\n|host_groups | list | A list of all host groups this object is in\ + \ |\n|host_hard_state | int | The effective hard state of this object |\n|host_has_been_checked\ + \ | int | Whether a check has already been executed **(0/1)** |\n|host_high_flap_threshold\ + \ | float | High threshold of flap detection |\n|host_icon_image | string | The\ + \ name of an image file to be used in the web pages |\n|host_icon_image_alt |\ + \ string | Alternative text for the icon_image |\n|host_icon_image_expanded |\ + \ string | The same as icon_image, but with the most important macros expanded\ + \ |\n|host_in_check_period | int | Whether this object is currently in its check\ + \ period **(0/1)** |\n|host_in_notification_period | int | Whether this object\ + \ is currently in its notification period **(0/1)** |\n|host_in_service_period\ + \ | int | Whether this object is currently in its service period **(0/1)** |\n\ + |host_initial_state | int | Initial state |\n|host_is_executing | int | is there\ + \ a check currently running **(0/1)** |\n|host_is_flapping | int | Whether the\ + \ state is flapping **(0/1)** |\n|host_label_names | list | A list of the names\ + \ of the labels |\n|host_label_source_names | list | A list of the names of the\ + \ label sources |\n|host_label_source_values | list | A list of the values of\ + \ the label sources |\n|host_label_sources | dict | A dictionary of the label\ + \ sources |\n|host_label_values | list | A list of the values of the labels |\n\ + |host_labels | dict | A dictionary of the labels |\n|host_last_check | time |\ + \ Time of the last check **(Unix timestamp)** |\n|host_last_hard_state | int |\ + \ Last hard state |\n|host_last_hard_state_change | time | Time of the last hard\ + \ state change - soft or hard **(Unix timestamp)** |\n|host_last_notification\ + \ | time | Time of the last notification **(Unix timestamp)** |\n|host_last_state\ + \ | int | State before last state change |\n|host_last_state_change | time | Time\ + \ of the last state change - soft or hard **(Unix timestamp)** |\n|host_last_time_down\ + \ | time | The last time the host was DOWN **(Unix timestamp)** |\n|host_last_time_unreachable\ + \ | time | The last time the host was UNREACHABLE **(Unix timestamp)** |\n|host_last_time_up\ + \ | time | The last time the host was UP **(Unix timestamp)** |\n|host_latency\ + \ | float | Time difference between scheduled check time and actual check time\ + \ |\n|host_long_plugin_output | string | Long **(extra)** output of the last check\ + \ |\n|host_low_flap_threshold | float | Low threshold of flap detection |\n|host_max_check_attempts\ + \ | int | Maximum attempts for active checks before a hard state |\n|host_metrics\ + \ | list | A list of all metrics of this object that historically existed |\n\ + |host_mk_inventory | blob | The file content of the Check_MK HW/SW-Inventory |\n\ + |host_mk_inventory_gz | blob | The gzipped file content of the Check_MK HW/SW-Inventory\ + \ |\n|host_mk_inventory_last | time | The timestamp of the last Check_MK HW/SW-Inventory\ + \ for this host. 0 means that no inventory data is present |\n|host_mk_logwatch_files\ + \ | list | This list of logfiles with problems fetched via mk_logwatch |\n|host_modified_attributes\ + \ | int | A bitmask specifying which attributes have been modified |\n|host_modified_attributes_list\ + \ | list | A list of all modified attributes |\n|host_name | string | Host name\ + \ |\n|host_next_check | time | Scheduled time for the next check **(Unix timestamp)**\ + \ |\n|host_next_notification | time | Time of the next notification **(Unix timestamp)**\ + \ |\n|host_no_more_notifications | int | Whether to stop sending notifications\ + \ **(0/1)** |\n|host_notes | string | Optional notes for this object, with macros\ + \ not expanded |\n|host_notes_expanded | string | The same as notes, but with\ + \ the most important macros expanded |\n|host_notes_url | string | An optional\ + \ URL with further information about the object |\n|host_notes_url_expanded |\ + \ string | Same es notes_url, but with the most important macros expanded |\n\ + |host_notification_interval | float | Interval of periodic notification in minutes\ + \ or 0 if its off |\n|host_notification_period | string | Time period in which\ + \ problems of this object will be notified. If empty then notification will be\ + \ always |\n|host_notification_postponement_reason | string | reason for postponing\ + \ the pending notification, empty if nothing is postponed |\n|host_notifications_enabled\ + \ | int | Whether notifications of the host are enabled **(0/1)** |\n|host_num_services\ + \ | int | The total number of services of the host |\n|host_num_services_crit\ + \ | int | The number of the host's services with the soft state CRIT |\n|host_num_services_handled_problems\ + \ | int | The number of the host's services which have handled problems |\n|host_num_services_hard_crit\ + \ | int | The number of the host's services with the hard state CRIT |\n|host_num_services_hard_ok\ + \ | int | The number of the host's services with the hard state OK |\n|host_num_services_hard_unknown\ + \ | int | The number of the host's services with the hard state UNKNOWN |\n|host_num_services_hard_warn\ + \ | int | The number of the host's services with the hard state WARN |\n|host_num_services_ok\ + \ | int | The number of the host's services with the soft state OK |\n|host_num_services_pending\ + \ | int | The number of the host's services which have not been checked yet **(pending)**\ + \ |\n|host_num_services_unhandled_problems | int | The number of the host's services\ + \ which have unhandled problems |\n|host_num_services_unknown | int | The number\ + \ of the host's services with the soft state UNKNOWN |\n|host_num_services_warn\ + \ | int | The number of the host's services with the soft state WARN |\n|host_obsess_over_host\ + \ | int | The current obsess_over_host setting **(0/1)** |\n|host_parents | list\ + \ | A list of all direct parents of the host |\n|host_pending_flex_downtime |\ + \ int | Number of pending flexible downtimes |\n|host_percent_state_change | float\ + \ | Percent state change |\n|host_perf_data | string | Optional performance data\ + \ of the last check |\n|host_plugin_output | string | Output of the last check\ + \ |\n|host_pnpgraph_present | int | Whether there is a PNP4Nagios graph present\ + \ for this object **(-1/0/1)** |\n|host_previous_hard_state | int | Previous hard\ + \ state **(that hard state before the current/last hard state)** |\n|host_process_performance_data\ + \ | int | Whether processing of performance data is enabled **(0/1)** |\n|host_retry_interval\ + \ | float | Number of basic interval lengths between checks when retrying after\ + \ a soft error |\n|host_scheduled_downtime_depth | int | The number of downtimes\ + \ this object is currently in |\n|host_service_period | string | Time period during\ + \ which the object is expected to be available |\n|host_services | list | A list\ + \ of all services of the host |\n|host_services_with_fullstate | list | A list\ + \ of all services including full state information. The list of entries can grow\ + \ in future versions. |\n|host_services_with_info | list | A list of all services\ + \ including detailed information about each service |\n|host_services_with_state\ + \ | list | A list of all services of the host together with state and has_been_checked\ + \ |\n|host_smartping_timeout | int | Maximum expected time between two received\ + \ packets in ms |\n|host_staleness | float | The staleness of this object |\n\ + |host_state | int | The current state of the object, for hosts: 0/1/2 for UP/DOWN/UNREACH,\ + \ for services: 0/1/2/3 for OK/WARN/CRIT/UNKNOWN |\n|host_state_type | int | Type\ + \ of the current state **(0: soft, 1: hard)** |\n|host_statusmap_image | string\ + \ | The name of in image file for the status map |\n|host_structured_status |\ + \ blob | The file content of the structured status of the Check_MK HW/SW-Inventory\ + \ |\n|host_tag_names | list | A list of the names of the tags |\n|host_tag_values\ + \ | list | A list of the values of the tags |\n|host_tags | dict | A dictionary\ + \ of the tags |\n|host_total_services | int | The total number of services of\ + \ the host |\n|host_worst_service_hard_state | int | The worst hard state of all\ + \ of the host's services **(OK <= WARN <= UNKNOWN <= CRIT)** |\n|host_worst_service_state\ + \ | int | The worst soft state of all of the host's services **(OK <= WARN <=\ + \ UNKNOWN <= CRIT)** |\n|host_x_3d | float | 3D-Coordinates: X |\n|host_y_3d |\ + \ float | 3D-Coordinates: Y |\n|host_z_3d | float | 3D-Coordinates: Z |\n\n##\ + \ Status Table\n\n### Columns:\n\n| Column name | Type | Description |\n| - |\ + \ - | - |\n|accept_passive_host_checks | int | Whether passive host checks are\ + \ accepted in general **(0/1)** |\n|accept_passive_service_checks | int | Whether\ + \ passive service checks are activated in general **(0/1)** |\n|average_latency_cmk\ + \ | float | The average latency for executing Check_MK checks **(i.e. the time\ + \ the start of the execution is behind the schedule)** |\n|average_latency_fetcher\ + \ | float | The average latency for executing Check_MK fetchers **(i.e. the time\ + \ the start of the execution is behind the schedule)** |\n|average_latency_generic\ + \ | float | The average latency for executing active checks **(i.e. the time the\ + \ start of the execution is behind the schedule)** |\n|average_latency_real_time\ + \ | float | The average latency for executing real time checks **(i.e. the time\ + \ the start of the execution is behind the schedule)** |\n|average_runnable_jobs_checker\ + \ | float | The average count of queued replies which have not yet been delivered\ + \ to the checker helpers |\n|average_runnable_jobs_fetcher | float | The average\ + \ count of scheduled fetcher jobs which have not yet been processed |\n|cached_log_messages\ + \ | int | The current number of log messages MK Livestatus keeps in memory |\n\ + |carbon_bytes_sent | float | The number of number of bytes sent over the carbon\ + \ connections since program start |\n|carbon_bytes_sent_rate | float | The averaged\ + \ number of number of bytes sent over the carbon connections per second |\n|carbon_overflows\ + \ | float | The number of times a Carbon connection could not send the metrics\ + \ since program start |\n|carbon_overflows_rate | float | The averaged number\ + \ of times a Carbon connection could not send the metrics per second |\n|carbon_queue_usage\ + \ | float | The number of number of elements in the queue / size of the queue\ + \ since program start |\n|carbon_queue_usage_rate | float | The averaged number\ + \ of number of elements in the queue / size of the queue per second |\n|check_external_commands\ + \ | int | Whether Nagios checks for external commands at its command pipe **(0/1)**\ + \ |\n|check_host_freshness | int | Whether host freshness checking is activated\ + \ in general **(0/1)** |\n|check_service_freshness | int | Whether service freshness\ + \ checking is activated in general **(0/1)** |\n|connections | float | The number\ + \ of client connections to Livestatus since program start |\n|connections_rate\ + \ | float | The averaged number of client connections to Livestatus per second\ + \ |\n|core_pid | int | The process ID of the monitoring core |\n|enable_event_handlers\ + \ | int | Whether alert handlers are activated in general **(0/1)** |\n|enable_flap_detection\ + \ | int | Whether flap detection is activated in general **(0/1)** |\n|enable_notifications\ + \ | int | Whether notifications are enabled in general **(0/1)** |\n|execute_host_checks\ + \ | int | Whether host checks are executed in general **(0/1)** |\n|execute_service_checks\ + \ | int | Whether active service checks are activated in general **(0/1)** |\n\ + |external_command_buffer_max | int | The maximum number of slots used in the external\ + \ command buffer |\n|external_command_buffer_slots | int | The size of the buffer\ + \ for the external commands |\n|external_command_buffer_usage | int | The number\ + \ of slots in use of the external command buffer |\n|external_commands | float\ + \ | The number of external commands since program start |\n|external_commands_rate\ + \ | float | The averaged number of external commands per second |\n|forks | float\ + \ | The number of process creations since program start |\n|forks_rate | float\ + \ | The averaged number of process creations per second |\n|has_event_handlers\ + \ | int | Whether or not at alert handler rules are configured **(0/1)** |\n|helper_usage_checker\ + \ | float | The average usage of the checker helpers, ranging from 0.0 **(0%)**\ + \ up to 1.0 **(100%)** |\n|helper_usage_cmk | float | The average usage of the\ + \ Check_MK check helpers, ranging from 0.0 **(0%)** up to 1.0 **(100%)** |\n|helper_usage_fetcher\ + \ | float | The average usage of the fetcher helpers, ranging from 0.0 **(0%)**\ + \ up to 1.0 **(100%)** |\n|helper_usage_generic | float | The average usage of\ + \ the generic check helpers, ranging from 0.0 **(0%)** up to 1.0 **(100%)** |\n\ + |helper_usage_real_time | float | The average usage of the real time check helpers,\ + \ ranging from 0.0 **(0%)** up to 1.0 **(100%)** |\n|host_checks | float | The\ + \ number of host checks since program start |\n|host_checks_rate | float | The\ + \ averaged number of host checks per second |\n|influxdb_bytes_sent | float |\ + \ The number of number of bytes sent over the InfluxDB connections **(payload\ + \ only)** since program start |\n|influxdb_bytes_sent_rate | float | The averaged\ + \ number of number of bytes sent over the InfluxDB connections **(payload only)**\ + \ per second |\n|influxdb_overflows | float | The number of times an InfluxDB\ + \ connection could not send the metrics since program start |\n|influxdb_overflows_rate\ + \ | float | The averaged number of times an InfluxDB connection could not send\ + \ the metrics per second |\n|influxdb_queue_usage | float | The number of number\ + \ of elements in the queue / size of the queue since program start |\n|influxdb_queue_usage_rate\ + \ | float | The averaged number of number of elements in the queue / size of the\ + \ queue per second |\n|interval_length | int | The default interval length |\n\ + |is_trial_expired | int | Whether or not expired trial of demo version |\n|last_command_check\ + \ | time | The time of the last check for a command as UNIX timestamp |\n|last_log_rotation\ + \ | time | Time time of the last log file rotation |\n|license_usage_history |\ + \ blob | Historic license usage information |\n|livechecks | float | The number\ + \ of checks executed via livecheck since program start |\n|livechecks_rate | float\ + \ | The averaged number of checks executed via livecheck per second |\n|livestatus_active_connections\ + \ | int | The current number of active connections to MK Livestatus |\n|livestatus_overflows\ + \ | float | The number of times a Livestatus connection could not be immediately\ + \ accepted because all threads where busy since program start |\n|livestatus_overflows_rate\ + \ | float | The averaged number of times a Livestatus connection could not be\ + \ immediately accepted because all threads where busy per second |\n|livestatus_queued_connections\ + \ | int | The current number of queued connections to MK Livestatus |\n|livestatus_threads\ + \ | int | The maximum number of connections to MK Livestatus that can be handled\ + \ in parallel |\n|livestatus_usage | float | The average usage of the livestatus\ + \ connection slots, ranging from 0.0 **(0%)** up to 1.0 **(100%)** |\n|livestatus_version\ + \ | string | The version of the MK Livestatus module |\n|log_messages | float\ + \ | The number of new log messages since program start |\n|log_messages_rate |\ + \ float | The averaged number of new log messages per second |\n|metrics_count\ + \ | float | The number of number of metrics processed by the core since program\ + \ start |\n|metrics_count_rate | float | The averaged number of number of metrics\ + \ processed by the core per second |\n|mk_inventory_last | time | The timestamp\ + \ of the last time a host has been inventorized by Check_MK HW/SW-Inventory |\n\ + |nagios_pid | int | The process ID of the monitoring core |\n|neb_callbacks |\ + \ float | The number of NEB callbacks since program start |\n|neb_callbacks_rate\ + \ | float | The averaged number of NEB callbacks per second |\n|num_hosts | int\ + \ | The total number of hosts |\n|num_queued_alerts | int | The number of queued\ + \ alerts which have not yet been delivered to the alert helper |\n|num_queued_notifications\ + \ | int | The number of queued notifications which have not yet been delivered\ + \ to the notification helper |\n|num_services | int | The total number of services\ + \ |\n|obsess_over_hosts | int | Whether Nagios will obsess over host checks **(0/1)**\ + \ |\n|obsess_over_services | int | Whether Nagios will obsess over service checks\ + \ and run the ocsp_command **(0/1)** |\n|perf_data_count | float | The number\ + \ of number of performance data processed by the core since program start |\n\ + |perf_data_count_rate | float | The averaged number of number of performance data\ + \ processed by the core per second |\n|process_performance_data | int | Whether\ + \ processing of performance data is activated in general **(0/1)** |\n|program_start\ + \ | time | The time of the last program start or configuration reload as UNIX\ + \ timestamp |\n|program_version | string | The version of the monitoring daemon\ + \ |\n|requests | float | The number of requests to Livestatus since program start\ + \ |\n|requests_rate | float | The averaged number of requests to Livestatus per\ + \ second |\n|rrdcached_bytes_sent | float | The number of number of bytes sent\ + \ over to the RRDs since program start |\n|rrdcached_bytes_sent_rate | float |\ + \ The averaged number of number of bytes sent over to the RRDs per second |\n\ + |rrdcached_overflows | float | The number of times an RRDCacheD connection could\ + \ not send the metrics since program start |\n|rrdcached_overflows_rate | float\ + \ | The averaged number of times an RRDCacheD connection could not send the metrics\ + \ per second |\n|rrdcached_queue_usage | float | The number of number of elements\ + \ in the queue / size of the queue since program start |\n|rrdcached_queue_usage_rate\ + \ | float | The averaged number of number of elements in the queue / size of the\ + \ queue per second |\n|service_checks | float | The number of completed service\ + \ checks since program start |\n|service_checks_rate | float | The averaged number\ + \ of completed service checks per second |\n|state_file_created | time | The time\ + \ when state file had been created |\n\n\n# Authentication\n\nTo use this API\ + \ from an automated client, a user needs to be set up in Checkmk. Any kind of\ + \ user,\nbe it *automation* or *GUI* users, can be used to access the REST API.\ + \ On a newly created site\nsome users are already created. You can configure them\ + \ in Checkmk at *Setup* > *Users*.\n\nFor the various authentication methods that\ + \ can be used please consult the following descriptions,\nwhich occur in the order\ + \ of precedence. This means that on a request which receives multiple\nauthentication\ + \ methods, the one with the hightes priority \"wins\" and is used. This is especially\n\ + convenient when developing automation scripts, as these can directly be used with\ + \ either the\ncurrently logged in GUI user, or the \"Bearer\" authentication method\ + \ which takes precedence over the\nGUI authentication method. The result is that\ + \ the user doesn't have to log out to check that the\nscripts works with the other\ + \ method.\n\n\n\n# Compatibility\n\n## HTTP client compatibility\n\ + \nIf you have a client which cannot do the HTTP PUT or DELETE methods, you can\ + \ use the\n`X-HTTP-Method-Override` HTTP header to force the server into believing\ + \ the client actually sent\nsuch a method. In these cases the HTTP method to use\ + \ has to be POST. You cannot override from GET.\n\n## Compatibility policy\n\n\ + It is our policy to keep all documented parts backwards compatible, as long as\ + \ there is no\ncompelling reason (like security, etc) to break compatibility.\n\ + \nIn the event of a break in backwards compatibility, these changes are documented\ + \ and, if possible,\nannounced by deprecating the field or endpoint in question\ + \ beforehand. Please understand that this\ncan't be promised for all cases (security,\ + \ etc) though.\n\n## Versioning\n\n### Definition\n\nThe REST API is versioned\ + \ by a *major* and *minor* version number.\n\nThe *major* number is incremented\ + \ when backwards incompatible changes to the API have been made.\nThis will reset\ + \ the *minor* number to *0*. A *werk* which contains the details of the change\ + \ and\nmarking the change as incompatible will be released when this happens.\n\ + \nTh *minor* number will be increased when backwards compatible changes are added\ + \ to the API. A\n*werk* detailing the additions will be released when this happens.\n\ + \n**Note:** Despite the noted backward compatibility, API consumers are best to\ + \ ensure that their\nimplementation does not disrupt use-case requirements.\n\n\ + ### Usage\n\nThe *major* version is part of the URL of each endpoint, while the\ + \ whole version (in the form\n*major*.*minor*) can be sent via the HTTP header\ + \ `X-API-Version`. If the header is not sent,\nthe most recent *minor* version\ + \ of the through the URL selected *major* version is used.\nThe header will also\ + \ be present in the accompanying HTTP response.\n\n### Format\n\n * URL: *v1*,\ + \ *v2*, etc.\n * X-API-Version HTTP header: *major.minor*\n\n### Notes\n\n * In\ + \ the first release, the version part in the URL has been documented as `1.0`.\ + \ These\n URLs will continue to work in the future, although using the `X-API-Version`\ + \ header will not be\n possible with this version identifier. You have to use\ + \ the above documented format (v1, v2, ...)\n in the URL to be able to use the\ + \ `X-API-Version` header.\n\n## Undocumented behaviour\n\nWe cannot guarantee\ + \ bug-for-bug backwards compatibility. If a behaviour of an endpoint is not\n\ + documented we may change it without incrementing the API version." + license: + name: GNU General Public License version 2 + url: https://checkmk.com/gpl.html + title: Checkmk REST-API + version: '1.0' +openapi: 3.0.2 +paths: + /domain-types/acknowledge/collections/host: + post: + description: "\n\nThis endpoint requires the following permissions: \n * `action.acknowledge`:\ + \ Acknowledge host and service problems and remove acknowledgements\n" + operationId: cmk.gui.plugins.openapi.endpoints.acknowledgement.set_acknowledgement_on_hosts + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The name of the tag. - operator: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeHostRelatedProblem' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '422': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unprocessable Entity: The query yielded no result.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Set acknowledgement on related hosts + tags: + - Acknowledge problems + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/acknowledge/collections/host\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n # This schema has multiple variations. Please refer to\n \ + \ # the 'Payload' section for details.\n json={\n 'acknowledge_type':\ + \ 'host',\n 'sticky': False,\n 'persistent': False,\n \ + \ 'notify': False,\n 'comment': 'This was expected.',\n \ + \ 'host_name': 'example.com'\n },\n)\nif resp.status_code == 200:\n\ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/acknowledge/collections/host\",\n method=\"\ + POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n # This schema has multiple\ + \ variations. Please refer to\n # the 'Payload' section for details.\n\ + \ data=json.dumps({\n 'acknowledge_type': 'host',\n 'sticky':\ + \ False,\n 'persistent': False,\n 'notify': False,\n \ + \ 'comment': 'This was expected.',\n 'host_name': 'example.com'\n\ + \ }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\n# This schema has multiple variations. Please\ + \ refer to the\n# 'Payload' section for details.\nhttp POST \"$API_URL/domain-types/acknowledge/collections/host\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n acknowledge_type='host'\ + \ \\\n sticky='False' \\\n persistent='False' \\\n notify='False'\ + \ \\\n comment='This was expected.' \\\n host_name='example.com' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ + \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ + \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ + \ application/json\" \\\n --data '{\n \"acknowledge_type\":\ + \ \"host\",\n \"comment\": \"This was expected.\",\n \"\ + host_name\": \"example.com\",\n \"notify\": false,\n \"\ + persistent\": false,\n \"sticky\": false\n }' \\\n \"\ + $API_URL/domain-types/acknowledge/collections/host\")\n\nresp=$( echo \"\ + ${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk\ + \ -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + /domain-types/acknowledge/collections/service: + post: + description: "\n\nThis endpoint requires the following permissions: \n * `action.acknowledge`:\ + \ Acknowledge host and service problems and remove acknowledgements\n" + operationId: cmk.gui.plugins.openapi.endpoints.acknowledgement.set_acknowledgement_on_services + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: If the tag's value should match what is given under the field - `value`. - enum: - - is - - is_not - value: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeServiceRelatedProblem' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '422': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unprocessable Entity: Service was not in a problem state.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Set acknowledgement on related services + tags: + - Acknowledge problems + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/acknowledge/collections/service\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n # This schema has multiple variations. Please refer to\n \ + \ # the 'Payload' section for details.\n json={\n 'acknowledge_type':\ + \ 'service',\n 'sticky': False,\n 'persistent': False,\n \ + \ 'notify': False,\n 'comment': 'This was expected.',\n \ + \ 'host_name': 'example.com',\n 'service_description': 'CPU load'\n\ + \ },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/acknowledge/collections/service\",\n method=\"\ + POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n # This schema has multiple\ + \ variations. Please refer to\n # the 'Payload' section for details.\n\ + \ data=json.dumps({\n 'acknowledge_type': 'service',\n \ + \ 'sticky': False,\n 'persistent': False,\n 'notify': False,\n\ + \ 'comment': 'This was expected.',\n 'host_name': 'example.com',\n\ + \ 'service_description': 'CPU load'\n }).encode('utf-8'),\n)\n\ + response = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\n# This schema has multiple variations. Please\ + \ refer to the\n# 'Payload' section for details.\nhttp POST \"$API_URL/domain-types/acknowledge/collections/service\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n acknowledge_type='service'\ + \ \\\n sticky='False' \\\n persistent='False' \\\n notify='False'\ + \ \\\n comment='This was expected.' \\\n host_name='example.com' \\\ + \n service_description='CPU load' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ + \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ + \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ + \ application/json\" \\\n --data '{\n \"acknowledge_type\":\ + \ \"service\",\n \"comment\": \"This was expected.\",\n \ + \ \"host_name\": \"example.com\",\n \"notify\": false,\n \ + \ \"persistent\": false,\n \"service_description\": \"CPU\ + \ load\",\n \"sticky\": false\n }' \\\n \"$API_URL/domain-types/acknowledge/collections/service\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/activation_run/{activation_id}/actions/wait-for-completion/invoke: + get: + description: "This endpoint will periodically redirect on itself to prevent\ + \ timeouts.This endpoint requires the following permissions: \n * `wato.activate`:\ + \ This permission is needed for activating the current configuration (and\ + \ thus rewriting the monitoring configuration and restart the monitoring daemon.)\n" + operationId: cmk.gui.plugins.openapi.endpoints.activate_changes.activate_changes_wait_for_completion + parameters: + - description: The activation-id. + in: path + name: activation_id + required: true + schema: + example: d3b07384d113e0ec49eaa6238ad5ff00 type: string - description: The value of a tag. - TagConditionConditionSchemaBase: - type: object - properties: - key: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: There is no running activation with this activation_id.' + '302': + content: {} + description: 'Found: The activation is still running. Redirecting to the + ''Wait for completion'' endpoint.' + '204': + content: {} + description: 'No Content: The activation has been completed.' + summary: Wait for activation completion + tags: + - Activate changes + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00/actions/wait-for-completion/invoke\"\ + ,\n allow_redirects=True,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00/actions/wait-for-completion/invoke\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00/actions/wait-for-completion/invoke\"\ + \ \\\n --follow \\\n --all \\\n \"Authorization: Bearer $USERNAME\ + \ $PASSWORD\" \\\n \"Accept: application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00/actions/wait-for-completion/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/activation_run/{activation_id}: + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.activate`:\ + \ This permission is needed for activating the current configuration (and\ + \ thus rewriting the monitoring configuration and restart the monitoring daemon.)\n" + operationId: cmk.gui.plugins.openapi.endpoints.activate_changes.show_activation + parameters: + - description: The activation-id. + in: path + name: activation_id + required: true + schema: + example: d3b07384d113e0ec49eaa6238ad5ff00 type: string - description: The name of the tag. - operator: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: There is no running activation with this activation_id.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show the activation status + tags: + - Activate changes + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/activation_run/d3b07384d113e0ec49eaa6238ad5ff00\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/activation_run/collections/running: + get: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * Any of:\n * `general.see_all`: See all objects regardless of contacts\ + \ and contact groups. If combined with 'perform commands' then commands may\ + \ be done on all objects.\n * `bi.see_all`: With this permission set,\ + \ the BI aggregation rules are applied to all hosts and services - not only\ + \ those the user is a contact for. If you remove this permissions then the\ + \ user will see incomplete aggregation trees with status based only on those\ + \ items.\n * `mkeventd.seeall`: If a user lacks this permission then he/she\ + \ can see only those events that originate from a host that he/she is a contact\ + \ for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.activate_changes.list_activations + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all currently running activations + tags: + - Activate changes + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/activation_run/collections/running\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/activation_run/collections/running\",\n \ + \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/activation_run/collections/running\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/domain-types/activation_run/collections/running\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/activation_run/actions/activate-changes/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.activate`: This permission is needed for activating the\ + \ current configuration (and thus rewriting the monitoring configuration and\ + \ restart the monitoring daemon.)\n * Optionally:\n * `wato.activateforeign`:\ + \ When several users work in parallel with WATO then several pending changes\ + \ of different users might pile up before changes are activate. Only with\ + \ this permission a user will be allowed to activate the current configuration\ + \ if this situation appears.\n * Optionally:\n * Any of:\n * `general.see_all`:\ + \ See all objects regardless of contacts and contact groups. If combined with\ + \ 'perform commands' then commands may be done on all objects.\n * `bi.see_all`:\ + \ With this permission set, the BI aggregation rules are applied to all hosts\ + \ and services - not only those the user is a contact for. If you remove this\ + \ permissions then the user will see incomplete aggregation trees with status\ + \ based only on those items.\n * `mkeventd.seeall`: If a user lacks\ + \ this permission then he/she can see only those events that originate from\ + \ a host that he/she is a contact for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.activate_changes.activate_changes + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: If the matched tag should be one of the given values, or not. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ActivateChanges' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '401': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unauthorized: The API user may not activate another users + changes, or the user may and activation was not forced explicitly.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '422': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unprocessable Entity: There are no changes to be activated.' + '423': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Locked: There is already an activation running.' + '409': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Conflict: Some sites could not be activated.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '302': + content: {} + description: 'Found: The activation has been started and is still running. + Redirecting to the ''Wait for completion'' endpoint.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The activation has been completed.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Activate pending changes + tags: + - Activate changes + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/activation_run/actions/activate-changes/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'redirect': False,\n 'sites': ['production'],\n\ + \ 'force_foreign_changes': False\n },\n allow_redirects=True,\n\ + )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/activation_run/actions/activate-changes/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'redirect': False,\n 'sites': ['production'],\n 'force_foreign_changes':\ + \ False\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/activation_run/actions/activate-changes/invoke\"\ + \ \\\n --follow \\\n --all \\\n \"Authorization: Bearer $USERNAME\ + \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ + \ \\\n redirect='False' \\\n sites='['production']' \\\n force_foreign_changes='False'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"force_foreign_changes\": false,\n \ + \ \"redirect\": false,\n \"sites\": [\n \"production\"\ + \n ]\n }' \\\n \"$API_URL/domain-types/activation_run/actions/activate-changes/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/agent/actions/download/invoke: + get: + description: '' + operationId: cmk.gui.plugins.openapi.endpoints.agent.download_agent + parameters: + - description: The type of the operating system. May be one of linux_rpm, linux_deb, + windows_msi + in: query + name: os_type + required: true + schema: enum: - - one_of - - none_of - value: - type: array - description: A list of values for the tag. - items: - type: string - description: The value of a tag. - TagCondition: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/TagConditionScalarSchemaBase' - - $ref: '#/components/schemas/TagConditionScalarSchemaBase' - - $ref: '#/components/schemas/TagConditionConditionSchemaBase' - - $ref: '#/components/schemas/TagConditionConditionSchemaBase' - discriminator: - propertyName: operator - mapping: - is: '#/components/schemas/TagConditionScalarSchemaBase' - is_not: '#/components/schemas/TagConditionScalarSchemaBase' - one_of: '#/components/schemas/TagConditionConditionSchemaBase' - none_of: '#/components/schemas/TagConditionConditionSchemaBase' - LabelCondition: - type: object - properties: - key: - type: string - description: The key of the label. e.g. 'os' in 'os:windows' - operator: + - linux_deb + - linux_rpm + - windows_msi + example: linux_deb type: string - description: How the label should be matched. - enum: - - is - - is_not - value: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/octet-stream: + schema: + format: binary + type: string + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Download agents shipped with Checkmk + tags: + - Agents + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\nimport shutil\n\ + \nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/octet-stream'\n\nresp = session.get(\n f\"{API_URL}/domain-types/agent/actions/download/invoke\"\ + ,\n params={ # goes into query string\n \"os_type\": 'linux_deb',\ + \ # (required) The type of the operating system.\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ file_name = resp.headers[\"content-disposition\"].split(\"filename=\"\ + )[1].strip(\"\"\")\n with open(file_name, 'wb') as out_file:\n \ + \ resp.raw.decode_content = True\n shutil.copyfileobj(resp.raw,\ + \ out_file)\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport shutil\nimport urllib.parse\n\ + import urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\n\ + API_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME\ + \ = \"automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"os_type\": 'linux_deb', # (required) The type of the operating system.\n\ + })\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/agent/actions/download/invoke?{query_string}\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/octet-stream\"\ + ,\n },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n file_name = response.headers[\"content-disposition\"].split(\"\ + filename=\")[1].strip(\"\"\")\n with open(file_name, 'wb') as out_file:\n\ + \ shutil.copyfileobj(response, out_file)\n print(\"Done\")\nelse:\n\ + \ raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/agent/actions/download/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/octet-stream\" \\\n os_type=='linux_deb' \\\n --download\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/octet-stream\" \\\n --data-urlencode\ + \ 'os_type=linux_deb' \\\n \"$API_URL/domain-types/agent/actions/download/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/bi_rule/{rule_id}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.bi_rules`: Use the WATO BI module, create, modify and delete\ + \ BI rules and aggregations in packs that you are a contact of.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.delete_bi_rule + parameters: + - description: The unique id for the rule + in: path + name: rule_id + required: true + schema: + example: rule1 type: string - description: The value of the label. e.g. 'windows' in 'os:windows' - required: - - key - - value - RuleConditions1: - type: object - properties: - host_name: - description: Here you can enter a list of explicit host names that the rule - should or should not apply to. Leave this option disabled if you want - the rule to apply for all hosts specified by the given tags. The names - that you enter here are compared with case sensitive exact matching. Alternatively - you can use regular expressions if you enter a tilde `~` as the first - character. That regular expression must match the beginning of the host - names in question. - example: - match_on: - - host1 - - host2 - operator: one_of - allOf: - - $ref: '#/components/schemas/HostOrServiceCondition' - host_tags: - description: The rule will only be applied to hosts fulfilling all the host - tag conditions listed here, even if they appear in the list of explicit - host names. - example: - - key: criticality - operator: is - value: prod - type: array - items: - $ref: '#/components/schemas/TagCondition' - host_labels: - description: Further restrict this rule by applying host label conditions. - example: - - key: os - operator: is - value: windows - type: array - items: - $ref: '#/components/schemas/LabelCondition' - service_labels: - description: Restrict the application of the rule, by checking against service - label conditions. - example: - - key: os - operator: is - value: windows - type: array - items: - $ref: '#/components/schemas/LabelCondition' - service_description: - description: "Specify a list of service patterns this rule shall apply to.\n\ - \ * The patterns must match the beginning of the service in question.\n\ - \ * Adding a `$` to the end forces an exact match.\n * Pattern use regular\ - \ expressions. e.g. a `.*` will match an arbitrary text.\n * The text\ - \ entered here is handled as a regular expression pattern.\n * The pattern\ - \ is matched from the beginning.\n * The match is performed case sensitive.\n\ - BE AWARE: Depending on the service ruleset the service_description of\ - \ the rules is only a check item or a full service description. For example\ - \ the check parameters rulesets only use the item, and other service rulesets\ - \ like disabled services ruleset use full servicedescriptions." - example: - match_on: - - foo1 - - bar2 - operator: none_of - allOf: - - $ref: '#/components/schemas/HostOrServiceCondition' - InputRuleObject: - type: object - properties: - properties: - description: Configuration values for rules. - example: &id038 - disabled: false - allOf: - - $ref: '#/components/schemas/RuleProperties1' - value_raw: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '409': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Conflict: The request is in conflict with the stored resource.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete BI rule + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/bi_rule/rule1\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_rule/rule1\",\n method=\"DELETE\",\n \ + \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/bi_rule/rule1\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/bi_rule/rule1\")\n\nresp=$(\ + \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ + \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.bi_rules`:\ + \ Use the WATO BI module, create, modify and delete BI rules and aggregations\ + \ in packs that you are a contact of.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.get_bi_rule + parameters: + - description: The unique id for the rule + in: path + name: rule_id + required: true + schema: + example: rule1 type: string - description: The raw parameter value for this rule. To create the correct - structure, for now use the 'export for API' menu item in the Rule Editor - of the GUI. The value is expected to be a valid Python type. - example: '{''cmk/os_family'': ''linux''}' - conditions: - description: Conditions. - example: &id039 {} - allOf: - - $ref: '#/components/schemas/RuleConditions1' - ruleset: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BIRuleEndpoint' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show a BI rule + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/bi_rule/rule1\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_rule/rule1\",\n method=\"GET\",\n headers={\n\ + \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ + \ \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/bi_rule/rule1\" \\\ + \n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/bi_rule/rule1\")\n\nresp=$(\ + \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ + \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.bi_rules`: Use the WATO BI module, create, modify and delete\ + \ BI rules and aggregations in packs that you are a contact of.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.post_bi_rule + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: Name of rule set. - example: host_label_rules - folder: + - description: The unique id for the rule + in: path + name: rule_id + required: true + schema: + example: rule1 + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BIRuleEndpoint' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BIRuleEndpoint' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Create a new BI rule + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/bi_rule/rule1\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'id': 'rule1',\n 'nodes': [],\n \ + \ 'params': {\n 'arguments': ['foo', 'bar']\n },\n\ + \ 'node_visualization': {\n 'type': 'block',\n \ + \ 'style_config': {}\n },\n 'properties': {\n \ + \ 'title': '',\n 'comment': '',\n 'docu_url': '',\n\ + \ 'icon': '',\n 'state_messages': {}\n },\n\ + \ 'aggregation_function': {\n 'type': 'best',\n \ + \ 'count': 1,\n 'restrict_state': 2\n },\n \ + \ 'computation_options': {\n 'disabled': False\n },\n\ + \ 'pack_id': 'pack1'\n },\n)\nif resp.status_code == 200:\n \ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_rule/rule1\",\n method=\"POST\",\n headers={\n\ + \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ + \ \"Accept\": \"application/json\",\n \"Content-Type\": 'application/json',\ + \ # (required) A header specifying which type of content is in the request/response\ + \ body.\n },\n data=json.dumps({\n 'id': 'rule1',\n \ + \ 'nodes': [],\n 'params': {\n 'arguments': ['foo', 'bar']\n\ + \ },\n 'node_visualization': {\n 'type': 'block',\n\ + \ 'style_config': {}\n },\n 'properties': {\n \ + \ 'title': '',\n 'comment': '',\n 'docu_url':\ + \ '',\n 'icon': '',\n 'state_messages': {}\n \ + \ },\n 'aggregation_function': {\n 'type': 'best',\n\ + \ 'count': 1,\n 'restrict_state': 2\n },\n\ + \ 'computation_options': {\n 'disabled': False\n \ + \ },\n 'pack_id': 'pack1'\n }).encode('utf-8'),\n)\nresponse\ + \ = urllib.request.urlopen(request)\nif response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/objects/bi_rule/rule1\" \\\ + \n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ + \ \\\n 'Content-Type:application/json' \\\n id='rule1' \\\n nodes='[]'\ + \ \\\n params='{'arguments': ['foo', 'bar']}' \\\n node_visualization='{'type':\ + \ 'block', 'style_config': {}}' \\\n properties='{'title': '', 'comment':\ + \ '', 'docu_url': '', 'icon': '', 'state_messages': {}}' \\\n aggregation_function='{'type':\ + \ 'best', 'count': 1, 'restrict_state': 2}' \\\n computation_options='{'disabled':\ + \ False}' \\\n pack_id='pack1' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"aggregation_function\": {\n \ + \ \"count\": 1,\n \"restrict_state\": 2,\n \"type\"\ + : \"best\"\n },\n \"computation_options\": {\n \ + \ \"disabled\": false\n },\n \"id\": \"rule1\",\n\ + \ \"node_visualization\": {\n \"style_config\": {},\n\ + \ \"type\": \"block\"\n },\n \"nodes\": [],\n\ + \ \"pack_id\": \"pack1\",\n \"params\": {\n \ + \ \"arguments\": [\n \"foo\",\n \"bar\"\n \ + \ ]\n },\n \"properties\": {\n \"comment\"\ + : \"\",\n \"docu_url\": \"\",\n \"icon\": \"\",\n\ + \ \"state_messages\": {},\n \"title\": \"\"\n \ + \ }\n }' \\\n \"$API_URL/objects/bi_rule/rule1\")\n\nresp=$(\ + \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ + \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.bi_rules`: Use the WATO BI module, create, modify and delete\ + \ BI rules and aggregations in packs that you are a contact of.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.put_bi_rule + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: 'The path name of the folder. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - example: ~hosts~linux - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - required: - - folder - - ruleset - RuleExtensions: - type: object - properties: - ruleset: + - description: The unique id for the rule + in: path + name: rule_id + required: true + schema: + example: rule1 type: string - description: The name of the ruleset. - folder: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BIRuleEndpoint' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BIRuleEndpoint' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Update an existing BI rule + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/bi_rule/rule1\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'id': 'rule1',\n 'nodes': [],\n \ + \ 'params': {\n 'arguments': ['foo', 'bar']\n },\n\ + \ 'node_visualization': {\n 'type': 'block',\n \ + \ 'style_config': {}\n },\n 'properties': {\n \ + \ 'title': '',\n 'comment': '',\n 'docu_url': '',\n\ + \ 'icon': '',\n 'state_messages': {}\n },\n\ + \ 'aggregation_function': {\n 'type': 'best',\n \ + \ 'count': 1,\n 'restrict_state': 2\n },\n \ + \ 'computation_options': {\n 'disabled': False\n },\n\ + \ 'pack_id': 'pack1'\n },\n)\nif resp.status_code == 200:\n \ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_rule/rule1\",\n method=\"PUT\",\n headers={\n\ + \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ + \ \"Accept\": \"application/json\",\n \"Content-Type\": 'application/json',\ + \ # (required) A header specifying which type of content is in the request/response\ + \ body.\n },\n data=json.dumps({\n 'id': 'rule1',\n \ + \ 'nodes': [],\n 'params': {\n 'arguments': ['foo', 'bar']\n\ + \ },\n 'node_visualization': {\n 'type': 'block',\n\ + \ 'style_config': {}\n },\n 'properties': {\n \ + \ 'title': '',\n 'comment': '',\n 'docu_url':\ + \ '',\n 'icon': '',\n 'state_messages': {}\n \ + \ },\n 'aggregation_function': {\n 'type': 'best',\n\ + \ 'count': 1,\n 'restrict_state': 2\n },\n\ + \ 'computation_options': {\n 'disabled': False\n \ + \ },\n 'pack_id': 'pack1'\n }).encode('utf-8'),\n)\nresponse\ + \ = urllib.request.urlopen(request)\nif response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/bi_rule/rule1\" \\\ + \n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ + \ \\\n 'Content-Type:application/json' \\\n id='rule1' \\\n nodes='[]'\ + \ \\\n params='{'arguments': ['foo', 'bar']}' \\\n node_visualization='{'type':\ + \ 'block', 'style_config': {}}' \\\n properties='{'title': '', 'comment':\ + \ '', 'docu_url': '', 'icon': '', 'state_messages': {}}' \\\n aggregation_function='{'type':\ + \ 'best', 'count': 1, 'restrict_state': 2}' \\\n computation_options='{'disabled':\ + \ False}' \\\n pack_id='pack1' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"aggregation_function\": {\n \ + \ \"count\": 1,\n \"restrict_state\": 2,\n \"type\"\ + : \"best\"\n },\n \"computation_options\": {\n \ + \ \"disabled\": false\n },\n \"id\": \"rule1\",\n\ + \ \"node_visualization\": {\n \"style_config\": {},\n\ + \ \"type\": \"block\"\n },\n \"nodes\": [],\n\ + \ \"pack_id\": \"pack1\",\n \"params\": {\n \ + \ \"arguments\": [\n \"foo\",\n \"bar\"\n \ + \ ]\n },\n \"properties\": {\n \"comment\"\ + : \"\",\n \"docu_url\": \"\",\n \"icon\": \"\",\n\ + \ \"state_messages\": {},\n \"title\": \"\"\n \ + \ }\n }' \\\n \"$API_URL/objects/bi_rule/rule1\")\n\nresp=$(\ + \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ + \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + /objects/bi_aggregation/{aggregation_id}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.bi_rules`: Use the WATO BI module, create, modify and delete\ + \ BI rules and aggregations in packs that you are a contact of.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.delete_bi_aggregation + parameters: + - description: The unique id for the aggregation + in: path + name: aggregation_id + required: true + schema: + example: aggregation1 type: string - description: 'The path name of the folder. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - example: ~router - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - folder_index: - type: integer - description: The position of this rule in the chain in this folder. - properties: - description: Property values of this rule. - example: {} - allOf: - - $ref: '#/components/schemas/RuleProperties1' - value_raw: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete a BI aggregation + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/bi_aggregation/aggregation1\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_aggregation/aggregation1\",\n method=\"\ + DELETE\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n },\n)\n\ + response = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/bi_aggregation/aggregation1\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/bi_aggregation/aggregation1\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.bi_rules`:\ + \ Use the WATO BI module, create, modify and delete BI rules and aggregations\ + \ in packs that you are a contact of.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.get_bi_aggregation + parameters: + - description: The unique id for the aggregation + in: path + name: aggregation_id + required: true + schema: + example: aggregation1 + type: string + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BIAggregationEndpoint' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Get a BI aggregation + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/bi_aggregation/aggregation1\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_aggregation/aggregation1\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/bi_aggregation/aggregation1\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/bi_aggregation/aggregation1\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.bi_rules`: Use the WATO BI module, create, modify and delete\ + \ BI rules and aggregations in packs that you are a contact of.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.post_bi_aggregation + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The raw parameter value for this rule. - example: '{"ignore_fs_types": ["tmpfs"]}' - conditions: - description: Conditions. - allOf: - - $ref: '#/components/schemas/RuleConditions1' - required: - - folder - RuleObject: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: rule - description: Domain type of this object. - example: rule - id: + - description: The unique id for the aggregation + in: path + name: aggregation_id + required: true + schema: + example: aggregation1 type: string - description: The unique identifier for this domain-object type. - title: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BIAggregationEndpoint' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BIAggregationEndpoint' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Create a BI aggregation + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/bi_aggregation/aggregation1\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'id': 'aggr1',\n 'comment': 'Rule comment',\n\ + \ 'customer': 'customer1',\n 'groups': {\n 'names':\ + \ ['groupA', 'groupB'],\n 'paths': [['path', 'group', 'a'],\n\ + \ ['path', 'group', 'b']]\n },\n 'node':\ + \ {\n 'search': {\n 'type': 'empty'\n \ + \ },\n 'action': {\n 'type': 'state_of_host',\n\ + \ 'host_regex': ''\n }\n },\n 'aggregation_visualization':\ + \ {\n 'ignore_rule_styles': False,\n 'layout_id':\ + \ 'builtin_default',\n 'line_style': 'round'\n },\n \ + \ 'computation_options': {\n 'disabled': False,\n \ + \ 'use_hard_states': False,\n 'escalate_downtimes_as_warn':\ + \ False\n },\n 'pack_id': 'pack1'\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_aggregation/aggregation1\",\n method=\"\ + POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({\n \ + \ 'id': 'aggr1',\n 'comment': 'Rule comment',\n 'customer':\ + \ 'customer1',\n 'groups': {\n 'names': ['groupA', 'groupB'],\n\ + \ 'paths': [['path', 'group', 'a'],\n ['path',\ + \ 'group', 'b']]\n },\n 'node': {\n 'search': {\n\ + \ 'type': 'empty'\n },\n 'action':\ + \ {\n 'type': 'state_of_host',\n 'host_regex':\ + \ ''\n }\n },\n 'aggregation_visualization': {\n\ + \ 'ignore_rule_styles': False,\n 'layout_id': 'builtin_default',\n\ + \ 'line_style': 'round'\n },\n 'computation_options':\ + \ {\n 'disabled': False,\n 'use_hard_states': False,\n\ + \ 'escalate_downtimes_as_warn': False\n },\n 'pack_id':\ + \ 'pack1'\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/objects/bi_aggregation/aggregation1\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n id='aggr1'\ + \ \\\n comment='Rule comment' \\\n customer='customer1' \\\n groups='{'names':\ + \ ['groupA', 'groupB'], 'paths': [['path', 'group', 'a'], ['path', 'group',\ + \ 'b']]}' \\\n node='{'search': {'type': 'empty'}, 'action': {'type':\ + \ 'state_of_host', 'host_regex': ''}}' \\\n aggregation_visualization='{'ignore_rule_styles':\ + \ False, 'layout_id': 'builtin_default', 'line_style': 'round'}' \\\n \ + \ computation_options='{'disabled': False, 'use_hard_states': False, 'escalate_downtimes_as_warn':\ + \ False}' \\\n pack_id='pack1' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"aggregation_visualization\": {\n \ + \ \"ignore_rule_styles\": false,\n \"layout_id\": \"builtin_default\"\ + ,\n \"line_style\": \"round\"\n },\n \"comment\"\ + : \"Rule comment\",\n \"computation_options\": {\n \"\ + disabled\": false,\n \"escalate_downtimes_as_warn\": false,\n\ + \ \"use_hard_states\": false\n },\n \"customer\"\ + : \"customer1\",\n \"groups\": {\n \"names\": [\n \ + \ \"groupA\",\n \"groupB\"\n ],\n \ + \ \"paths\": [\n [\n \"path\",\n \ + \ \"group\",\n \"a\"\n ],\n \ + \ [\n \"path\",\n \"group\",\n \ + \ \"b\"\n ]\n ]\n },\n \ + \ \"id\": \"aggr1\",\n \"node\": {\n \"action\"\ + : {\n \"host_regex\": \"\",\n \"type\": \"state_of_host\"\ + \n },\n \"search\": {\n \"type\": \"\ + empty\"\n }\n },\n \"pack_id\": \"pack1\"\n\ + \ }' \\\n \"$API_URL/objects/bi_aggregation/aggregation1\")\n\n\ + resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ + ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.bi_rules`: Use the WATO BI module, create, modify and delete\ + \ BI rules and aggregations in packs that you are a contact of.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.put_bi_aggregation + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: Attributes specific to rule objects. - allOf: - - $ref: '#/components/schemas/RuleExtensions' - required: - - links - UpdateRuleObject: - type: object - properties: - properties: - description: Configuration values for rules. - example: *id038 - allOf: - - $ref: '#/components/schemas/RuleProperties1' - value_raw: + - description: The unique id for the aggregation + in: path + name: aggregation_id + required: true + schema: + example: aggregation1 type: string - description: The raw parameter value for this rule. To create the correct - structure, for now use the 'export for API' menu item in the Rule Editor - of the GUI. The value is expected to be a valid Python type. - example: '{''cmk/os_family'': ''linux''}' - conditions: - description: Conditions. - example: *id039 - allOf: - - $ref: '#/components/schemas/RuleConditions1' - RuleCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BIAggregationEndpoint' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BIAggregationEndpoint' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Update an existing BI aggregation + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/bi_aggregation/aggregation1\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'id': 'aggr1',\n 'comment': 'Rule comment',\n\ + \ 'customer': 'customer1',\n 'groups': {\n 'names':\ + \ ['groupA', 'groupB'],\n 'paths': [['path', 'group', 'a'],\n\ + \ ['path', 'group', 'b']]\n },\n 'node':\ + \ {\n 'search': {\n 'type': 'empty'\n \ + \ },\n 'action': {\n 'type': 'state_of_host',\n\ + \ 'host_regex': ''\n }\n },\n 'aggregation_visualization':\ + \ {\n 'ignore_rule_styles': False,\n 'layout_id':\ + \ 'builtin_default',\n 'line_style': 'round'\n },\n \ + \ 'computation_options': {\n 'disabled': False,\n \ + \ 'use_hard_states': False,\n 'escalate_downtimes_as_warn':\ + \ False\n },\n 'pack_id': 'pack1'\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_aggregation/aggregation1\",\n method=\"\ + PUT\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"Content-Type\":\ + \ 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({\n \ + \ 'id': 'aggr1',\n 'comment': 'Rule comment',\n 'customer':\ + \ 'customer1',\n 'groups': {\n 'names': ['groupA', 'groupB'],\n\ + \ 'paths': [['path', 'group', 'a'],\n ['path',\ + \ 'group', 'b']]\n },\n 'node': {\n 'search': {\n\ + \ 'type': 'empty'\n },\n 'action':\ + \ {\n 'type': 'state_of_host',\n 'host_regex':\ + \ ''\n }\n },\n 'aggregation_visualization': {\n\ + \ 'ignore_rule_styles': False,\n 'layout_id': 'builtin_default',\n\ + \ 'line_style': 'round'\n },\n 'computation_options':\ + \ {\n 'disabled': False,\n 'use_hard_states': False,\n\ + \ 'escalate_downtimes_as_warn': False\n },\n 'pack_id':\ + \ 'pack1'\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/bi_aggregation/aggregation1\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n id='aggr1'\ + \ \\\n comment='Rule comment' \\\n customer='customer1' \\\n groups='{'names':\ + \ ['groupA', 'groupB'], 'paths': [['path', 'group', 'a'], ['path', 'group',\ + \ 'b']]}' \\\n node='{'search': {'type': 'empty'}, 'action': {'type':\ + \ 'state_of_host', 'host_regex': ''}}' \\\n aggregation_visualization='{'ignore_rule_styles':\ + \ False, 'layout_id': 'builtin_default', 'line_style': 'round'}' \\\n \ + \ computation_options='{'disabled': False, 'use_hard_states': False, 'escalate_downtimes_as_warn':\ + \ False}' \\\n pack_id='pack1' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"aggregation_visualization\": {\n \ + \ \"ignore_rule_styles\": false,\n \"layout_id\": \"builtin_default\"\ + ,\n \"line_style\": \"round\"\n },\n \"comment\"\ + : \"Rule comment\",\n \"computation_options\": {\n \"\ + disabled\": false,\n \"escalate_downtimes_as_warn\": false,\n\ + \ \"use_hard_states\": false\n },\n \"customer\"\ + : \"customer1\",\n \"groups\": {\n \"names\": [\n \ + \ \"groupA\",\n \"groupB\"\n ],\n \ + \ \"paths\": [\n [\n \"path\",\n \ + \ \"group\",\n \"a\"\n ],\n \ + \ [\n \"path\",\n \"group\",\n \ + \ \"b\"\n ]\n ]\n },\n \ + \ \"id\": \"aggr1\",\n \"node\": {\n \"action\"\ + : {\n \"host_regex\": \"\",\n \"type\": \"state_of_host\"\ + \n },\n \"search\": {\n \"type\": \"\ + empty\"\n }\n },\n \"pack_id\": \"pack1\"\n\ + \ }' \\\n \"$API_URL/objects/bi_aggregation/aggregation1\")\n\n\ + resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ + ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/bi_pack/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.bi_rules`:\ + \ Use the WATO BI module, create, modify and delete BI rules and aggregations\ + \ in packs that you are a contact of.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.get_bi_packs + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all BI packs + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/bi_pack/collections/all\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/bi_pack/collections/all\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/bi_pack/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/domain-types/bi_pack/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/bi_pack/{pack_id}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.bi_rules`: Use the WATO BI module, create, modify and delete\ + \ BI rules and aggregations in packs that you are a contact of.\n * `wato.bi_admin`:\ + \ Edit all rules and aggregations for Business Intelligence, create, modify\ + \ and delete rule packs.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.delete_bi_pack + parameters: + - description: The unique id for the aggregation pack + in: path + name: pack_id + required: true + schema: + example: pack1 type: string - default: all - description: The name of this collection. - domainType: - default: rule - description: Domain type of this object. - title: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete BI pack + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/bi_pack/pack1\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_pack/pack1\",\n method=\"DELETE\",\n \ + \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/bi_pack/pack1\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/bi_pack/pack1\")\n\nresp=$(\ + \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ + \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.bi_rules`:\ + \ Use the WATO BI module, create, modify and delete BI rules and aggregations\ + \ in packs that you are a contact of.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.get_bi_pack + parameters: + - description: The unique id for the aggregation pack + in: path + name: pack_id + required: true + schema: + example: pack1 type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - description: The collection itself. Each entry in here is part of the collection. - type: array - items: - $ref: '#/components/schemas/RuleObject' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - MoveToFolder: - type: object - properties: - position: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Get a BI pack and its rules and aggregations + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/bi_pack/pack1\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_pack/pack1\",\n method=\"GET\",\n headers={\n\ + \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ + \ \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/bi_pack/pack1\" \\\ + \n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/bi_pack/pack1\")\n\nresp=$(\ + \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ + \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.bi_rules`: Use the WATO BI module, create, modify and delete\ + \ BI rules and aggregations in packs that you are a contact of.\n * `wato.bi_admin`:\ + \ Edit all rules and aggregations for Business Intelligence, create, modify\ + \ and delete rule packs.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.post_bi_pack + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The type of position to move to. - example: top_of_folder - folder: + - description: The unique id for the aggregation pack + in: path + name: pack_id + required: true + schema: + example: pack1 type: string - description: 'The path name of the folder. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - example: / - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - MoveToSpecificRule: - type: object - properties: - position: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BIPackEndpoint' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BIPackEndpoint' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Create a new BI pack + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/bi_pack/pack1\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'title': 'BI Title',\n 'contact_groups':\ + \ [\n 'contact', 'contactgroup_b'\n ],\n 'public':\ + \ 'false'\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_pack/pack1\",\n method=\"POST\",\n headers={\n\ + \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ + \ \"Accept\": \"application/json\",\n \"Content-Type\": 'application/json',\ + \ # (required) A header specifying which type of content is in the request/response\ + \ body.\n },\n data=json.dumps({\n 'title': 'BI Title',\n \ + \ 'contact_groups': [\n 'contact', 'contactgroup_b'\n \ + \ ],\n 'public': 'false'\n }).encode('utf-8'),\n)\nresponse\ + \ = urllib.request.urlopen(request)\nif response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/objects/bi_pack/pack1\" \\\ + \n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ + \ \\\n 'Content-Type:application/json' \\\n title='BI Title' \\\n\ + \ contact_groups='['contact', 'contactgroup_b']' \\\n public='false'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"contact_groups\": [\n \"contact\"\ + ,\n \"contactgroup_b\"\n ],\n \"public\": \"\ + false\",\n \"title\": \"BI Title\"\n }' \\\n \"$API_URL/objects/bi_pack/pack1\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.bi_rules`: Use the WATO BI module, create, modify and delete\ + \ BI rules and aggregations in packs that you are a contact of.\n * `wato.bi_admin`:\ + \ Edit all rules and aggregations for Business Intelligence, create, modify\ + \ and delete rule packs.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.put_bi_pack + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The type of position to move to. - example: after_specific_rule - rule_id: + - description: The unique id for the aggregation pack + in: path + name: pack_id + required: true + schema: + example: pack1 type: string - description: The UUID of the rule to move after/before. - example: f8b74720-a454-4242-99c4-62994ef0f2bf - MoveRuleTo: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/MoveToFolder' - - $ref: '#/components/schemas/MoveToFolder' - - $ref: '#/components/schemas/MoveToSpecificRule' - - $ref: '#/components/schemas/MoveToSpecificRule' - discriminator: - propertyName: position - mapping: - top_of_folder: '#/components/schemas/MoveToFolder' - bottom_of_folder: '#/components/schemas/MoveToFolder' - after_specific_rule: '#/components/schemas/MoveToSpecificRule' - before_specific_rule: '#/components/schemas/MoveToSpecificRule' - RulesetCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BIPackEndpoint' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BIPackEndpoint' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Update an existing BI pack + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/bi_pack/pack1\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'title': 'BI Title',\n 'contact_groups':\ + \ [\n 'contact', 'contactgroup_b'\n ],\n 'public':\ + \ 'false'\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/bi_pack/pack1\",\n method=\"PUT\",\n headers={\n\ + \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ + \ \"Accept\": \"application/json\",\n \"Content-Type\": 'application/json',\ + \ # (required) A header specifying which type of content is in the request/response\ + \ body.\n },\n data=json.dumps({\n 'title': 'BI Title',\n \ + \ 'contact_groups': [\n 'contact', 'contactgroup_b'\n \ + \ ],\n 'public': 'false'\n }).encode('utf-8'),\n)\nresponse\ + \ = urllib.request.urlopen(request)\nif response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/bi_pack/pack1\" \\\ + \n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ + \ \\\n 'Content-Type:application/json' \\\n title='BI Title' \\\n\ + \ contact_groups='['contact', 'contactgroup_b']' \\\n public='false'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"contact_groups\": [\n \"contact\"\ + ,\n \"contactgroup_b\"\n ],\n \"public\": \"\ + false\",\n \"title\": \"BI Title\"\n }' \\\n \"$API_URL/objects/bi_pack/pack1\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/bi_aggregation/actions/aggregation_state/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.bi_rules`:\ + \ Use the WATO BI module, create, modify and delete BI rules and aggregations\ + \ in packs that you are a contact of.\n" + operationId: cmk.gui.plugins.openapi.endpoints.bi.get_bi_aggregation_state + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - default: all - description: The name of this collection. - domainType: - default: ruleset - description: Domain type of this object. - example: ruleset - title: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BIAggregationStateRequest' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BIAggregationStateResponse' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Get the state of BI aggregations + tags: + - Business intelligence (BI) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/bi_aggregation/actions/aggregation_state/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'filter_names': ['Host foo'],\n 'filter_groups':\ + \ ['My Group']\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/bi_aggregation/actions/aggregation_state/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'filter_names': ['Host foo'],\n 'filter_groups': ['My Group']\n\ + \ }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/bi_aggregation/actions/aggregation_state/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n filter_names='['Host\ + \ foo']' \\\n filter_groups='['My Group']' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"filter_groups\": [\n \"My Group\"\ + \n ],\n \"filter_names\": [\n \"Host foo\"\n\ + \ ]\n }' \\\n \"$API_URL/domain-types/bi_aggregation/actions/aggregation_state/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /root_cert: + get: + description: "\n\nThis endpoint requires the following permissions: \n * `general.agent_pairing`:\ + \ Pairing of Checkmk agents with the monitoring site. This step establishes\ + \ trust between the agent and the monitoring site.\n" + operationId: cmk.gui.plugins.openapi.endpoints.certs.root_cert + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: You do not have the permission for agent pairing.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/X509PEM' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: X.509 PEM-encoded root certificate + tags: + - Certificates + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/root_cert\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/root_cert\",\n method=\"GET\",\n headers={\n \ + \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \"\ + Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/root_cert\" \\\n \"Authorization:\ + \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/root_cert\")\n\nresp=$( echo \"\ + ${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk\ + \ -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + /csr: + post: + description: "\n\nThis endpoint requires the following permissions: \n * `general.agent_pairing`:\ + \ Pairing of Checkmk agents with the monitoring site. This step establishes\ + \ trust between the agent and the monitoring site.\n" + operationId: cmk.gui.plugins.openapi.endpoints.certs.make_certificate + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - description: The collection itself. Each entry in here is part of the collection. - type: array - items: - $ref: '#/components/schemas/CollectionItem' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - RulesetExtensions: - type: object - properties: - name: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/X509ReqPEMUUID' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: You do not have the permission for agent pairing.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/X509PEM' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: X.509 PEM-encoded Certificate Signing Requests (CSRs) + tags: + - Certificates + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/csr\",\n\ + \ headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'csr': '-----BEGIN CERTIFICATE REQUEST-----\\\ + n...\\n-----END CERTIFICATE REQUEST-----\\n'\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/csr\",\n method=\"POST\",\n headers={\n \"\ + Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \"Accept\"\ + : \"application/json\",\n \"Content-Type\": 'application/json', \ + \ # (required) A header specifying which type of content is in the request/response\ + \ body.\n },\n data=json.dumps({\n 'csr': '-----BEGIN CERTIFICATE\ + \ REQUEST-----\\n...\\n-----END CERTIFICATE REQUEST-----\\n'\n }).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/csr\" \\\n \"Authorization:\ + \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\\n\ + \ 'Content-Type:application/json' \\\n csr='-----BEGIN CERTIFICATE\ + \ REQUEST-----\n...\n-----END CERTIFICATE REQUEST-----\n' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"csr\": \"-----BEGIN CERTIFICATE REQUEST-----\\\ + n...\\n-----END CERTIFICATE REQUEST-----\\n\"\n }' \\\n \"$API_URL/csr\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/contact_group_config/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.users`:\ + \ This permission is needed for the modules Users, Roles and\ + \ Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.list_group + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LinkedValueDomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all contact groups + tags: + - Contact groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/contact_group_config/collections/all\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/contact_group_config/collections/all\",\n\ + \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/contact_group_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/domain-types/contact_group_config/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.users`: This permission is needed for the modules Users,\ + \ Roles and Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.create + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The name of the ruleset - example: host_groups - folder: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InputContactGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Create a contact group + tags: + - Contact groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/contact_group_config/collections/all\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={'name': 'OnCall', 'alias': 'Not on Sundays.'},\n)\nif\ + \ resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/contact_group_config/collections/all\",\n\ + \ method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({'name':\ + \ 'OnCall', 'alias': 'Not on Sundays.'}).encode('utf-8'),\n)\nresponse =\ + \ urllib.request.urlopen(request)\nif response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/contact_group_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n name='OnCall'\ + \ \\\n alias='Not on Sundays.' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"alias\": \"Not on Sundays.\",\n \ + \ \"name\": \"OnCall\"\n }' \\\n \"$API_URL/domain-types/contact_group_config/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/contact_group_config/{name}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.users`: This permission is needed for the modules Users,\ + \ Roles and Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.delete + parameters: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - description: 'The path name of the folder. - - - Path delimiters can be either `~`, `/` or `\`. Please use the one most - appropriate for your quoting/escaping needs. A good default choice is - `~`.' - example: ~router - pattern: ^(?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32})$ - number_of_rules: - type: integer - description: The number of rules of this ruleset. - example: 5 - required: - - folder - RulesetObject: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: ruleset - description: Domain type of this object. - example: ruleset - id: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete a contact group + tags: + - Contact groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/contact_group_config/pathname\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/contact_group_config/pathname\",\n method=\"\ + DELETE\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n },\n)\n\ + response = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/contact_group_config/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/contact_group_config/pathname\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.users`:\ + \ This permission is needed for the modules Users, Roles and\ + \ Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.show + parameters: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - description: The unique identifier for this domain-object type. - title: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContactGroup' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Show a contact group + tags: + - Contact groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/contact_group_config/pathname\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/contact_group_config/pathname\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/contact_group_config/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/contact_group_config/pathname\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.users`: This permission is needed for the modules Users,\ + \ Roles and Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.update + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: Specific attributes related to rulesets. - allOf: - - $ref: '#/components/schemas/RulesetExtensions' - required: - - links - DiscoverServicesDeprecated: - type: object - properties: - mode: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - default: fix_all - description: "The mode of the discovery action. The 'refresh' mode starts\ - \ a new service\n discovery which will contact the host and identify\ - \ undecided and vanished services and host\n labels. Those services\ - \ and host labels can be added or removed accordingly with the\n \ - \ 'fix_all' mode. The 'tabula_rasa' mode combines these two procedures.\ - \ The 'new', 'remove'\n and 'only_host_labels' modes give you more\ - \ granular control. The corresponding user\n interface option for\ - \ each discovery mode is shown below.\n\n * `new` - Monitor undecided\ - \ services\n * `remove` - Remove vanished services\n * `fix_all` - Accept\ - \ all\n * `tabula_rasa` - Remove all and find new\n * `refresh` - Rescan\n\ - \ * `only_host_labels` - Update host labels\n " - enum: - - new - - remove - - fix_all - - refresh - - only_host_labels - - tabula_rasa - example: refresh - BulkDiscovery: - type: object - properties: - hostnames: - type: array - description: A list of host names - example: - - example - - sample - items: - type: string - description: The hostname or IP address itself. - example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - mode: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - default: new - description: "The mode of the discovery action. The 'refresh' mode starts\ - \ a new service\n discovery which will contact the host and identify\ - \ undecided and vanished services and host\n labels. Those services\ - \ and host labels can be added or removed accordingly with the\n \ - \ 'fix_all' mode. The 'tabula_rasa' mode combines these two procedures.\ - \ The 'new', 'remove'\n and 'only_host_labels' modes give you more\ - \ granular control. The corresponding user\n interface option for\ - \ each discovery mode is shown below.\n\n * `new` - Monitor undecided\ - \ services\n * `remove` - Remove vanished services\n * `fix_all` - Accept\ - \ all\n * `tabula_rasa` - Remove all and find new\n * `refresh` - Rescan\n\ - \ * `only_host_labels` - Update host labels\n " - enum: - - new - - remove - - fix_all - - refresh - - only_host_labels - - tabula_rasa - example: refresh - do_full_scan: - type: boolean - default: true - description: The option whether to perform a full scan or not. - example: true - bulk_size: - type: integer - default: 10 - description: The number of hosts to be handled at once. - example: 10 - ignore_errors: - type: boolean - default: true - description: The option whether to ignore errors in single check plugins. - example: true - required: - - hostnames - JobLogs: - type: object - properties: - result: - type: array - description: The list of result related logs - items: - type: string - progress: - type: array - description: The list of progress related logs - items: - type: string - BackgroundJobStatus: - type: object - properties: - active: - type: boolean - description: This field indicates if the background job is active or not. - example: true - state: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContactGroup' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Update a contact group + tags: + - Contact groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/contact_group_config/pathname\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={'alias': 'Example\ + \ Group'},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/contact_group_config/pathname\",\n method=\"\ + PUT\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ + a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ + \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n data=json.dumps({'alias': 'Example Group'}).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/contact_group_config/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n alias='Example Group' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"alias\": \"Example Group\"\n }' \\\n \"$API_URL/objects/contact_group_config/pathname\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/contact_group_config/actions/bulk-update/invoke: + put: + description: "Please be aware that when doing bulk updates, it is not possible\ + \ to prevent the\n[Updating Values](\"lost update problem\"), which is normally\ + \ prevented by the ETag locking\nmechanism. Use at your own risk.This endpoint\ + \ requires the following permissions: \n * All of:\n * `wato.edit`: This\ + \ permission is needed in order to make any changes or perform any actions\ + \ at all. Without this permission, the user is only able to view data, and\ + \ that only in modules he has explicit permissions for.\n * `wato.users`:\ + \ This permission is needed for the modules Users, Roles and\ + \ Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.bulk_update + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: This field indicates the current state of the background job. - enum: - - initialized - - running - - finished - - stopped - - exception - example: initialized - logs: - description: Logs related to the background job. - example: - result: - - result1 - progress: - - progress1 - allOf: - - $ref: '#/components/schemas/JobLogs' - required: - - active - - logs - - state - DiscoveryBackgroundJobStatusObject: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: discovery_run - description: The domain type of the object - id: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkUpdateContactGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Bulk update contact groups + tags: + - Contact groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/domain-types/contact_group_config/actions/bulk-update/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'entries': [{\n 'name': 'OnCall',\n\ + \ 'attributes': {\n 'alias': 'Not on Sundays'\n\ + \ }\n }]\n },\n)\nif resp.status_code == 200:\n \ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/contact_group_config/actions/bulk-update/invoke\"\ + ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'entries': [{\n 'name': 'OnCall',\n 'attributes':\ + \ {\n 'alias': 'Not on Sundays'\n }\n }]\n\ + \ }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/domain-types/contact_group_config/actions/bulk-update/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='[{'name':\ + \ 'OnCall', 'attributes': {'alias': 'Not on Sundays'}}]' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n {\n \ + \ \"attributes\": {\n \"alias\": \"Not on Sundays\"\n\ + \ },\n \"name\": \"OnCall\"\n }\n \ + \ ]\n }' \\\n \"$API_URL/domain-types/contact_group_config/actions/bulk-update/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/contact_group_config/actions/bulk-create/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.users`: This permission is needed for the modules Users,\ + \ Roles and Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.bulk_create + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The unique identifier for this domain-object type. - title: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkInputContactGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Bulk create contact groups + tags: + - Contact groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/contact_group_config/actions/bulk-create/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'entries': [{\n 'name': 'OnCall',\n\ + \ 'alias': 'Not on Sundays'\n }]\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/contact_group_config/actions/bulk-create/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'entries': [{\n 'name': 'OnCall',\n 'alias':\ + \ 'Not on Sundays'\n }]\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/contact_group_config/actions/bulk-create/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='[{'name':\ + \ 'OnCall', 'alias': 'Not on Sundays'}]' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n {\n \ + \ \"alias\": \"Not on Sundays\",\n \"name\": \"OnCall\"\ + \n }\n ]\n }' \\\n \"$API_URL/domain-types/contact_group_config/actions/bulk-create/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/contact_group_config/actions/bulk-delete/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.users`: This permission is needed for the modules Users,\ + \ Roles and Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.contact_group_config.bulk_delete + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: The attributes of the background job + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkDeleteContactGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Bulk delete contact groups + tags: + - Contact groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/contact_group_config/actions/bulk-delete/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={'entries': ['windows', 'panels']},\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/contact_group_config/actions/bulk-delete/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({'entries':\ + \ ['windows', 'panels']}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/contact_group_config/actions/bulk-delete/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='['windows',\ + \ 'panels']' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n \"windows\",\n\ + \ \"panels\"\n ]\n }' \\\n \"$API_URL/domain-types/contact_group_config/actions/bulk-delete/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/downtime/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * Any of:\n * `general.see_all`: See all objects regardless of contacts\ + \ and contact groups. If combined with 'perform commands' then commands may\ + \ be done on all objects.\n * `bi.see_all`: With this permission set,\ + \ the BI aggregation rules are applied to all hosts and services - not only\ + \ those the user is a contact for. If you remove this permissions then the\ + \ user will see incomplete aggregation trees with status based only on those\ + \ items.\n * `mkeventd.seeall`: If a user lacks this permission then he/she\ + \ can see only those events that originate from a host that he/she is a contact\ + \ for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.downtime.show_downtimes + parameters: + - description: An query expression of the Livestatus 'downtimes' table in nested + dictionary form. If you want to use multiple expressions, nest them with + the AND/OR operators. + in: query + name: query + required: false + schema: allOf: - - $ref: '#/components/schemas/BackgroundJobStatus' - required: - - links - DiscoverServices: - type: object - properties: - host_name: + - $ref: '#/components/schemas/Expr' + example: '{"op": "and", "expr": [{"op": "=", "left": "host_name", "right": + "example.com"}, {"op": "=", "left": "type", "right": "0"}]}' + - description: The service description. No exception is raised when the specified + service description does not exist + in: query + name: service_description + required: false + schema: + example: Memory type: string - description: The host of the service which shall be updated. + - description: The host name. No exception is raised when the specified host + name does not exist + in: query + name: host_name + required: false + schema: example: example.com - pattern: ^[-0-9a-zA-Z_.]+\Z - mode: - type: string - default: fix_all - description: "The mode of the discovery action. The 'refresh' mode starts\ - \ a new service\n discovery which will contact the host and identify\ - \ undecided and vanished services and host\n labels. Those services\ - \ and host labels can be added or removed accordingly with the\n \ - \ 'fix_all' mode. The 'tabula_rasa' mode combines these two procedures.\ - \ The 'new', 'remove'\n and 'only_host_labels' modes give you more\ - \ granular control. The corresponding user\n interface option for\ - \ each discovery mode is shown below.\n\n * `new` - Monitor undecided\ - \ services\n * `remove` - Remove vanished services\n * `fix_all` - Accept\ - \ all\n * `tabula_rasa` - Remove all and find new\n * `refresh` - Rescan\n\ - \ * `only_host_labels` - Update host labels\n " - enum: - - new - - remove - - fix_all - - refresh - - only_host_labels - - tabula_rasa - example: refresh - required: - - host_name - UpdateDiscoveryPhase: - type: object - properties: - check_type: - type: string - description: The name of the check which this service uses. - example: df - service_item: - type: string - nullable: true - description: The value uniquely identifying the service on a given host. - example: /home - target_phase: - type: string - description: The target phase of the service. - enum: - - active - - active_ignored - - clustered_ignored - - clustered_monitored - - clustered_undecided - - clustered_vanished - - custom - - custom_ignored - - ignored - - legacy - - legacy_ignored - - manual - - monitored - - removed - - undecided - - vanished - example: monitored - required: - - check_type - - service_item - - target_phase - InputServiceGroup: - type: object - properties: - name: - type: string - description: A name used as identifier - example: windows - pattern: ^[-a-z0-9A-Z_\.]*\Z - alias: - type: string - description: The name used for displaying in the GUI. - example: Environment Sensors - required: - - alias - - name - BulkInputServiceGroup: - type: object - properties: - entries: - type: array - description: A list of service group entries. - example: - - name: environment - alias: Environment Sensors - uniqueItems: true - items: - $ref: '#/components/schemas/InputServiceGroup' - required: - - entries - ServiceGroup: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: service_group_config - description: The domain type of the object. - id: + pattern: '[-0-9a-zA-Z_.]+' type: string - description: The unique identifier for this domain-object type. - title: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all scheduled downtimes + tags: + - Downtimes + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/downtime/collections/all\"\ + ,\n params={ # goes into query string\n \"host_name\": 'example.com',\ + \ # The host name.\n \"service_description\": 'Memory', # The service\ + \ description.\n \"query\": '{\"op\": \"and\", \"expr\": [{\"op\"\ + : \"=\", \"left\": \"host_name\", \"right\": \"example.com\"}, {\"op\":\ + \ \"=\", \"left\": \"type\", \"right\": \"0\"}]}', # An query expression\ + \ of the Livestatus 'downtimes' table in nested dictionary form.\n },\n\ + )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"host_name\": 'example.com', # The host name.\n \"service_description\"\ + : 'Memory', # The service description.\n \"query\": '{\"op\": \"and\"\ + , \"expr\": [{\"op\": \"=\", \"left\": \"host_name\", \"right\": \"example.com\"\ + }, {\"op\": \"=\", \"left\": \"type\", \"right\": \"0\"}]}', # An query\ + \ expression of the Livestatus 'downtimes' table in nested dictionary form.\n\ + })\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/downtime/collections/all?{query_string}\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/downtime/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n host_name=='example.com' \\\n service_description=='Memory'\ + \ \\\n query=='{\"op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\"\ + : \"host_name\", \"right\": \"example.com\"}, {\"op\": \"=\", \"left\":\ + \ \"type\", \"right\": \"0\"}]}' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --data-urlencode 'host_name=example.com'\ + \ \\\n --data-urlencode 'service_description=Memory' \\\n --data-urlencode\ + \ 'query={\"op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"host_name\"\ + , \"right\": \"example.com\"}, {\"op\": \"=\", \"left\": \"type\", \"right\"\ + : \"0\"}]}' \\\n \"$API_URL/domain-types/downtime/collections/all\")\n\ + \nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/downtime/{downtime_id}: + get: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * Any of:\n * `general.see_all`: See all objects regardless of contacts\ + \ and contact groups. If combined with 'perform commands' then commands may\ + \ be done on all objects.\n * `bi.see_all`: With this permission set,\ + \ the BI aggregation rules are applied to all hosts and services - not only\ + \ those the user is a contact for. If you remove this permissions then the\ + \ user will see incomplete aggregation trees with status based only on those\ + \ items.\n * `mkeventd.seeall`: If a user lacks this permission then he/she\ + \ can see only those events that originate from a host that he/she is a contact\ + \ for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.downtime.show_downtime + parameters: + - description: The id of the downtime + in: path + name: downtime_id + required: true + schema: + example: '1' + type: integer + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show downtime + tags: + - Downtimes + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/downtime/1\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/downtime/1\",\n method=\"GET\",\n headers={\n\ + \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \ + \ \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/downtime/1\" \\\n\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\"\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/downtime/1\")\n\nresp=$(\ + \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ + \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + /domain-types/downtime/collections/host: + post: + description: "\n\nThis endpoint requires the following permissions: \n * `action.downtimes`:\ + \ Schedule and remove downtimes on hosts and services\n" + operationId: cmk.gui.plugins.openapi.endpoints.downtime.create_host_related_downtime + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - type: object - description: All the attributes of the domain object. - required: - - links - ServiceGroupCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateHostRelatedDowntime' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '422': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unprocessable Entity: The request could not be processed.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Create a host related scheduled downtime + tags: + - Downtimes + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/downtime/collections/host\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n # This schema has multiple variations. Please refer to\n \ + \ # the 'Payload' section for details.\n json={\n 'start_time':\ + \ '2017-07-21T17:32:28Z',\n 'end_time': '2017-07-21T17:32:28Z',\n\ + \ 'recur': 'hour',\n 'duration': 3600,\n 'comment':\ + \ 'Security updates',\n 'downtime_type': 'host',\n 'host_name':\ + \ 'example.com'\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/downtime/collections/host\",\n method=\"\ + POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n # This schema has multiple\ + \ variations. Please refer to\n # the 'Payload' section for details.\n\ + \ data=json.dumps({\n 'start_time': '2017-07-21T17:32:28Z',\n\ + \ 'end_time': '2017-07-21T17:32:28Z',\n 'recur': 'hour',\n\ + \ 'duration': 3600,\n 'comment': 'Security updates',\n \ + \ 'downtime_type': 'host',\n 'host_name': 'example.com'\n \ + \ }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\nif\ + \ response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\n# This schema has multiple variations. Please\ + \ refer to the\n# 'Payload' section for details.\nhttp POST \"$API_URL/domain-types/downtime/collections/host\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n start_time='2017-07-21T17:32:28Z'\ + \ \\\n end_time='2017-07-21T17:32:28Z' \\\n recur='hour' \\\n duration='3600'\ + \ \\\n comment='Security updates' \\\n downtime_type='host' \\\n \ + \ host_name='example.com' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ + \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ + \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ + \ application/json\" \\\n --data '{\n \"comment\": \"Security\ + \ updates\",\n \"downtime_type\": \"host\",\n \"duration\"\ + : 3600,\n \"end_time\": \"2017-07-21T17:32:28Z\",\n \"\ + host_name\": \"example.com\",\n \"recur\": \"hour\",\n \ + \ \"start_time\": \"2017-07-21T17:32:28Z\"\n }' \\\n \"$API_URL/domain-types/downtime/collections/host\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/downtime/collections/service: + post: + description: "\n\nThis endpoint requires the following permissions: \n * `action.downtimes`:\ + \ Schedule and remove downtimes on hosts and services\n" + operationId: cmk.gui.plugins.openapi.endpoints.downtime.create_service_related_downtime + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - default: all - description: The name of this collection. - domainType: - default: service_group_config - description: The domain type of the objects in the collection. - title: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateServiceRelatedDowntime' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '422': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unprocessable Entity: The request could not be processed.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Create a service related scheduled downtime + tags: + - Downtimes + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/downtime/collections/service\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n # This schema has multiple variations. Please refer to\n \ + \ # the 'Payload' section for details.\n json={\n 'start_time':\ + \ '2017-07-21T17:32:28Z',\n 'end_time': '2017-07-21T17:32:28Z',\n\ + \ 'recur': 'hour',\n 'duration': 3600,\n 'comment':\ + \ 'Security updates',\n 'downtime_type': 'service',\n 'host_name':\ + \ 'example.com',\n 'service_descriptions': [\n 'CPU utilization',\ + \ 'Memory'\n ]\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/downtime/collections/service\",\n method=\"\ + POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n # This schema has multiple\ + \ variations. Please refer to\n # the 'Payload' section for details.\n\ + \ data=json.dumps({\n 'start_time': '2017-07-21T17:32:28Z',\n\ + \ 'end_time': '2017-07-21T17:32:28Z',\n 'recur': 'hour',\n\ + \ 'duration': 3600,\n 'comment': 'Security updates',\n \ + \ 'downtime_type': 'service',\n 'host_name': 'example.com',\n\ + \ 'service_descriptions': [\n 'CPU utilization', 'Memory'\n\ + \ ]\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\n# This schema has multiple variations. Please\ + \ refer to the\n# 'Payload' section for details.\nhttp POST \"$API_URL/domain-types/downtime/collections/service\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n start_time='2017-07-21T17:32:28Z'\ + \ \\\n end_time='2017-07-21T17:32:28Z' \\\n recur='hour' \\\n duration='3600'\ + \ \\\n comment='Security updates' \\\n downtime_type='service' \\\n\ + \ host_name='example.com' \\\n service_descriptions='['CPU utilization',\ + \ 'Memory']' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ + \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ + \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ + \ application/json\" \\\n --data '{\n \"comment\": \"Security\ + \ updates\",\n \"downtime_type\": \"service\",\n \"duration\"\ + : 3600,\n \"end_time\": \"2017-07-21T17:32:28Z\",\n \"\ + host_name\": \"example.com\",\n \"recur\": \"hour\",\n \ + \ \"service_descriptions\": [\n \"CPU utilization\",\n \ + \ \"Memory\"\n ],\n \"start_time\": \"2017-07-21T17:32:28Z\"\ + \n }' \\\n \"$API_URL/domain-types/downtime/collections/service\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/downtime/actions/delete/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * `action.downtimes`:\ + \ Schedule and remove downtimes on hosts and services\n" + operationId: cmk.gui.plugins.openapi.endpoints.downtime.delete_downtime + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of service group objects. - items: - $ref: '#/components/schemas/ServiceGroup' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - BulkDeleteServiceGroup: - type: object - properties: - entries: - type: array - description: A list of service group names. - example: - - windows - - panels - items: - type: string - description: The name of the service group config - example: windows - required: - - entries - UpdateGroup2: - type: object - properties: - alias: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteDowntime' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete a scheduled downtime + tags: + - Downtimes + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/downtime/actions/delete/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n # This schema has multiple variations. Please refer to\n \ + \ # the 'Payload' section for details.\n json={'delete_type': 'params',\ + \ 'downtime_id': '54'},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/downtime/actions/delete/invoke\",\n method=\"\ + POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n # This schema has multiple\ + \ variations. Please refer to\n # the 'Payload' section for details.\n\ + \ data=json.dumps({'delete_type': 'params', 'downtime_id': '54'}).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\n# This schema has multiple variations. Please\ + \ refer to the\n# 'Payload' section for details.\nhttp POST \"$API_URL/domain-types/downtime/actions/delete/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n delete_type='params'\ + \ \\\n downtime_id='54' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ + \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ + \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ + \ application/json\" \\\n --data '{\n \"delete_type\": \"params\"\ + ,\n \"downtime_id\": \"54\"\n }' \\\n \"$API_URL/domain-types/downtime/actions/delete/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/folder_config/{folder}/collections/hosts: + get: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * `wato.see_all_folders`: Users without this permissions can only see\ + \ folders with a contact group they are in.\n" + operationId: cmk.gui.plugins.openapi.endpoints.folder_config.hosts_of_folder + parameters: + - description: 'The path of the folder being requested. Please be aware that + slashes can''t be used in the URL. Also, escaping the slashes via %2f will + not work. Please replace the path delimiters with the tilde character `~`. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate + for your quoting/escaping needs. A good default choice is `~`.' + in: path + name: folder + required: true + schema: + example: ~my~fine~folder + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - description: The name used for displaying in the GUI. - example: Example Group - required: - - alias - UpdateServiceGroup: - type: object - properties: - name: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostConfigCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all hosts in a folder + tags: + - Folders + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/folder_config/~my~fine~folder/collections/hosts\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/folder_config/~my~fine~folder/collections/hosts\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/folder_config/~my~fine~folder/collections/hosts\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/folder_config/~my~fine~folder/collections/hosts\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/folder_config/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * `wato.see_all_folders`: Users without this permissions can only see\ + \ folders with a contact group they are in.\n" + operationId: cmk.gui.plugins.openapi.endpoints.folder_config.list_folders + parameters: + - description: 'Show all sub-folders of this folder. The default is the root-folder. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate + for your quoting/escaping needs. A good default choice is `~`.' + in: query + name: parent + required: false + schema: + example: /servers + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - description: The name of the service group. - example: windows - attributes: - $ref: '#/components/schemas/UpdateGroup2' - required: - - name - BulkUpdateServiceGroup: - type: object - properties: - entries: - type: array - description: A list of service group entries. - example: - - name: windows - attributes: - alias: Windows Servers - items: - $ref: '#/components/schemas/UpdateServiceGroup' - required: - - entries - SocketIP4: - type: object - properties: - socket_type: - type: string - description: The connection name. This can be tcp, tcp6, unix or local. - enum: &id040 - - tcp - - tcp6 - - unix - - local - example: tcp - port: - type: integer - description: The TCP port to connect to. - example: 6790 - maximum: 65535 - minimum: 1 - encrypted: + - description: 'List the folder (default: root) and all its sub-folders recursively.' + in: query + name: recursive + required: false + schema: + default: false + example: false type: boolean - description: To enable an encrypted connection. - example: true - verify: + - description: When set, all hosts that are stored in each folder will also + be shown. On large setups this may come at a performance cost, so by default + this is switched off. + in: query + name: show_hosts + required: false + schema: + default: false + example: false type: boolean - description: Verify server certificate. - example: true - host: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FolderCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all folders + tags: + - Folders + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/folder_config/collections/all\"\ + ,\n params={ # goes into query string\n \"parent\": '/servers',\ + \ # Show all sub-folders of this folder.\n \"recursive\": False,\ + \ # List the folder (default: root) and all its sub-folders recursively.\n\ + \ \"show_hosts\": False, # When set, all hosts that are stored in\ + \ each folder will also be shown.\n },\n)\nif resp.status_code == 200:\n\ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"parent\": '/servers', # Show all sub-folders of this folder.\n \ + \ \"recursive\": False, # List the folder (default: root) and all its\ + \ sub-folders recursively.\n \"show_hosts\": False, # When set, all\ + \ hosts that are stored in each folder will also be shown.\n})\n\nrequest\ + \ = urllib.request.Request(\n f\"{API_URL}/domain-types/folder_config/collections/all?{query_string}\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/folder_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n parent=='/servers' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --data-urlencode 'parent=/servers'\ + \ \\\n \"$API_URL/domain-types/folder_config/collections/all\")\n\nresp=$(\ + \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ + \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.manage_folders`: Add new folders and delete existing folders.\ + \ If a folder to be deleted contains hosts then the permission to delete hosts\ + \ is also required.\n * Optionally:\n * `wato.all_folders`: Without\ + \ this permission, operations on folders can only be done by users that are\ + \ members of one of the folders contact groups. This permission grants full\ + \ access to all folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.folder_config.create + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The IP or domain name of the host. - example: 127.0.0.1 - required: - - encrypted - - host - - port - - socket_type - SocketIP6: - type: object - properties: - socket_type: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateFolder' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Folder' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Create a folder + tags: + - Folders + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/folder_config/collections/all\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'name': 'production',\n 'title': 'Production\ + \ Hosts',\n 'parent': '/',\n 'attributes': {\n \ + \ 'tag_criticality': 'prod'\n }\n },\n)\nif resp.status_code ==\ + \ 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/folder_config/collections/all\",\n method=\"\ + POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({\n \ + \ 'name': 'production',\n 'title': 'Production Hosts',\n \ + \ 'parent': '/',\n 'attributes': {\n 'tag_criticality':\ + \ 'prod'\n }\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/folder_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n name='production'\ + \ \\\n title='Production Hosts' \\\n parent='/' \\\n attributes='{'tag_criticality':\ + \ 'prod'}' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"attributes\": {\n \"tag_criticality\"\ + : \"prod\"\n },\n \"name\": \"production\",\n \ + \ \"parent\": \"/\",\n \"title\": \"Production Hosts\"\n \ + \ }' \\\n \"$API_URL/domain-types/folder_config/collections/all\")\n\ + \nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/folder_config/{folder}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.manage_folders`: Add new folders and delete existing folders.\ + \ If a folder to be deleted contains hosts then the permission to delete hosts\ + \ is also required.\n * Optionally:\n * `wato.all_folders`: Without\ + \ this permission, operations on folders can only be done by users that are\ + \ members of one of the folders contact groups. This permission grants full\ + \ access to all folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.folder_config.delete + parameters: + - description: 'The path of the folder being requested. Please be aware that + slashes can''t be used in the URL. Also, escaping the slashes via %2f will + not work. Please replace the path delimiters with the tilde character `~`. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate + for your quoting/escaping needs. A good default choice is `~`.' + in: path + name: folder + required: true + schema: + example: ~my~fine~folder + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - description: The connection name. This can be tcp, tcp6, unix or local. - enum: *id040 - example: tcp - port: - type: integer - description: The TCP port to connect to. - example: 6790 - maximum: 65535 - minimum: 1 - encrypted: - type: boolean - description: To enable an encrypted connection. - example: true - verify: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete a folder + tags: + - Folders + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/folder_config/~my~fine~folder\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/folder_config/~my~fine~folder\",\n method=\"\ + DELETE\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n },\n)\n\ + response = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/folder_config/~my~fine~folder\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/folder_config/~my~fine~folder\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * `wato.see_all_folders`: Users without this permissions can only see\ + \ folders with a contact group they are in.\n" + operationId: cmk.gui.plugins.openapi.endpoints.folder_config.show_folder + parameters: + - description: When set, all hosts that are stored in this folder will also + be shown. On large setups this may come at a performance cost, so by default + this is switched off. + in: query + name: show_hosts + required: false + schema: + default: false + example: false type: boolean - description: Verify server certificate. - example: true - host: - type: string - description: The IP or domain name of the host. - example: 5402:1db8:95a3:0000:0000:9a2e:0480:8334 - required: - - encrypted - - host - - port - - socket_type - SocketUnixAttributes: - type: object - properties: - socket_type: - type: string - description: The connection name. This can be tcp, tcp6, unix or local. - enum: *id040 - example: tcp - path: - type: string - description: When the connection name is unix, this is the path to the unix - socket. - example: /path/to/your/unix_socket - required: - - path - - socket_type - SocketType: - type: object - properties: - socket_type: + - description: 'The path of the folder being requested. Please be aware that + slashes can''t be used in the URL. Also, escaping the slashes via %2f will + not work. Please replace the path delimiters with the tilde character `~`. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate + for your quoting/escaping needs. A good default choice is `~`.' + in: path + name: folder + required: true + schema: + example: ~my~fine~folder + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - description: The connection name. This can be tcp, tcp6, unix or local. - enum: *id040 - example: tcp - required: - - socket_type - SocketAttributes: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/SocketIP4' - - $ref: '#/components/schemas/SocketIP6' - - $ref: '#/components/schemas/SocketUnixAttributes' - - $ref: '#/components/schemas/SocketType' - discriminator: - propertyName: socket_type - mapping: - tcp: '#/components/schemas/SocketIP4' - tcp6: '#/components/schemas/SocketIP6' - unix: '#/components/schemas/SocketUnixAttributes' - local: '#/components/schemas/SocketType' - UseLiveStatusDaemon: - type: object - properties: - use_livestatus_daemon: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Folder' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Show a folder + tags: + - Folders + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/folder_config/~my~fine~folder\"\ + ,\n params={ # goes into query string\n \"show_hosts\": False,\ + \ # When set, all hosts that are stored in this folder will also be shown.\n\ + \ },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"show_hosts\": False, # When set, all hosts that are stored in this\ + \ folder will also be shown.\n})\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/folder_config/~my~fine~folder?{query_string}\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/folder_config/~my~fine~folder\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n \"$API_URL/objects/folder_config/~my~fine~folder\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit_folders`: Modify the properties of existing folders.\n\ + \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ + \ on folders can only be done by users that are members of one of the folders\ + \ contact groups. This permission grants full access to all folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.folder_config.update + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: Use livestatus daemon with direct connection or with livestatus - proxy. - enum: &id041 - - direct - - with_proxy - example: true - required: - - use_livestatus_daemon - ProxyTcp: - type: object - properties: - port: - type: integer - description: The TCP port to connect to. - example: 6790 - maximum: 65535 - minimum: 1 - only_from: - type: array - description: Restrict access to these IP addresses. - example: - - 192.168.1.23 - items: - type: string - description: The IP or domain name of the host. - example: 192.168.1.1 - tls: - type: boolean - description: Encrypt TCP Livestatus connections. - example: false - required: - - port - Heartbeat: - type: object - properties: - interval: - type: integer - description: The heartbeat interval for the TCP connection. - example: 5 - minimum: 1 - timeout: - type: number - description: The heartbeat timeout for the TCP connection. - example: 2.0 - ProxyParams: - type: object - properties: - channels: - type: integer - description: The number of channels to keep open. - example: 5 - maximum: 50 - minimum: 2 - heartbeat: - description: The heartbeat interval and timeout configuration. - allOf: - - $ref: '#/components/schemas/Heartbeat' - channel_timeout: - type: number - description: The timeout waiting for a free channel. - example: 3.0 - query_timeout: - type: number - description: The total query timeout. - example: 120.0 - connect_retry: - type: number - description: The cooling period after failed connect/heartbeat. - example: 4.0 - cache: - type: boolean - description: Enable caching. - example: true - ProxyAttributes: - type: object - properties: - use_livestatus_daemon: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: Use livestatus daemon with direct connection or with livestatus - proxy. - enum: *id041 - example: true - global_settings: - type: boolean - description: When use_livestatus_daemon is set to 'with_proxy', you can - set this to True to use global setting or False to use custom parameters. - example: true - tcp: - description: Allow access via TCP configuration. - allOf: - - $ref: '#/components/schemas/ProxyTcp' - params: - description: The live status proxy daemon parameters. - allOf: - - $ref: '#/components/schemas/ProxyParams' - required: - - global_settings - - use_livestatus_daemon - ProxyOrDirect: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/UseLiveStatusDaemon' - - $ref: '#/components/schemas/ProxyAttributes' - discriminator: - propertyName: use_livestatus_daemon - mapping: - direct: '#/components/schemas/UseLiveStatusDaemon' - with_proxy: '#/components/schemas/ProxyAttributes' - StatusHostAttributesSet: - type: object - properties: - status_host_set: + - description: 'The path of the folder being requested. Please be aware that + slashes can''t be used in the URL. Also, escaping the slashes via %2f will + not work. Please replace the path delimiters with the tilde character `~`. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate + for your quoting/escaping needs. A good default choice is `~`.' + in: path + name: folder + required: true + schema: + example: ~my~fine~folder + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - description: enabled for 'use the following status host' and disabled for - 'no status host' - enum: &id042 - - enabled - - disabled - example: false - site: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateFolder' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Folder' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Update a folder + tags: + - Folders + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/folder_config/~my~fine~folder\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={\n 'title':\ + \ 'Virtual Servers.',\n 'attributes': {\n 'networking':\ + \ 'wan'\n },\n 'update_attributes': {\n 'tag_criticality':\ + \ 'prod'\n },\n 'remove_attributes': ['tag_foobar']\n },\n\ + )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/folder_config/~my~fine~folder\",\n method=\"\ + PUT\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ + a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ + \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n data=json.dumps({\n 'title': 'Virtual Servers.',\n \ + \ 'attributes': {\n 'networking': 'wan'\n },\n \ + \ 'update_attributes': {\n 'tag_criticality': 'prod'\n\ + \ },\n 'remove_attributes': ['tag_foobar']\n }).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/folder_config/~my~fine~folder\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n title='Virtual Servers.' \\\n attributes='{'networking': 'wan'}'\ + \ \\\n update_attributes='{'tag_criticality': 'prod'}' \\\n remove_attributes='['tag_foobar']'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"attributes\": {\n \"networking\": \"wan\"\n \ + \ },\n \"remove_attributes\": [\n \"tag_foobar\"\ + \n ],\n \"title\": \"Virtual Servers.\",\n \"\ + update_attributes\": {\n \"tag_criticality\": \"prod\"\n \ + \ }\n }' \\\n \"$API_URL/objects/folder_config/~my~fine~folder\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/folder_config/actions/bulk-update/invoke: + put: + description: "Please be aware that when doing bulk updates, it is not possible\ + \ to prevent the\n[Updating Values](\"lost update problem\"), which is normally\ + \ prevented by the ETag locking\nmechanism. Use at your own riskThis endpoint\ + \ requires the following permissions: \n * All of:\n * `wato.edit_folders`:\ + \ Modify the properties of existing folders.\n * Optionally:\n * `wato.all_folders`:\ + \ Without this permission, operations on folders can only be done by users\ + \ that are members of one of the folders contact groups. This permission grants\ + \ full access to all folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.folder_config.bulk_update + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The site ID of the status host. - example: prod - host: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkUpdateFolder' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FolderCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Bulk update folders + tags: + - Folders + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/domain-types/folder_config/actions/bulk-update/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'entries': [{\n 'remove_attributes':\ + \ ['tag_foobar']\n }]\n },\n)\nif resp.status_code == 200:\n \ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/folder_config/actions/bulk-update/invoke\"\ + ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'entries': [{\n 'remove_attributes': ['tag_foobar']\n\ + \ }]\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/domain-types/folder_config/actions/bulk-update/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='[{'remove_attributes':\ + \ ['tag_foobar']}]' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n {\n \ + \ \"remove_attributes\": [\n \"tag_foobar\"\n \ + \ ]\n }\n ]\n }' \\\n \"$API_URL/domain-types/folder_config/actions/bulk-update/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/folder_config/{folder}/actions/move/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.manage_folders`: Add new folders and delete existing folders.\ + \ If a folder to be deleted contains hosts then the permission to delete hosts\ + \ is also required.\n * Optionally:\n * `wato.all_folders`: Without\ + \ this permission, operations on folders can only be done by users that are\ + \ members of one of the folders contact groups. This permission grants full\ + \ access to all folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.folder_config.move + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: The host name of the status host. - example: host_1 - pattern: ^[-0-9a-zA-Z_.]+\Z - required: - - host - - site - - status_host_set - StatusHostAttributesBase: - type: object - properties: - status_host_set: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: enabled for 'use the following status host' and disabled for - 'no status host' - enum: *id042 - example: false - required: - - status_host_set - StatusHostSet: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/StatusHostAttributesSet' - - $ref: '#/components/schemas/StatusHostAttributesBase' - discriminator: - propertyName: status_host_set - mapping: - enabled: '#/components/schemas/StatusHostAttributesSet' - disabled: '#/components/schemas/StatusHostAttributesBase' - StatusConnectionAttributes: - type: object - properties: - connection: - description: When connecting to remote site please make sure that Livestatus - over TCP is activated there. You can use UNIX sockets to connect to foreign - sites on localhost. - allOf: - - $ref: '#/components/schemas/SocketAttributes' - proxy: - description: The Livestatus proxy daemon configuration attributes. - allOf: - - $ref: '#/components/schemas/ProxyOrDirect' - connect_timeout: - type: integer - description: The time that the GUI waits for a connection to the site to - be established before the site is considered to be unreachable. - example: 2 - persistent_connection: - type: boolean - description: If you enable persistent connections then Multisite will try - to keep open the connection to the remote sites. - example: false - url_prefix: - type: string - description: The URL prefix will be prepended to links of addons like NagVis - when a link to such applications points to a host or service on that site. - example: /remote_1/ - status_host: - description: By specifying a status host for each non-local connection you - prevent Multisite from running into timeouts when remote sites do not - respond. - allOf: - - $ref: '#/components/schemas/StatusHostSet' - disable_in_status_gui: - type: boolean - description: If you disable a connection, then no data of this site will - be shown in the status GUI. The replication is not affected by this, however. - example: false - required: - - connect_timeout - - connection - - proxy - - status_host - UserSyncWithLdapConnection: - type: object - properties: - sync_with_ldap_connections: + - description: 'The path of the folder being requested. Please be aware that + slashes can''t be used in the URL. Also, escaping the slashes via %2f will + not work. Please replace the path delimiters with the tilde character `~`. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate + for your quoting/escaping needs. A good default choice is `~`.' + in: path + name: folder + required: true + schema: + example: ~my~fine~folder + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - description: Sync with ldap connections. The options are ldap, all, disabled. - enum: &id043 - - ldap - - all - - disabled - example: ldap - ldap_connections: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MoveFolder' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Folder' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Move a folder + tags: + - Folders + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/folder_config/~my~fine~folder/actions/move/invoke\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={'destination': '%2Fmy%2Ffine%2Ffolder'},\n\ + )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/folder_config/~my~fine~folder/actions/move/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ + \ the, to be modified, object's ETag header.\n \"Content-Type\":\ + \ 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({'destination':\ + \ '%2Fmy%2Ffine%2Ffolder'}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/objects/folder_config/~my~fine~folder/actions/move/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n destination='%2Fmy%2Ffine%2Ffolder' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"destination\": \"%2Fmy%2Ffine%2Ffolder\"\n }' \\\n \ + \ \"$API_URL/objects/folder_config/~my~fine~folder/actions/move/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/host/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * Any of:\n * `general.see_all`: See all objects regardless of contacts\ + \ and contact groups. If combined with 'perform commands' then commands may\ + \ be done on all objects.\n * `bi.see_all`: With this permission set,\ + \ the BI aggregation rules are applied to all hosts and services - not only\ + \ those the user is a contact for. If you remove this permissions then the\ + \ user will see incomplete aggregation trees with status based only on those\ + \ items.\n * `mkeventd.seeall`: If a user lacks this permission then he/she\ + \ can see only those events that originate from a host that he/she is a contact\ + \ for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host.list_hosts + parameters: + - description: Restrict the query to this particular site. + explode: true + in: query + name: sites + required: false + schema: + default: [] + items: + type: string type: array - description: A list of ldap connections. + style: form + - description: An query expression of the Livestatus 'hosts' table in nested + dictionary form. If you want to use multiple expressions, nest them with + the AND/OR operators. + in: query + name: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/Expr' + example: '{"op": "and", "expr": [{"op": "=", "left": "name", "right": "example.com"}, + {"op": "!=", "left": "state", "right": "0"}]}' + - description: The desired columns of the `hosts` table. If left empty, a default + set of columns is used. + explode: true + in: query + name: columns + required: false + schema: + default: + - name example: - - LDAP_1 - - LDAP_2 + - name items: type: string - description: An LDAP connection ID string. - required: - - ldap_connections - - sync_with_ldap_connections - UserSyncBase: - type: object - properties: - sync_with_ldap_connections: + type: array + style: form + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show hosts of specific condition + tags: + - Host status + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/host/collections/all\"\ + ,\n params={ # goes into query string\n \"query\": '{\"op\":\ + \ \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"name\", \"right\": \"\ + example.com\"}, {\"op\": \"!=\", \"left\": \"state\", \"right\": \"0\"}]}',\ + \ # An query expression of the Livestatus 'hosts' table in nested dictionary\ + \ form.\n \"columns\": ['name'], # The desired columns of the `hosts`\ + \ table.\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"query\": '{\"op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\":\ + \ \"name\", \"right\": \"example.com\"}, {\"op\": \"!=\", \"left\": \"state\"\ + , \"right\": \"0\"}]}', # An query expression of the Livestatus 'hosts'\ + \ table in nested dictionary form.\n \"columns\": ['name'], # The desired\ + \ columns of the `hosts` table.\n})\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/host/collections/all?{query_string}\",\n\ + \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/host/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n query=='{\"op\": \"and\", \"expr\": [{\"op\"\ + : \"=\", \"left\": \"name\", \"right\": \"example.com\"}, {\"op\": \"!=\"\ + , \"left\": \"state\", \"right\": \"0\"}]}' \\\n columns=='['name']'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --data-urlencode 'query={\"\ + op\": \"and\", \"expr\": [{\"op\": \"=\", \"left\": \"name\", \"right\"\ + : \"example.com\"}, {\"op\": \"!=\", \"left\": \"state\", \"right\": \"\ + 0\"}]}' \\\n --data-urlencode 'columns=name' \\\n \"$API_URL/domain-types/host/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/host_config/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * `wato.see_all_folders`: Users without this permissions can only see\ + \ folders with a contact group they are in.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.list_hosts + parameters: + - description: Show all effective attributes on hosts, not just the attributes + which were set on this host specifically. This includes all attributes of + all of this host's parent folders. + in: query + name: effective_attributes + required: false + schema: + default: false + example: false + type: boolean + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostConfigCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all hosts + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/host_config/collections/all\"\ + ,\n params={ # goes into query string\n \"effective_attributes\"\ + : False, # Show all effective attributes on hosts, not just the attributes\ + \ which were set on this host specifically.\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"effective_attributes\": False, # Show all effective attributes on\ + \ hosts, not just the attributes which were set on this host specifically.\n\ + })\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/host_config/collections/all?{query_string}\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/host_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n \"$API_URL/domain-types/host_config/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.manage_hosts`: Add hosts to the monitoring and remove hosts\ + \ from the monitoring. Please also add the permission Modify existing hosts.\n\ + \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ + \ on folders can only be done by users that are members of one of the folders\ + \ contact groups. This permission grants full access to all folders and hosts.\n\ + \ * Optionally:\n * Any of:\n * `bi.see_all`: With this permission\ + \ set, the BI aggregation rules are applied to all hosts and services - not\ + \ only those the user is a contact for. If you remove this permissions then\ + \ the user will see incomplete aggregation trees with status based only on\ + \ those items.\n * `general.see_all`: See all objects regardless of\ + \ contacts and contact groups. If combined with 'perform commands' then commands\ + \ may be done on all objects.\n * `mkeventd.seeall`: If a user lacks\ + \ this permission then he/she can see only those events that originate from\ + \ a host that he/she is a contact for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.create_host + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: Sync with ldap connections. The options are ldap, all, disabled. - enum: *id043 - example: ldap - required: - - sync_with_ldap_connections - UserSyncAttributes: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/UserSyncWithLdapConnection' - - $ref: '#/components/schemas/UserSyncBase' - - $ref: '#/components/schemas/UserSyncBase' - discriminator: - propertyName: sync_with_ldap_connections - mapping: - ldap: '#/components/schemas/UserSyncWithLdapConnection' - all: '#/components/schemas/UserSyncBase' - disabled: '#/components/schemas/UserSyncBase' - ConfigurationConnectionAttributes: - type: object - properties: - enable_replication: + - description: Tries to bake the agents for the just created hosts. This process + is started in the background after configuring the host. Please note that + the backing may take some time and might block subsequent API calls. This + only works when using the Enterprise Editions. + in: query + name: bake_agent + required: false + schema: + default: false + example: false type: boolean - description: Replication allows you to manage several monitoring sites with - a logically centralized setup. Remote sites receive their configuration - from the central sites. - example: true - url_of_remote_site: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateHost' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostConfig' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Create a host + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_config/collections/all\"\ + ,\n params={ # goes into query string\n \"bake_agent\": False,\ + \ # Tries to bake the agents for the just created hosts.\n },\n headers={\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n json={\n\ + \ 'folder': '/',\n 'host_name': 'example.com',\n 'attributes':\ + \ {\n 'ipaddress': '192.168.0.123'\n }\n },\n)\nif\ + \ resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"bake_agent\": False, # Tries to bake the agents for the just created\ + \ hosts.\n})\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/host_config/collections/all?{query_string}\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'folder': '/',\n 'host_name': 'example.com',\n 'attributes':\ + \ {\n 'ipaddress': '192.168.0.123'\n }\n }).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/host_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n folder='/'\ + \ \\\n host_name='example.com' \\\n attributes='{'ipaddress': '192.168.0.123'}'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ + \ application/json\" \\\n --data '{\n \"attributes\": {\n \ + \ \"ipaddress\": \"192.168.0.123\"\n },\n \"\ + folder\": \"/\",\n \"host_name\": \"example.com\"\n }' \\\ + \n \"$API_URL/domain-types/host_config/collections/all\")\n\nresp=$(\ + \ echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\"\ + \ | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + /objects/host_config/{host_name}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.manage_hosts`: Add hosts to the monitoring and remove hosts\ + \ from the monitoring. Please also add the permission Modify existing hosts.\n\ + \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ + \ on folders can only be done by users that are members of one of the folders\ + \ contact groups. This permission grants full access to all folders and hosts.\n\ + \ * Optionally:\n * Any of:\n * `bi.see_all`: With this permission\ + \ set, the BI aggregation rules are applied to all hosts and services - not\ + \ only those the user is a contact for. If you remove this permissions then\ + \ the user will see incomplete aggregation trees with status based only on\ + \ those items.\n * `general.see_all`: See all objects regardless of\ + \ contacts and contact groups. If combined with 'perform commands' then commands\ + \ may be done on all objects.\n * `mkeventd.seeall`: If a user lacks\ + \ this permission then he/she can see only those events that originate from\ + \ a host that he/she is a contact for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.delete + parameters: + - description: A hostname. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: URL of the remote Checkmk including /check_mk/. This URL is - in many cases the same as the URL-Prefix but with check_mk/ appended, - but it must always be an absolute URL. - example: http://remote_site_1/check_mk/ - disable_remote_configuration: - type: boolean - description: It is a good idea to disable access to Setup completely on - the remote site. Otherwise a user who does not now about the replication - could make local changes that are overridden at the next configuration - activation. - example: true - ignore_tls_errors: - type: boolean - description: This might be needed to make the synchronization accept problems - with SSL certificates when using an SSL secured connection. + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete a host + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/host_config/example.com\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_config/example.com\",\n method=\"DELETE\"\ + ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/host_config/example.com\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/host_config/example.com\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * `wato.see_all_folders`: Users without this permissions can only see\ + \ folders with a contact group they are in.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.show_host + parameters: + - description: Show all effective attributes on hosts, not just the attributes + which were set on this host specifically. This includes all attributes of + all of this host's parent folders. + in: query + name: effective_attributes + required: false + schema: + default: false example: false - direct_login_to_web_gui_allowed: - type: boolean - description: When enabled, this site is marked for synchronisation every - time a Web GUI related option is changed and users are allowed to login - to the Web GUI of this site. - example: true - user_sync: - description: By default the users are synchronized automatically in the - interval configured in the connection. For example the LDAP connector - synchronizes the users every five minutes by default. The interval can - be changed for each connection individually in the connection settings. - Please note that the synchronization is only performed on the master site - in distributed setups by default. - allOf: - - $ref: '#/components/schemas/UserSyncAttributes' - replicate_event_console: type: boolean - description: This option enables the distribution of global settings and - rules of the Event Console to the remote site. Any change in the local - Event Console settings will mark the site as need sync. A synchronization - will automatically reload the Event Console of the remote site. - example: true - replicate_extensions: - type: boolean - description: 'If you enable the replication of MKPs then during each Activate - Changes MKPs that are installed on your central site and all other files - below the ~/local/ directory will be also transferred to the remote site. - Note: all other MKPs and files below ~/local/ on the remote site will - be removed.' - example: true - required: - - direct_login_to_web_gui_allowed - - disable_remote_configuration - - enable_replication - - ignore_tls_errors - - replicate_event_console - - replicate_extensions - - url_of_remote_site - - user_sync - BasicSettingsAttributesCreate: - type: object - properties: - alias: + - description: A hostname. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: The alias of the site. - example: Site Alias - site_id: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostConfig' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Show a host + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host_config/example.com\"\ + ,\n params={ # goes into query string\n \"effective_attributes\"\ + : False, # Show all effective attributes on hosts, not just the attributes\ + \ which were set on this host specifically.\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"effective_attributes\": False, # Show all effective attributes on\ + \ hosts, not just the attributes which were set on this host specifically.\n\ + })\n\nrequest = urllib.request.Request(\n f\"{API_URL}/objects/host_config/example.com?{query_string}\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/host_config/example.com\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n \"$API_URL/objects/host_config/example.com\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.all_folders`:\ + \ Without this permission, operations on folders can only be done by users\ + \ that are members of one of the folders contact groups. This permission grants\ + \ full access to all folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.update_host + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: The site ID. - example: prod - required: - - alias - - site_id - SiteConfigAttributesCreate: - type: object - properties: - status_connection: - $ref: '#/components/schemas/StatusConnectionAttributes' - configuration_connection: - $ref: '#/components/schemas/ConfigurationConnectionAttributes' - secret: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The shared secret used by the central site to authenticate - with the remote site for configuring Checkmk. - example: secret - basic_settings: - $ref: '#/components/schemas/BasicSettingsAttributesCreate' - required: - - basic_settings - - configuration_connection - - status_connection - SiteConnectionRequestCreate: - type: object - properties: - site_config: - description: A site's connection. - example: - basic_settings: - alias: Die remote site 1 - site_id: site_id_1 - status_connection: - connection: - socket_type: tcp - host: 123.124.1.3 - port: 1253 - encrypted: true - verify: false - proxy: - use_livestatus_daemon: with_proxy - global_settings: false - params: - channels: 15 - heartbeat: - interval: 12 - timeout: 3.0 - channel_timeout: 3.5 - query_timeout: 120.2 - connect_retry: 4.6 - cache: true - tcp: - port: 6560 - only_from: - - 192.168.1.1 - tls: false - connect_timeout: 2 - persistent_connection: false - url_prefix: /heute_remote_1/ - status_host: - status_host_set: disabled - disable_in_status_gui: false - configuration_connection: - enable_replication: true - url_of_remote_site: http://localhost/heute_remote_site_id_1/check_mk/ - disable_remote_configuration: true - ignore_tls_errors: false - direct_login_to_web_gui_allowed: true - user_sync: - sync_with_ldap_connections: all - replicate_event_console: true - replicate_extensions: true - allOf: - - $ref: '#/components/schemas/SiteConfigAttributesCreate' - required: - - site_config - BasicSettingsAttributes: - type: object - properties: - site_id: + - description: A hostname. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: The site id. - example: prod - alias: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateHost' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostConfig' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Update a host + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_config/example.com\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={\n 'attributes':\ + \ {\n 'ipaddress': '192.168.0.123'\n },\n 'update_attributes':\ + \ {\n 'ipaddress': '192.168.0.123'\n },\n 'remove_attributes':\ + \ ['tag_foobar']\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_config/example.com\",\n method=\"PUT\"\ + ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ + a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ + \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n data=json.dumps({\n 'attributes': {\n 'ipaddress':\ + \ '192.168.0.123'\n },\n 'update_attributes': {\n \ + \ 'ipaddress': '192.168.0.123'\n },\n 'remove_attributes':\ + \ ['tag_foobar']\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/host_config/example.com\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n attributes='{'ipaddress': '192.168.0.123'}' \\\n update_attributes='{'ipaddress':\ + \ '192.168.0.123'}' \\\n remove_attributes='['tag_foobar']' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"attributes\": {\n \"ipaddress\": \"192.168.0.123\"\ + \n },\n \"remove_attributes\": [\n \"tag_foobar\"\ + \n ],\n \"update_attributes\": {\n \"ipaddress\"\ + : \"192.168.0.123\"\n }\n }' \\\n \"$API_URL/objects/host_config/example.com\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/host_config/{host_name}/properties/nodes: + put: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.all_folders`:\ + \ Without this permission, operations on folders can only be done by users\ + \ that are members of one of the folders contact groups. This permission grants\ + \ full access to all folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.update_nodes + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: The alias of the site. - example: Site Alias - required: - - alias - - site_id - SocketAttributes1: - type: object - properties: - socket_type: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The connection name. This can be tcp, tcp6, unix or local. - example: tcp - path: + - description: A cluster host. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: When the connection name is unix, this is the path to the unix - socket. - example: /path/to/your/unix_socket - host: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateNodes' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ObjectProperty' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Update the nodes of a cluster host + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_config/example.com/properties/nodes\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={'nodes': ['host1',\ + \ 'host2', 'host3']},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_config/example.com/properties/nodes\",\n\ + \ method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ + \ the, to be modified, object's ETag header.\n \"Content-Type\":\ + \ 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({'nodes':\ + \ ['host1', 'host2', 'host3']}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/host_config/example.com/properties/nodes\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n nodes='['host1', 'host2', 'host3']' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"nodes\": [\n \"host1\",\n \"host2\",\n\ + \ \"host3\"\n ]\n }' \\\n \"$API_URL/objects/host_config/example.com/properties/nodes\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/host_config/actions/bulk-update/invoke: + put: + description: "Please be aware that when doing bulk updates, it is not possible\ + \ to prevent the\n[Updating Values](\"lost update problem\"), which is normally\ + \ prevented by the ETag locking\nmechanism. Use at your own risk.This endpoint\ + \ requires the following permissions: \n * `wato.all_folders`: Without this\ + \ permission, operations on folders can only be done by users that are members\ + \ of one of the folders contact groups. This permission grants full access\ + \ to all folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.bulk_update_hosts + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The IP or domain name of the host. - example: 127.0.0.1 - port: - type: integer - description: The TCP port to connect to. - example: 6792 - encrypted: - type: boolean - description: To enable an encrypted connection. - example: true - verify: - type: boolean - description: Verify server certificate. - example: true - required: - - socket_type - ProxyTcp1: - type: object - properties: - port: - type: integer - description: The livestatus proxy TCP port. - example: 6560 - maximum: 65535 - minimum: 1 - only_from: - type: array - description: Restrict access to these IP addresses. - example: - - 192.123.32.1 - - 192.123.32.2 - items: - type: string - tls: - type: boolean - description: Encrypt TCP Livestatus connections. - example: true - Heartbeat1: - type: object - properties: - interval: - type: integer - description: The heartbeat interval for the TCP connection. - example: 5 - timeout: - type: number - description: The heartbeat timeout for the TCP connection. - example: 2.0 - ProxyParams1: - type: object - properties: - channels: - type: integer - description: The number of channels to keep open. - example: 5 - heartbeat: - description: The heartbeat interval and timeout configuration. - allOf: - - $ref: '#/components/schemas/Heartbeat1' - channel_timeout: - type: number - description: The timeout waiting for a free channel. - example: 3.0 - query_timeout: - type: number - description: The total query timeout. - example: 120.0 - connect_retry: - type: number - description: The cooling period after failed connect/heartbeat. - example: 4.0 - cache: - type: boolean - description: Enable caching. - example: true - ProxyAttributes1: - type: object - properties: - use_livestatus_daemon: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkUpdateHost' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/BulkHostActionWithFailedHosts' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostConfigCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Bulk update hosts + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/domain-types/host_config/actions/bulk-update/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'entries': [{\n 'host_name': 'example.com',\n\ + \ 'attributes': {}\n }]\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/host_config/actions/bulk-update/invoke\"\ + ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'entries': [{\n 'host_name': 'example.com',\n \ + \ 'attributes': {}\n }]\n }).encode('utf-8'),\n)\nresponse\ + \ = urllib.request.urlopen(request)\nif response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/domain-types/host_config/actions/bulk-update/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='[{'host_name':\ + \ 'example.com', 'attributes': {}}]' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n {\n \ + \ \"attributes\": {},\n \"host_name\": \"example.com\"\n\ + \ }\n ]\n }' \\\n \"$API_URL/domain-types/host_config/actions/bulk-update/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/host_config/{host_name}/actions/rename/invoke: + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.manage_hosts`: Add hosts to the monitoring and remove hosts\ + \ from the monitoring. Please also add the permission Modify existing hosts.\n\ + \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ + \ on folders can only be done by users that are members of one of the folders\ + \ contact groups. This permission grants full access to all folders and hosts.\n\ + \ * Optionally:\n * Any of:\n * `bi.see_all`: With this permission\ + \ set, the BI aggregation rules are applied to all hosts and services - not\ + \ only those the user is a contact for. If you remove this permissions then\ + \ the user will see incomplete aggregation trees with status based only on\ + \ those items.\n * `general.see_all`: See all objects regardless of\ + \ contacts and contact groups. If combined with 'perform commands' then commands\ + \ may be done on all objects.\n * `mkeventd.seeall`: If a user lacks\ + \ this permission then he/she can see only those events that originate from\ + \ a host that he/she is a contact for.\n * `wato.edit_hosts`: Modify the\ + \ properties of existing hosts. Please note: for the management of services\ + \ (inventory) there is a separate permission (see below)\n * `wato.rename_hosts`:\ + \ Rename existing hosts. Please also add the permission Modify existing\ + \ hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.rename_host + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: Use livestatus daemon with direct connection or with livestatus - proxy. - example: true - global_settings: - type: boolean - description: When Livestatus proxy daemon is set, you can enable this to - use global setting and disable it to use custom parameters. - example: true - tcp: - description: Allow access via TCP configuration. - allOf: - - $ref: '#/components/schemas/ProxyTcp1' - params: - description: The live status proxy daemon parameters. - allOf: - - $ref: '#/components/schemas/ProxyParams1' - required: - - use_livestatus_daemon - StatusHostAttributes: - type: object - properties: - status_host_set: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: enabled for 'use the following status host' and disabled for - 'no status host'. - example: true - site: + - description: A hostname. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: The site ID of the status host. - example: prod - host: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RenameHost' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '422': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unprocessable Entity: The host could not be renamed.' + '409': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Conflict: There are pending changes not yet activated.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostConfig' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Rename a host + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_config/example.com/actions/rename/invoke\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={'new_name': 'newhost'},\n\ + )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_config/example.com/actions/rename/invoke\"\ + ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ + \ the, to be modified, object's ETag header.\n \"Content-Type\":\ + \ 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({'new_name':\ + \ 'newhost'}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/host_config/example.com/actions/rename/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n new_name='newhost' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"new_name\": \"newhost\"\n }' \\\n \"$API_URL/objects/host_config/example.com/actions/rename/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/host_config/collections/clusters: + post: + description: "A cluster host groups many hosts (called nodes in this context)\ + \ into a conceptual cluster.\nAll the services of the individual nodes will\ + \ be collated on the cluster host.This endpoint requires the following permissions:\ + \ \n * All of:\n * `wato.manage_hosts`: Add hosts to the monitoring and\ + \ remove hosts from the monitoring. Please also add the permission Modify\ + \ existing hosts.\n * Optionally:\n * `wato.all_folders`: Without\ + \ this permission, operations on folders can only be done by users that are\ + \ members of one of the folders contact groups. This permission grants full\ + \ access to all folders and hosts.\n * Optionally:\n * Any of:\n \ + \ * `bi.see_all`: With this permission set, the BI aggregation rules are\ + \ applied to all hosts and services - not only those the user is a contact\ + \ for. If you remove this permissions then the user will see incomplete aggregation\ + \ trees with status based only on those items.\n * `general.see_all`:\ + \ See all objects regardless of contacts and contact groups. If combined with\ + \ 'perform commands' then commands may be done on all objects.\n * `mkeventd.seeall`:\ + \ If a user lacks this permission then he/she can see only those events that\ + \ originate from a host that he/she is a contact for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.create_cluster_host + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The host name of the status host. - example: host_1 - required: - - status_host_set - StatusConnectionAttributes1: - type: object - properties: - connection: - description: When connecting to remote site please make sure that Livestatus - over TCP is activated there. You can use UNIX sockets to connect to foreign - sites on localhost. - allOf: - - $ref: '#/components/schemas/SocketAttributes1' - proxy: - description: The Livestatus proxy daemon configuration attributes. - allOf: - - $ref: '#/components/schemas/ProxyAttributes1' - connect_timeout: - type: integer - description: The time that the GUI waits for a connection to the site to - be established before the site is considered to be unreachable. - example: 2 - persistent_connection: - type: boolean - description: If you enable persistent connections then Multisite will try - to keep open the connection to the remote sites. - example: true - url_prefix: - type: string - description: The URL prefix will be prepended to links of addons like NagVis - when a link to such applications points to a host or service on that site. - example: /remote_1/ - status_host: - description: By specifying a status host for each non-local connection you - prevent Multisite from running into timeouts when remote sites do not - respond. - allOf: - - $ref: '#/components/schemas/StatusHostAttributes' - disable_in_status_gui: - type: boolean - description: If you disable a connection, then no data of this site will - be shown in the status GUI. The replication is not affected by this, however. + - description: Tries to bake the agents for the just created hosts. This process + is started in the background after configuring the host. Please note that + the backing may take some time and might block subsequent API calls. This + only works when using the Enterprise Editions. + in: query + name: bake_agent + required: false + schema: + default: false example: false - required: - - connect_timeout - - connection - - proxy - UserSyncAttributes1: - type: object - properties: - sync_with_ldap_connections: - type: string - description: Sync with ldap connections. The options are ldap, all, disabled. - example: ldap - ldap_connections: - type: array - description: A list of ldap connections. - example: - - LDAP_1 - - LDAP_2 - items: - type: string - required: - - sync_with_ldap_connections - ConfigurationConnectionAttributes1: - type: object - properties: - enable_replication: type: boolean - description: Replication allows you to manage several monitoring sites with - a logically centralized setup. Remote sites receive their configuration - from the central sites. - example: true - url_of_remote_site: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateClusterHost' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostConfig' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Create a cluster host + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_config/collections/clusters\"\ + ,\n params={ # goes into query string\n \"bake_agent\": False,\ + \ # Tries to bake the agents for the just created hosts.\n },\n headers={\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n json={\n\ + \ 'folder': '/',\n 'host_name': 'example.com',\n 'attributes':\ + \ {\n 'ipaddress': '192.168.0.123'\n },\n 'nodes':\ + \ ['host1', 'host2', 'host3']\n },\n)\nif resp.status_code == 200:\n\ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"bake_agent\": False, # Tries to bake the agents for the just created\ + \ hosts.\n})\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/host_config/collections/clusters?{query_string}\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'folder': '/',\n 'host_name': 'example.com',\n 'attributes':\ + \ {\n 'ipaddress': '192.168.0.123'\n },\n 'nodes':\ + \ ['host1', 'host2', 'host3']\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/host_config/collections/clusters\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n folder='/'\ + \ \\\n host_name='example.com' \\\n attributes='{'ipaddress': '192.168.0.123'}'\ + \ \\\n nodes='['host1', 'host2', 'host3']' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ + \ application/json\" \\\n --data '{\n \"attributes\": {\n \ + \ \"ipaddress\": \"192.168.0.123\"\n },\n \"\ + folder\": \"/\",\n \"host_name\": \"example.com\",\n \"\ + nodes\": [\n \"host1\",\n \"host2\",\n \ + \ \"host3\"\n ]\n }' \\\n \"$API_URL/domain-types/host_config/collections/clusters\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/host_config/actions/bulk-create/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.manage_hosts`: Add hosts to the monitoring and remove hosts\ + \ from the monitoring. Please also add the permission Modify existing hosts.\n\ + \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ + \ on folders can only be done by users that are members of one of the folders\ + \ contact groups. This permission grants full access to all folders and hosts.\n\ + \ * Optionally:\n * Any of:\n * `bi.see_all`: With this permission\ + \ set, the BI aggregation rules are applied to all hosts and services - not\ + \ only those the user is a contact for. If you remove this permissions then\ + \ the user will see incomplete aggregation trees with status based only on\ + \ those items.\n * `general.see_all`: See all objects regardless of\ + \ contacts and contact groups. If combined with 'perform commands' then commands\ + \ may be done on all objects.\n * `mkeventd.seeall`: If a user lacks\ + \ this permission then he/she can see only those events that originate from\ + \ a host that he/she is a contact for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.bulk_create_hosts + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: URL of the remote Checkmk including /check_mk/. This URL is - in many cases the same as the URL-Prefix but with check_mk/ appended, - but it must always be an absolute URL. - example: http://remote_site_1/check_mk/ - disable_remote_configuration: - type: boolean - description: It is a good idea to disable access to Setup completely on - the remote site. Otherwise a user who does not now about the replication - could make local changes that are overridden at the next configuration - activation. - example: true - ignore_tls_errors: - type: boolean - description: This might be needed to make the synchronization accept problems - with SSL certificates when using an SSL secured connection. + - description: Tries to bake the agents for the just created hosts. This process + is started in the background after configuring the host. Please note that + the backing may take some time and might block subsequent API calls. This + only works when using the Enterprise Editions. + in: query + name: bake_agent + required: false + schema: + default: false example: false - direct_login_to_web_gui_allowed: - type: boolean - description: When enabled, this site is marked for synchronisation every - time a Web GUI related option is changed and users are allowed to login - to the Web GUI of this site. - example: true - user_sync: - description: By default the users are synchronized automatically in the - interval configured in the connection. For example the LDAP connector - synchronizes the users every five minutes by default. The interval can - be changed for each connection individually in the connection settings. - Please note that the synchronization is only performed on the master site - in distributed setups by default. - allOf: - - $ref: '#/components/schemas/UserSyncAttributes1' - replicate_event_console: - type: boolean - description: This option enables the distribution of global settings and - rules of the Event Console to the remote site. Any change in the local - Event Console settings will mark the site as need sync. A synchronization - will automatically reload the Event Console of the remote site. - example: true - replicate_extensions: type: boolean - description: 'If you enable the replication of MKPs then during each Activate - Changes MKPs that are installed on your central site and all other files - below the ~/local/ directory will be also transferred to the remote site. - Note: all other MKPs and files below ~/local/ on the remote site will - be removed.' - example: true - required: - - user_sync - SiteConfigAttributes: - type: object - properties: - basic_settings: - $ref: '#/components/schemas/BasicSettingsAttributes' - status_connection: - $ref: '#/components/schemas/StatusConnectionAttributes1' - configuration_connection: - $ref: '#/components/schemas/ConfigurationConnectionAttributes1' - secret: - type: string - description: The shared secret used by the central site to authenticate - with the remote site for configuring Checkmk. - example: secret - SiteConnectionResponse: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: site_connection - description: The domain type of the object. - id: - type: string - description: The unique identifier for this domain-object type. - title: - type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: The configuration attributes of a site. - example: - basic_settings: - alias: Die remote site 1 - site_id: site_id_1 - status_connection: - connection: - socket_type: tcp - host: 123.124.1.3 - port: 1253 - encrypted: true - verify: false - proxy: - use_livestatus_daemon: with_proxy - global_settings: false - params: - channels: 15 - heartbeat: - interval: 12 - timeout: 3.0 - channel_timeout: 3.5 - query_timeout: 120.2 - connect_retry: 4.6 - cache: true - tcp: - port: 6560 - only_from: - - 192.168.1.1 - tls: false - connect_timeout: 2 - persistent_connection: false - url_prefix: /heute_remote_1/ - status_host: - status_host_set: disabled - disable_in_status_gui: false - configuration_connection: - enable_replication: true - url_of_remote_site: http://localhost/heute_remote_site_id_1/check_mk/ - disable_remote_configuration: true - ignore_tls_errors: false - direct_login_to_web_gui_allowed: true - user_sync: - sync_with_ldap_connections: all - replicate_event_console: true - replicate_extensions: true - allOf: - - $ref: '#/components/schemas/SiteConfigAttributes' - required: - - links - BasicSettingsAttributesUpdate: - type: object - properties: - alias: - type: string - description: The alias of the site. - example: Site Alias - site_id: - type: string - description: The site ID. - example: prod - required: - - alias - - site_id - SiteConfigAttributesUpdate: - type: object - properties: - status_connection: - $ref: '#/components/schemas/StatusConnectionAttributes' - configuration_connection: - $ref: '#/components/schemas/ConfigurationConnectionAttributes' - secret: - type: string - description: The shared secret used by the central site to authenticate - with the remote site for configuring Checkmk. - example: secret - basic_settings: - $ref: '#/components/schemas/BasicSettingsAttributesUpdate' - required: - - basic_settings - - configuration_connection - - status_connection - SiteConnectionRequestUpdate: - type: object - properties: - site_config: - description: A site's connection. - example: - basic_settings: - alias: Die remote site 1 - site_id: site_id_1 - status_connection: - connection: - socket_type: tcp - host: 123.124.1.3 - port: 1253 - encrypted: true - verify: false - proxy: - use_livestatus_daemon: with_proxy - global_settings: false - params: - channels: 15 - heartbeat: - interval: 12 - timeout: 3.0 - channel_timeout: 3.5 - query_timeout: 120.2 - connect_retry: 4.6 - cache: true - tcp: - port: 6560 - only_from: - - 192.168.1.1 - tls: false - connect_timeout: 2 - persistent_connection: false - url_prefix: /heute_remote_1/ - status_host: - status_host_set: disabled - disable_in_status_gui: false - configuration_connection: - enable_replication: true - url_of_remote_site: http://localhost/heute_remote_site_id_1/check_mk/ - disable_remote_configuration: true - ignore_tls_errors: false - direct_login_to_web_gui_allowed: true - user_sync: - sync_with_ldap_connections: all - replicate_event_console: true - replicate_extensions: true - allOf: - - $ref: '#/components/schemas/SiteConfigAttributesUpdate' - required: - - site_config - SiteConnectionResponseCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: - type: string - default: all - description: The name of this collection. - domainType: - default: site_connection - description: The domain type of the objects in the collection. - title: - type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of site configuration objects. - example: - - links: [] - domainType: site_connection - id: prod - title: Site Alias - members: {} - extensions: - basic_settings: - alias: Die remote site 1 - site_id: site_id_1 - status_connection: - connection: - socket_type: tcp - host: 123.124.1.3 - port: 1253 - encrypted: true - verify: false - proxy: - use_livestatus_daemon: with_proxy - global_settings: false - params: - channels: 15 - heartbeat: - interval: 12 - timeout: 3.0 - channel_timeout: 3.5 - query_timeout: 120.2 - connect_retry: 4.6 - cache: true - tcp: - port: 6560 - only_from: - - 192.168.1.1 - tls: false - connect_timeout: 2 - persistent_connection: false - url_prefix: /heute_remote_1/ - status_host: - status_host_set: disabled - disable_in_status_gui: false - configuration_connection: - enable_replication: true - url_of_remote_site: http://localhost/heute_remote_site_id_1/check_mk/ - disable_remote_configuration: true - ignore_tls_errors: false - direct_login_to_web_gui_allowed: true - user_sync: - sync_with_ldap_connections: all - replicate_event_console: true - replicate_extensions: true - items: - $ref: '#/components/schemas/SiteConnectionResponse' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - SiteLoginRequest: - type: object - properties: - username: - type: string - description: An administrative user's username. - example: cmkadmin - password: - type: string - description: The password for the username given - example: password - required: - - password - - username - TimeRange1: - type: object - properties: - start: - type: string - description: The start time of the period's time range - example: '14:00:00' - format: time - end: - type: string - description: The end time of the period's time range - example: '16:00:00' - format: time - required: - - end - - start - TimeRangeActive: - type: object - properties: - day: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkCreateHost' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/BulkHostActionWithFailedHosts' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostConfigCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Bulk create hosts + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_config/actions/bulk-create/invoke\"\ + ,\n params={ # goes into query string\n \"bake_agent\": False,\ + \ # Tries to bake the agents for the just created hosts.\n },\n headers={\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n json={\n\ + \ 'entries': [{\n 'host_name': 'example.com',\n \ + \ 'folder': '/',\n 'attributes': {}\n }]\n },\n\ + )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"bake_agent\": False, # Tries to bake the agents for the just created\ + \ hosts.\n})\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/host_config/actions/bulk-create/invoke?{query_string}\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'entries': [{\n 'host_name': 'example.com',\n \ + \ 'folder': '/',\n 'attributes': {}\n }]\n }).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/host_config/actions/bulk-create/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='[{'host_name':\ + \ 'example.com', 'folder': '/', 'attributes': {}}]' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --header \"Content-Type:\ + \ application/json\" \\\n --data '{\n \"entries\": [\n \ + \ {\n \"attributes\": {},\n \"folder\":\ + \ \"/\",\n \"host_name\": \"example.com\"\n }\n\ + \ ]\n }' \\\n \"$API_URL/domain-types/host_config/actions/bulk-create/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/host_config/{host_name}/actions/move/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.manage_hosts`: Add hosts to the monitoring and remove hosts\ + \ from the monitoring. Please also add the permission Modify existing hosts.\n\ + \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ + \ on folders can only be done by users that are members of one of the folders\ + \ contact groups. This permission grants full access to all folders and hosts.\n\ + \ * Optionally:\n * Any of:\n * `bi.see_all`: With this permission\ + \ set, the BI aggregation rules are applied to all hosts and services - not\ + \ only those the user is a contact for. If you remove this permissions then\ + \ the user will see incomplete aggregation trees with status based only on\ + \ those items.\n * `general.see_all`: See all objects regardless of\ + \ contacts and contact groups. If combined with 'perform commands' then commands\ + \ may be done on all objects.\n * `mkeventd.seeall`: If a user lacks\ + \ this permission then he/she can see only those events that originate from\ + \ a host that he/she is a contact for.\n * `wato.edit_hosts`: Modify the\ + \ properties of existing hosts. Please note: for the management of services\ + \ (inventory) there is a separate permission (see below)\n * `wato.move_hosts`:\ + \ Move existing hosts to other folders. Please also add the permission Modify\ + \ existing hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.move + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - default: all - description: The day for which time ranges are to be specified. The 'all' - option allows to specify time ranges for all days. - enum: - - all - - monday - - tuesday - - wednesday - - thursday - - friday - - saturday - - sunday - time_ranges: - type: array - default: - - start: 00:00:00 - end: '23:59:00' - example: - - start: '13:00:00' - end: '19:00:00' - items: - $ref: '#/components/schemas/TimeRange1' - TimePeriodException: - type: object - properties: - date: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The date of the time period exception.8601 profile - example: '2020-01-01' - format: date - time_ranges: - type: array - default: [] - example: - - start: '14:00' - end: '18:00' - items: - $ref: '#/components/schemas/TimeRange1' - required: - - date - CreateTimePeriod: - type: object - properties: - name: + - description: A hostname. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: A unique name for the time period. - example: first - pattern: ^[-a-z0-9A-Z_]+\Z - alias: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MoveHost' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostConfig' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Move a host to another folder + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/host_config/example.com/actions/move/invoke\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={'target_folder': '%2Fmy%2Ffine%2Ffolder'},\n\ + )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_config/example.com/actions/move/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ + \ the, to be modified, object's ETag header.\n \"Content-Type\":\ + \ 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({'target_folder':\ + \ '%2Fmy%2Ffine%2Ffolder'}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/objects/host_config/example.com/actions/move/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n target_folder='%2Fmy%2Ffine%2Ffolder' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"target_folder\": \"%2Fmy%2Ffine%2Ffolder\"\n }' \\\n\ + \ \"$API_URL/objects/host_config/example.com/actions/move/invoke\")\n\ + \nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/host_config/actions/bulk-delete/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.manage_hosts`: Add hosts to the monitoring and remove hosts\ + \ from the monitoring. Please also add the permission Modify existing hosts.\n\ + \ * Optionally:\n * `wato.all_folders`: Without this permission, operations\ + \ on folders can only be done by users that are members of one of the folders\ + \ contact groups. This permission grants full access to all folders and hosts.\n\ + \ * Optionally:\n * Any of:\n * `bi.see_all`: With this permission\ + \ set, the BI aggregation rules are applied to all hosts and services - not\ + \ only those the user is a contact for. If you remove this permissions then\ + \ the user will see incomplete aggregation trees with status based only on\ + \ those items.\n * `general.see_all`: See all objects regardless of\ + \ contacts and contact groups. If combined with 'perform commands' then commands\ + \ may be done on all objects.\n * `mkeventd.seeall`: If a user lacks\ + \ this permission then he/she can see only those events that originate from\ + \ a host that he/she is a contact for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_config.bulk_delete + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: An alias for the time period. - example: alias - active_time_ranges: - type: array - description: The list of active time ranges. - example: - - day: monday - time_ranges: - - start: '12:00:00' - end: '14:00:00' - items: - $ref: '#/components/schemas/TimeRangeActive' - exceptions: - type: array - description: A list of additional time ranges to be added. - example: - - date: '2020-01-01' - time_ranges: - - start: '14:00:00' - end: '18:00:00' - items: - $ref: '#/components/schemas/TimePeriodException' - exclude: - type: array - description: A list of time period names whose periods are excluded. - example: - - name - items: - type: string - description: A unique name for the time period. - example: time_name - pattern: ^[-a-z0-9A-Z_]+\Z - required: - - active_time_ranges - - alias - - name - ConcreteTimeRange: - type: object - properties: - start: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkDeleteHost' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Bulk delete hosts + tags: + - Hosts + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_config/actions/bulk-delete/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={'entries': ['example', 'sample']},\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/host_config/actions/bulk-delete/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({'entries':\ + \ ['example', 'sample']}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/host_config/actions/bulk-delete/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='['example',\ + \ 'sample']' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n \"example\",\n\ + \ \"sample\"\n ]\n }' \\\n \"$API_URL/domain-types/host_config/actions/bulk-delete/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/host_group_config/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.groups`:\ + \ Access to the modules for managing host and service groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.list_groups + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LinkedValueDomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all host groups + tags: + - Host groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/host_group_config/collections/all\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/host_group_config/collections/all\",\n \ + \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/host_group_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/domain-types/host_group_config/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.groups`: Access to the modules for managing host and service\ + \ groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.create + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The hour of the time period. - example: '14:00' - format: time - end: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InputHostGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostGroup' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Create a host group + tags: + - Host groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_group_config/collections/all\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={'name': 'windows', 'alias': 'Windows Servers'},\n)\n\ + if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/host_group_config/collections/all\",\n \ + \ method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({'name':\ + \ 'windows', 'alias': 'Windows Servers'}).encode('utf-8'),\n)\nresponse\ + \ = urllib.request.urlopen(request)\nif response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/host_group_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n name='windows'\ + \ \\\n alias='Windows Servers' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"alias\": \"Windows Servers\",\n \ + \ \"name\": \"windows\"\n }' \\\n \"$API_URL/domain-types/host_group_config/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/host_group_config/{name}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.groups`: Access to the modules for managing host and service\ + \ groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.delete + parameters: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - description: The hour of the time period. - example: '14:00' - format: time - ConcreteTimeRangeActive: - type: object - properties: - day: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete a host group + tags: + - Host groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/host_group_config/pathname\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_group_config/pathname\",\n method=\"DELETE\"\ + ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/host_group_config/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/host_group_config/pathname\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.groups`:\ + \ Access to the modules for managing host and service groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.get + parameters: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - description: The day for which the time ranges are specified - enum: - - monday - - tuesday - - wednesday - - thursday - - friday - - saturday - - sunday - time_ranges: - type: array - items: - $ref: '#/components/schemas/ConcreteTimeRange' - ConcreteTimePeriodException: - type: object - properties: - date: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostGroup' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Show a host group + tags: + - Host groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host_group_config/pathname\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_group_config/pathname\",\n method=\"GET\"\ + ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/host_group_config/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/host_group_config/pathname\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.groups`: Access to the modules for managing host and service\ + \ groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.update + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: The date of the time period exception.8601 profile - example: '2020-01-01' - format: date - time_ranges: - type: array - example: '[{''start'': ''14:00'', ''end'': ''18:00''}]' - items: - $ref: '#/components/schemas/ConcreteTimeRange' - TimePeriodAttrsResponse: - type: object - properties: - alias: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The alias of the time period - example: alias - active_time_ranges: - type: array - description: The days for which time ranges were specified - example: - day: all - time_ranges: - - start: '12:00' - end: '14:00' - items: - $ref: '#/components/schemas/ConcreteTimeRangeActive' - exceptions: - type: array - description: Specific day exclusions with their list of time ranges - example: - - date: '2020-01-01' - time_ranges: - - start: '14:00' - end: '18:00' - items: - $ref: '#/components/schemas/ConcreteTimePeriodException' - exclude: - type: array - description: The collection of time period names whose periods are excluded - example: - - time_period_1 - - time_period_2 - - time_period_3 - items: - type: string - description: Name of excluding time period - TimePeriodResponse: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: time_period - description: The domain type of the object. - id: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - description: The unique identifier for this time period. - example: time_period_name - title: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostGroup' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Update a host group + tags: + - Host groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_group_config/pathname\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={'alias': 'Example\ + \ Group'},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_group_config/pathname\",\n method=\"PUT\"\ + ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ + a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ + \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n data=json.dumps({'alias': 'Example Group'}).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/host_group_config/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n alias='Example Group' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"alias\": \"Example Group\"\n }' \\\n \"$API_URL/objects/host_group_config/pathname\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/host_group_config/actions/bulk-update/invoke: + put: + description: "Please be aware that when doing bulk updates, it is not possible\ + \ to prevent the\n[Updating Values](\"lost update problem\"), which is normally\ + \ prevented by the ETag locking\nmechanism. Use at your own riskThis endpoint\ + \ requires the following permissions: \n * All of:\n * `wato.edit`: This\ + \ permission is needed in order to make any changes or perform any actions\ + \ at all. Without this permission, the user is only able to view data, and\ + \ that only in modules he has explicit permissions for.\n * `wato.groups`:\ + \ Access to the modules for managing host and service groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.bulk_update + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The time period name. - example: time_period_alias. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: The time period attributes. - example: &id044 - alias: holidays - active_time_ranges: - - day: monday - time_ranges: - - start: '12:00' - end: '15:00' - exceptions: - - date: '2023-01-01' - time_ranges: - - start: '12:30' - end: '13:30' - exclude: - - time_period_1 - - time_period_2 - - time_period_3 - allOf: - - $ref: '#/components/schemas/TimePeriodAttrsResponse' - required: - - links - TimePeriodResponseCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkUpdateHostGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Bulk update host groups + tags: + - Host groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/domain-types/host_group_config/actions/bulk-update/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'entries': [{\n 'name': 'windows',\n\ + \ 'attributes': {\n 'alias': 'Windows Servers'\n\ + \ }\n }]\n },\n)\nif resp.status_code == 200:\n \ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/host_group_config/actions/bulk-update/invoke\"\ + ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'entries': [{\n 'name': 'windows',\n 'attributes':\ + \ {\n 'alias': 'Windows Servers'\n }\n \ + \ }]\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/domain-types/host_group_config/actions/bulk-update/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='[{'name':\ + \ 'windows', 'attributes': {'alias': 'Windows Servers'}}]' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n {\n \ + \ \"attributes\": {\n \"alias\": \"Windows Servers\"\n\ + \ },\n \"name\": \"windows\"\n }\n\ + \ ]\n }' \\\n \"$API_URL/domain-types/host_group_config/actions/bulk-update/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/host_group_config/actions/bulk-create/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.groups`: Access to the modules for managing host and service\ + \ groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.bulk_create + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - default: all - description: The name of this collection. - domainType: - default: time_period - description: The domain type of the objects in the collection. - title: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkInputHostGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Bulk create host groups + tags: + - Host groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_group_config/actions/bulk-create/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'entries': [{\n 'name': 'windows',\n\ + \ 'alias': 'Windows Servers'\n }]\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/host_group_config/actions/bulk-create/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'entries': [{\n 'name': 'windows',\n 'alias':\ + \ 'Windows Servers'\n }]\n }).encode('utf-8'),\n)\nresponse =\ + \ urllib.request.urlopen(request)\nif response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/host_group_config/actions/bulk-create/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='[{'name':\ + \ 'windows', 'alias': 'Windows Servers'}]' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n {\n \ + \ \"alias\": \"Windows Servers\",\n \"name\": \"windows\"\ + \n }\n ]\n }' \\\n \"$API_URL/domain-types/host_group_config/actions/bulk-create/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/host_group_config/actions/bulk-delete/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.groups`: Access to the modules for managing host and service\ + \ groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_group_config.bulk_delete + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of time period objects. - example: - - links: [] - domainType: time_period - id: time_period - members: {} - extensions: *id044 - items: - $ref: '#/components/schemas/TimePeriodResponse' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - UpdateTimePeriod: - type: object - properties: - alias: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkDeleteHostGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Bulk delete host groups + tags: + - Host groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_group_config/actions/bulk-delete/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={'entries': ['windows', 'panels']},\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/host_group_config/actions/bulk-delete/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({'entries':\ + \ ['windows', 'panels']}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/host_group_config/actions/bulk-delete/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='['windows',\ + \ 'panels']' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n \"windows\",\n\ + \ \"panels\"\n ]\n }' \\\n \"$API_URL/domain-types/host_group_config/actions/bulk-delete/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/host_config_internal/{host_name}: + get: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * `wato.see_all_folders`: Users without this permissions can only see\ + \ folders with a contact group they are in.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_internal.show_host + parameters: + - description: A hostname. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: An alias for the time period - example: new_alias - active_time_ranges: - type: array - description: The list of active time ranges which replaces the existing - list of time ranges - example: - - day: monday - time_ranges: - - start: '12:00:00' - end: '14:00:00' - items: - $ref: '#/components/schemas/TimeRangeActive' - exceptions: - type: array - description: A list of additional time ranges to be added. - example: - - date: '2020-01-01' - time_ranges: - - start: '14:00:00' - end: '18:00:00' - items: - $ref: '#/components/schemas/TimePeriodException' - exclude: - type: array - description: A list of time period names whose periods are excluded. - example: - - time_name - items: - type: string - description: A unique name for the time period. - example: time_name - pattern: ^[-a-z0-9A-Z_]+\Z - AuthPassword: - type: object - properties: - password: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '401': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unauthorized: You do not have read access to this host.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostConfigSchemaInternal' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show a host + tags: + - Hosts (internal) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host_config_internal/example.com\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_config_internal/example.com\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/host_config_internal/example.com\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/host_config_internal/example.com\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/host_config_internal/{host_name}/actions/link_uuid/invoke: + put: + description: "\n\nThis endpoint requires the following permissions: \n * Any\ + \ of:\n * `wato.all_folders`: Without this permission, operations on folders\ + \ can only be done by users that are members of one of the folders contact\ + \ groups. This permission grants full access to all folders and hosts.\n \ + \ * `wato.edit_hosts`: Modify the properties of existing hosts. Please note:\ + \ for the management of services (inventory) there is a separate permission\ + \ (see below)\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_internal.link_with_uuid + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The password for login - example: password - minLength: 1 - auth_type: + - description: A hostname. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: The authentication type - enum: &id045 - - automation - - password - example: password - enforce_password_change: - type: boolean + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LinkHostUUID' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '401': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unauthorized: You do not have the permissions to edit this + host.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Link a host to a UUID + tags: + - Hosts (internal) + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_config_internal/example.com/actions/link_uuid/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={'uuid': '34e4c967-1591-4883-8cdf-0e335b09618d'},\n)\n\ + if resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_config_internal/example.com/actions/link_uuid/invoke\"\ + ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({'uuid':\ + \ '34e4c967-1591-4883-8cdf-0e335b09618d'}).encode('utf-8'),\n)\nresponse\ + \ = urllib.request.urlopen(request)\nif response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/host_config_internal/example.com/actions/link_uuid/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n uuid='34e4c967-1591-4883-8cdf-0e335b09618d'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"uuid\": \"34e4c967-1591-4883-8cdf-0e335b09618d\"\ + \n }' \\\n \"$API_URL/objects/host_config_internal/example.com/actions/link_uuid/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/host_tag_group/{name}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.hosttags`: Create, remove and edit tags. Removing tags\ + \ also might remove rules, so this permission should not be available to normal\ + \ users.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ + \ operations on folders can only be done by users that are members of one\ + \ of the folders contact groups. This permission grants full access to all\ + \ folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_tag.delete_host_tag_group + parameters: + - description: The host tag group can still be in use. Setting repair to True + gives permission to automatically remove the tag from the affected hosts. + in: query + name: repair + required: false + schema: default: false - description: If set to True, the user will be forced to change his password - on the next login or access. Defaults to False example: false - AuthSecret: - type: object - properties: - secret: + type: boolean + - description: The name of the host tag group + in: path + name: name + required: true + schema: + example: datasource + pattern: '[a-zA-Z_]+[-0-9a-zA-Z_]*' type: string - description: For accounts used by automation processes (such as fetching - data from views for further procession). This is the automation secret - example: DEYQEQQPYCFFBYH@AVMC - auth_type: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '405': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Method Not Allowed: Method not allowed: This request is only + allowed with other HTTP methods' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete a host tag group + tags: + - Host tag groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/host_tag_group/datasource\"\ + ,\n params={ # goes into query string\n \"repair\": False, #\ + \ The host tag group can still be in use.\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"repair\": False, # The host tag group can still be in use.\n})\n\ + \nrequest = urllib.request.Request(\n f\"{API_URL}/objects/host_tag_group/datasource?{query_string}\"\ + ,\n method=\"DELETE\",\n headers={\n \"Authorization\": f\"\ + Bearer {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\"\ + ,\n },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/host_tag_group/datasource\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request DELETE \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n \"$API_URL/objects/host_tag_group/datasource\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.hosttags`: Create, remove and edit tags. Removing tags also\ + \ might remove rules, so this permission should not be available to normal\ + \ users.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ + \ operations on folders can only be done by users that are members of one\ + \ of the folders contact groups. This permission grants full access to all\ + \ folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_tag.show_host_tag_group + parameters: + - description: The name of the host tag group + in: path + name: name + required: true + schema: + example: datasource + pattern: '[a-zA-Z_]+[-0-9a-zA-Z_]*' type: string - description: The authentication type - enum: *id045 - example: password - AuthOption: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/AuthPassword' - - $ref: '#/components/schemas/AuthSecret' - discriminator: - propertyName: auth_type - mapping: - password: '#/components/schemas/AuthPassword' - automation: '#/components/schemas/AuthSecret' - UserContactOption: - type: object - properties: - email: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConcreteHostTagGroup' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Show a host tag group + tags: + - Host tag groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host_tag_group/datasource\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_tag_group/datasource\",\n method=\"GET\"\ + ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/host_tag_group/datasource\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/host_tag_group/datasource\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.hosttags`: Create, remove and edit tags. Removing tags\ + \ also might remove rules, so this permission should not be available to normal\ + \ users.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ + \ operations on folders can only be done by users that are members of one\ + \ of the folders contact groups. This permission grants full access to all\ + \ folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_tag.update_host_tag_group + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: The mail address of the user. Required if the user is a monitoringcontact - and receives notifications via mail. - example: user@example.com - fallback_contact: - type: boolean - default: false - description: In case none of your notification rules handles a certain event - a notification will be sent to the specified email - example: false - required: - - email - IdleOption: - type: object - properties: - option: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: Specify if the idle timeout should use the global configuration, - be disabled or use an individual duration - enum: - - global - - disable - - individual - example: false - duration: - type: integer - default: 3600 - description: The duration in seconds of the individual idle timeout if individual - is selected as idle timeout option. - example: 60 - required: - - option - CustomTimeRange: - type: object - properties: - start_time: + - description: The name of the host tag group + in: path + name: name + required: true + schema: + example: datasource + pattern: '[a-zA-Z_]+[-0-9a-zA-Z_]*' type: string - format: iso8601 - description: The start datetime of the time period. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - end_time: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateHostTagGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '401': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unauthorized: The user is not authorized to do this request.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '405': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Method Not Allowed: Method not allowed: This request is only + allowed with other HTTP methods' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConcreteHostTagGroup' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Update a host tag group + tags: + - Host tag groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host_tag_group/datasource\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={\n 'title':\ + \ 'Kubernetes',\n 'topic': 'Data Sources',\n 'help': 'Kubernetes\ + \ Pods',\n 'tags': [{\n 'ident': 'pod',\n 'title':\ + \ 'Pod'\n }],\n 'repair': False\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host_tag_group/datasource\",\n method=\"PUT\"\ + ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ + a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ + \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n data=json.dumps({\n 'title': 'Kubernetes',\n \ + \ 'topic': 'Data Sources',\n 'help': 'Kubernetes Pods',\n \ + \ 'tags': [{\n 'ident': 'pod',\n 'title': 'Pod'\n\ + \ }],\n 'repair': False\n }).encode('utf-8'),\n)\nresponse\ + \ = urllib.request.urlopen(request)\nif response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/host_tag_group/datasource\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n title='Kubernetes' \\\n topic='Data Sources' \\\n help='Kubernetes\ + \ Pods' \\\n tags='[{'ident': 'pod', 'title': 'Pod'}]' \\\n repair='False'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"help\": \"Kubernetes Pods\",\n \"repair\": false,\n\ + \ \"tags\": [\n {\n \"ident\": \"pod\"\ + ,\n \"title\": \"Pod\"\n }\n ],\n \ + \ \"title\": \"Kubernetes\",\n \"topic\": \"Data Sources\"\n\ + \ }' \\\n \"$API_URL/objects/host_tag_group/datasource\")\n\n\ + resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ + ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/host_tag_group/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.hosttags`: Create, remove and edit tags. Removing tags also\ + \ might remove rules, so this permission should not be available to normal\ + \ users.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ + \ operations on folders can only be done by users that are members of one\ + \ of the folders contact groups. This permission grants full access to all\ + \ folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_tag.list_host_tag_groups + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HostTagGroupCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all host tag groups + tags: + - Host tag groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/host_tag_group/collections/all\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/host_tag_group/collections/all\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/host_tag_group/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/domain-types/host_tag_group/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.hosttags`: Create, remove and edit tags. Removing tags\ + \ also might remove rules, so this permission should not be available to normal\ + \ users.\n * Optionally:\n * `wato.all_folders`: Without this permission,\ + \ operations on folders can only be done by users that are members of one\ + \ of the folders contact groups. This permission grants full access to all\ + \ folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.host_tag.create_host_tag_group + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - format: iso8601 - description: The end datetime of the time period. The format has to conform - to the ISO 8601 profile - example: '2017-07-21T17:32:28Z' - required: - - end_time - - start_time - DisabledNotifications: - type: object - properties: - disable: - type: boolean - description: Option if all notifications should be temporarily disabled - example: false - timerange: - description: A custom timerange during which notifications are disabled - example: - start_time: '2017-07-21T17:32:28Z' - end_time: '2017-07-21T18:32:28Z' - allOf: - - $ref: '#/components/schemas/CustomTimeRange' - UserInterfaceAttributes: - type: object - properties: - interface_theme: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InputHostTagGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Create a host tag group + tags: + - Host tag groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/host_tag_group/collections/all\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'ident': 'group_id',\n 'title': 'Kubernetes',\n\ + \ 'topic': 'Data Sources',\n 'help': 'Kubernetes Pods',\n\ + \ 'tags': [{\n 'ident': 'pod',\n 'title': 'Pod'\n\ + \ }]\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/host_tag_group/collections/all\",\n method=\"\ + POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({\n \ + \ 'ident': 'group_id',\n 'title': 'Kubernetes',\n 'topic':\ + \ 'Data Sources',\n 'help': 'Kubernetes Pods',\n 'tags': [{\n\ + \ 'ident': 'pod',\n 'title': 'Pod'\n }]\n \ + \ }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/host_tag_group/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n ident='group_id'\ + \ \\\n title='Kubernetes' \\\n topic='Data Sources' \\\n help='Kubernetes\ + \ Pods' \\\n tags='[{'ident': 'pod', 'title': 'Pod'}]' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"help\": \"Kubernetes Pods\",\n \ + \ \"ident\": \"group_id\",\n \"tags\": [\n {\n \ + \ \"ident\": \"pod\",\n \"title\": \"Pod\"\n \ + \ }\n ],\n \"title\": \"Kubernetes\",\n \ + \ \"topic\": \"Data Sources\"\n }' \\\n \"$API_URL/domain-types/host_tag_group/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/password/{name}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.passwords`: This permission is needed for the module Passwords.\n\ + \ * Optionally:\n * `wato.edit_all_passwords`: Without this permission,\ + \ users can only edit passwords which are shared with a contact group they\ + \ are member of. This permission grants full access to all passwords.\n" + operationId: cmk.gui.plugins.openapi.endpoints.password.delete_password + parameters: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - default: default - description: The theme of the interface - enum: - - default - - dark - - light - sidebar_position: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete a password + tags: + - Passwords + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/password/pathname\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/password/pathname\",\n method=\"DELETE\",\n\ + \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/password/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/password/pathname\")\n\n\ + resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ + ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.passwords`: This permission is needed for the module Passwords.\n\ + \ * Optionally:\n * `wato.edit_all_passwords`: Without this permission,\ + \ users can only edit passwords which are shared with a contact group they\ + \ are member of. This permission grants full access to all passwords.\n" + operationId: cmk.gui.plugins.openapi.endpoints.password.show_password + parameters: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - default: right - description: The position of the sidebar - enum: - - left - - right - navigation_bar_icons: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show a password + tags: + - Passwords + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/password/pathname\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/password/pathname\",\n method=\"GET\",\n \ + \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/password/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/password/pathname\")\n\n\ + resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ + ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.passwords`: This permission is needed for the module Passwords.\n\ + \ * Optionally:\n * `wato.edit_all_passwords`: Without this permission,\ + \ users can only edit passwords which are shared with a contact group they\ + \ are member of. This permission grants full access to all passwords.\n" + operationId: cmk.gui.plugins.openapi.endpoints.password.update_password + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - default: hide - description: This option decides if icons in the navigation bar should show/hide - the respective titles - enum: - - hide - - show - mega_menu_icons: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - default: topic - description: This option decides if colored icon should be shown foe every - entry in the mega menus or alternatively only for the headlines (the 'topics') - enum: - - topic - - entry - show_mode: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePassword' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Update a password + tags: + - Passwords + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/password/pathname\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={\n 'title':\ + \ 'Kubernetes login',\n 'comment': 'Kommentar',\n 'documentation_url':\ + \ 'localhost',\n 'password': 'password',\n 'owner': 'admin',\n\ + \ 'shared': ['all']\n },\n)\nif resp.status_code == 200:\n \ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/password/pathname\",\n method=\"PUT\",\n \ + \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ + a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ + \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n data=json.dumps({\n 'title': 'Kubernetes login',\n \ + \ 'comment': 'Kommentar',\n 'documentation_url': 'localhost',\n\ + \ 'password': 'password',\n 'owner': 'admin',\n 'shared':\ + \ ['all']\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/password/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n title='Kubernetes login' \\\n comment='Kommentar' \\\n documentation_url='localhost'\ + \ \\\n password='password' \\\n owner='admin' \\\n shared='['all']'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"comment\": \"Kommentar\",\n \"documentation_url\"\ + : \"localhost\",\n \"owner\": \"admin\",\n \"password\"\ + : \"password\",\n \"shared\": [\n \"all\"\n \ + \ ],\n \"title\": \"Kubernetes login\"\n }' \\\n \"\ + $API_URL/objects/password/pathname\")\n\nresp=$( echo \"${out}\" | grep\ + \ -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk -F\"=\" '/^xxx-status_code/\ + \ {print $2}')\n\n# For indentation, please install 'jq' (JSON query tool)\n\ + echo \"$resp\" | jq\n# echo \"$resp\"\n\nif [[ $code -lt 400 ]]; then\n\ + \ echo \"OK\"\n exit 0\nelse\n echo \"Request error\"\n exit\ + \ 1\nfi" + /domain-types/password/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.passwords`: This permission is needed for the module Passwords.\n\ + \ * Optionally:\n * `wato.edit_all_passwords`: Without this permission,\ + \ users can only edit passwords which are shared with a contact group they\ + \ are member of. This permission grants full access to all passwords.\n" + operationId: cmk.gui.plugins.openapi.endpoints.password.list_passwords + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all passwords + tags: + - Passwords + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/password/collections/all\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/password/collections/all\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/password/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/domain-types/password/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.passwords`: This permission is needed for the module Passwords.\n\ + \ * Optionally:\n * `wato.edit_all_passwords`: Without this permission,\ + \ users can only edit passwords which are shared with a contact group they\ + \ are member of. This permission grants full access to all passwords.\n" + operationId: cmk.gui.plugins.openapi.endpoints.password.create_password + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - default: default - description: This option decides what show mode should be used for unvisited - menus. Alternatively, this option can also be used to enforce show more - removing the three dots for all menus. - enum: - - default - - default_show_less - - default_show_more - - enforce_show_more - CreateUser: - type: object - properties: - username: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InputPassword' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Create a password + tags: + - Passwords + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/password/collections/all\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'ident': 'pass',\n 'title': 'Kubernetes\ + \ login',\n 'comment': 'Kommentar',\n 'documentation_url':\ + \ 'localhost',\n 'password': 'password',\n 'owner': 'admin',\n\ + \ 'shared': ['all']\n },\n)\nif resp.status_code == 200:\n \ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/password/collections/all\",\n method=\"\ + POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({\n \ + \ 'ident': 'pass',\n 'title': 'Kubernetes login',\n 'comment':\ + \ 'Kommentar',\n 'documentation_url': 'localhost',\n 'password':\ + \ 'password',\n 'owner': 'admin',\n 'shared': ['all']\n \ + \ }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/password/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n ident='pass'\ + \ \\\n title='Kubernetes login' \\\n comment='Kommentar' \\\n documentation_url='localhost'\ + \ \\\n password='password' \\\n owner='admin' \\\n shared='['all']'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"comment\": \"Kommentar\",\n \"\ + documentation_url\": \"localhost\",\n \"ident\": \"pass\",\n \ + \ \"owner\": \"admin\",\n \"password\": \"password\",\n\ + \ \"shared\": [\n \"all\"\n ],\n \"\ + title\": \"Kubernetes login\"\n }' \\\n \"$API_URL/domain-types/password/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/rule/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.rulesets`: Access to the module for managing Check_MK rules.\ + \ Please note that a user can only manage rules in folders he has permissions\ + \ to. \n * Optionally:\n * `wato.all_folders`: Without this permission,\ + \ operations on folders can only be done by users that are members of one\ + \ of the folders contact groups. This permission grants full access to all\ + \ folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.rule.list_rules + parameters: + - description: The name of the ruleset. + in: query + name: ruleset_name + required: true + schema: + example: host_groups type: string - description: An unique username for the user - example: cmkuser - fullname: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RuleCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: List rules + tags: + - Rules + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/rule/collections/all\"\ + ,\n params={ # goes into query string\n \"ruleset_name\": 'host_groups',\ + \ # (required) The name of the ruleset.\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"ruleset_name\": 'host_groups', # (required) The name of the ruleset.\n\ + })\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/rule/collections/all?{query_string}\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/rule/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n ruleset_name=='host_groups' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --data-urlencode 'ruleset_name=host_groups'\ + \ \\\n \"$API_URL/domain-types/rule/collections/all\")\n\nresp=$( echo\ + \ \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" |\ + \ awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.rulesets`: Access to the module for managing Check_MK rules.\ + \ Please note that a user can only manage rules in folders he has permissions\ + \ to. \n * Optionally:\n * `wato.all_folders`: Without this permission,\ + \ operations on folders can only be done by users that are members of one\ + \ of the folders contact groups. This permission grants full access to all\ + \ folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.rule.create_rule + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The alias or full name of the user - example: Mathias Kettner - auth_option: - description: Authentication option for the user - example: - auth_type: password - password: password - allOf: - - $ref: '#/components/schemas/AuthOption' - disable_login: - type: boolean - default: false - description: The user can be blocked from login but will remain part of - the site. The disabling does not affect notification and alerts. - example: false - contact_options: - description: Contact settings for the user - example: - email: user@example.com - allOf: - - $ref: '#/components/schemas/UserContactOption' - pager_address: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InputRuleObject' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RuleObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Create rule + tags: + - Rules + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/rule/collections/all\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'ruleset': 'host_config',\n 'folder':\ + \ '~router',\n 'properties': {\n 'disabled': False\n \ + \ },\n 'value_raw': '{\"ignore_fs_types\": [\"tmpfs\"]}',\n\ + \ 'conditions': {}\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/rule/collections/all\",\n method=\"POST\"\ + ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"Content-Type\":\ + \ 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({\n \ + \ 'ruleset': 'host_config',\n 'folder': '~router',\n 'properties':\ + \ {\n 'disabled': False\n },\n 'value_raw': '{\"\ + ignore_fs_types\": [\"tmpfs\"]}',\n 'conditions': {}\n }).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/rule/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n ruleset='host_config'\ + \ \\\n folder='~router' \\\n properties='{'disabled': False}' \\\n\ + \ value_raw='{\"ignore_fs_types\": [\"tmpfs\"]}' \\\n conditions='{}'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"conditions\": {},\n \"folder\"\ + : \"~router\",\n \"properties\": {\n \"disabled\": false\n\ + \ },\n \"ruleset\": \"host_config\",\n \"value_raw\"\ + : \"{\\\"ignore_fs_types\\\": [\\\"tmpfs\\\"]}\"\n }' \\\n \"\ + $API_URL/domain-types/rule/collections/all\")\n\nresp=$( echo \"${out}\"\ + \ | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk -F\"=\"\ + \ '/^xxx-status_code/ {print $2}')\n\n# For indentation, please install\ + \ 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\nif [[\ + \ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo \"\ + Request error\"\n exit 1\nfi" + /objects/rule/{rule_id}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.rulesets`: Access to the module for managing Check_MK rules.\ + \ Please note that a user can only manage rules in folders he has permissions\ + \ to. \n * Optionally:\n * `wato.all_folders`: Without this permission,\ + \ operations on folders can only be done by users that are members of one\ + \ of the folders contact groups. This permission grants full access to all\ + \ folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.rule.delete_rule + parameters: + - description: The ID of the rule. + in: path + name: rule_id + required: true + schema: + example: 0a168697-14a2-48d0-9c3c-ca65569a39e2 type: string - default: '' - description: '' - example: '' - idle_timeout: - description: Idle timeout for the user. Per default, the global configuration - is used. - example: - option: global - allOf: - - $ref: '#/components/schemas/IdleOption' - roles: - type: array - description: The list of assigned roles to the user - example: - - user - items: - type: string - description: An existing user role - example: user - authorized_sites: - type: array - default: - - all - description: The names of the sites the user is authorized to handle. - example: - - heute - items: - type: string - contactgroups: - type: array - description: Assign the user to one or multiple contact groups. If no contact - group is specified then no monitoring contact will be created for the - user. - example: - - all - items: - type: string - description: Assign the user to one or multiple contact groups - example: all - disable_notifications: - description: '' - example: - disable: false - allOf: - - $ref: '#/components/schemas/DisabledNotifications' - language: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The rule to be deleted was not found.' + '204': + content: {} + description: 'No Content: Rule was deleted successfully.' + summary: Delete a rule + tags: + - Rules + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\",\n\ + \ method=\"DELETE\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.rulesets`: Access to the module for managing Check_MK rules.\ + \ Please note that a user can only manage rules in folders he has permissions\ + \ to. \n * Optionally:\n * `wato.all_folders`: Without this permission,\ + \ operations on folders can only be done by users that are members of one\ + \ of the folders contact groups. This permission grants full access to all\ + \ folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.rule.show_rule + parameters: + - description: The ID of the rule. + in: path + name: rule_id + required: true + schema: + example: 0a168697-14a2-48d0-9c3c-ca65569a39e2 type: string - description: Configure the language to be used by the user in the user interface. - Omitting this will configure the default language. - enum: - - de - - en - - ro - example: en - temperature_unit: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RuleObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show a rule + tags: + - Rules + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\",\n\ + \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/rule/{rule_id}/actions/move/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.rulesets`: Access to the module for managing Check_MK rules.\ + \ Please note that a user can only manage rules in folders he has permissions\ + \ to. \n * Optionally:\n * `wato.all_folders`: Without this permission,\ + \ operations on folders can only be done by users that are members of one\ + \ of the folders contact groups. This permission grants full access to all\ + \ folders and hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.rule.move_rule_to + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: Configure the temperature unit used for graphs and perfometers. - Omitting this field will configure the default temperature unit. - enum: - - default - - celsius - - fahrenheit - example: celsius - interface_options: - default: - interface_theme: default - sidebar_position: right - navigation_bar_icons: hide - mega_menu_icons: topic - show_mode: default - description: '' - example: - interface_theme: dark - allOf: - - $ref: '#/components/schemas/UserInterfaceAttributes' - required: - - fullname - - username - additionalProperties: true - ConcreteUserContactOption: - type: object - properties: - email: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The mail address of the user. - example: user@example.com - fallback_contact: - type: boolean - description: In case none of the notification rules handle a certain event - a notification will be sent to the specified email - required: - - email - UserIdleOption: - type: object - properties: - option: + - description: The ID of the rule. + in: path + name: rule_id + required: true + schema: + example: 0a168697-14a2-48d0-9c3c-ca65569a39e2 type: string - description: This field indicates if the idle timeout uses the global configuration, - is disabled or uses an individual duration - enum: - - global - - disable - - individual - duration: - type: integer - description: The duration in seconds of the individual idle timeout if individual - is selected as idle timeout option. - example: 3600 - required: - - option - DateTimeRange: - type: object - properties: - start_time: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MoveRuleTo' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RuleObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Move a rule to a specific location + tags: + - Rules + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2/actions/move/invoke\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n # This schema has multiple\ + \ variations. Please refer to\n # the 'Payload' section for details.\n\ + \ json={'position': 'top_of_folder', 'folder': '/'},\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2/actions/move/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"If-Match\": '\"a20ceacf346041dc\"', # (required) The value of\ + \ the, to be modified, object's ETag header.\n \"Content-Type\":\ + \ 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n # This schema has multiple\ + \ variations. Please refer to\n # the 'Payload' section for details.\n\ + \ data=json.dumps({'position': 'top_of_folder', 'folder': '/'}).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\n# This schema has multiple variations. Please\ + \ refer to the\n# 'Payload' section for details.\nhttp POST \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2/actions/move/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n position='top_of_folder' \\\n folder='/' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\n# This schema has multiple variations.\ + \ Please refer to the\n# 'Payload' section for details.\nout=$(\n curl\ + \ \\\n --request POST \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --header \"If-Match:\ + \ \"a20ceacf346041dc\"\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"folder\": \"/\",\n \"position\"\ + : \"top_of_folder\"\n }' \\\n \"$API_URL/objects/rule/0a168697-14a2-48d0-9c3c-ca65569a39e2/actions/move/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/ruleset/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.rulesets`:\ + \ Access to the module for managing Check_MK rules. Please note that a user\ + \ can only manage rules in folders he has permissions to. \n" + operationId: cmk.gui.plugins.openapi.endpoints.ruleset.list_rulesets + parameters: + - description: Search all keys (like `name`, `title`, `help`, etc.) for this + text. Regex allowed. + in: query + name: fulltext + required: false + schema: type: string - format: date-time - description: The start datetime of the time period. The format conforms - to the ISO 8601 profile - example: '2017-07-21T17:32:28+00:00' - end_time: + - description: 'The folder in which to search for rules. + + + Path delimiters can be either `~`, `/` or `\`. Please use the one most appropriate + for your quoting/escaping needs. A good default choice is `~`.' + in: query + name: folder + required: false + schema: + pattern: (?:(?:[~\\\/]|(?:[~\\\/][-_ a-zA-Z0-9.]+)+[~\\\/]?)|[0-9a-fA-F]{32}) type: string - format: iso8601 - description: The end datetime of the time period. The format conforms to - the ISO 8601 profile - example: '2017-07-21T17:32:28+00:00' - required: - - start_time - ConcreteDisabledNotifications: - type: object - properties: - disable: - type: boolean - description: Option if all notifications should be temporarily disabled - timerange: - description: A custom timerange during which notifications are disabled - allOf: - - $ref: '#/components/schemas/DateTimeRange' - AuthOption1: - type: object - properties: - auth_type: + - description: Also show deprecated rulesets. Defaults to False. + in: query + name: deprecated + required: false + schema: type: string - enum: - - password - - automation - - saml2 - - ldap - example: password - enforce_password_change: - type: boolean - description: If set to True, the user will be forced to change his password - on the next login or access. Defaults to False - example: false - ConcreteUserInterfaceAttributes: - type: object - properties: - interface_theme: + - description: Only show used rulesets. Defaults to True. + in: query + name: used + required: false + schema: type: string - description: The theme of the interface - enum: - - default - - dark - - light - example: default - sidebar_position: + - description: The specific group to search for rules in. + in: query + name: group + required: false + schema: type: string - description: The position of the sidebar - enum: - - left - - right - example: right - navigation_bar_icons: + - description: A regex of the name. + in: query + name: name + required: false + schema: type: string - description: This option decides if icons in the navigation bar should show/hide - the respective titles - enum: - - hide - - show - example: hide - mega_menu_icons: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Search rule sets + tags: + - Rulesets + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/ruleset/collections/all\"\ + ,\n params={ # goes into query string\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + })\n\nrequest = urllib.request.Request(\n f\"{API_URL}/domain-types/ruleset/collections/all?{query_string}\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/ruleset/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n \"$API_URL/domain-types/ruleset/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/ruleset/{ruleset_name}: + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.rulesets`:\ + \ Access to the module for managing Check_MK rules. Please note that a user\ + \ can only manage rules in folders he has permissions to. \n" + operationId: cmk.gui.plugins.openapi.endpoints.ruleset.show_ruleset + parameters: + - description: The name of the ruleset. + in: path + name: ruleset_name + required: true + schema: + example: host_groups type: string - description: This option decides if colored icon should be shown foe every - entry in the mega menus or alternatively only for the headlines (the 'topics') - enum: - - topic - - entry - example: topic - show_mode: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Show a ruleset + tags: + - Rulesets + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/ruleset/host_groups\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/ruleset/host_groups\",\n method=\"GET\",\n\ + \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/ruleset/host_groups\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/ruleset/host_groups\")\n\ + \nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/host/{host_name}/actions/show_service/invoke: + get: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * Any of:\n * `general.see_all`: See all objects regardless of contacts\ + \ and contact groups. If combined with 'perform commands' then commands may\ + \ be done on all objects.\n * `bi.see_all`: With this permission set,\ + \ the BI aggregation rules are applied to all hosts and services - not only\ + \ those the user is a contact for. If you remove this permissions then the\ + \ user will see incomplete aggregation trees with status based only on those\ + \ items.\n * `mkeventd.seeall`: If a user lacks this permission then he/she\ + \ can see only those events that originate from a host that he/she is a contact\ + \ for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service.show_service + parameters: + - description: The service description of the selected host + in: query + name: service_description + required: false + schema: + example: Filesystem %boot type: string - description: This option decides what show mode should be used for unvisited - menus. Alternatively, this option can also be used to enforce show more - removing the three dots for all menus. - enum: - - default - - default_show_less - - default_show_more - - enforce_show_more - example: default - BaseUserAttributes: - type: object - properties: - fullname: + - description: A hostname. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: The alias or full name of the user. - disable_login: - type: boolean - description: This field indicates if the user is allowed to login to the - monitoring. - contact_options: - description: Contact settings for the user - allOf: - - $ref: '#/components/schemas/ConcreteUserContactOption' - idle_timeout: - description: Idle timeout for the user. Per default, the global configuration - is used. - example: - option: global - allOf: - - $ref: '#/components/schemas/UserIdleOption' - roles: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show the monitored service of a host + tags: + - Service status + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host/example.com/actions/show_service/invoke\"\ + ,\n params={ # goes into query string\n \"service_description\"\ + : 'Filesystem %boot', # The service description of the selected host\n\ + \ },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"service_description\": 'Filesystem %boot', # The service description\ + \ of the selected host\n})\n\nrequest = urllib.request.Request(\n f\"\ + {API_URL}/objects/host/example.com/actions/show_service/invoke?{query_string}\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/host/example.com/actions/show_service/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n service_description=='Filesystem %boot' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --data-urlencode 'service_description=Filesystem\ + \ %boot' \\\n \"$API_URL/objects/host/example.com/actions/show_service/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/host/{host_name}/collections/services: + get: + description: "This list is filterable by various parameters.This endpoint requires\ + \ the following permissions: \n * Optionally:\n * Any of:\n * `general.see_all`:\ + \ See all objects regardless of contacts and contact groups. If combined with\ + \ 'perform commands' then commands may be done on all objects.\n * `bi.see_all`:\ + \ With this permission set, the BI aggregation rules are applied to all hosts\ + \ and services - not only those the user is a contact for. If you remove this\ + \ permissions then the user will see incomplete aggregation trees with status\ + \ based only on those items.\n * `mkeventd.seeall`: If a user lacks this\ + \ permission then he/she can see only those events that originate from a host\ + \ that he/she is a contact for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service._list_host_services + parameters: + - description: Restrict the query to this particular site. + explode: true + in: query + name: sites + required: false + schema: + items: + type: string type: array - description: The list of assigned roles to the user + style: form + - description: An query expression of the Livestatus 'services' table in nested + dictionary form. If you want to use multiple expressions, nest them with + the AND/OR operators. + in: query + name: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/Expr' + example: '{"op": "=", "left": "host_name", "right": "example.com"}' + - description: The desired columns of the `services` table. If left empty, a + default set of columns is used. + explode: true + in: query + name: columns + required: false + schema: + default: + - host_name + - description + example: &id019 + - host_name + - description items: type: string - authorized_sites: type: array - description: The names of the sites that this user is authorized to handle + style: form + - description: A hostname. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show the monitored services of a host + tags: + - Service status + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/host/example.com/collections/services\"\ + ,\n params={ # goes into query string\n \"query\": '{\"op\":\ + \ \"=\", \"left\": \"host_name\", \"right\": \"example.com\"}', # An query\ + \ expression of the Livestatus 'services' table in nested dictionary form.\n\ + \ \"columns\": ['host_name', 'description'], # The desired columns\ + \ of the `services` table.\n },\n)\nif resp.status_code == 200:\n \ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"query\": '{\"op\": \"=\", \"left\": \"host_name\", \"right\": \"\ + example.com\"}', # An query expression of the Livestatus 'services' table\ + \ in nested dictionary form.\n \"columns\": ['host_name', 'description'],\ + \ # The desired columns of the `services` table.\n})\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host/example.com/collections/services?{query_string}\"\ + ,\n method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/host/example.com/collections/services\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n query=='{\"op\": \"=\", \"left\": \"host_name\"\ + , \"right\": \"example.com\"}' \\\n columns=='['host_name', 'description']'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --data-urlencode 'query={\"\ + op\": \"=\", \"left\": \"host_name\", \"right\": \"example.com\"}' \\\n\ + \ --data-urlencode 'columns=host_name' \\\n --data-urlencode 'columns=description'\ + \ \\\n \"$API_URL/objects/host/example.com/collections/services\")\n\n\ + resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ + ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/service/collections/all: + get: + description: "This list is filterable by various parameters.This endpoint requires\ + \ the following permissions: \n * Optionally:\n * Any of:\n * `general.see_all`:\ + \ See all objects regardless of contacts and contact groups. If combined with\ + \ 'perform commands' then commands may be done on all objects.\n * `bi.see_all`:\ + \ With this permission set, the BI aggregation rules are applied to all hosts\ + \ and services - not only those the user is a contact for. If you remove this\ + \ permissions then the user will see incomplete aggregation trees with status\ + \ based only on those items.\n * `mkeventd.seeall`: If a user lacks this\ + \ permission then he/she can see only those events that originate from a host\ + \ that he/she is a contact for.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service._list_all_services + parameters: + - description: A hostname. + in: query + name: host_name + required: false + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + - description: Restrict the query to this particular site. + explode: true + in: query + name: sites + required: false + schema: items: type: string - contactgroups: type: array - description: The contact groups that this user is a member of + style: form + - description: An query expression of the Livestatus 'services' table in nested + dictionary form. If you want to use multiple expressions, nest them with + the AND/OR operators. + in: query + name: query + required: false + schema: + allOf: + - $ref: '#/components/schemas/Expr' + example: '{"op": "=", "left": "host_name", "right": "example.com"}' + - description: The desired columns of the `services` table. If left empty, a + default set of columns is used. + explode: true + in: query + name: columns + required: false + schema: + default: + - host_name + - description + example: *id019 items: type: string - pager_address: - type: string - description: '' - disable_notifications: - $ref: '#/components/schemas/ConcreteDisabledNotifications' - language: - type: string - description: The language used by the user in the user interface - temperature_unit: - type: string - description: The temperature unit used for graphs and perfometers. - auth_option: - description: Enforce password change attribute for the user - example: - auth_type: password - enforce_password_change: false - allOf: - - $ref: '#/components/schemas/AuthOption1' - interface_options: - $ref: '#/components/schemas/ConcreteUserInterfaceAttributes' - required: - - fullname - CustomUserAttributes: - type: object - properties: {} - additionalProperties: - type: string - description: Each tag is a mapping of string to string - UserObject: - type: object - properties: - links: type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: user_config - description: The domain type of the object. - id: - type: string - description: The unique identifier for this domain-object type. - title: - type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - anyOf: - - $ref: '#/components/schemas/BaseUserAttributes' - - $ref: '#/components/schemas/CustomUserAttributes' - description: The attributes of the user - example: - fullname: John Doe - required: - - links - AuthUpdatePassword: - type: object - properties: - password: + style: form + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all monitored services + tags: + - Service status + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/service/collections/all\"\ + ,\n params={ # goes into query string\n \"host_name\": 'example.com',\ + \ # A hostname.\n \"query\": '{\"op\": \"=\", \"left\": \"host_name\"\ + , \"right\": \"example.com\"}', # An query expression of the Livestatus\ + \ 'services' table in nested dictionary form.\n \"columns\": ['host_name',\ + \ 'description'], # The desired columns of the `services` table.\n },\n\ + )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"host_name\": 'example.com', # A hostname.\n \"query\": '{\"op\"\ + : \"=\", \"left\": \"host_name\", \"right\": \"example.com\"}', # An query\ + \ expression of the Livestatus 'services' table in nested dictionary form.\n\ + \ \"columns\": ['host_name', 'description'], # The desired columns of\ + \ the `services` table.\n})\n\nrequest = urllib.request.Request(\n f\"\ + {API_URL}/domain-types/service/collections/all?{query_string}\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/service/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n host_name=='example.com' \\\n query=='{\"\ + op\": \"=\", \"left\": \"host_name\", \"right\": \"example.com\"}' \\\n\ + \ columns=='['host_name', 'description']' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --data-urlencode 'host_name=example.com'\ + \ \\\n --data-urlencode 'query={\"op\": \"=\", \"left\": \"host_name\"\ + , \"right\": \"example.com\"}' \\\n --data-urlencode 'columns=host_name'\ + \ \\\n --data-urlencode 'columns=description' \\\n \"$API_URL/domain-types/service/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/service_discovery/{host_name}: + get: + description: '' + operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.show_service_discovery_result + parameters: + - description: The host of the service discovery result + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: The password for login - example: password - minLength: 1 - auth_type: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show the current service discovery result + tags: + - Service discovery + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/service_discovery/example.com\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/service_discovery/example.com\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/service_discovery/example.com\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/service_discovery/example.com\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/service/collections/services: + get: + deprecated: true + description: '`WARNING`: This URL is deprecated, see [Werk 14537](https://checkmk.com/werk/14537) + for more details. + + + ' + operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.show_services-14537 + parameters: + - description: The host of the discovered services. + in: query + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: The authentication type - enum: &id046 - - automation - - password - - remove - example: password - enforce_password_change: - type: boolean - description: If set to True, the user will be forced to change his password - on the next login or access - example: false - required: - - auth_type - AuthUpdateSecret: - type: object - properties: - secret: + - description: The discovery phase of the services. + in: query + name: discovery_phase + required: true + schema: + enum: + - active + - active_ignored + - clustered_ignored + - clustered_monitored + - clustered_undecided + - clustered_vanished + - custom + - custom_ignored + - ignored + - legacy + - legacy_ignored + - manual + - monitored + - removed + - undecided + - vanished + example: monitored type: string - description: For accounts used by automation processes (such as fetching - data from views for further procession). This is the automation secret - example: DEYQEQQPYCFFBYH@AVMC - auth_type: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all services of specific phase + tags: + - Service discovery + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/service/collections/services\"\ + ,\n params={ # goes into query string\n \"host_name\": 'example.com',\ + \ # (required) The host of the discovered services.\n \"discovery_phase\"\ + : 'monitored', # (required) The discovery phase of the services.\n },\n\ + )\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.parse\nimport\ + \ urllib.request\n\nHOST_NAME = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL\ + \ = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\n\nUSERNAME = \"\ + automation\"\nPASSWORD = \"test123\"\n\nquery_string = urllib.parse.urlencode({\n\ + \ \"host_name\": 'example.com', # (required) The host of the discovered\ + \ services.\n \"discovery_phase\": 'monitored', # (required) The discovery\ + \ phase of the services.\n})\n\nrequest = urllib.request.Request(\n f\"\ + {API_URL}/domain-types/service/collections/services?{query_string}\",\n\ + \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/service/collections/services\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n host_name=='example.com' \\\n discovery_phase=='monitored'\ + \ \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n -G \\\n \ + \ --request GET \\\n --write-out \"\\nxxx-status_code=%{http_code}\\\ + n\" \\\n --header \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n\ + \ --header \"Accept: application/json\" \\\n --data-urlencode 'host_name=example.com'\ + \ \\\n --data-urlencode 'discovery_phase=monitored' \\\n \"$API_URL/domain-types/service/collections/services\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/service_discovery_run/{host_name}: + get: + description: '' + operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.show_service_discovery_run + parameters: + - description: A hostname. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: The authentication type - enum: *id046 - example: password - required: - - auth_type - AuthUpdateRemove: - type: object - properties: - auth_type: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show the last service discovery background job on a host + tags: + - Service discovery + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/service_discovery_run/example.com\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/service_discovery_run/example.com\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/service_discovery_run/example.com\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/service_discovery_run/example.com\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/discovery_run/{job_id}: + get: + description: '' + operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.show_bulk_discovery_status + parameters: + - description: The unique identifier of the background job executing the bulk + discovery + in: path + name: job_id + required: true + schema: + example: bulk_discovery type: string - description: The authentication type - enum: *id046 - example: password - required: - - auth_type - AuthUpdateOption: - type: object - properties: {} - oneOf: - - $ref: '#/components/schemas/AuthUpdatePassword' - - $ref: '#/components/schemas/AuthUpdateSecret' - - $ref: '#/components/schemas/AuthUpdateRemove' - discriminator: - propertyName: auth_type - mapping: - password: '#/components/schemas/AuthUpdatePassword' - automation: '#/components/schemas/AuthUpdateSecret' - remove: '#/components/schemas/AuthUpdateRemove' - UserInterfaceUpdateAttributes: - type: object - properties: - interface_theme: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: There is no running background job with this job_id.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DiscoveryBackgroundJobStatusObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show the status of a bulk discovery job + tags: + - Service discovery + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/discovery_run/bulk_discovery\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/discovery_run/bulk_discovery\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/discovery_run/bulk_discovery\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/discovery_run/bulk_discovery\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/host/{host_name}/actions/update_discovery_phase/invoke: + put: + description: "\n\nThis endpoint requires the following permissions: \n * Optionally:\n\ + \ * Any of:\n * `wato.service_discovery_to_monitored`: Service discovery:\ + \ Move to monitored services\n * `wato.service_discovery_to_ignored`:\ + \ Service discovery: Disabled services\n * `wato.service_discovery_to_undecided`:\ + \ Service discovery: Move to undecided services\n * `wato.service_discovery_to_removed`:\ + \ Service discovery: Remove services\n" + operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.update_service_phase + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The theme of the interface - enum: - - default - - dark - - light - sidebar_position: + - description: The host of the service which shall be updated. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDiscoveryPhase' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: Host could not be found' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Update the phase of a service + tags: + - Service discovery + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/host/example.com/actions/update_discovery_phase/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'check_type': 'df',\n 'service_item':\ + \ '/home',\n 'target_phase': 'monitored'\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host/example.com/actions/update_discovery_phase/invoke\"\ + ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'check_type': 'df',\n 'service_item': '/home',\n \ + \ 'target_phase': 'monitored'\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/host/example.com/actions/update_discovery_phase/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n check_type='df'\ + \ \\\n service_item='/home' \\\n target_phase='monitored' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"check_type\": \"df\",\n \"service_item\"\ + : \"/home\",\n \"target_phase\": \"monitored\"\n }' \\\n\ + \ \"$API_URL/objects/host/example.com/actions/update_discovery_phase/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/service_discovery_run/actions/start/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * Optionally:\n * `wato.service_discovery_to_undecided`: Service\ + \ discovery: Move to undecided services\n * Optionally:\n * `wato.service_discovery_to_monitored`:\ + \ Service discovery: Move to monitored services\n * Optionally:\n *\ + \ `wato.service_discovery_to_ignored`: Service discovery: Disabled services\n\ + \ * Optionally:\n * `wato.service_discovery_to_removed`: Service discovery:\ + \ Remove services\n * Optionally:\n * `wato.services`: Do inventory\ + \ and service configuration on existing hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.execute_service_discovery + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The position of the sidebar - enum: - - left - - right - navigation_bar_icons: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DiscoverServices' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '409': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Conflict: A service discovery background job is currently + running' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '302': + content: {} + description: 'Found: The service discovery background job has been initialized. + Redirecting to the ''Show discovery service background job'' endpoint.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Execute a service discovery on a host + tags: + - Service discovery + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/service_discovery_run/actions/start/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={'host_name': 'example.com', 'mode': 'refresh'},\n \ + \ allow_redirects=True,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/service_discovery_run/actions/start/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({'host_name':\ + \ 'example.com', 'mode': 'refresh'}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/service_discovery_run/actions/start/invoke\"\ + \ \\\n --follow \\\n --all \\\n \"Authorization: Bearer $USERNAME\ + \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ + \ \\\n host_name='example.com' \\\n mode='refresh' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"host_name\": \"example.com\",\n \ + \ \"mode\": \"refresh\"\n }' \\\n \"$API_URL/domain-types/service_discovery_run/actions/start/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/host/{host_name}/actions/discover_services/invoke: + post: + deprecated: true + description: "`WARNING`: This URL is deprecated, see [Werk 14538](https://checkmk.com/werk/14538)\ + \ for more details.\n\nThis endpoint requires the following permissions: \n\ + \ * All of:\n * `wato.edit`: This permission is needed in order to make\ + \ any changes or perform any actions at all. Without this permission, the\ + \ user is only able to view data, and that only in modules he has explicit\ + \ permissions for.\n * Optionally:\n * `wato.service_discovery_to_undecided`:\ + \ Service discovery: Move to undecided services\n * Optionally:\n *\ + \ `wato.service_discovery_to_monitored`: Service discovery: Move to monitored\ + \ services\n * Optionally:\n * `wato.service_discovery_to_ignored`:\ + \ Service discovery: Disabled services\n * Optionally:\n * `wato.service_discovery_to_removed`:\ + \ Service discovery: Remove services\n * Optionally:\n * `wato.services`:\ + \ Do inventory and service configuration on existing hosts.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.execute-14538 + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: This option decides if icons in the navigation bar should show/hide - the respective titles - enum: - - hide - - show - mega_menu_icons: + - description: A hostname. + in: path + name: host_name + required: true + schema: + example: example.com + pattern: '[-0-9a-zA-Z_.]+' type: string - description: This option decides if colored icon should be shown foe every - entry in the mega menus or alternatively only for the headlines (the 'topics') - enum: - - topic - - entry - show_mode: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DiscoverServicesDeprecated' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: Host could not be found' + '409': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Conflict: A service discovery background job is currently + running' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '302': + content: {} + description: 'Found: The service discovery background job has been initialized. + Redirecting to the ''Show discovery service background job'' endpoint.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Execute a service discovery on a host + tags: + - Service discovery + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/objects/host/example.com/actions/discover_services/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={'mode': 'refresh'},\n allow_redirects=True,\n)\nif\ + \ resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/host/example.com/actions/discover_services/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({'mode':\ + \ 'refresh'}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/objects/host/example.com/actions/discover_services/invoke\"\ + \ \\\n --follow \\\n --all \\\n \"Authorization: Bearer $USERNAME\ + \ $PASSWORD\" \\\n \"Accept: application/json\" \\\n 'Content-Type:application/json'\ + \ \\\n mode='refresh' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"mode\": \"refresh\"\n }' \\\n \ + \ \"$API_URL/objects/host/example.com/actions/discover_services/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/discovery_run/actions/bulk-discovery-start/invoke: + post: + description: '' + operationId: cmk.gui.plugins.openapi.endpoints.service_discovery.execute_bulk_discovery + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: This option decides what show mode should be used for unvisited - menus. Alternatively, this option can also be used to enforce show more - removing the three dots for all menus. - enum: - - default - - default_show_less - - default_show_more - - enforce_show_more - UpdateUser: - type: object - properties: - fullname: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkDiscovery' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '409': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Conflict: A bulk discovery job is already active' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DiscoveryBackgroundJobStatusObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Start a bulk discovery job + tags: + - Service discovery + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/discovery_run/actions/bulk-discovery-start/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'hostnames': ['example', 'sample'],\n \ + \ 'mode': 'refresh',\n 'do_full_scan': True,\n 'bulk_size':\ + \ 10,\n 'ignore_errors': True\n },\n)\nif resp.status_code ==\ + \ 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/discovery_run/actions/bulk-discovery-start/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'hostnames': ['example', 'sample'],\n 'mode': 'refresh',\n\ + \ 'do_full_scan': True,\n 'bulk_size': 10,\n 'ignore_errors':\ + \ True\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/discovery_run/actions/bulk-discovery-start/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n hostnames='['example',\ + \ 'sample']' \\\n mode='refresh' \\\n do_full_scan='True' \\\n \ + \ bulk_size='10' \\\n ignore_errors='True' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"bulk_size\": 10,\n \"do_full_scan\"\ + : true,\n \"hostnames\": [\n \"example\",\n \ + \ \"sample\"\n ],\n \"ignore_errors\": true,\n \ + \ \"mode\": \"refresh\"\n }' \\\n \"$API_URL/domain-types/discovery_run/actions/bulk-discovery-start/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/service_group_config/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.groups`:\ + \ Access to the modules for managing host and service groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.list_groups + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LinkedValueDomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all service groups + tags: + - Service groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/service_group_config/collections/all\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/service_group_config/collections/all\",\n\ + \ method=\"GET\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ },\n)\nresponse = urllib.request.urlopen(request)\nif response.status\ + \ == 200:\n pprint.pprint(json.loads(response.read()))\nelif response.status\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/service_group_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/domain-types/service_group_config/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.groups`: Access to the modules for managing host and service\ + \ groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.create + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The alias or full name of the user - example: Mathias Kettner - auth_option: - description: Authentication option for the user - example: - auth_type: password - password: password - allOf: - - $ref: '#/components/schemas/AuthUpdateOption' - disable_login: - type: boolean - description: The user can be blocked from login but will remain part of - the site. The disabling does not affect notification and alerts. - example: false - contact_options: - description: Contact settings for the user - example: - email: user@example.com - allOf: - - $ref: '#/components/schemas/UserContactOption' - pager_address: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InputServiceGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Create a service group + tags: + - Service groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/service_group_config/collections/all\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'name': 'windows',\n 'alias': 'Environment\ + \ Sensors'\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/service_group_config/collections/all\",\n\ + \ method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'name': 'windows',\n 'alias': 'Environment Sensors'\n \ + \ }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/service_group_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n name='windows'\ + \ \\\n alias='Environment Sensors' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"alias\": \"Environment Sensors\",\n \ + \ \"name\": \"windows\"\n }' \\\n \"$API_URL/domain-types/service_group_config/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/service_group_config/{name}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.groups`: Access to the modules for managing host and service\ + \ groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.delete + parameters: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - description: '' - example: '' - idle_timeout: - description: Idle timeout for the user - example: {} - allOf: - - $ref: '#/components/schemas/IdleOption' - roles: - type: array - description: The list of assigned roles to the user - example: - - user - items: - type: string - description: An existing user role - example: user - authorized_sites: - type: array - description: The names of the sites the user is authorized to handle. Specifying - 'all' will grant the user access to all sites. - example: - - heute - items: - type: string - contactgroups: - type: array - description: Assign the user to one or multiple contact groups. If no contact - group is specified then no monitoring contact will be created for the - user. - example: - - all - items: - type: string - description: Assign the user to one or multiple contact groups - example: all - disable_notifications: - description: '' - example: - disabled: false - allOf: - - $ref: '#/components/schemas/DisabledNotifications' - language: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete a service group + tags: + - Service groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/service_group_config/pathname\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/service_group_config/pathname\",\n method=\"\ + DELETE\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n },\n)\n\ + response = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/service_group_config/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/service_group_config/pathname\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.groups`:\ + \ Access to the modules for managing host and service groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.show_group + parameters: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - description: Configure the language to be used by the user in the user interface. - Omitting this will configure the default language - enum: - - de - - en - - ro - example: en - temperature_unit: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceGroup' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Show a service group + tags: + - Service groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/service_group_config/pathname\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/service_group_config/pathname\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/service_group_config/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/service_group_config/pathname\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.groups`: Access to the modules for managing host and service\ + \ groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.update + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: Configure the temperature unit used for graphs and perfometers. - enum: - - default - - celsius - - fahrenheit - example: celsius - interface_options: - description: '' - example: - interface_theme: dark - allOf: - - $ref: '#/components/schemas/UserInterfaceUpdateAttributes' - additionalProperties: true - UserCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - default: all - description: The name of this collection. - domainType: - default: user_config - description: The domain type of the objects in the collection. - title: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of user objects. - items: - $ref: '#/components/schemas/UserObject' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - CreateUserRole: - type: object - properties: - role_id: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceGroup' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Update a service group + tags: + - Service groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/service_group_config/pathname\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={'alias': 'Example\ + \ Group'},\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/service_group_config/pathname\",\n method=\"\ + PUT\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ + a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ + \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n data=json.dumps({'alias': 'Example Group'}).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/service_group_config/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n alias='Example Group' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"alias\": \"Example Group\"\n }' \\\n \"$API_URL/objects/service_group_config/pathname\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/service_group_config/actions/bulk-update/invoke: + put: + description: "Please be aware that when doing bulk updates, it is not possible\ + \ to prevent the\n[Updating Values](\"lost update problem\"), which is normally\ + \ prevented by the ETag locking\nmechanism. Use at your own risk.This endpoint\ + \ requires the following permissions: \n * All of:\n * `wato.edit`: This\ + \ permission is needed in order to make any changes or perform any actions\ + \ at all. Without this permission, the user is only able to view data, and\ + \ that only in modules he has explicit permissions for.\n * `wato.groups`:\ + \ Access to the modules for managing host and service groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.bulk_update + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: Existing userrole that you want to clone. - example: admin - new_role_id: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkUpdateServiceGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Bulk update service groups + tags: + - Service groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/domain-types/service_group_config/actions/bulk-update/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'entries': [{\n 'name': 'windows',\n\ + \ 'attributes': {\n 'alias': 'Windows Servers'\n\ + \ }\n }]\n },\n)\nif resp.status_code == 200:\n \ + \ pprint.pprint(resp.json())\nelif resp.status_code == 204:\n print(\"\ + Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/service_group_config/actions/bulk-update/invoke\"\ + ,\n method=\"PUT\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'entries': [{\n 'name': 'windows',\n 'attributes':\ + \ {\n 'alias': 'Windows Servers'\n }\n \ + \ }]\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/domain-types/service_group_config/actions/bulk-update/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='[{'name':\ + \ 'windows', 'attributes': {'alias': 'Windows Servers'}}]' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n {\n \ + \ \"attributes\": {\n \"alias\": \"Windows Servers\"\n\ + \ },\n \"name\": \"windows\"\n }\n\ + \ ]\n }' \\\n \"$API_URL/domain-types/service_group_config/actions/bulk-update/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/service_group_config/actions/bulk-create/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.groups`: Access to the modules for managing host and service\ + \ groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.bulk_create + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The new role id for the newly created user role. - example: limited_permissions_user - new_alias: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkInputServiceGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Bulk create service groups + tags: + - Service groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/service_group_config/actions/bulk-create/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'entries': [{\n 'name': 'environment',\n\ + \ 'alias': 'Environment Sensors'\n }]\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/service_group_config/actions/bulk-create/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({\n\ + \ 'entries': [{\n 'name': 'environment',\n \ + \ 'alias': 'Environment Sensors'\n }]\n }).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/service_group_config/actions/bulk-create/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='[{'name':\ + \ 'environment', 'alias': 'Environment Sensors'}]' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n {\n \ + \ \"alias\": \"Environment Sensors\",\n \"name\": \"environment\"\ + \n }\n ]\n }' \\\n \"$API_URL/domain-types/service_group_config/actions/bulk-create/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/service_group_config/actions/bulk-delete/invoke: + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.groups`: Access to the modules for managing host and service\ + \ groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.service_group_config.bulk_delete + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: A new alias that you want to give to the newly created user - role. - example: user_a - required: - - role_id - UserRoleAttributes: - type: object - properties: - alias: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BulkDeleteServiceGroup' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Bulk delete service groups + tags: + - Service groups + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/service_group_config/actions/bulk-delete/invoke\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={'entries': ['windows', 'panels']},\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/service_group_config/actions/bulk-delete/invoke\"\ + ,\n method=\"POST\",\n headers={\n \"Authorization\": f\"Bearer\ + \ {USERNAME} {PASSWORD}\",\n \"Accept\": \"application/json\",\n\ + \ \"Content-Type\": 'application/json', # (required) A header specifying\ + \ which type of content is in the request/response body.\n },\n data=json.dumps({'entries':\ + \ ['windows', 'panels']}).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/service_group_config/actions/bulk-delete/invoke\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n entries='['windows',\ + \ 'panels']' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"entries\": [\n \"windows\",\n\ + \ \"panels\"\n ]\n }' \\\n \"$API_URL/domain-types/service_group_config/actions/bulk-delete/invoke\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/time_period/{name}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.timeperiods`: Access to the module Timeperiods\n" + operationId: cmk.gui.plugins.openapi.endpoints.time_period.delete + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: The alias of the user role. - permissions: - type: array - description: 'A list of permissions for the user role. ' - items: - type: string - builtin: - type: boolean - description: True if it's a builtin user role, otherwise False. - basedon: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - description: The builtin user role id that the user role is based on. - enum: - - user - - admin - - guest - - agent_registration - required: - - alias - - builtin - - permissions - UserRoleObject: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - domainType: - default: user_role - description: The domain type of the object. - id: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Delete a time period + tags: + - Time periods + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/time_period/pathname\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n },\n)\nif\ + \ resp.status_code == 200:\n pprint.pprint(resp.json())\nelif resp.status_code\ + \ == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/time_period/pathname\",\n method=\"DELETE\"\ + ,\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ + a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ + \ ETag header.\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/time_period/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n \"$API_URL/objects/time_period/pathname\")\n\nresp=$( echo \"\ + ${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk\ + \ -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation, please\ + \ install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\ + \nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo\ + \ \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.timeperiods`:\ + \ Access to the module Timeperiods\n" + operationId: cmk.gui.plugins.openapi.endpoints.time_period.show_time_period + parameters: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - description: The unique identifier for this domain-object type. - title: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConcreteTimePeriod' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show a time period + tags: + - Time periods + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/time_period/pathname\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/time_period/pathname\",\n method=\"GET\",\n\ + \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/time_period/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/time_period/pathname\")\n\ + \nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.timeperiods`: Access to the module Timeperiods\n" + operationId: cmk.gui.plugins.openapi.endpoints.time_period.update_timeperiod + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: A human readable title of this object. Can be used for user - interfaces. - members: - type: object - description: The container for external resources, like linked foreign objects - or actions. - extensions: - description: All the attributes of a user role. - allOf: - - $ref: '#/components/schemas/UserRoleAttributes' - required: - - links - EditUserRole: - type: object - properties: - new_role_id: + - description: A name used as an identifier. Can be of arbitrary (sensible) + length. + in: path + name: name + required: true + schema: + example: pathname + pattern: '[a-zA-Z0-9][a-zA-Z0-9_-]+' type: string - description: New role_id for the userrole that must be unique. - example: new_userrole_id - new_alias: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTimePeriod' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '405': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Method Not Allowed: Method not allowed: This request is only + allowed with other HTTP methods' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Update a time period + tags: + - Time periods + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/time_period/pathname\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'alias': 'alias',\n 'active_time_ranges':\ + \ [{\n 'day': 'monday',\n 'time_ranges': [{\n \ + \ 'start': '12:00',\n 'end': '14:00'\n \ + \ }]\n }],\n 'exceptions': [{\n 'date': '2020-01-01',\n\ + \ 'time_ranges': [{\n 'start': '14:00',\n \ + \ 'end': '18:00'\n }]\n }]\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/time_period/pathname\",\n method=\"PUT\",\n\ + \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"Content-Type\":\ + \ 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({\n \ + \ 'alias': 'alias',\n 'active_time_ranges': [{\n 'day':\ + \ 'monday',\n 'time_ranges': [{\n 'start': '12:00',\n\ + \ 'end': '14:00'\n }]\n }],\n 'exceptions':\ + \ [{\n 'date': '2020-01-01',\n 'time_ranges': [{\n\ + \ 'start': '14:00',\n 'end': '18:00'\n \ + \ }]\n }]\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/time_period/pathname\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n alias='alias'\ + \ \\\n active_time_ranges='[{'day': 'monday', 'time_ranges': [{'start':\ + \ '12:00', 'end': '14:00'}]}]' \\\n exceptions='[{'date': '2020-01-01',\ + \ 'time_ranges': [{'start': '14:00', 'end': '18:00'}]}]' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"active_time_ranges\": [\n {\n\ + \ \"day\": \"monday\",\n \"time_ranges\": [\n\ + \ {\n \"end\": \"14:00\",\n \ + \ \"start\": \"12:00\"\n }\n ]\n \ + \ }\n ],\n \"alias\": \"alias\",\n \"exceptions\"\ + : [\n {\n \"date\": \"2020-01-01\",\n \ + \ \"time_ranges\": [\n {\n \"end\": \"\ + 18:00\",\n \"start\": \"14:00\"\n }\n \ + \ ]\n }\n ]\n }' \\\n \"$API_URL/objects/time_period/pathname\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/time_period/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.timeperiods`:\ + \ Access to the module Timeperiods\n" + operationId: cmk.gui.plugins.openapi.endpoints.time_period.list_time_periods + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObjectCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all time periods + tags: + - Time periods + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/time_period/collections/all\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/time_period/collections/all\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/time_period/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/domain-types/time_period/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + post: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.timeperiods`: Access to the module Timeperiods\n" + operationId: cmk.gui.plugins.openapi.endpoints.time_period.create_timeperiod + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: New alias for the userrole that must be unique. - example: new_userrole_alias - new_basedon: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InputTimePeriod' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DomainObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Create a time period + tags: + - Time periods + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/time_period/collections/all\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'name': 'first',\n 'alias': 'alias',\n\ + \ 'active_time_ranges': [{\n 'day': 'monday',\n \ + \ 'time_ranges': [{\n 'start': '12:00',\n \ + \ 'end': '14:00'\n }]\n }],\n 'exceptions':\ + \ [{\n 'date': '2020-01-01',\n 'time_ranges': [{\n\ + \ 'start': '14:00',\n 'end': '18:00'\n \ + \ }]\n }],\n 'exclude': ['alias']\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/time_period/collections/all\",\n method=\"\ + POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({\n \ + \ 'name': 'first',\n 'alias': 'alias',\n 'active_time_ranges':\ + \ [{\n 'day': 'monday',\n 'time_ranges': [{\n \ + \ 'start': '12:00',\n 'end': '14:00'\n \ + \ }]\n }],\n 'exceptions': [{\n 'date': '2020-01-01',\n\ + \ 'time_ranges': [{\n 'start': '14:00',\n \ + \ 'end': '18:00'\n }]\n }],\n 'exclude':\ + \ ['alias']\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/time_period/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n name='first'\ + \ \\\n alias='alias' \\\n active_time_ranges='[{'day': 'monday', 'time_ranges':\ + \ [{'start': '12:00', 'end': '14:00'}]}]' \\\n exceptions='[{'date':\ + \ '2020-01-01', 'time_ranges': [{'start': '14:00', 'end': '18:00'}]}]' \\\ + \n exclude='['alias']' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"active_time_ranges\": [\n {\n\ + \ \"day\": \"monday\",\n \"time_ranges\": [\n\ + \ {\n \"end\": \"14:00\",\n \ + \ \"start\": \"12:00\"\n }\n ]\n \ + \ }\n ],\n \"alias\": \"alias\",\n \"exceptions\"\ + : [\n {\n \"date\": \"2020-01-01\",\n \ + \ \"time_ranges\": [\n {\n \"end\": \"\ + 18:00\",\n \"start\": \"14:00\"\n }\n \ + \ ]\n }\n ],\n \"exclude\": [\n\ + \ \"alias\"\n ],\n \"name\": \"first\"\n \ + \ }' \\\n \"$API_URL/domain-types/time_period/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /objects/user_config/{username}: + delete: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.users`: This permission is needed for the modules Users,\ + \ Roles and Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.user_config.delete_user + parameters: + - description: A username. + in: path + name: username + required: true + schema: + example: user type: string - description: A builtin user role that you want the user role to be based - on. - example: guest - new_permissions: - type: object - description: 'A map of permission names to their state. The following values - can be set: ''yes'' - the permission is active for this role.''no'' - - the permission is deactivated for this role, even if it was active in - the role it was based on.''default'' - takes the activation state from - the role this role was based on. ' - example: - general.edit_profile: 'yes' - general.message: 'no' - additionalProperties: - type: string - enum: - - 'yes' - - 'no' - - default - UserRoleCollection: - type: object - properties: - links: - type: array - description: list of links to other resources. - example: null - items: - $ref: '#/components/schemas/Link' - id: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '204': + content: {} + description: 'No Content: Operation done successfully. No further output.' + summary: Delete a user + tags: + - Users + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.delete(\n f\"{API_URL}/objects/user_config/user\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/user_config/user\",\n method=\"DELETE\",\n\ + \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp DELETE \"$API_URL/objects/user_config/user\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request DELETE\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/user_config/user\")\n\n\ + resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ + ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.users`:\ + \ This permission is needed for the modules Users, Roles and\ + \ Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.user_config.show_user + parameters: + - description: A username. + in: path + name: username + required: true + schema: + example: user type: string - default: all - description: The name of this collection. - domainType: - default: user_role - description: The domain type of the objects in the collection. - title: + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Show an user + tags: + - Users + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/objects/user_config/user\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/user_config/user\",\n method=\"GET\",\n \ + \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/objects/user_config/user\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/objects/user_config/user\")\n\n\ + resp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo \"\ + ${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + put: + description: "\n\nThis endpoint requires the following permissions: \n * All\ + \ of:\n * `wato.edit`: This permission is needed in order to make any changes\ + \ or perform any actions at all. Without this permission, the user is only\ + \ able to view data, and that only in modules he has explicit permissions\ + \ for.\n * `wato.users`: This permission is needed for the modules Users,\ + \ Roles and Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.user_config.edit_user + parameters: + - description: The value of the, to be modified, object's ETag header. You can + get this value by displaying the object it individually. To update this + object the currently stored ETag needs to be the same as the one sent. The + content of the ETag can potentially be anything and should be treated as + semantically opaque. + in: header + name: If-Match + required: true + schema: + example: '"a20ceacf346041dc"' type: string - description: A human readable title of this object. Can be used for user - interfaces. - value: - type: array - description: A list of user role objects. - items: - $ref: '#/components/schemas/UserRoleObject' - extensions: - type: object - description: Additional attributes alongside the collection. - required: - - links - InstalledVersions: - type: object - properties: - site: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The site where this API call was made on. - example: production - group: + - description: A username. + in: path + name: username + required: true + schema: + example: user type: string - description: The Apache WSGI application group this call was made on. - example: de - rest_api: - type: object - description: The REST-API version - example: - revision: 1.0.0 - versions: - type: object - description: Some version numbers - example: - checkmk: 1.8.0p1 - edition: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateUser' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '404': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Found: The requested object has not been found.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + '412': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Failed: The value of the If-Match header doesn''t + match the object''s ETag.' + '428': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Precondition Required: The required If-Match header is missing.' + summary: Edit an user + tags: + - Users + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.put(\n f\"{API_URL}/objects/user_config/user\"\ + ,\n headers={\n \"If-Match\": '\"a20ceacf346041dc\"', # (required)\ + \ The value of the, to be modified, object's ETag header.\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n json={\n 'fullname':\ + \ 'Mathias Kettner',\n 'auth_option': {\n 'auth_type':\ + \ 'password',\n 'password': 'password'\n },\n 'disable_login':\ + \ False,\n 'contact_options': {\n 'email': 'user@example.com'\n\ + \ },\n 'pager_address': '',\n 'idle_timeout': {},\n\ + \ 'roles': ['user'],\n 'authorized_sites': ['heute'],\n \ + \ 'contactgroups': ['all'],\n 'disable_notifications': {\n \ + \ 'disabled': False\n },\n 'language': 'en',\n \ + \ 'interface_options': {\n 'interface_theme': 'dark'\n\ + \ }\n },\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\n\ + elif resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/objects/user_config/user\",\n method=\"PUT\",\n \ + \ headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n \"If-Match\": '\"\ + a20ceacf346041dc\"', # (required) The value of the, to be modified, object's\ + \ ETag header.\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n data=json.dumps({\n 'fullname': 'Mathias Kettner',\n\ + \ 'auth_option': {\n 'auth_type': 'password',\n \ + \ 'password': 'password'\n },\n 'disable_login': False,\n\ + \ 'contact_options': {\n 'email': 'user@example.com'\n\ + \ },\n 'pager_address': '',\n 'idle_timeout': {},\n\ + \ 'roles': ['user'],\n 'authorized_sites': ['heute'],\n \ + \ 'contactgroups': ['all'],\n 'disable_notifications': {\n \ + \ 'disabled': False\n },\n 'language': 'en',\n \ + \ 'interface_options': {\n 'interface_theme': 'dark'\n\ + \ }\n }).encode('utf-8'),\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp PUT \"$API_URL/objects/user_config/user\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'If-Match:\"a20ceacf346041dc\"' \\\n 'Content-Type:application/json'\ + \ \\\n fullname='Mathias Kettner' \\\n auth_option='{'auth_type':\ + \ 'password', 'password': 'password'}' \\\n disable_login='False' \\\n\ + \ contact_options='{'email': 'user@example.com'}' \\\n pager_address=''\ + \ \\\n idle_timeout='{}' \\\n roles='['user']' \\\n authorized_sites='['heute']'\ + \ \\\n contactgroups='['all']' \\\n disable_notifications='{'disabled':\ + \ False}' \\\n language='en' \\\n interface_options='{'interface_theme':\ + \ 'dark'}' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request PUT\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"If-Match: \"a20ceacf346041dc\"\"\ + \ \\\n --header \"Content-Type: application/json\" \\\n --data '{\n\ + \ \"auth_option\": {\n \"auth_type\": \"password\",\n\ + \ \"password\": \"password\"\n },\n \"authorized_sites\"\ + : [\n \"heute\"\n ],\n \"contact_options\"\ + : {\n \"email\": \"user@example.com\"\n },\n \ + \ \"contactgroups\": [\n \"all\"\n ],\n \"\ + disable_login\": false,\n \"disable_notifications\": {\n \ + \ \"disabled\": false\n },\n \"fullname\": \"Mathias\ + \ Kettner\",\n \"idle_timeout\": {},\n \"interface_options\"\ + : {\n \"interface_theme\": \"dark\"\n },\n \ + \ \"language\": \"en\",\n \"pager_address\": \"\",\n \"\ + roles\": [\n \"user\"\n ]\n }' \\\n \"$API_URL/objects/user_config/user\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /domain-types/user_config/collections/all: + get: + description: "\n\nThis endpoint requires the following permissions: \n * `wato.users`:\ + \ This permission is needed for the modules Users, Roles and\ + \ Contact Groups\n" + operationId: cmk.gui.plugins.openapi.endpoints.user_config.list_users + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserCollection' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Show all users + tags: + - Users + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/domain-types/user_config/collections/all\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/user_config/collections/all\",\n method=\"\ + GET\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\"\ + ,\n \"Accept\": \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/domain-types/user_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/domain-types/user_config/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + post: + description: "You can pass custom attributes you defined directly in the top\ + \ level JSON object of the request.This endpoint requires the following permissions:\ + \ \n * All of:\n * `wato.edit`: This permission is needed in order to make\ + \ any changes or perform any actions at all. Without this permission, the\ + \ user is only able to view data, and that only in modules he has explicit\ + \ permissions for.\n * `wato.users`: This permission is needed for the modules\ + \ Users, Roles and Contact Groups\n * Optionally:\n\ + \ * `wato.groups`: Access to the modules for managing host and service\ + \ groups.\n" + operationId: cmk.gui.plugins.openapi.endpoints.user_config.create_user + parameters: + - description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. When + the request body is empty, this header should not be sent. + in: header + name: Content-Type + required: true + schema: + example: application/json type: string - description: The Checkmk edition. - example: raw - demo: - type: boolean - description: Whether this is a demo version or not. - example: false - parameters: - Accept: - name: Accept - in: header - required: false - description: Media type(s) that is/are acceptable for the response. - allowEmptyValue: false - example: application/json - schema: - type: string - securitySchemes: - headerAuth: - type: http - scheme: bearer - description: Use user credentials in the `Authorization` HTTP header. The format - of the header value is `$user $password`. This method has the highest precedence. - If authentication succeeds, `cookieAuth` will be skipped. - bearerFormat: username password - webserverAuth: - type: http - scheme: basic - description: Use the authentication method of the webserver ('basic' or 'digest'). - To use this, you'll either have to re-configure the site's Apache instance - by yourself. If authentication succeeds, `cookieAuth` will be skipped. - cookieAuth: - in: cookie - name: auth_cmk - type: apiKey - description: Any user of Checkmk, who has already logged in, and thus got a - cookie assigned, can use the REST API. Some actions may or may not succeed - due to group and permission restrictions. This authentication method has theleast - precedence. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateUser' + required: true + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '403': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Forbidden: Configuration via WATO is disabled.' + '415': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Unsupported Media Type: The submitted content-type is not + supported.' + '400': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Bad Request: Parameter or validation failure.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserObject' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + ETag: + allowEmptyValue: false + description: The HTTP ETag header for this resource. It identifies the + current state of the object and needs to be sent along in the "If-Match" + request-header for subsequent modifications. Please note that the + actual ETag returned by some endpoints may look different than the + one shown in this example. + example: '"a20ceacf346041dc"' + required: false + schema: + type: string + summary: Create a user + tags: + - Users + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.post(\n f\"{API_URL}/domain-types/user_config/collections/all\"\ + ,\n headers={\n \"Content-Type\": 'application/json', # (required)\ + \ A header specifying which type of content is in the request/response body.\n\ + \ },\n json={\n 'username': 'cmkuser',\n 'fullname':\ + \ 'Mathias Kettner',\n 'auth_option': {\n 'auth_type':\ + \ 'password',\n 'password': 'password'\n },\n 'disable_login':\ + \ False,\n 'contact_options': {\n 'email': 'user@example.com'\n\ + \ },\n 'pager_address': '',\n 'idle_timeout': {\n \ + \ 'option': 'global'\n },\n 'roles': ['user'],\n\ + \ 'authorized_sites': ['heute'],\n 'contactgroups': ['all'],\n\ + \ 'disable_notifications': {\n 'disable': False\n \ + \ },\n 'language': 'en',\n 'interface_options': {\n \ + \ 'interface_theme': 'dark'\n }\n },\n)\nif resp.status_code\ + \ == 200:\n pprint.pprint(resp.json())\nelif resp.status_code == 204:\n\ + \ print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/domain-types/user_config/collections/all\",\n method=\"\ + POST\",\n headers={\n \"Authorization\": f\"Bearer {USERNAME}\ + \ {PASSWORD}\",\n \"Accept\": \"application/json\",\n \"Content-Type\"\ + : 'application/json', # (required) A header specifying which type of content\ + \ is in the request/response body.\n },\n data=json.dumps({\n \ + \ 'username': 'cmkuser',\n 'fullname': 'Mathias Kettner',\n \ + \ 'auth_option': {\n 'auth_type': 'password',\n \ + \ 'password': 'password'\n },\n 'disable_login': False,\n\ + \ 'contact_options': {\n 'email': 'user@example.com'\n\ + \ },\n 'pager_address': '',\n 'idle_timeout': {\n \ + \ 'option': 'global'\n },\n 'roles': ['user'],\n\ + \ 'authorized_sites': ['heute'],\n 'contactgroups': ['all'],\n\ + \ 'disable_notifications': {\n 'disable': False\n \ + \ },\n 'language': 'en',\n 'interface_options': {\n \ + \ 'interface_theme': 'dark'\n }\n }).encode('utf-8'),\n\ + )\nresponse = urllib.request.urlopen(request)\nif response.status == 200:\n\ + \ pprint.pprint(json.loads(response.read()))\nelif response.status ==\ + \ 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp POST \"$API_URL/domain-types/user_config/collections/all\"\ + \ \\\n \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n \"Accept:\ + \ application/json\" \\\n 'Content-Type:application/json' \\\n username='cmkuser'\ + \ \\\n fullname='Mathias Kettner' \\\n auth_option='{'auth_type':\ + \ 'password', 'password': 'password'}' \\\n disable_login='False' \\\n\ + \ contact_options='{'email': 'user@example.com'}' \\\n pager_address=''\ + \ \\\n idle_timeout='{'option': 'global'}' \\\n roles='['user']' \\\ + \n authorized_sites='['heute']' \\\n contactgroups='['all']' \\\n\ + \ disable_notifications='{'disable': False}' \\\n language='en' \\\ + \n interface_options='{'interface_theme': 'dark'}' \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request POST\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n --header \"Content-Type: application/json\"\ + \ \\\n --data '{\n \"auth_option\": {\n \"auth_type\"\ + : \"password\",\n \"password\": \"password\"\n },\n\ + \ \"authorized_sites\": [\n \"heute\"\n ],\n\ + \ \"contact_options\": {\n \"email\": \"user@example.com\"\ + \n },\n \"contactgroups\": [\n \"all\"\n \ + \ ],\n \"disable_login\": false,\n \"disable_notifications\"\ + : {\n \"disable\": false\n },\n \"fullname\"\ + : \"Mathias Kettner\",\n \"idle_timeout\": {\n \"option\"\ + : \"global\"\n },\n \"interface_options\": {\n \ + \ \"interface_theme\": \"dark\"\n },\n \"language\"\ + : \"en\",\n \"pager_address\": \"\",\n \"roles\": [\n\ + \ \"user\"\n ],\n \"username\": \"cmkuser\"\ + \n }' \\\n \"$API_URL/domain-types/user_config/collections/all\"\ + )\n\nresp=$( echo \"${out}\" | grep -v \"xxx-status_code\" )\ncode=$( echo\ + \ \"${out}\" | awk -F\"=\" '/^xxx-status_code/ {print $2}')\n\n# For indentation,\ + \ please install 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"\ + $resp\"\n\nif [[ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n\ + \ echo \"Request error\"\n exit 1\nfi" + /version: + get: + description: '' + operationId: cmk.gui.plugins.openapi.endpoints.version.search + responses: + '406': + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ApiError' + description: 'Not Acceptable: The requests accept headers can not be satisfied.' + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InstalledVersions' + description: 'OK: The operation was done successfully.' + headers: + Content-Type: + allowEmptyValue: false + description: A header specifying which type of content is in the request/response + body. This is required when sending encoded data in a POST/PUT body. + When the request body is empty, this header should not be sent. + example: application/json + required: true + schema: + type: string + summary: Display some version information + tags: + - Miscellaneous + x-codeSamples: + - label: requests + lang: python + source: "#!/usr/bin/env python3\nimport pprint\nimport requests\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nsession = requests.session()\n\ + session.headers['Authorization'] = f\"Bearer {USERNAME} {PASSWORD}\"\nsession.headers['Accept']\ + \ = 'application/json'\n\nresp = session.get(\n f\"{API_URL}/version\"\ + ,\n)\nif resp.status_code == 200:\n pprint.pprint(resp.json())\nelif\ + \ resp.status_code == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(pprint.pformat(resp.json()))" + - label: urllib + lang: python + source: "#!/usr/bin/env python3\nimport json\nimport urllib.request\n\nHOST_NAME\ + \ = \"localhost\"\nSITE_NAME = \"cmk\"\nAPI_URL = f\"http://{HOST_NAME}/{SITE_NAME}/check_mk/api/1.0\"\ + \n\nUSERNAME = \"automation\"\nPASSWORD = \"test123\"\n\nrequest = urllib.request.Request(\n\ + \ f\"{API_URL}/version\",\n method=\"GET\",\n headers={\n \ + \ \"Authorization\": f\"Bearer {USERNAME} {PASSWORD}\",\n \"Accept\"\ + : \"application/json\",\n },\n)\nresponse = urllib.request.urlopen(request)\n\ + if response.status == 200:\n pprint.pprint(json.loads(response.read()))\n\ + elif response.status == 204:\n print(\"Done\")\nelse:\n raise RuntimeError(response.read())" + - label: httpie + lang: bash + source: "#!/bin/bash\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\nAPI_URL=\"\ + http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"automation\"\ + \nPASSWORD=\"test123\"\n\nhttp GET \"$API_URL/version\" \\\n \"Authorization:\ + \ Bearer $USERNAME $PASSWORD\" \\\n \"Accept: application/json\" \\" + - label: curl + lang: bash + source: "#!/bin/bash\n\n# NOTE: We recommend all shell users to use the \"\ + httpie\" examples instead.\n\nHOST_NAME=\"localhost\"\nSITE_NAME=\"cmk\"\ + \nAPI_URL=\"http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0\"\n\nUSERNAME=\"\ + automation\"\nPASSWORD=\"test123\"\n\nout=$(\n curl \\\n --request GET\ + \ \\\n --write-out \"\\nxxx-status_code=%{http_code}\\n\" \\\n --header\ + \ \"Authorization: Bearer $USERNAME $PASSWORD\" \\\n --header \"Accept:\ + \ application/json\" \\\n \"$API_URL/version\")\n\nresp=$( echo \"${out}\"\ + \ | grep -v \"xxx-status_code\" )\ncode=$( echo \"${out}\" | awk -F\"=\"\ + \ '/^xxx-status_code/ {print $2}')\n\n# For indentation, please install\ + \ 'jq' (JSON query tool)\necho \"$resp\" | jq\n# echo \"$resp\"\n\nif [[\ + \ $code -lt 400 ]]; then\n echo \"OK\"\n exit 0\nelse\n echo \"\ + Request error\"\n exit 1\nfi" +security: +- headerAuth: [] +- webserverAuth: [] +- cookieAuth: [] servers: -- url: //localhost:8080/cmk/check_mk/api/v0 - description: 'Site: cmk' +- description: 'Site: cmk' + url: //localhost:8080/cmk/check_mk/api/v0 +tags: +- description: 'A problem occurs if a host is not UP or a service ist not OK. + + The acknowledgement of the problem is the indication that the reported issue is + known and that + + somebody is attending to it. + + + You can find an introduction to the acknowledgement of problems in the + + [Checkmk guide](https://docs.checkmk.com/latest/en/basics_ackn.html).' + name: Acknowledge problems + x-displayName: Acknowledge problems +- description: 'When changes are activated, Checkmk transfers the current configuration + status to the ongoing + + monitoring. + + + Changes in the configuration - adding a new host, for example - will initially + have no effect + + on the monitoring. Changes must first be activated, which will bring all changes + that you have + + accumulated since the last activation as a "bundle" into the operational monitoring. + + + You can find an introduction to the configuration of Checkmk including activation + of changes in the + + [Checkmk guide](https://docs.checkmk.com/latest/en/wato.html).' + name: Activate changes + x-displayName: Activate changes +- description: 'An agent is a small program that is installed on a host in order for + Checkmk to be able query + + data from the host. + + + An introduction to agents can be found in the + + [Checkmk guide](https://docs.checkmk.com/latest/en/wato_monitoringagents.html). + + + You can find more about the agent bakery and automatic agent updates of checkmk + enterprise + + in [Agent Deployment](https://docs.checkmk.com/latest/en/agent_deployment.html).' + name: Agents + x-displayName: Agents +- description: 'BI is used in Checkmk to set up a tree based on the status of hosts + and services as branches and to + + extend with higher level nodes summarizing (or aggregating) the status of the + contained objects. + + A BI pack contains the configuration data by means of BI aggregations and BI rules. + + A BI aggregation is a tree of nodes and a BI rule is used to define a node and + its status. + + + You can find an introduction to BI in the + + [Checkmk guide](https://docs.checkmk.com/latest/en/bi.html).' + name: Business intelligence (BI) + x-displayName: Business intelligence (BI) +- description: 'WARNING: Use at your own risk, not supported. + + + Checkmk uses SSL certificates to verify push hosts.' + name: Certificates + x-displayName: Certificates +- description: "Contact groups are the link between hosts and services on one side\ + \ and users on the other.\nEvery contact group represents a responsibility for\ + \ a specific area in the IT landscape.\n\nYou can find an introduction to user\ + \ management including contact groups in the\n[Checkmk guide](https://docs.checkmk.com/latest/en/wato_user.html).\n\ + \n### Relations\n\nA contact group object can have the following relations present\ + \ in `links`:\n\n * `self` - The contact group itself.\n * `urn:org.restfulobject/rels:update`\ + \ - An endpoint to change this contact group.\n * `urn:org.restfulobject/rels:delete`\ + \ - An endpoint to delete this contact group." + name: Contact groups + x-displayName: Contact groups +- description: "A (scheduled) downtime is a planned maintenance period.\nHosts and\ + \ services are handled differently by Checkmk during a downtime, for example,\n\ + notifications are disabled.\n\n### Related documentation\n\nHow to use the query\ + \ DSL used in the `query` parameters of these endpoints, have a look at the\n\ + [Querying Status Data](#section/Querying-Status-Data) section of this documentation.\n\ + \nThese endpoints support all [Livestatus filter operators](https://docs.checkmk.com/latest/en/livestatus_references.html#heading_filter),\n\ + which you can look up in the Checkmk documentation.\n\nFor a detailed list of\ + \ columns, please take a look at the [downtimes table](https://github.com/tribe29/checkmk/blob/master/cmk/gui/plugins/openapi/livestatus_helpers/tables/downtimes.py)\n\ + definition on GitHub.\n\n### Relations\n\nDowntime object can have the following\ + \ relations:\n\n * `self` - The downtime itself.\n * `urn:com.checkmk:rels/host_config`\ + \ - The host the downtime applies to.\n * `urn:org.restfulobjects/delete` - The\ + \ endpoint to delete downtimes." + name: Downtimes + x-displayName: Downtimes +- description: "Folders are used in Checkmk to organize the hosts in a tree structure.\n\ + The root (or main) folder is always existing, other folders can be created manually.\n\ + If you build the tree cleverly you can use it to pass on attributes in a meaningful\ + \ manner.\n\nYou can find an introduction to hosts including folders in the\n\ + [Checkmk guide](https://docs.checkmk.com/latest/en/wato_hosts.html).\n\nDue to\ + \ HTTP escaping folders are represented with the tilde character (`~`) as the\ + \ path separator.\n\n### Host and Folder attributes\n\nEvery host and folder can\ + \ have \"attributes\" set, which determine the behavior of Checkmk. Each\nhost\ + \ inherits all attributes of its folder and the folder's parent folders. So setting\ + \ an SNMP\ncommunity in a folder is equivalent to setting the same on all hosts\ + \ in said folder.\n\nSome host endpoints allow one to view the \"effective attributes\"\ + , which is an aggregation of all\nattributes up to the root.\n\n### Relations\n\ + \nA folder_config object can have the following relations present in `links`:\n\ + \n * `self` - The folder itself.\n * `urn:org.restfulobjects:rels/update` - The\ + \ endpoint to update this folder.\n * `urn:org.restfulobjects:rels/delete` - The\ + \ endpoint to delete this folder." + name: Folders + x-displayName: Folders +- description: "The host status provides the host's \"health\" information.\n\n###\ + \ Related documentation\n\nHow to use the query DSL used in the `query` parameters\ + \ of these endpoints, have a look at the\n[Querying Status Data](#section/Querying-Status-Data)\ + \ section of this documentation.\n\nThese endpoints support all [Livestatus filter\ + \ operators](https://docs.checkmk.com/latest/en/livestatus_references.html#heading_filter),\n\ + which you can look up in the Checkmk documentation.\n\nFor a detailed list of\ + \ columns, please take a look at the [hosts table](https://github.com/tribe29/checkmk/blob/master/cmk/gui/plugins/openapi/livestatus_helpers/tables/hosts.py)\n\ + definition on GitHub.\n\n### Examples\n\nThe query expression for all non-OK hosts\ + \ would be:\n\n {'op': '!=', 'left': 'state', 'right': '0'}\n\nTo search for\ + \ unreachable hosts:\n\n {'op': '=', 'left': 'state', 'right': '2'}\n\nTo search\ + \ for all hosts with their host name or alias starting with 'location1-':\n\n\ + \ {'op': '~', 'left': 'name', 'right': 'location1-.*'}\n\n {'op': '~', 'left':\ + \ 'alias', 'right': 'location1-.*'}\n\nTo search for hosts with specific tags\ + \ set on them:\n\n {'op': '~', 'left': 'tag_names', 'right': 'windows'}" + name: Host status + x-displayName: Host status +- description: "A host is an object that is monitored by Checkmk, for example, a server\ + \ or a network device.\nA host belongs to a certain folder, is usually connected\ + \ to a data source (agent or SNMP) and\nprovides one or more services.\n\nA cluster\ + \ host is a special host type containing the nodes the cluster consists of and\ + \ having\nthe services assigned that are provided by the cluster.\n\nYou can find\ + \ an introduction to hosts in the\n[Checkmk guide](https://docs.checkmk.com/latest/en/wato_hosts.html).\n\ + \nPlease note that every host always resides in a folder. The folder is included\ + \ twice\nin the host's links: Once based upon the canonical path and once based\ + \ upon the folder's\nunique id. You can never remove a host from a folder, just\ + \ move it to a different one.\n\n### Host and Folder attributes\n\nEvery host\ + \ and folder can have \"attributes\" set, which determine the behavior of Checkmk.\ + \ Each\nhost inherits all attributes of its folder and the folder's parent folders.\ + \ So setting an SNMP\ncommunity in a folder is equivalent to setting the same\ + \ on all hosts in said folder.\n\nSome host endpoints allow one to view the \"\ + effective attributes\", which is an aggregation of all\nattributes up to the root.\n\ + \n### Relations\n\nA host_config object can have the following relations present\ + \ in `links`:\n\n * `self` - The host itself.\n * `urn:com.checkmk:rels/folder_config`\ + \ - The folder object this host resides in.\n * `urn:org.restfulobjects:rels/update`\ + \ - The endpoint to update this host.\n * `urn:org.restfulobjects:rels/delete`\ + \ - The endpoint to delete this host." + name: Hosts + x-displayName: Hosts +- description: "Host groups are a way to organize hosts in Checkmk for monitoring.\n\ + By using a host group you can generate suitable views for overview and/or analysis.\n\ + \nYou can find an introduction to hosts including host groups in the\n[Checkmk\ + \ guide](https://docs.checkmk.com/latest/en/wato_hosts.html).\n\nA host group\ + \ object can have the following relations present in `links`:\n\n * `self` - The\ + \ host group itself.\n * `urn:org.restfulobject/rels:update` - An endpoint to\ + \ change this host group.\n * `urn:org.restfulobject/rels:delete` - An endpoint\ + \ to delete this host group." + name: Host groups + x-displayName: Host groups +- description: 'WARNING: Use at your own risk, not supported.' + name: Hosts (internal) + x-displayName: Hosts (internal) +- description: 'Host tag groups are, besides the static folder structure, another + more flexible way to + + organize hosts in Checkmk for configuration. + + A host tag group is a collection of different host tags, with each host receiving + exactly one + + tag from the group. + + + You can find an introduction to hosts including host tags and host tag groups + in the + + [Checkmk guide](https://docs.checkmk.com/latest/en/wato_hosts.html).' + name: Host tag groups + x-displayName: Host tag groups +- description: 'Passwords intended for authentication of certain checks can be stored + in the Checkmk + + password store. You can use in a rule a password stored in the password store + without knowing or + + entering the password.' + name: Passwords + x-displayName: Passwords +- name: Rules + x-displayName: Rules +- name: Rulesets + x-displayName: Rulesets +- description: 'The service status provides the service''s "health" information. + + + A service (for example, a file system or a process) is a property of a certain + host that + + is monitored by Checkmk. + + + ### Related documentation + + + How to use the query DSL used in the `query` parameters of these endpoints, have + a look at the + + [Querying Status Data](#section/Querying-Status-Data) section of this documentation. + + + These endpoints support all [Livestatus filter operators](https://docs.checkmk.com/latest/en/livestatus_references.html#heading_filter), + + which you can look up in the Checkmk documentation. + + + For a detailed list of columns have a look at the [services table](https://github.com/tribe29/checkmk/blob/master/cmk/gui/plugins/openapi/livestatus_helpers/tables/services.py) + + definition on GitHub.' + name: Service status + x-displayName: Service status +- description: 'A service discovery is the automatic and reliable detection of all + services to be monitored on + + a host. + + + You can find an introduction to services including service discovery in the + + [Checkmk guide](https://docs.checkmk.com/latest/en/wato_services.html).' + name: Service discovery + x-displayName: Service discovery +- description: "Service groups are a way to organize services in Checkmk for monitoring.\n\ + By using a service group you can generate suitable views for overview and/or analysis,\n\ + for example, file system services of multiple hosts.\n\nYou can find an introduction\ + \ to services including service groups in the\n[Checkmk guide](https://docs.checkmk.com/latest/en/wato_services.html).\n\ + \nA service group object can have the following relations present in `links`:\n\ + \n * `self` - The service group itself.\n * `urn:org.restfulobject/rels:update`\ + \ - An endpoint to change this service group.\n * `urn:org.restfulobject/rels:delete`\ + \ - An endpoint to delete this service group." + name: Service groups + x-displayName: Service groups +- description: 'With time periods the monitoring with Checkmk can be adapted to recurring + conditions, for + + example, to avoid senseless notifications. + + + You can find an introduction to time periods in the + + [Checkmk guide](https://docs.checkmk.com/latest/en/timeperiods.html).' + name: Time periods + x-displayName: Time periods +- name: Users + x-displayName: Users +- description: This folder collects individual endpoints not fitting into the other + endpoint folders. + name: Miscellaneous + x-displayName: Miscellaneous +x-ignoredHeaderParameters: +- User-Agent +- X-Test-Header +x-logo: + altText: Checkmk + url: https://checkmk.com/bilder/brand-assets/checkmk_logo_main.png +x-tagGroups: +- name: Monitoring + tags: + - Acknowledge problems + - Downtimes + - Host status + - Service status + - Miscellaneous +- name: Setup + tags: + - Activate changes + - Agents + - Business intelligence (BI) + - Contact groups + - Folders + - Hosts + - Host groups + - Host tag groups + - Passwords + - Rules + - Rulesets + - Service discovery + - Service groups + - Time periods + - Users +- name: Checkmk Internal + tags: + - Certificates + - Hosts (internal)