def destroy(app, gear, keep_uid=false, uid=nil, skip_hooks=false)
args = Hash.new
args['--with-app-uuid'] = app.uuid
args['--with-app-name'] = app.name
args['--with-container-uuid'] = gear.uuid
args['--with-container-name'] = gear.name
args['--with-namespace'] = app.domain.namespace
args['--skip-hooks'] = true if skip_hooks
result = execute_direct(@@C_CONTROLLER, 'app-destroy', args)
result_io = parse_result(result)
uid = gear.uid unless uid
if uid && !keep_uid
unreserve_uid(uid)
end
return result_io
end