def update(params): name = params['name'] group = _fetch_contact_group(name) constructors.require_etag(constructors.etag_of_dict(group)) edit_group(name, 'contact', params['body']) group = _fetch_contact_group(name) return serve_group(group, serialize_group('contact_group'))
def update(params): """Update a service-group""" name = params['name'] group = fetch_group(name, "service") constructors.require_etag(constructors.etag_of_dict(group)) edit_group(name, group_type='service', extra_info=params['body']) group = fetch_group(name, "service") return serve_group(group, serialize_group('service_group_config'))
def update(params): """Update a host-group""" name = params['name'] group = _fetch_host_group(name) constructors.require_etag(constructors.etag_of_dict(group)) edit_group(name, 'host', params['body']) group = _fetch_host_group(name) return serve_group(group, serialize_group('host_group_config'))
def update(params): """Update a contact group""" name = params['name'] group = fetch_group(name, "contact") constructors.require_etag(constructors.etag_of_dict(group)) edit_group(name, 'contact', params['body']) group = fetch_group(name, "contact") return serve_group(group, serialize_group('contact_group_config'))
def update(params): """Update a service-group""" name = params['name'] group = _fetch_service_group(name) constructors.require_etag(constructors.etag_of_dict(group)) edit_group(name, 'service', params['body']) group = _fetch_service_group(name) return serve_group(group, serialize_group('service_group'))
def update_groups(group_type: GroupType, entries: List[Dict[str, Any]]): groups = [] for details in entries: name = details['name'] edit_group(name, group_type, details['attributes']) groups.append(name) return fetch_specific_groups(groups, group_type)
def update(params): """Update a host group""" name = params["name"] group = fetch_group(name, "host") constructors.require_etag(constructors.etag_of_dict(group)) edit_group(name, "host", updated_group_details(name, "host", params["body"])) group = fetch_group(name, "host") return serve_group(group, serialize_group("host_group_config"))
def update(params): """Update a host group""" name = params['name'] group = fetch_group(name, "host") constructors.require_etag(constructors.etag_of_dict(group)) edit_group(name, 'host', updated_group_details(name, 'host', params['body'])) group = fetch_group(name, "host") return serve_group(group, serialize_group('host_group_config'))
def update(params): """Update a contact group""" user.need_permission("wato.edit") name = params["name"] group = fetch_group(name, "contact") constructors.require_etag(constructors.etag_of_dict(group)) edit_group(name, "contact", updated_group_details(name, "contact", params["body"])) group = fetch_group(name, "contact") return serve_group(group, serialize_group("contact_group_config"))
def update_groups(group_type: GroupType, entries: List[Dict[str, Any]]): groups = [] for details in entries: name = details["name"] group_details = details["attributes"] updated_details = updated_group_details(name, group_type, group_details) edit_group(name, group_type, updated_details) groups.append(name) return fetch_specific_groups(groups, group_type)
def action(self) -> ActionResult: if not transactions.check_transaction(): return redirect(mode_url("%s_groups" % self.type_name)) alias = request.get_str_input_mandatory("alias").strip() self.group = {"alias": alias} self._determine_additional_group_data() if self._new: self._name = request.get_ascii_input_mandatory("name").strip() groups.add_group(self._name, self.type_name, self.group) else: assert self._name is not None groups.edit_group(self._name, self.type_name, self.group) return redirect(mode_url("%s_groups" % self.type_name))
def post(ident, body, user=None, token_info=None): # type: (str, HostGroup, Optional[str], Optional[RFC7662]) -> HostGroup edit_group(ident, 'host', body) return get(ident)