def manage_template(): req_type = request.args(0) if req_type == 'delete' or request.vars['delete_this_record'] == 'on': can_delete = check_delete_template(request.args(2)) if not can_delete: redirect(URL(c='admin', f='manage_template')) form = get_manage_template_form(request.args(0)) return dict(form=form)
def manage_template(): req_type = request.args(0) if req_type == 'delete' or request.vars['delete_this_record'] == 'on': can_delete = check_delete_template(request.args(2)) if not can_delete: redirect(URL(c='admin', f='manage_template')) form = get_manage_template_form(request.args(0)) return dict(form = form)
def manage_public_ip_pool(): req_type = request.args(0) if req_type == 'delete' or request.vars['delete_this_record'] == 'on': error_message = is_ip_assigned(request.args(2), is_private=False) if error_message != None: session.flash = error_message redirect(URL(c='admin', f='manage_public_ip_pool')) else: session.flash = 'Public IP deleted successfully' form = get_manage_public_ip_pool_form() return dict(form=form)
def manage_security_domain(): req_type = request.args(0) if req_type == 'delete' or request.vars['delete_this_record'] == 'on': error_message = check_delete_security_domain(request.args(2)) if error_message != None: session.flash = error_message redirect(URL(c='admin', f='manage_security_domain')) form = get_security_domain_form() return dict(form = form)
def manage_security_domain(): req_type = request.args(0) if req_type == 'delete' or request.vars['delete_this_record'] == 'on': error_message = check_delete_security_domain(request.args(2)) if error_message != None: session.flash = error_message redirect(URL(c='admin', f='manage_security_domain')) form = get_security_domain_form() return dict(form=form)
def show_host_performance(): host_id = request.args(0) host_info = get_host_config(host_id) host_identity = str(host_info.host_ip.private_ip).replace('.','_') return dict(host_id=host_id, host_identity=host_identity)
def update(): (db, table) = get_table(request) keyed = hasattr(db[table],'_primarykey') record = None if keyed: key = [f for f in request.vars if f in db[table]._primarykey] if key: record = db(db[table][key[0]] == request.vars[key[0]]).select().first() else: record = db(db[table].id == request.args(2)).select().first() if not record: qry = query_by_table_type(table, db) session.flash = T('record does not exist') redirect(URL('select', args=request.args[:1], vars=dict(query=qry))) if keyed: for k in db[table]._primarykey: db[table][k].writable=False form = SQLFORM(db[table], record, deletable=True, delete_label=T('Check to delete'), ignore_rw=ignore_rw and not keyed, linkto=URL('select', args=request.args[:1]), upload=URL(r=request, f='download', args=request.args[:1])) if form.accepts(request.vars, session): session.flash = T('done!') qry = query_by_table_type(table, db) redirect(URL('select', args=request.args[:1], vars=dict(query=qry))) return dict(form=form,table=db[table])
def update(): (db, table) = get_table(request) keyed = hasattr(db[table], '_primarykey') record = None if keyed: key = [f for f in request.vars if f in db[table]._primarykey] if key: record = db( db[table][key[0]] == request.vars[key[0]]).select().first() else: record = db(db[table].id == request.args(2)).select().first() if not record: qry = query_by_table_type(table, db) session.flash = T('record does not exist') redirect(URL('select', args=request.args[:1], vars=dict(query=qry))) if keyed: for k in db[table]._primarykey: db[table][k].writable = False form = SQLFORM(db[table], record, deletable=True, delete_label=T('Check to delete'), ignore_rw=ignore_rw and not keyed, linkto=URL('select', args=request.args[:1]), upload=URL(r=request, f='download', args=request.args[:1])) if form.accepts(request.vars, session): session.flash = T('done!') qry = query_by_table_type(table, db) redirect(URL('select', args=request.args[:1], vars=dict(query=qry))) return dict(form=form, table=db[table])
def show_host_performance(): host_id = request.args(0) host_info = get_host_config(host_id) host_identity = str(host_info.host_ip.private_ip).replace('.', '_') return dict(host_id=host_id, host_identity=host_identity)
def show_host_performance(): host_id = request.args(0) host_info = get_host_config(host_id) host_identity = str(host_info.host_ip.private_ip).replace('.','_') host_cpu=host_info.CPUs host_ram=host_info.RAM logger.debug(host_cpu) logger.debug(type(host_cpu)) m_type="host" return dict(host_id=host_id, host_identity=host_identity ,host_ram=host_ram, m_type=m_type,host_cpu=host_cpu)
def show_host_performance(): host_id = request.args(0) host_info = get_host_config(host_id) host_identity = str(host_info.host_ip.private_ip).replace('.', '_') host_cpu = host_info.CPUs host_ram = host_info.RAM logger.debug(host_cpu) logger.debug(type(host_cpu)) m_type = "host" return dict(host_id=host_id, host_identity=host_identity, host_ram=host_ram, m_type=m_type, host_cpu=host_cpu)
def host_config(): host_id=request.args(0) host_info = get_host_config(host_id) logger.debug(host_info) return dict(host_info=host_info)
def manage_datastore(): form = get_manage_datastore_form(request.args(0)) return dict(form=form)
def host_config(): host_id = request.args(0) host_info = get_host_config(host_id) logger.debug(host_info) return dict(host_info=host_info)