예제 #1
0
def _get_host_group(grp_name):
    handler = ApiPortal()
    data = handler.api_get_group(grp_name)
    if not data:
        abort(404)
    #return jsonify(msg="success",data= data),200
    return data
예제 #2
0
def _create_host_group(grp_name):
    handler = ApiPortal()
    #grp_name = request.form["resource_name"].strip()
    if not handler.api_create_group(grp_name):
        abort(500)
    data = handler.api_get_group(grp_name)
    #return jsonify(msg="success",action="create",data= data),200
    return True
예제 #3
0
def _delete_host_group(grp_name):
    handler = ApiPortal()
#    grp_name = request.form["resource_name"].strip()
    if not handler.api_get_group(grp_name):
        abort(404)
    if not handler.api_delete_group(grp_name):
        abort(500)
    #return jsonify(msg="success",action="delete"),200
    return True