Example #1
0
def save_and_shutdown(caller_id, farm_id, name, description):
    """
    Saves and shutdowns specified Farm's head. Worker nodes are destroyed.

    @cmview_admin_cm
    @param_post{farm_id,int} id of the Farm to save
    @param_post{name,string} name which Farm's head should saved to
    @param_post{description,string} description for newly saved Farm
    """
    farm = Farm.admin_get(farm_id)
    return Farm.save_and_shutdown(farm, name, description)
Example #2
0
def save_and_shutdown(caller_id, farm_id, name, description):
    """
    Saves and shutdowns specified Farm's head. Worker nodes are destroyed.

    @cmview_admin_cm
    @param_post{farm_id,int} id of the Farm to save
    @param_post{name,string} name which Farm's head should saved to
    @param_post{description,string} description for newly saved Farm
    """
    farm = Farm.admin_get(farm_id)
    return Farm.save_and_shutdown(farm, name, description)
Example #3
0
def save_and_shutdown(caller_id, farm_id, name, description):
    """
    Saves and shutdowns VM described by \c data.
    @decoratedby{src.cm.utils.decorators.admin_cm_log}

    @parameter{farm_id,int} id of the requested farm
    @parameter{data,dict}
    \n fields @asrequired{manager.cm.farm.utils.save_and_shutdown()}
    """
    farm = Farm.admin_get(farm_id)
    return Farm.save_and_shutdown(farm, name, description)
Example #4
0
def save_and_shutdown(caller_id, farm_id, name, description):
    """
    Safely saves and shutdowns Farm's Head.

    @cmview_user
    @param_post{farm_id,int}
    @param_post{name,string}
    @param_post{description,string}

    @response{src.cm.manager.farm.utils.save_and_shutdown()}
    """
    farm = Farm.get(caller_id, farm_id)
    if farm.user.id == caller_id:
        return Farm.save_and_shutdown(farm, name, description)
    else:
        raise CMException("farm_save")
Example #5
0
def save_and_shutdown(caller_id, farm_id, name, description):
    """
    Safely saves and shutdowns Farm's Head.

    @cmview_user
    @param_post{farm_id,int}
    @param_post{name,string}
    @param_post{description,string}

    @response{src.cm.manager.farm.utils.save_and_shutdown()}
    """
    farm = Farm.get(caller_id, farm_id)
    if farm.user.id == caller_id:
        return Farm.save_and_shutdown(farm, name, description)
    else:
        raise CMException("farm_save")
Example #6
0
def save_and_shutdown(caller_id, farm_id, name, description):
    """
    Saves and shutdowns safely farm's Head.
    It saves Head to image described in \c data.
    @decoratedby{src.cm.utils.decorators.user_log}

    @parameter{farm_id,int}
    @parameter{data,dict}
    \n fields @asrequired{src.cm.farm.utils.save_and_shutdown()}

    @response{src.cm.manager.farm.utils.save_and_shutdown()}
    """
    farm = Farm.get(caller_id, farm_id)
    if farm.user.id == caller_id:
        return Farm.save_and_shutdown(farm, name, description)
    else:
        raise CMException("farm_save")