def template_unbind_group_get(): tpl_id = request.args.get('tpl_id', '') grp_id = request.args.get('grp_id', '') if not tpl_id: return jsonify(msg="tpl_id is blank") if not grp_id: return jsonify(msg="grp_id is blank") GrpTpl.unbind(grp_id, tpl_id) return jsonify(msg='')
def template_unbind_grp_name_get(): tpl_id = request.args.get('tpl_id', '') if not tpl_id: return jsonify(msg="tpl_id is blank") grp_name = request.args.get('grp_name', '') if not grp_name: return jsonify(msg='grp_name is blank') hg = HostGroup.read('grp_name=%s', [grp_name]) if not hg: return jsonify(msg='no such host group') GrpTpl.unbind(hg.id, tpl_id) return jsonify(msg='')