Пример #1
0
    def _get(self, request):
        hosttags_config = cmk.utils.tags.TagConfig()
        hosttags_config.parse_config(TagConfigFile().load_for_reading())

        hosttags_dict = hosttags_config.get_dict_format()

        # The configuration hash is computed for the configurable hosttags
        add_configuration_hash(hosttags_dict, hosttags_dict)  # Looks strange, but is OK

        hosttags_dict["builtin"] = self._get_builtin_tags_configuration()
        return hosttags_dict
Пример #2
0
    def _get(self, request):
        folder_path = request["folder"]
        if not watolib.Folder.folder_exists(folder_path):
            raise MKUserError(None, _("Folder %s does not exist") % folder_path)

        folder = watolib.Folder.folder(folder_path)
        if bool(int(request.get("effective_attributes", "0"))):
            attributes = folder.effective_attributes()
        else:
            attributes = folder.attributes()

        response = {"attributes": attributes}
        add_configuration_hash(response, attributes)
        return response
Пример #3
0
 def _get(self, request):
     ruleset_name = ensure_str(request["ruleset_name"])
     ruleset_dict = self._get_ruleset_configuration(ruleset_name)
     response = {"ruleset": ruleset_dict}
     add_configuration_hash(response, ruleset_dict)
     return response
Пример #4
0
 def _get(self, request):
     ruleset_name = request["ruleset_name"].encode("utf-8")
     ruleset_dict = self._get_ruleset_configuration(ruleset_name)
     response = {"ruleset": ruleset_dict}
     add_configuration_hash(response, ruleset_dict)
     return response