WebHDFS.html 219 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <!--
  3. | Generated by Apache Maven Doxia at 2025-05-04
  4. | Rendered using Apache Maven Stylus Skin 1.5
  5. -->
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <title>Apache Hadoop 3.5.0-SNAPSHOT &#x2013; WebHDFS REST API</title>
  9. <style type="text/css" media="all">
  10. @import url("./css/maven-base.css");
  11. @import url("./css/maven-theme.css");
  12. @import url("./css/site.css");
  13. </style>
  14. <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
  15. <meta name="Date-Revision-yyyymmdd" content="20250504" />
  16. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  17. </head>
  18. <body class="composite">
  19. <div id="banner">
  20. <a href="http://hadoop.apache.org/" id="bannerLeft">
  21. <img src="http://hadoop.apache.org/images/hadoop-logo.jpg" alt="" />
  22. </a>
  23. <a href="http://www.apache.org/" id="bannerRight">
  24. <img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
  25. </a>
  26. <div class="clear">
  27. <hr/>
  28. </div>
  29. </div>
  30. <div id="breadcrumbs">
  31. <div class="xright"> <a href="http://wiki.apache.org/hadoop" class="externalLink">Wiki</a>
  32. |
  33. <a href="https://gitbox.apache.org/repos/asf/hadoop.git" class="externalLink">git</a>
  34. |
  35. <a href="http://hadoop.apache.org/" class="externalLink">Apache Hadoop</a>
  36. &nbsp;| Last Published: 2025-05-04
  37. &nbsp;| Version: 3.5.0-SNAPSHOT
  38. </div>
  39. <div class="clear">
  40. <hr/>
  41. </div>
  42. </div>
  43. <div id="leftColumn">
  44. <div id="navcolumn">
  45. <h5>General</h5>
  46. <ul>
  47. <li class="none">
  48. <a href="../../index.html">Overview</a>
  49. </li>
  50. <li class="none">
  51. <a href="../../hadoop-project-dist/hadoop-common/SingleCluster.html">Single Node Setup</a>
  52. </li>
  53. <li class="none">
  54. <a href="../../hadoop-project-dist/hadoop-common/ClusterSetup.html">Cluster Setup</a>
  55. </li>
  56. <li class="none">
  57. <a href="../../hadoop-project-dist/hadoop-common/CommandsManual.html">Commands Reference</a>
  58. </li>
  59. <li class="none">
  60. <a href="../../hadoop-project-dist/hadoop-common/FileSystemShell.html">FileSystem Shell</a>
  61. </li>
  62. <li class="none">
  63. <a href="../../hadoop-project-dist/hadoop-common/Compatibility.html">Compatibility Specification</a>
  64. </li>
  65. <li class="none">
  66. <a href="../../hadoop-project-dist/hadoop-common/DownstreamDev.html">Downstream Developer's Guide</a>
  67. </li>
  68. <li class="none">
  69. <a href="../../hadoop-project-dist/hadoop-common/AdminCompatibilityGuide.html">Admin Compatibility Guide</a>
  70. </li>
  71. <li class="none">
  72. <a href="../../hadoop-project-dist/hadoop-common/InterfaceClassification.html">Interface Classification</a>
  73. </li>
  74. <li class="none">
  75. <a href="../../hadoop-project-dist/hadoop-common/filesystem/index.html">FileSystem Specification</a>
  76. </li>
  77. </ul>
  78. <h5>Common</h5>
  79. <ul>
  80. <li class="none">
  81. <a href="../../hadoop-project-dist/hadoop-common/CLIMiniCluster.html">CLI Mini Cluster</a>
  82. </li>
  83. <li class="none">
  84. <a href="../../hadoop-project-dist/hadoop-common/FairCallQueue.html">Fair Call Queue</a>
  85. </li>
  86. <li class="none">
  87. <a href="../../hadoop-project-dist/hadoop-common/NativeLibraries.html">Native Libraries</a>
  88. </li>
  89. <li class="none">
  90. <a href="../../hadoop-project-dist/hadoop-common/Superusers.html">Proxy User</a>
  91. </li>
  92. <li class="none">
  93. <a href="../../hadoop-project-dist/hadoop-common/RackAwareness.html">Rack Awareness</a>
  94. </li>
  95. <li class="none">
  96. <a href="../../hadoop-project-dist/hadoop-common/SecureMode.html">Secure Mode</a>
  97. </li>
  98. <li class="none">
  99. <a href="../../hadoop-project-dist/hadoop-common/ServiceLevelAuth.html">Service Level Authorization</a>
  100. </li>
  101. <li class="none">
  102. <a href="../../hadoop-project-dist/hadoop-common/HttpAuthentication.html">HTTP Authentication</a>
  103. </li>
  104. <li class="none">
  105. <a href="../../hadoop-project-dist/hadoop-common/CredentialProviderAPI.html">Credential Provider API</a>
  106. </li>
  107. <li class="none">
  108. <a href="../../hadoop-kms/index.html">Hadoop KMS</a>
  109. </li>
  110. <li class="none">
  111. <a href="../../hadoop-project-dist/hadoop-common/Tracing.html">Tracing</a>
  112. </li>
  113. <li class="none">
  114. <a href="../../hadoop-project-dist/hadoop-common/UnixShellGuide.html">Unix Shell Guide</a>
  115. </li>
  116. <li class="none">
  117. <a href="../../hadoop-project-dist/hadoop-common/registry/index.html">Registry</a>
  118. </li>
  119. <li class="none">
  120. <a href="../../hadoop-project-dist/hadoop-common/AsyncProfilerServlet.html">Async Profiler</a>
  121. </li>
  122. </ul>
  123. <h5>HDFS</h5>
  124. <ul>
  125. <li class="none">
  126. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsDesign.html">Architecture</a>
  127. </li>
  128. <li class="none">
  129. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html">User Guide</a>
  130. </li>
  131. <li class="none">
  132. <a href="../../hadoop-project-dist/hadoop-hdfs/HDFSCommands.html">Commands Reference</a>
  133. </li>
  134. <li class="none">
  135. <a href="../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html">NameNode HA With QJM</a>
  136. </li>
  137. <li class="none">
  138. <a href="../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithNFS.html">NameNode HA With NFS</a>
  139. </li>
  140. <li class="none">
  141. <a href="../../hadoop-project-dist/hadoop-hdfs/ObserverNameNode.html">Observer NameNode</a>
  142. </li>
  143. <li class="none">
  144. <a href="../../hadoop-project-dist/hadoop-hdfs/Federation.html">Federation</a>
  145. </li>
  146. <li class="none">
  147. <a href="../../hadoop-project-dist/hadoop-hdfs/ViewFs.html">ViewFs</a>
  148. </li>
  149. <li class="none">
  150. <a href="../../hadoop-project-dist/hadoop-hdfs/ViewFsOverloadScheme.html">ViewFsOverloadScheme</a>
  151. </li>
  152. <li class="none">
  153. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsSnapshots.html">Snapshots</a>
  154. </li>
  155. <li class="none">
  156. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsEditsViewer.html">Edits Viewer</a>
  157. </li>
  158. <li class="none">
  159. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsImageViewer.html">Image Viewer</a>
  160. </li>
  161. <li class="none">
  162. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html">Permissions and HDFS</a>
  163. </li>
  164. <li class="none">
  165. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsQuotaAdminGuide.html">Quotas and HDFS</a>
  166. </li>
  167. <li class="none">
  168. <a href="../../hadoop-project-dist/hadoop-hdfs/LibHdfs.html">libhdfs (C API)</a>
  169. </li>
  170. <li class="none">
  171. <a href="../../hadoop-project-dist/hadoop-hdfs/WebHDFS.html">WebHDFS (REST API)</a>
  172. </li>
  173. <li class="none">
  174. <a href="../../hadoop-hdfs-httpfs/index.html">HttpFS</a>
  175. </li>
  176. <li class="none">
  177. <a href="../../hadoop-project-dist/hadoop-hdfs/ShortCircuitLocalReads.html">Short Circuit Local Reads</a>
  178. </li>
  179. <li class="none">
  180. <a href="../../hadoop-project-dist/hadoop-hdfs/CentralizedCacheManagement.html">Centralized Cache Management</a>
  181. </li>
  182. <li class="none">
  183. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html">NFS Gateway</a>
  184. </li>
  185. <li class="none">
  186. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsRollingUpgrade.html">Rolling Upgrade</a>
  187. </li>
  188. <li class="none">
  189. <a href="../../hadoop-project-dist/hadoop-hdfs/ExtendedAttributes.html">Extended Attributes</a>
  190. </li>
  191. <li class="none">
  192. <a href="../../hadoop-project-dist/hadoop-hdfs/TransparentEncryption.html">Transparent Encryption</a>
  193. </li>
  194. <li class="none">
  195. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsMultihoming.html">Multihoming</a>
  196. </li>
  197. <li class="none">
  198. <a href="../../hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html">Storage Policies</a>
  199. </li>
  200. <li class="none">
  201. <a href="../../hadoop-project-dist/hadoop-hdfs/MemoryStorage.html">Memory Storage Support</a>
  202. </li>
  203. <li class="none">
  204. <a href="../../hadoop-project-dist/hadoop-hdfs/SLGUserGuide.html">Synthetic Load Generator</a>
  205. </li>
  206. <li class="none">
  207. <a href="../../hadoop-project-dist/hadoop-hdfs/HDFSErasureCoding.html">Erasure Coding</a>
  208. </li>
  209. <li class="none">
  210. <a href="../../hadoop-project-dist/hadoop-hdfs/HDFSDiskbalancer.html">Disk Balancer</a>
  211. </li>
  212. <li class="none">
  213. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsUpgradeDomain.html">Upgrade Domain</a>
  214. </li>
  215. <li class="none">
  216. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsDataNodeAdminGuide.html">DataNode Admin</a>
  217. </li>
  218. <li class="none">
  219. <a href="../../hadoop-project-dist/hadoop-hdfs-rbf/HDFSRouterFederation.html">Router Federation</a>
  220. </li>
  221. <li class="none">
  222. <a href="../../hadoop-project-dist/hadoop-hdfs/HdfsProvidedStorage.html">Provided Storage</a>
  223. </li>
  224. </ul>
  225. <h5>MapReduce</h5>
  226. <ul>
  227. <li class="none">
  228. <a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html">Tutorial</a>
  229. </li>
  230. <li class="none">
  231. <a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredCommands.html">Commands Reference</a>
  232. </li>
  233. <li class="none">
  234. <a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduce_Compatibility_Hadoop1_Hadoop2.html">Compatibility with 1.x</a>
  235. </li>
  236. <li class="none">
  237. <a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/EncryptedShuffle.html">Encrypted Shuffle</a>
  238. </li>
  239. <li class="none">
  240. <a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/PluggableShuffleAndPluggableSort.html">Pluggable Shuffle/Sort</a>
  241. </li>
  242. <li class="none">
  243. <a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/DistributedCacheDeploy.html">Distributed Cache Deploy</a>
  244. </li>
  245. <li class="none">
  246. <a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/SharedCacheSupport.html">Support for YARN Shared Cache</a>
  247. </li>
  248. </ul>
  249. <h5>MapReduce REST APIs</h5>
  250. <ul>
  251. <li class="none">
  252. <a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredAppMasterRest.html">MR Application Master</a>
  253. </li>
  254. <li class="none">
  255. <a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-hs/HistoryServerRest.html">MR History Server</a>
  256. </li>
  257. </ul>
  258. <h5>YARN</h5>
  259. <ul>
  260. <li class="none">
  261. <a href="../../hadoop-yarn/hadoop-yarn-site/YARN.html">Architecture</a>
  262. </li>
  263. <li class="none">
  264. <a href="../../hadoop-yarn/hadoop-yarn-site/YarnCommands.html">Commands Reference</a>
  265. </li>
  266. <li class="none">
  267. <a href="../../hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html">Capacity Scheduler</a>
  268. </li>
  269. <li class="none">
  270. <a href="../../hadoop-yarn/hadoop-yarn-site/FairScheduler.html">Fair Scheduler</a>
  271. </li>
  272. <li class="none">
  273. <a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRestart.html">ResourceManager Restart</a>
  274. </li>
  275. <li class="none">
  276. <a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html">ResourceManager HA</a>
  277. </li>
  278. <li class="none">
  279. <a href="../../hadoop-yarn/hadoop-yarn-site/ResourceModel.html">Resource Model</a>
  280. </li>
  281. <li class="none">
  282. <a href="../../hadoop-yarn/hadoop-yarn-site/NodeLabel.html">Node Labels</a>
  283. </li>
  284. <li class="none">
  285. <a href="../../hadoop-yarn/hadoop-yarn-site/NodeAttributes.html">Node Attributes</a>
  286. </li>
  287. <li class="none">
  288. <a href="../../hadoop-yarn/hadoop-yarn-site/WebApplicationProxy.html">Web Application Proxy</a>
  289. </li>
  290. <li class="none">
  291. <a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html">Timeline Server</a>
  292. </li>
  293. <li class="none">
  294. <a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html">Timeline Service V.2</a>
  295. </li>
  296. <li class="none">
  297. <a href="../../hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html">Writing YARN Applications</a>
  298. </li>
  299. <li class="none">
  300. <a href="../../hadoop-yarn/hadoop-yarn-site/YarnApplicationSecurity.html">YARN Application Security</a>
  301. </li>
  302. <li class="none">
  303. <a href="../../hadoop-yarn/hadoop-yarn-site/NodeManager.html">NodeManager</a>
  304. </li>
  305. <li class="none">
  306. <a href="../../hadoop-yarn/hadoop-yarn-site/DockerContainers.html">Running Applications in Docker Containers</a>
  307. </li>
  308. <li class="none">
  309. <a href="../../hadoop-yarn/hadoop-yarn-site/RuncContainers.html">Running Applications in runC Containers</a>
  310. </li>
  311. <li class="none">
  312. <a href="../../hadoop-yarn/hadoop-yarn-site/NodeManagerCgroups.html">Using CGroups</a>
  313. </li>
  314. <li class="none">
  315. <a href="../../hadoop-yarn/hadoop-yarn-site/SecureContainer.html">Secure Containers</a>
  316. </li>
  317. <li class="none">
  318. <a href="../../hadoop-yarn/hadoop-yarn-site/ReservationSystem.html">Reservation System</a>
  319. </li>
  320. <li class="none">
  321. <a href="../../hadoop-yarn/hadoop-yarn-site/GracefulDecommission.html">Graceful Decommission</a>
  322. </li>
  323. <li class="none">
  324. <a href="../../hadoop-yarn/hadoop-yarn-site/OpportunisticContainers.html">Opportunistic Containers</a>
  325. </li>
  326. <li class="none">
  327. <a href="../../hadoop-yarn/hadoop-yarn-site/Federation.html">YARN Federation</a>
  328. </li>
  329. <li class="none">
  330. <a href="../../hadoop-yarn/hadoop-yarn-site/SharedCache.html">Shared Cache</a>
  331. </li>
  332. <li class="none">
  333. <a href="../../hadoop-yarn/hadoop-yarn-site/UsingGpus.html">Using GPU</a>
  334. </li>
  335. <li class="none">
  336. <a href="../../hadoop-yarn/hadoop-yarn-site/UsingFPGA.html">Using FPGA</a>
  337. </li>
  338. <li class="none">
  339. <a href="../../hadoop-yarn/hadoop-yarn-site/PlacementConstraints.html">Placement Constraints</a>
  340. </li>
  341. <li class="none">
  342. <a href="../../hadoop-yarn/hadoop-yarn-site/YarnUI2.html">YARN UI2</a>
  343. </li>
  344. </ul>
  345. <h5>YARN REST APIs</h5>
  346. <ul>
  347. <li class="none">
  348. <a href="../../hadoop-yarn/hadoop-yarn-site/WebServicesIntro.html">Introduction</a>
  349. </li>
  350. <li class="none">
  351. <a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html">Resource Manager</a>
  352. </li>
  353. <li class="none">
  354. <a href="../../hadoop-yarn/hadoop-yarn-site/NodeManagerRest.html">Node Manager</a>
  355. </li>
  356. <li class="none">
  357. <a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html#Timeline_Server_REST_API_v1">Timeline Server</a>
  358. </li>
  359. <li class="none">
  360. <a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html#Timeline_Service_v.2_REST_API">Timeline Service V.2</a>
  361. </li>
  362. </ul>
  363. <h5>YARN Service</h5>
  364. <ul>
  365. <li class="none">
  366. <a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/Overview.html">Overview</a>
  367. </li>
  368. <li class="none">
  369. <a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/QuickStart.html">QuickStart</a>
  370. </li>
  371. <li class="none">
  372. <a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/Concepts.html">Concepts</a>
  373. </li>
  374. <li class="none">
  375. <a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/YarnServiceAPI.html">Yarn Service API</a>
  376. </li>
  377. <li class="none">
  378. <a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/ServiceDiscovery.html">Service Discovery</a>
  379. </li>
  380. <li class="none">
  381. <a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/SystemServices.html">System Services</a>
  382. </li>
  383. </ul>
  384. <h5>Hadoop Compatible File Systems</h5>
  385. <ul>
  386. <li class="none">
  387. <a href="../../hadoop-aliyun/tools/hadoop-aliyun/index.html">Aliyun OSS</a>
  388. </li>
  389. <li class="none">
  390. <a href="../../hadoop-aws/tools/hadoop-aws/index.html">Amazon S3</a>
  391. </li>
  392. <li class="none">
  393. <a href="../../hadoop-azure/index.html">Azure Blob Storage</a>
  394. </li>
  395. <li class="none">
  396. <a href="../../hadoop-azure-datalake/index.html">Azure Data Lake Storage</a>
  397. </li>
  398. <li class="none">
  399. <a href="../../hadoop-cos/cloud-storage/index.html">Tencent COS</a>
  400. </li>
  401. <li class="none">
  402. <a href="../../hadoop-huaweicloud/index.html">Huaweicloud OBS</a>
  403. </li>
  404. <li class="none">
  405. <a href="../../hadoop-tos/cloud-storage/index.html">VolcanoEngine TOS</a>
  406. </li>
  407. </ul>
  408. <h5>Auth</h5>
  409. <ul>
  410. <li class="none">
  411. <a href="../../hadoop-auth/index.html">Overview</a>
  412. </li>
  413. <li class="none">
  414. <a href="../../hadoop-auth/Examples.html">Examples</a>
  415. </li>
  416. <li class="none">
  417. <a href="../../hadoop-auth/Configuration.html">Configuration</a>
  418. </li>
  419. <li class="none">
  420. <a href="../../hadoop-auth/BuildingIt.html">Building</a>
  421. </li>
  422. </ul>
  423. <h5>Tools</h5>
  424. <ul>
  425. <li class="none">
  426. <a href="../../hadoop-streaming/HadoopStreaming.html">Hadoop Streaming</a>
  427. </li>
  428. <li class="none">
  429. <a href="../../hadoop-archives/HadoopArchives.html">Hadoop Archives</a>
  430. </li>
  431. <li class="none">
  432. <a href="../../hadoop-archive-logs/HadoopArchiveLogs.html">Hadoop Archive Logs</a>
  433. </li>
  434. <li class="none">
  435. <a href="../../hadoop-distcp/DistCp.html">DistCp</a>
  436. </li>
  437. <li class="none">
  438. <a href="../../hadoop-federation-balance/HDFSFederationBalance.html">HDFS Federation Balance</a>
  439. </li>
  440. <li class="none">
  441. <a href="../../hadoop-gridmix/GridMix.html">GridMix</a>
  442. </li>
  443. <li class="none">
  444. <a href="../../hadoop-rumen/Rumen.html">Rumen</a>
  445. </li>
  446. <li class="none">
  447. <a href="../../hadoop-resourceestimator/ResourceEstimator.html">Resource Estimator Service</a>
  448. </li>
  449. <li class="none">
  450. <a href="../../hadoop-sls/SchedulerLoadSimulator.html">Scheduler Load Simulator</a>
  451. </li>
  452. <li class="none">
  453. <a href="../../hadoop-project-dist/hadoop-common/Benchmarking.html">Hadoop Benchmarking</a>
  454. </li>
  455. <li class="none">
  456. <a href="../../hadoop-dynamometer/Dynamometer.html">Dynamometer</a>
  457. </li>
  458. </ul>
  459. <h5>Reference</h5>
  460. <ul>
  461. <li class="none">
  462. <a href="../../hadoop-project-dist/hadoop-common/release/">Changelog and Release Notes</a>
  463. </li>
  464. <li class="none">
  465. <a href="../../api/index.html">Java API docs</a>
  466. </li>
  467. <li class="none">
  468. <a href="../../hadoop-project-dist/hadoop-common/UnixShellAPI.html">Unix Shell API</a>
  469. </li>
  470. <li class="none">
  471. <a href="../../hadoop-project-dist/hadoop-common/Metrics.html">Metrics</a>
  472. </li>
  473. </ul>
  474. <h5>Configuration</h5>
  475. <ul>
  476. <li class="none">
  477. <a href="../../hadoop-project-dist/hadoop-common/core-default.xml">core-default.xml</a>
  478. </li>
  479. <li class="none">
  480. <a href="../../hadoop-project-dist/hadoop-hdfs/hdfs-default.xml">hdfs-default.xml</a>
  481. </li>
  482. <li class="none">
  483. <a href="../../hadoop-project-dist/hadoop-hdfs-rbf/hdfs-rbf-default.xml">hdfs-rbf-default.xml</a>
  484. </li>
  485. <li class="none">
  486. <a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml">mapred-default.xml</a>
  487. </li>
  488. <li class="none">
  489. <a href="../../hadoop-yarn/hadoop-yarn-common/yarn-default.xml">yarn-default.xml</a>
  490. </li>
  491. <li class="none">
  492. <a href="../../hadoop-kms/kms-default.html">kms-default.xml</a>
  493. </li>
  494. <li class="none">
  495. <a href="../../hadoop-hdfs-httpfs/httpfs-default.html">httpfs-default.xml</a>
  496. </li>
  497. <li class="none">
  498. <a href="../../hadoop-project-dist/hadoop-common/DeprecatedProperties.html">Deprecated Properties</a>
  499. </li>
  500. </ul>
  501. <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
  502. <img alt="Built by Maven" src="./images/logos/maven-feather.png"/>
  503. </a>
  504. </div>
  505. </div>
  506. <div id="bodyColumn">
  507. <div id="contentBox">
  508. <!---
  509. Licensed under the Apache License, Version 2.0 (the "License");
  510. you may not use this file except in compliance with the License.
  511. You may obtain a copy of the License at
  512. http://www.apache.org/licenses/LICENSE-2.0
  513. Unless required by applicable law or agreed to in writing, software
  514. distributed under the License is distributed on an "AS IS" BASIS,
  515. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  516. See the License for the specific language governing permissions and
  517. limitations under the License. See accompanying LICENSE file.
  518. -->
  519. <h1>WebHDFS REST API</h1>
  520. <ul>
  521. <li><a href="#Document_Conventions">Document Conventions</a></li>
  522. <li><a href="#Introduction">Introduction</a>
  523. <ul>
  524. <li><a href="#Operations">Operations</a></li>
  525. <li><a href="#FileSystem_URIs_vs_HTTP_URLs">FileSystem URIs vs HTTP URLs</a></li>
  526. <li><a href="#HDFS_Configuration_Options">HDFS Configuration Options</a></li></ul></li>
  527. <li><a href="#Authentication">Authentication</a></li>
  528. <li><a href="#SSL_Configurations_for_SWebHDFS">SSL Configurations for SWebHDFS</a></li>
  529. <li><a href="#Proxy_Users">Proxy Users</a></li>
  530. <li><a href="#Cross-Site_Request_Forgery_Prevention">Cross-Site Request Forgery Prevention</a></li>
  531. <li><a href="#WebHDFS_Retry_Policy">WebHDFS Retry Policy</a></li>
  532. <li><a href="#WebHDFS_Request_Filtering">WebHDFS Request Filtering</a></li>
  533. <li><a href="#File_and_Directory_Operations">File and Directory Operations</a>
  534. <ul>
  535. <li><a href="#Create_and_Write_to_a_File">Create and Write to a File</a></li>
  536. <li><a href="#Append_to_a_File">Append to a File</a></li>
  537. <li><a href="#Concat_File.28s.29">Concat File(s)</a></li>
  538. <li><a href="#Open_and_Read_a_File">Open and Read a File</a></li>
  539. <li><a href="#Make_a_Directory">Make a Directory</a></li>
  540. <li><a href="#Create_a_Symbolic_Link">Create a Symbolic Link</a></li>
  541. <li><a href="#Rename_a_File.2FDirectory">Rename a File/Directory</a></li>
  542. <li><a href="#Delete_a_File.2FDirectory">Delete a File/Directory</a></li>
  543. <li><a href="#Truncate_a_File">Truncate a File</a></li>
  544. <li><a href="#Status_of_a_File.2FDirectory">Status of a File/Directory</a></li>
  545. <li><a href="#List_a_Directory">List a Directory</a></li>
  546. <li><a href="#List_a_File">List a File</a></li>
  547. <li><a href="#Iteratively_List_a_Directory">Iteratively List a Directory</a></li></ul></li>
  548. <li><a href="#Other_File_System_Operations">Other File System Operations</a>
  549. <ul>
  550. <li><a href="#Get_Content_Summary_of_a_Directory">Get Content Summary of a Directory</a></li>
  551. <li><a href="#Get_Quota_Usage_of_a_Directory">Get Quota Usage of a Directory</a></li>
  552. <li><a href="#Set_Quota">Set Quota</a></li>
  553. <li><a href="#Set_Quota_By_Storage_Type">Set Quota By Storage Type</a></li>
  554. <li><a href="#Get_File_Checksum">Get File Checksum</a></li>
  555. <li><a href="#Get_Home_Directory">Get Home Directory</a></li>
  556. <li><a href="#Get_Trash_Root">Get Trash Root</a></li>
  557. <li><a href="#Set_Permission">Set Permission</a></li>
  558. <li><a href="#Set_Owner">Set Owner</a></li>
  559. <li><a href="#Set_Replication_Factor">Set Replication Factor</a></li>
  560. <li><a href="#Set_Access_or_Modification_Time">Set Access or Modification Time</a></li>
  561. <li><a href="#Modify_ACL_Entries">Modify ACL Entries</a></li>
  562. <li><a href="#Remove_ACL_Entries">Remove ACL Entries</a></li>
  563. <li><a href="#Remove_Default_ACL">Remove Default ACL</a></li>
  564. <li><a href="#Remove_ACL">Remove ACL</a></li>
  565. <li><a href="#Set_ACL">Set ACL</a></li>
  566. <li><a href="#Get_ACL_Status">Get ACL Status</a></li>
  567. <li><a href="#Check_access">Check access</a></li>
  568. <li><a href="#Get_Server_Defaults">Get Server Defaults</a></li>
  569. <li><a href="#Get_Link_Target">Get Link Target</a></li>
  570. <li><a href="#Get_File_Link_Status">Get File Link Status</a></li>
  571. <li><a href="#Get_EC_Policies">Get EC Policies</a></li>
  572. <li><a href="#Get_Status">Get Status</a></li>
  573. <li><a href="#Get_EC_Codecs">Get EC Codecs</a></li>
  574. <li><a href="#Get_Trash_Roots">Get Trash Roots</a></li></ul></li>
  575. <li><a href="#Storage_Policy_Operations">Storage Policy Operations</a>
  576. <ul>
  577. <li><a href="#Get_all_Storage_Policies">Get all Storage Policies</a></li>
  578. <li><a href="#Set_Storage_Policy">Set Storage Policy</a></li>
  579. <li><a href="#Unset_Storage_Policy">Unset Storage Policy</a></li>
  580. <li><a href="#Get_Storage_Policy">Get Storage Policy</a></li>
  581. <li><a href="#Satisfy_Storage_Policy">Satisfy Storage Policy</a></li>
  582. <li><a href="#Get_File_Block_Locations">Get File Block Locations</a></li></ul></li>
  583. <li><a href="#Extended_Attributes.28XAttrs.29_Operations">Extended Attributes(XAttrs) Operations</a>
  584. <ul>
  585. <li><a href="#Set_XAttr">Set XAttr</a></li>
  586. <li><a href="#Remove_XAttr">Remove XAttr</a></li>
  587. <li><a href="#Get_an_XAttr">Get an XAttr</a></li>
  588. <li><a href="#Get_multiple_XAttrs">Get multiple XAttrs</a></li>
  589. <li><a href="#Get_all_XAttrs">Get all XAttrs</a></li>
  590. <li><a href="#List_all_XAttrs">List all XAttrs</a></li></ul></li>
  591. <li><a href="#Erasure_Coding_Operations">Erasure Coding Operations</a>
  592. <ul>
  593. <li><a href="#Enable_EC_Policy">Enable EC Policy</a></li>
  594. <li><a href="#Disable_EC_Policy">Disable EC Policy</a></li>
  595. <li><a href="#Set_EC_Policy">Set EC Policy</a></li>
  596. <li><a href="#Get_EC_Policy">Get EC Policy</a></li>
  597. <li><a href="#Unset_EC_Policy">Unset EC Policy</a></li></ul></li>
  598. <li><a href="#Snapshot_Operations">Snapshot Operations</a>
  599. <ul>
  600. <li><a href="#Allow_Snapshot">Allow Snapshot</a></li>
  601. <li><a href="#Disallow_Snapshot">Disallow Snapshot</a></li>
  602. <li><a href="#Create_Snapshot">Create Snapshot</a></li>
  603. <li><a href="#Delete_Snapshot">Delete Snapshot</a></li>
  604. <li><a href="#Rename_Snapshot">Rename Snapshot</a></li>
  605. <li><a href="#Get_Snapshot_Diff">Get Snapshot Diff</a></li>
  606. <li><a href="#Get_Snapshot_Diff_Iteratively">Get Snapshot Diff Iteratively</a></li>
  607. <li><a href="#Get_Snapshottable_Directory_List">Get Snapshottable Directory List</a></li>
  608. <li><a href="#Get_Snapshot_List">Get Snapshot List</a></li></ul></li>
  609. <li><a href="#Delegation_Token_Operations">Delegation Token Operations</a>
  610. <ul>
  611. <li><a href="#Get_Delegation_Token">Get Delegation Token</a></li>
  612. <li><a href="#Renew_Delegation_Token">Renew Delegation Token</a></li>
  613. <li><a href="#Cancel_Delegation_Token">Cancel Delegation Token</a></li></ul></li>
  614. <li><a href="#Error_Responses">Error Responses</a>
  615. <ul>
  616. <li><a href="#HTTP_Response_Codes">HTTP Response Codes</a>
  617. <ul>
  618. <li><a href="#Illegal_Argument_Exception">Illegal Argument Exception</a></li>
  619. <li><a href="#Security_Exception">Security Exception</a></li>
  620. <li><a href="#Access_Control_Exception">Access Control Exception</a></li>
  621. <li><a href="#File_Not_Found_Exception">File Not Found Exception</a></li></ul></li></ul></li>
  622. <li><a href="#JSON_Schemas">JSON Schemas</a>
  623. <ul>
  624. <li><a href="#ACL_Status_JSON_Schema">ACL Status JSON Schema</a></li>
  625. <li><a href="#XAttrs_JSON_Schema">XAttrs JSON Schema</a></li>
  626. <li><a href="#XAttrNames_JSON_Schema">XAttrNames JSON Schema</a></li>
  627. <li><a href="#Boolean_JSON_Schema">Boolean JSON Schema</a></li>
  628. <li><a href="#ContentSummary_JSON_Schema">ContentSummary JSON Schema</a></li>
  629. <li><a href="#QuotaUsage_JSON_Schema">QuotaUsage JSON Schema</a></li>
  630. <li><a href="#FileChecksum_JSON_Schema">FileChecksum JSON Schema</a></li>
  631. <li><a href="#FileStatus_JSON_Schema">FileStatus JSON Schema</a>
  632. <ul>
  633. <li><a href="#FileStatus_Properties">FileStatus Properties</a></li></ul></li>
  634. <li><a href="#FileStatuses_JSON_Schema">FileStatuses JSON Schema</a></li>
  635. <li><a href="#DirectoryListing_JSON_Schema">DirectoryListing JSON Schema</a></li>
  636. <li><a href="#Long_JSON_Schema">Long JSON Schema</a></li>
  637. <li><a href="#Path_JSON_Schema">Path JSON Schema</a></li>
  638. <li><a href="#RemoteException_JSON_Schema">RemoteException JSON Schema</a></li>
  639. <li><a href="#Token_JSON_Schema">Token JSON Schema</a>
  640. <ul>
  641. <li><a href="#Token_Properties">Token Properties</a></li></ul></li>
  642. <li><a href="#BlockStoragePolicy_JSON_Schema">BlockStoragePolicy JSON Schema</a>
  643. <ul>
  644. <li><a href="#BlockStoragePolicy_Properties">BlockStoragePolicy Properties</a></li></ul></li>
  645. <li><a href="#ECPolicy_JSON_Schema">ECPolicy JSON Schema</a></li>
  646. <li><a href="#BlockStoragePolicies_JSON_Schema">BlockStoragePolicies JSON Schema</a></li>
  647. <li><a href="#SnapshotDiffReport_JSON_Schema">SnapshotDiffReport JSON Schema</a>
  648. <ul>
  649. <li><a href="#DiffReport_Entries">DiffReport Entries</a></li></ul></li>
  650. <li><a href="#SnapshotDiffReportListing_JSON_Schema">SnapshotDiffReportListing JSON Schema</a>
  651. <ul>
  652. <li><a href="#DiffReportListing_Entries">DiffReportListing Entries</a></li></ul></li>
  653. <li><a href="#SnapshottableDirectoryList_JSON_Schema">SnapshottableDirectoryList JSON Schema</a>
  654. <ul>
  655. <li><a href="#SnapshottableDirectoryStatus">SnapshottableDirectoryStatus</a></li></ul></li>
  656. <li><a href="#SnapshotList_JSON_Schema">SnapshotList JSON Schema</a>
  657. <ul>
  658. <li><a href="#SnapshotStatus">SnapshotStatus</a></li></ul></li>
  659. <li><a href="#BlockLocations_JSON_Schema">BlockLocations JSON Schema</a></li>
  660. <li><a href="#BlockLocation_JSON_Schema">BlockLocation JSON Schema</a>
  661. <ul>
  662. <li><a href="#BlockLocation_Properties">BlockLocation Properties</a></li></ul></li>
  663. <li><a href="#Server_Defaults_JSON_Schema">Server Defaults JSON Schema</a></li>
  664. <li><a href="#FsStatus_JSON_Schema">FsStatus JSON Schema</a></li>
  665. <li><a href="#EC_Policies_JSON_Schema">EC Policies JSON Schema</a></li>
  666. <li><a href="#EC_Codecs_JSON_Schema">EC Codecs JSON Schema</a></li>
  667. <li><a href="#Paths_JSON_Schema">Paths JSON Schema</a></li></ul></li>
  668. <li><a href="#HTTP_Query_Parameter_Dictionary">HTTP Query Parameter Dictionary</a>
  669. <ul>
  670. <li><a href="#ACL_Spec">ACL Spec</a></li>
  671. <li><a href="#XAttr_Name">XAttr Name</a></li>
  672. <li><a href="#XAttr_Value">XAttr Value</a></li>
  673. <li><a href="#XAttr_set_flag">XAttr set flag</a></li>
  674. <li><a href="#XAttr_value_encoding">XAttr value encoding</a></li>
  675. <li><a href="#Access_Time">Access Time</a></li>
  676. <li><a href="#Block_Size">Block Size</a></li>
  677. <li><a href="#Buffer_Size">Buffer Size</a></li>
  678. <li><a href="#Create_Flag">Create Flag</a></li>
  679. <li><a href="#Create_Parent">Create Parent</a></li>
  680. <li><a href="#Delegation">Delegation</a></li>
  681. <li><a href="#Destination">Destination</a></li>
  682. <li><a href="#Do_As">Do As</a></li>
  683. <li><a href="#Fs_Action">Fs Action</a></li>
  684. <li><a href="#Group">Group</a></li>
  685. <li><a href="#Length">Length</a></li>
  686. <li><a href="#Modification_Time">Modification Time</a></li>
  687. <li><a href="#New_Length">New Length</a></li>
  688. <li><a href="#Offset">Offset</a></li>
  689. <li><a href="#Old_Snapshot_Name">Old Snapshot Name</a></li>
  690. <li><a href="#Op">Op</a></li>
  691. <li><a href="#Overwrite">Overwrite</a></li>
  692. <li><a href="#Owner">Owner</a></li>
  693. <li><a href="#Permission">Permission</a></li>
  694. <li><a href="#Recursive">Recursive</a></li>
  695. <li><a href="#Renewer">Renewer</a></li>
  696. <li><a href="#Replication">Replication</a></li>
  697. <li><a href="#Snapshot_Name">Snapshot Name</a></li>
  698. <li><a href="#Sources">Sources</a></li>
  699. <li><a href="#Token">Token</a></li>
  700. <li><a href="#Token_Kind">Token Kind</a></li>
  701. <li><a href="#Token_Service">Token Service</a></li>
  702. <li><a href="#Username">Username</a></li>
  703. <li><a href="#NoRedirect">NoRedirect</a></li>
  704. <li><a href="#Namespace_Quota">Namespace Quota</a></li>
  705. <li><a href="#Storage_Space_Quota">Storage Space Quota</a></li>
  706. <li><a href="#Storage_Type">Storage Type</a></li>
  707. <li><a href="#Storage_Policy">Storage Policy</a></li>
  708. <li><a href="#Erasure_Coding_Policy">Erasure Coding Policy</a></li>
  709. <li><a href="#Start_After">Start After</a></li></ul></li></ul>
  710. <section>
  711. <h2><a name="Document_Conventions"></a>Document Conventions</h2>
  712. <table border="0" class="bodyTable">
  713. <thead>
  714. <tr class="a">
  715. <th align="left"> <code>Monospaced</code> </th>
  716. <th align="left"> Used for commands, HTTP request and responses and code blocks. </th></tr>
  717. </thead><tbody>
  718. <tr class="b">
  719. <td align="left"> <code>&lt;Monospaced&gt;</code> </td>
  720. <td align="left"> User entered values. </td></tr>
  721. <tr class="a">
  722. <td align="left"> <code>[Monospaced]</code> </td>
  723. <td align="left"> Optional values. When the value is not specified, the default value is used. </td></tr>
  724. <tr class="b">
  725. <td align="left"> <i>Italics</i> </td>
  726. <td align="left"> Important phrases and words. </td></tr>
  727. </tbody>
  728. </table></section><section>
  729. <h2><a name="Introduction"></a>Introduction</h2>
  730. <p>The HTTP REST API supports the complete <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>/<a href="../../api/org/apache/hadoop/fs/FileContext.html">FileContext</a> interface for HDFS. The operations and the corresponding FileSystem/FileContext methods are shown in the next section. The Section <a href="#HTTP_Query_Parameter_Dictionary">HTTP Query Parameter Dictionary</a> specifies the parameter details such as the defaults and the valid values.</p><section>
  731. <h3><a name="Operations"></a>Operations</h3>
  732. <ul>
  733. <li>HTTP GET
  734. <ul>
  735. <li><a href="#Open_and_Read_a_File"><code>OPEN</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.open)</li>
  736. <li><a href="#Status_of_a_FileDirectory"><code>GETFILESTATUS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileStatus)</li>
  737. <li><a href="#List_a_Directory"><code>LISTSTATUS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listStatus)</li>
  738. <li><a href="#Iteratively_List_a_Directory"><code>LISTSTATUS_BATCH</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listStatusIterator)</li>
  739. <li><a href="#Get_Content_Summary_of_a_Directory"><code>GETCONTENTSUMMARY</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getContentSummary)</li>
  740. <li><a href="#Get_Quota_Usage_of_a_Directory"><code>GETQUOTAUSAGE</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getQuotaUsage)</li>
  741. <li><a href="#Get_File_Checksum"><code>GETFILECHECKSUM</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileChecksum)</li>
  742. <li><a href="#Get_Home_Directory"><code>GETHOMEDIRECTORY</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getHomeDirectory)</li>
  743. <li><a href="#Get_Delegation_Token"><code>GETDELEGATIONTOKEN</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getDelegationToken)</li>
  744. <li><a href="#Get_Trash_Root"><code>GETTRASHROOT</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getTrashRoot)</li>
  745. <li><a href="#Get_an_XAttr"><code>GETXATTRS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttr)</li>
  746. <li><a href="#Get_multiple_XAttrs"><code>GETXATTRS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttrs)</li>
  747. <li><a href="#Get_all_XAttrs"><code>GETXATTRS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttrs)</li>
  748. <li><a href="#List_all_XAttrs"><code>LISTXATTRS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listXAttrs)</li>
  749. <li><a href="#Check_access"><code>CHECKACCESS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.access)</li>
  750. <li><a href="#Get_all_Storage_Policies"><code>GETALLSTORAGEPOLICY</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getAllStoragePolicies)</li>
  751. <li><a href="#Get_Storage_Policy"><code>GETSTORAGEPOLICY</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getStoragePolicy)</li>
  752. <li><a href="#Get_Snapshot_Diff"><code>GETSNAPSHOTDIFF</code></a></li>
  753. <li><a href="#Get_Snapshot_Diff_Iteratively"><code>GETSNAPSHOTDIFFLISTING</code></a></li>
  754. <li><a href="#Get_Snapshottable_Directory_List"><code>GETSNAPSHOTTABLEDIRECTORYLIST</code></a></li>
  755. <li><a href="#Get_Snapshot_List"><code>GETSNAPSHOTLIST</code></a></li>
  756. <li><a href="#Get_File_Block_Locations"><code>GETFILEBLOCKLOCATIONS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileBlockLocations)</li>
  757. <li><a href="#Get_EC_Policy"><code>GETECPOLICY</code></a> (see <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.getErasureCodingPolicy)</li>
  758. <li><a href="#Get_Server_Defaults"><code>GETSERVERDEFAULTS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getServerDefaults)</li>
  759. <li><a href="#Get_Link_Target"><code>GETLINKTARGET</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getLinkTarget)</li>
  760. <li><a href="#Get_File_Link_Status"><code>GETFILELINKSTATUS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileLinkStatus)</li>
  761. <li><a href="#Get_Status"><code>GETSTATUS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getStatus)</li>
  762. <li><a href="#Get_EC_Policies"><code>GETECPOLICIES</code></a></li>
  763. <li><a href="#Get_EC_Codecs"><code>GETECCODECS</code></a></li>
  764. <li><a href="#Get_Trash_Roots"><code>GETTRASHROOTS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getTrashRoots)</li>
  765. </ul>
  766. </li>
  767. <li>HTTP PUT
  768. <ul>
  769. <li><a href="#Create_and_Write_to_a_File"><code>CREATE</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.create)</li>
  770. <li><a href="#Make_a_Directory"><code>MKDIRS</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.mkdirs)</li>
  771. <li><a href="#Create_a_Symbolic_Link"><code>CREATESYMLINK</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileContext.html">FileContext</a>.createSymlink)</li>
  772. <li><a href="#Rename_a_FileDirectory"><code>RENAME</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.rename)</li>
  773. <li><a href="#Set_Replication_Factor"><code>SETREPLICATION</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setReplication)</li>
  774. <li><a href="#Set_Owner"><code>SETOWNER</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setOwner)</li>
  775. <li><a href="#Set_Permission"><code>SETPERMISSION</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setPermission)</li>
  776. <li><a href="#Set_Access_or_Modification_Time"><code>SETTIMES</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setTimes)</li>
  777. <li><a href="#Renew_Delegation_Token"><code>RENEWDELEGATIONTOKEN</code></a> (see <a href="../../api/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticator.html">DelegationTokenAuthenticator</a>.renewDelegationToken)</li>
  778. <li><a href="#Cancel_Delegation_Token"><code>CANCELDELEGATIONTOKEN</code></a> (see <a href="../../api/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticator.html">DelegationTokenAuthenticator</a>.cancelDelegationToken)</li>
  779. <li><a href="#Allow_Snapshot"><code>ALLOWSNAPSHOT</code></a></li>
  780. <li><a href="#Disallow_Snapshot"><code>DISALLOWSNAPSHOT</code></a></li>
  781. <li><a href="#Create_Snapshot"><code>CREATESNAPSHOT</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.createSnapshot)</li>
  782. <li><a href="#Rename_Snapshot"><code>RENAMESNAPSHOT</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.renameSnapshot)</li>
  783. <li><a href="#Set_XAttr"><code>SETXATTR</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setXAttr)</li>
  784. <li><a href="#Remove_XAttr"><code>REMOVEXATTR</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.removeXAttr)</li>
  785. <li><a href="#Set_Storage_Policy"><code>SETSTORAGEPOLICY</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setStoragePolicy)</li>
  786. <li><a href="#Satisfy_Storage_Policy"><code>SATISFYSTORAGEPOLICY</code></a> (see <a href="./ArchivalStorage.html#Satisfy_Storage_Policy">ArchivalStorage</a>.satisfyStoragePolicy)</li>
  787. <li><a href="#Enable_EC_Policy"><code>ENABLEECPOLICY</code></a> (see <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.enablePolicy)</li>
  788. <li><a href="#Disable_EC_Policy"><code>DISABLEECPOLICY</code></a> (see <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.disablePolicy)</li>
  789. <li><a href="#Set_EC_Policy"><code>SETECPOLICY</code></a> (see <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.setErasureCodingPolicy)</li>
  790. </ul>
  791. </li>
  792. <li>HTTP POST
  793. <ul>
  794. <li><a href="#Append_to_a_File"><code>APPEND</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.append)</li>
  795. <li><a href="#Concat_Files"><code>CONCAT</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.concat)</li>
  796. <li><a href="#Truncate_a_File"><code>TRUNCATE</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.truncate)</li>
  797. <li><a href="#Unset_Storage_Policy"><code>UNSETSTORAGEPOLICY</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.unsetStoragePolicy)</li>
  798. <li><a href="#Unset_EC_Policy"><code>UNSETECPOLICY</code></a> (see <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.unsetErasureCodingPolicy)</li>
  799. </ul>
  800. </li>
  801. <li>HTTP DELETE
  802. <ul>
  803. <li><a href="#Delete_a_FileDirectory"><code>DELETE</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.delete)</li>
  804. <li><a href="#Delete_Snapshot"><code>DELETESNAPSHOT</code></a> (see <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.deleteSnapshot)</li>
  805. </ul>
  806. </li>
  807. </ul></section><section>
  808. <h3><a name="FileSystem_URIs_vs_HTTP_URLs"></a>FileSystem URIs vs HTTP URLs</h3>
  809. <p>The FileSystem scheme of WebHDFS is &#x201c;<code>webhdfs://</code>&#x201d;. A WebHDFS FileSystem URI has the following format.</p>
  810. <div class="source">
  811. <div class="source">
  812. <pre> webhdfs://&lt;HOST&gt;:&lt;HTTP_PORT&gt;/&lt;PATH&gt;
  813. </pre></div></div>
  814. <p>The above WebHDFS URI corresponds to the below HDFS URI.</p>
  815. <div class="source">
  816. <div class="source">
  817. <pre> hdfs://&lt;HOST&gt;:&lt;RPC_PORT&gt;/&lt;PATH&gt;
  818. </pre></div></div>
  819. <p>In the REST API, the prefix &#x201c;<code>/webhdfs/v1</code>&#x201d; is inserted in the path and a query is appended at the end. Therefore, the corresponding HTTP URL has the following format.</p>
  820. <div class="source">
  821. <div class="source">
  822. <pre> http://&lt;HOST&gt;:&lt;HTTP_PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=...
  823. </pre></div></div>
  824. <p><b>Note</b> that if WebHDFS is secured with SSL, then the scheme should be &#x201c;<code>swebhdfs://</code>&#x201d;.</p>
  825. <div class="source">
  826. <div class="source">
  827. <pre> swebhdfs://&lt;HOST&gt;:&lt;HTTP_PORT&gt;/&lt;PATH&gt;
  828. </pre></div></div>
  829. <p>See also: <a href="#SSL_Configurations_for_SWebHDFS">SSL Configurations for SWebHDFS</a></p></section><section>
  830. <h3><a name="HDFS_Configuration_Options"></a>HDFS Configuration Options</h3>
  831. <p>Below are the HDFS configuration options for WebHDFS.</p>
  832. <table border="0" class="bodyTable">
  833. <thead>
  834. <tr class="a">
  835. <th align="left"> Property Name </th>
  836. <th align="left"> Description </th></tr>
  837. </thead><tbody>
  838. <tr class="b">
  839. <td align="left"> <code>dfs.web.authentication.kerberos.principal</code> </td>
  840. <td align="left"> The HTTP Kerberos principal used by Hadoop-Auth in the HTTP endpoint. The HTTP Kerberos principal MUST start with &#x2018;HTTP/&#x2019; per Kerberos HTTP SPNEGO specification. A value of &#x201c;*&#x201d; will use all HTTP principals found in the keytab. </td></tr>
  841. <tr class="a">
  842. <td align="left"> <code>dfs.web.authentication.kerberos.keytab</code> </td>
  843. <td align="left"> The Kerberos keytab file with the credentials for the HTTP Kerberos principal used by Hadoop-Auth in the HTTP endpoint. </td></tr>
  844. <tr class="b">
  845. <td align="left"> <code>dfs.webhdfs.socket.connect-timeout</code> </td>
  846. <td align="left"> How long to wait for a connection to be established before failing. Specified as a time duration, ie numerical value followed by a units symbol, eg 2m for two minutes. Defaults to 60s. </td></tr>
  847. <tr class="a">
  848. <td align="left"> <code>dfs.webhdfs.socket.read-timeout</code> </td>
  849. <td align="left"> How long to wait for data to arrive before failing. Defaults to 60s. </td></tr>
  850. </tbody>
  851. </table></section></section><section>
  852. <h2><a name="Authentication"></a>Authentication</h2>
  853. <p>When security is <i>off</i>, the authenticated user is the username specified in the <code>user.name</code> query parameter. If the <code>user.name</code> parameter is not set, the server may either set the authenticated user to a default web user, if there is any, or return an error response.</p>
  854. <p>When security is <i>on</i>, authentication is performed by either Hadoop delegation token or Kerberos SPNEGO. If a token is set in the <code>delegation</code> query parameter, the authenticated user is the user encoded in the token. If the <code>delegation</code> parameter is not set, the user is authenticated by Kerberos SPNEGO.</p>
  855. <p>Below are examples using the <code>curl</code> command tool.</p>
  856. <ol style="list-style-type: decimal">
  857. <li>
  858. <p>Authentication when security is off:</p>
  859. <div class="source">
  860. <div class="source">
  861. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?[user.name=&lt;USER&gt;&amp;]op=...&quot;
  862. </pre></div></div>
  863. </li>
  864. <li>
  865. <p>Authentication using Kerberos SPNEGO when security is on:</p>
  866. <div class="source">
  867. <div class="source">
  868. <pre>curl -i --negotiate -u : &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=...&quot;
  869. </pre></div></div>
  870. </li>
  871. <li>
  872. <p>Authentication using Hadoop delegation token when security is on:</p>
  873. <div class="source">
  874. <div class="source">
  875. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?delegation=&lt;TOKEN&gt;&amp;op=...&quot;
  876. </pre></div></div>
  877. </li>
  878. </ol>
  879. <p>See also: <a href="../hadoop-common/HttpAuthentication.html">Authentication for Hadoop HTTP web-consoles</a></p>
  880. <p>Additionally, WebHDFS supports OAuth2 on the client side. The Namenode and Datanodes do not currently support clients using OAuth2 but other backends that implement the WebHDFS REST interface may.</p>
  881. <p>WebHDFS supports two type of OAuth2 code grants (user-provided refresh and access token or user provided credential) by default and provides a pluggable mechanism for implementing other OAuth2 authentications per the <a class="externalLink" href="https://tools.ietf.org/html/rfc6749">OAuth2 RFC</a>, or custom authentications. When using either of the provided code grant mechanisms, the WebHDFS client will refresh the access token as necessary.</p>
  882. <p>OAuth2 should only be enabled for clients not running with Kerberos SPENGO.</p>
  883. <table border="0" class="bodyTable">
  884. <thead>
  885. <tr class="a">
  886. <th align="left"> OAuth2 code grant mechanism </th>
  887. <th align="left"> Description </th>
  888. <th align="left"> Value of <code>dfs.webhdfs.oauth2.access.token.provider</code> that implements code grant </th></tr>
  889. </thead><tbody>
  890. <tr class="b">
  891. <td align="left"> Authorization Code Grant </td>
  892. <td align="left"> The user provides an initial access token and refresh token, which are then used to authenticate WebHDFS requests and obtain replacement access tokens, respectively. </td>
  893. <td align="left"> org.apache.hadoop.hdfs.web.oauth2.ConfRefreshTokenBasedAccessTokenProvider </td></tr>
  894. <tr class="a">
  895. <td align="left"> Client Credentials Grant </td>
  896. <td align="left"> The user provides a credential which is used to obtain access tokens, which are then used to authenticate WebHDFS requests. </td>
  897. <td align="left"> org.apache.hadoop.hdfs.web.oauth2.ConfCredentialBasedAccessTokenProvider </td></tr>
  898. </tbody>
  899. </table>
  900. <p>The following properties control OAuth2 authentication.</p>
  901. <table border="0" class="bodyTable">
  902. <thead>
  903. <tr class="a">
  904. <th align="left"> OAuth2 related property </th>
  905. <th align="left"> Description </th></tr>
  906. </thead><tbody>
  907. <tr class="b">
  908. <td align="left"> <code>dfs.webhdfs.oauth2.enabled</code> </td>
  909. <td align="left"> Boolean to enable/disable OAuth2 authentication </td></tr>
  910. <tr class="a">
  911. <td align="left"> <code>dfs.webhdfs.oauth2.access.token.provider</code> </td>
  912. <td align="left"> Class name of an implementation of <code>org.apache.hadoop.hdfs.web.oauth.AccessTokenProvider.</code> Two are provided with the code, as described above, or the user may specify a user-provided implementation. The default value for this configuration key is the <code>ConfCredentialBasedAccessTokenProvider</code> implementation. </td></tr>
  913. <tr class="b">
  914. <td align="left"> <code>dfs.webhdfs.oauth2.client.id</code> </td>
  915. <td align="left"> Client id used to obtain access token with either credential or refresh token </td></tr>
  916. <tr class="a">
  917. <td align="left"> <code>dfs.webhdfs.oauth2.refresh.url</code> </td>
  918. <td align="left"> URL against which to post for obtaining bearer token with either credential or refresh token </td></tr>
  919. <tr class="b">
  920. <td align="left"> <code>dfs.webhdfs.oauth2.access.token</code> </td>
  921. <td align="left"> (required if using ConfRefreshTokenBasedAccessTokenProvider) Initial access token with which to authenticate </td></tr>
  922. <tr class="a">
  923. <td align="left"> <code>dfs.webhdfs.oauth2.refresh.token</code> </td>
  924. <td align="left"> (required if using ConfRefreshTokenBasedAccessTokenProvider) Initial refresh token to use to obtain new access tokens </td></tr>
  925. <tr class="b">
  926. <td align="left"> <code>dfs.webhdfs.oauth2.refresh.token.expires.ms.since.epoch</code> </td>
  927. <td align="left"> (required if using ConfRefreshTokenBasedAccessTokenProvider) Access token expiration measured in milliseconds since Jan 1, 1970. <i>Note this is a different value than provided by OAuth providers and has been munged as described in interface to be suitable for a client application</i> </td></tr>
  928. <tr class="a">
  929. <td align="left"> <code>dfs.webhdfs.oauth2.credential</code> </td>
  930. <td align="left"> (required if using ConfCredentialBasedAccessTokenProvider). Credential used to obtain initial and subsequent access tokens. </td></tr>
  931. </tbody>
  932. </table></section><section>
  933. <h2><a name="SSL_Configurations_for_SWebHDFS"></a>SSL Configurations for SWebHDFS</h2>
  934. <p>To use SWebHDFS FileSystem (i.e. using the swebhdfs protocol), a SSL configuration file needs to be specified on the client side. This must specify 3 parameters:</p>
  935. <table border="0" class="bodyTable">
  936. <thead>
  937. <tr class="a">
  938. <th align="left"> SSL property </th>
  939. <th align="left"> Description </th></tr>
  940. </thead><tbody>
  941. <tr class="b">
  942. <td align="left"> <code>ssl.client.truststore.location</code> </td>
  943. <td align="left"> The local-filesystem location of the trust-store file, containing the certificate for the NameNode. </td></tr>
  944. <tr class="a">
  945. <td align="left"> <code>ssl.client.truststore.type</code> </td>
  946. <td align="left"> (Optional) The format of the trust-store file. </td></tr>
  947. <tr class="b">
  948. <td align="left"> <code>ssl.client.truststore.password</code> </td>
  949. <td align="left"> (Optional) Password for the trust-store file. </td></tr>
  950. </tbody>
  951. </table>
  952. <p>The following is an example SSL configuration file (<b>ssl-client.xml</b>):</p>
  953. <div class="source">
  954. <div class="source">
  955. <pre>&lt;configuration&gt;
  956. &lt;property&gt;
  957. &lt;name&gt;ssl.client.truststore.location&lt;/name&gt;
  958. &lt;value&gt;/work/keystore.jks&lt;/value&gt;
  959. &lt;description&gt;Truststore to be used by clients. Must be specified.&lt;/description&gt;
  960. &lt;/property&gt;
  961. &lt;property&gt;
  962. &lt;name&gt;ssl.client.truststore.password&lt;/name&gt;
  963. &lt;value&gt;changeme&lt;/value&gt;
  964. &lt;description&gt;Optional. Default value is &quot;&quot;.&lt;/description&gt;
  965. &lt;/property&gt;
  966. &lt;property&gt;
  967. &lt;name&gt;ssl.client.truststore.type&lt;/name&gt;
  968. &lt;value&gt;jks&lt;/value&gt;
  969. &lt;description&gt;Optional. Default value is &quot;jks&quot;.&lt;/description&gt;
  970. &lt;/property&gt;
  971. &lt;/configuration&gt;
  972. </pre></div></div>
  973. <p>The SSL configuration file must be in the class-path of the client program and the filename needs to be specified in <b>core-site.xml</b>:</p>
  974. <div class="source">
  975. <div class="source">
  976. <pre>&lt;property&gt;
  977. &lt;name&gt;hadoop.ssl.client.conf&lt;/name&gt;
  978. &lt;value&gt;ssl-client.xml&lt;/value&gt;
  979. &lt;description&gt;
  980. Resource file from which ssl client keystore information will be extracted.
  981. This file is looked up in the classpath, typically it should be in Hadoop
  982. conf/ directory. Default value is &quot;ssl-client.xml&quot;.
  983. &lt;/description&gt;
  984. &lt;/property&gt;
  985. </pre></div></div>
  986. </section><section>
  987. <h2><a name="Proxy_Users"></a>Proxy Users</h2>
  988. <p>When the proxy user feature is enabled, a proxy user <i>P</i> may submit a request on behalf of another user <i>U</i>. The username of <i>U</i> must be specified in the <code>doas</code> query parameter unless a delegation token is presented in authentication. In such case, the information of both users <i>P</i> and <i>U</i> must be encoded in the delegation token.</p>
  989. <ol style="list-style-type: decimal">
  990. <li>
  991. <p>A proxy request when security is off:</p>
  992. <div class="source">
  993. <div class="source">
  994. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?[user.name=&lt;USER&gt;&amp;]doas=&lt;USER&gt;&amp;op=...&quot;
  995. </pre></div></div>
  996. </li>
  997. <li>
  998. <p>A proxy request using Kerberos SPNEGO when security is on:</p>
  999. <div class="source">
  1000. <div class="source">
  1001. <pre>curl -i --negotiate -u : &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?doas=&lt;USER&gt;&amp;op=...&quot;
  1002. </pre></div></div>
  1003. </li>
  1004. <li>
  1005. <p>A proxy request using Hadoop delegation token when security is on:</p>
  1006. <div class="source">
  1007. <div class="source">
  1008. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?delegation=&lt;TOKEN&gt;&amp;op=...&quot;
  1009. </pre></div></div>
  1010. </li>
  1011. </ol></section><section>
  1012. <h2><a name="Cross-Site_Request_Forgery_Prevention"></a>Cross-Site Request Forgery Prevention</h2>
  1013. <p>WebHDFS supports an optional, configurable mechanism for cross-site request forgery (CSRF) prevention. When enabled, WebHDFS HTTP requests to the NameNode or DataNode must include a custom HTTP header. Configuration properties allow adjusting which specific HTTP methods are protected and the name of the HTTP header. The value sent in the header is not relevant. Only the presence of a header by that name is required.</p>
  1014. <p>Enabling CSRF prevention also sets up the <code>WebHdfsFileSystem</code> class to send the required header. This ensures that CLI commands like <a href="./HDFSCommands.html#dfs"><code>hdfs dfs</code></a> and <a href="../../hadoop-distcp/DistCp.html"><code>hadoop distcp</code></a> continue to work correctly when used with <code>webhdfs:</code> URIs.</p>
  1015. <p>Enabling CSRF prevention also sets up the NameNode web UI to send the required header. After enabling CSRF prevention and restarting the NameNode, existing users of the NameNode web UI need to refresh the browser to reload the page and find the new configuration.</p>
  1016. <p>The following properties control CSRF prevention.</p>
  1017. <table border="0" class="bodyTable">
  1018. <thead>
  1019. <tr class="a">
  1020. <th align="left"> Property </th>
  1021. <th align="left"> Description </th>
  1022. <th align="left"> Default Value </th></tr>
  1023. </thead><tbody>
  1024. <tr class="b">
  1025. <td align="left"> <code>dfs.webhdfs.rest-csrf.enabled</code> </td>
  1026. <td align="left"> If true, then enables WebHDFS protection against cross-site request forgery (CSRF). The WebHDFS client also uses this property to determine whether or not it needs to send the custom CSRF prevention header in its HTTP requests. </td>
  1027. <td align="left"> <code>false</code> </td></tr>
  1028. <tr class="a">
  1029. <td align="left"> <code>dfs.webhdfs.rest-csrf.custom-header</code> </td>
  1030. <td align="left"> The name of a custom header that HTTP requests must send when protection against cross-site request forgery (CSRF) is enabled for WebHDFS by setting dfs.webhdfs.rest-csrf.enabled to true. The WebHDFS client also uses this property to determine whether or not it needs to send the custom CSRF prevention header in its HTTP requests. </td>
  1031. <td align="left"> <code>X-XSRF-HEADER</code> </td></tr>
  1032. <tr class="b">
  1033. <td align="left"> <code>dfs.webhdfs.rest-csrf.methods-to-ignore</code> </td>
  1034. <td align="left"> A comma-separated list of HTTP methods that do not require HTTP requests to include a custom header when protection against cross-site request forgery (CSRF) is enabled for WebHDFS by setting dfs.webhdfs.rest-csrf.enabled to true. The WebHDFS client also uses this property to determine whether or not it needs to send the custom CSRF prevention header in its HTTP requests. </td>
  1035. <td align="left"> <code>GET,OPTIONS,HEAD,TRACE</code> </td></tr>
  1036. <tr class="a">
  1037. <td align="left"> <code>dfs.webhdfs.rest-csrf.browser-useragents-regex</code> </td>
  1038. <td align="left"> A comma-separated list of regular expressions used to match against an HTTP request&#x2019;s User-Agent header when protection against cross-site request forgery (CSRF) is enabled for WebHDFS by setting dfs.webhdfs.reset-csrf.enabled to true. If the incoming User-Agent matches any of these regular expressions, then the request is considered to be sent by a browser, and therefore CSRF prevention is enforced. If the request&#x2019;s User-Agent does not match any of these regular expressions, then the request is considered to be sent by something other than a browser, such as scripted automation. In this case, CSRF is not a potential attack vector, so the prevention is not enforced. This helps achieve backwards-compatibility with existing automation that has not been updated to send the CSRF prevention header. </td>
  1039. <td align="left"> <code>^Mozilla.*,^Opera.*</code> </td></tr>
  1040. <tr class="b">
  1041. <td align="left"> <code>dfs.datanode.httpserver.filter.handlers</code> </td>
  1042. <td align="left"> Comma separated list of Netty servlet-style filter handlers to inject into the Datanode WebHDFS I/O path </td>
  1043. <td align="left"> <code>org.apache.hadoop.hdfs.server.datanode.web.RestCsrfPreventionFilterHandler</code> </td></tr>
  1044. </tbody>
  1045. </table>
  1046. <p>The following is an example <code>curl</code> call that uses the <code>-H</code> option to include the custom header in the request.</p>
  1047. <div class="source">
  1048. <div class="source">
  1049. <pre> curl -i -L -X PUT -H 'X-XSRF-HEADER: &quot;&quot;' 'http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATE'
  1050. </pre></div></div>
  1051. </section><section>
  1052. <h2><a name="WebHDFS_Retry_Policy"></a>WebHDFS Retry Policy</h2>
  1053. <p>WebHDFS supports an optional, configurable retry policy for resilient copy of large files that could timeout, or copy file between HA clusters that could failover during the copy.</p>
  1054. <p>The following properties control WebHDFS retry and failover policy.</p>
  1055. <table border="0" class="bodyTable">
  1056. <thead>
  1057. <tr class="a">
  1058. <th align="left"> Property </th>
  1059. <th align="left"> Description </th>
  1060. <th align="left"> Default Value </th></tr>
  1061. </thead><tbody>
  1062. <tr class="b">
  1063. <td align="left"> <code>dfs.http.client.retry.policy.enabled</code> </td>
  1064. <td align="left"> If &#x201c;true&#x201d;, enable the retry policy of WebHDFS client. If &#x201c;false&#x201d;, retry policy is turned off. </td>
  1065. <td align="left"> <code>false</code> </td></tr>
  1066. <tr class="a">
  1067. <td align="left"> <code>dfs.http.client.retry.policy.spec</code> </td>
  1068. <td align="left"> Specify a policy of multiple linear random retry for WebHDFS client, e.g. given pairs of number of retries and sleep time (n0, t0), (n1, t1), &#x2026;, the first n0 retries sleep t0 milliseconds on average, the following n1 retries sleep t1 milliseconds on average, and so on. </td>
  1069. <td align="left"> <code>10000,6,60000,10</code> </td></tr>
  1070. <tr class="b">
  1071. <td align="left"> <code>dfs.http.client.failover.max.attempts</code> </td>
  1072. <td align="left"> Specify the max number of failover attempts for WebHDFS client in case of network exception. </td>
  1073. <td align="left"> <code>15</code> </td></tr>
  1074. <tr class="a">
  1075. <td align="left"> <code>dfs.http.client.retry.max.attempts</code> </td>
  1076. <td align="left"> Specify the max number of retry attempts for WebHDFS client, if the difference between retried attempts and failovered attempts is larger than the max number of retry attempts, there will be no more retries. </td>
  1077. <td align="left"> <code>10</code> </td></tr>
  1078. <tr class="b">
  1079. <td align="left"> <code>dfs.http.client.failover.sleep.base.millis</code> </td>
  1080. <td align="left"> Specify the base amount of time in milliseconds upon which the exponentially increased sleep time between retries or failovers is calculated for WebHDFS client. </td>
  1081. <td align="left"> <code>500</code> </td></tr>
  1082. <tr class="a">
  1083. <td align="left"> <code>dfs.http.client.failover.sleep.max.millis</code> </td>
  1084. <td align="left"> Specify the upper bound of sleep time in milliseconds between retries or failovers for WebHDFS client. </td>
  1085. <td align="left"> <code>15000</code> </td></tr>
  1086. </tbody>
  1087. </table></section><section>
  1088. <h2><a name="WebHDFS_Request_Filtering"></a>WebHDFS Request Filtering</h2>
  1089. <p>One may control directionality of data in the WebHDFS protocol allowing only writing data from insecure networks. To enable, one must ensure <code>dfs.datanode.httpserver.filter.handlers</code> includes <code>org.apache.hadoop.hdfs.server.datanode.web.HostRestrictingAuthorizationFilterHandler</code>. Configuration of the <code>HostRestrictingAuthorizationFilter</code> is controlled via the following properties.</p>
  1090. <table border="0" class="bodyTable">
  1091. <thead>
  1092. <tr class="a">
  1093. <th align="left"> Property </th>
  1094. <th align="left"> Description </th>
  1095. <th align="left"> Default Value </th></tr>
  1096. </thead><tbody>
  1097. <tr class="b">
  1098. <td align="left"> <code>dfs.datanode.httpserver.filter.handlers</code> </td>
  1099. <td align="left"> Comma separated list of Netty servlet-style filter handlers to inject into the Datanode WebHDFS I/O path </td>
  1100. <td align="left"> <code>org.apache.hadoop.hdfs.server.datanode.web.RestCsrfPreventionFilterHandler</code> </td></tr>
  1101. <tr class="a">
  1102. <td align="left"> <code>dfs.web.authentication.host.allow.rules</code> </td>
  1103. <td align="left"> Rules allowing users to read files in the format of <i>user</i>,<i>network/bits</i>,<i>path glob</i> newline or <code>|</code>-separated. Use <code>*</code> for a wildcard of all <i>users</i> or <i>network/bits</i>. </td>
  1104. <td align="left"> nothing - defaults to no one may read via WebHDFS </td></tr>
  1105. </tbody>
  1106. </table></section><section>
  1107. <h2><a name="File_and_Directory_Operations"></a>File and Directory Operations</h2><section>
  1108. <h3><a name="Create_and_Write_to_a_File"></a>Create and Write to a File</h3>
  1109. <ul>
  1110. <li>
  1111. <p>Step 1: Submit a HTTP PUT request without automatically following redirects and without sending the file data.</p>
  1112. <div class="source">
  1113. <div class="source">
  1114. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATE
  1115. [&amp;overwrite=&lt;true |false&gt;][&amp;blocksize=&lt;LONG&gt;][&amp;replication=&lt;SHORT&gt;]
  1116. [&amp;permission=&lt;OCTAL&gt;][&amp;buffersize=&lt;INT&gt;][&amp;noredirect=&lt;true|false&gt;]&quot;
  1117. </pre></div></div>
  1118. <p>Usually the request is redirected to a datanode where the file data is to be written.</p>
  1119. <div class="source">
  1120. <div class="source">
  1121. <pre>HTTP/1.1 307 TEMPORARY_REDIRECT
  1122. Location: http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATE...
  1123. Content-Length: 0
  1124. </pre></div></div>
  1125. <p>However, if you do not want to be automatically redirected, you can set the noredirect flag.</p>
  1126. <div class="source">
  1127. <div class="source">
  1128. <pre>HTTP/1.1 200 OK
  1129. Content-Type: application/json
  1130. {&quot;Location&quot;:&quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATE...&quot;}
  1131. </pre></div></div>
  1132. </li>
  1133. <li>
  1134. <p>Step 2: Submit another HTTP PUT request using the URL in the <code>Location</code> header (or the returned response in case you specified noredirect) with the file data to be written.</p>
  1135. <div class="source">
  1136. <div class="source">
  1137. <pre>curl -i -X PUT -T &lt;LOCAL_FILE&gt; &quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATE...&quot;
  1138. </pre></div></div>
  1139. <p>The client receives a <code>201 Created</code> response with zero content length and the WebHDFS URI of the file in the <code>Location</code> header:</p>
  1140. <div class="source">
  1141. <div class="source">
  1142. <pre>HTTP/1.1 201 Created
  1143. Location: webhdfs://&lt;HOST&gt;:&lt;PORT&gt;/&lt;PATH&gt;
  1144. Content-Length: 0
  1145. </pre></div></div>
  1146. <p>If no permissions are specified, the newly created file will be assigned with default 644 permission. No umask mode will be applied from server side (so &#x201c;fs.permissions.umask-mode&#x201d; value configuration set on Namenode side will have no effect).</p>
  1147. </li>
  1148. </ul>
  1149. <p><b>Note</b> that the reason of having two-step create/append is for preventing clients to send out data before the redirect. This issue is addressed by the &#x201c;<code>Expect: 100-continue</code>&#x201d; header in HTTP/1.1; see <a class="externalLink" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3">RFC 2616, Section 8.2.3</a>. Unfortunately, there are software library bugs (e.g. Jetty 6 HTTP server and Java 6 HTTP client), which do not correctly implement &#x201c;<code>Expect: 100-continue</code>&#x201d;. The two-step create/append is a temporary workaround for the software library bugs.</p>
  1150. <p>See also: <a href="#Overwrite"><code>overwrite</code></a>, <a href="#Block_Size"><code>blocksize</code></a>, <a href="#Replication"><code>replication</code></a>, <a href="#Permission"><code>permission</code></a>, <a href="#Buffer_Size"><code>buffersize</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.create</p></section><section>
  1151. <h3><a name="Append_to_a_File"></a>Append to a File</h3>
  1152. <ul>
  1153. <li>Step 1: Submit a HTTP POST request without automatically following redirects and without sending the file data.
  1154. <div class="source">
  1155. <div class="source">
  1156. <pre>curl -i -X POST &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=APPEND[&amp;buffersize=&lt;INT&gt;][&amp;noredirect=&lt;true|false&gt;]&quot;
  1157. </pre></div></div>
  1158. <p>Usually the request is redirected to a datanode where the file data is to be appended:</p>
  1159. <div class="source">
  1160. <div class="source">
  1161. <pre>HTTP/1.1 307 TEMPORARY_REDIRECT
  1162. Location: http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=APPEND...
  1163. Content-Length: 0
  1164. </pre></div></div>
  1165. </li>
  1166. </ul>
  1167. <p>However, if you do not want to be automatically redirected, you can set the noredirect flag.</p>
  1168. <div class="source">
  1169. <div class="source">
  1170. <pre> HTTP/1.1 200 OK
  1171. Content-Type: application/json
  1172. {&quot;Location&quot;:&quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=APPEND...&quot;}
  1173. </pre></div></div>
  1174. <ul>
  1175. <li>Step 2: Submit another HTTP POST request using the URL in the <code>Location</code> header (or the returned response in case you specified noredirect) with the file data to be appended.
  1176. <div class="source">
  1177. <div class="source">
  1178. <pre>curl -i -X POST -T &lt;LOCAL_FILE&gt; &quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=APPEND...&quot;
  1179. </pre></div></div>
  1180. <p>The client receives a response with zero content length:</p>
  1181. <div class="source">
  1182. <div class="source">
  1183. <pre>HTTP/1.1 200 OK
  1184. Content-Length: 0
  1185. </pre></div></div>
  1186. </li>
  1187. </ul>
  1188. <p>See the note in the previous section for the description of why this operation requires two steps.</p>
  1189. <p>See also: <a href="#Buffer_Size"><code>buffersize</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.append</p></section><section>
  1190. <h3><a name="Concat_File.28s.29"></a>Concat File(s)</h3>
  1191. <ul>
  1192. <li>Submit a HTTP POST request.
  1193. <div class="source">
  1194. <div class="source">
  1195. <pre>curl -i -X POST &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CONCAT&amp;sources=&lt;PATHS&gt;&quot;
  1196. </pre></div></div>
  1197. <p>The client receives a response with zero content length:</p>
  1198. <div class="source">
  1199. <div class="source">
  1200. <pre>HTTP/1.1 200 OK
  1201. Content-Length: 0
  1202. </pre></div></div>
  1203. </li>
  1204. </ul>
  1205. <p>See also: <a href="#Sources"><code>sources</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.concat</p></section><section>
  1206. <h3><a name="Open_and_Read_a_File"></a>Open and Read a File</h3>
  1207. <ul>
  1208. <li>Submit a HTTP GET request with automatically following redirects.
  1209. <div class="source">
  1210. <div class="source">
  1211. <pre>curl -i -L &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=OPEN
  1212. [&amp;offset=&lt;LONG&gt;][&amp;length=&lt;LONG&gt;][&amp;buffersize=&lt;INT&gt;][&amp;noredirect=&lt;true|false&gt;]&quot;
  1213. </pre></div></div>
  1214. <p>Usually the request is redirected to a datanode where the file data can be read:</p>
  1215. <div class="source">
  1216. <div class="source">
  1217. <pre>HTTP/1.1 307 TEMPORARY_REDIRECT
  1218. Location: http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=OPEN...
  1219. Content-Length: 0
  1220. </pre></div></div>
  1221. <p>However if you do not want to be automatically redirected, you can set the noredirect flag.</p>
  1222. <div class="source">
  1223. <div class="source">
  1224. <pre>HTTP/1.1 200 OK
  1225. Content-Type: application/json
  1226. {&quot;Location&quot;:&quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=OPEN...&quot;}
  1227. </pre></div></div>
  1228. <p>The client follows the redirect to the datanode and receives the file data:</p>
  1229. <div class="source">
  1230. <div class="source">
  1231. <pre>HTTP/1.1 200 OK
  1232. Content-Type: application/octet-stream
  1233. Content-Length: 22
  1234. Hello, webhdfs user!
  1235. </pre></div></div>
  1236. </li>
  1237. </ul>
  1238. <p>See also: <a href="#Offset"><code>offset</code></a>, <a href="#Length"><code>length</code></a>, <a href="#Buffer_Size"><code>buffersize</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.open</p></section><section>
  1239. <h3><a name="Make_a_Directory"></a>Make a Directory</h3>
  1240. <ul>
  1241. <li>Submit a HTTP PUT request.
  1242. <div class="source">
  1243. <div class="source">
  1244. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=MKDIRS[&amp;permission=&lt;OCTAL&gt;]&quot;
  1245. </pre></div></div>
  1246. <p>The client receives a response with a <a href="#Boolean_JSON_Schema"><code>boolean</code> JSON object</a>:</p>
  1247. <div class="source">
  1248. <div class="source">
  1249. <pre>HTTP/1.1 200 OK
  1250. Content-Type: application/json
  1251. Transfer-Encoding: chunked
  1252. {&quot;boolean&quot;: true}
  1253. </pre></div></div>
  1254. <p>If no permissions are specified, the newly created directory will have 755 permission as default. No umask mode will be applied from server side (so &#x201c;fs.permissions.umask-mode&#x201d; value configuration set on Namenode side will have no effect).</p></li>
  1255. </ul>
  1256. <p>See also: <a href="#Permission"><code>permission</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.mkdirs</p></section><section>
  1257. <h3><a name="Create_a_Symbolic_Link"></a>Create a Symbolic Link</h3>
  1258. <ul>
  1259. <li>Submit a HTTP PUT request.
  1260. <div class="source">
  1261. <div class="source">
  1262. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATESYMLINK
  1263. &amp;destination=&lt;PATH&gt;[&amp;createParent=&lt;true |false&gt;]&quot;
  1264. </pre></div></div>
  1265. <p>The client receives a response with zero content length:</p>
  1266. <div class="source">
  1267. <div class="source">
  1268. <pre>HTTP/1.1 200 OK
  1269. Content-Length: 0
  1270. </pre></div></div>
  1271. </li>
  1272. </ul>
  1273. <p>See also: <a href="#Destination"><code>destination</code></a>, <a href="#Create_Parent"><code>createParent</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.createSymlink</p></section><section>
  1274. <h3><a name="Rename_a_File.2FDirectory"></a>Rename a File/Directory</h3>
  1275. <ul>
  1276. <li>Submit a HTTP PUT request.
  1277. <div class="source">
  1278. <div class="source">
  1279. <pre>curl -i -X PUT &quot;&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=RENAME&amp;destination=&lt;PATH&gt;&quot;
  1280. </pre></div></div>
  1281. <p>The client receives a response with a <a href="#Boolean_JSON_Schema"><code>boolean</code> JSON object</a>:</p>
  1282. <div class="source">
  1283. <div class="source">
  1284. <pre>HTTP/1.1 200 OK
  1285. Content-Type: application/json
  1286. Transfer-Encoding: chunked
  1287. {&quot;boolean&quot;: true}
  1288. </pre></div></div>
  1289. </li>
  1290. </ul>
  1291. <p>See also: <a href="#Destination"><code>destination</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.rename</p></section><section>
  1292. <h3><a name="Delete_a_File.2FDirectory"></a>Delete a File/Directory</h3>
  1293. <ul>
  1294. <li>Submit a HTTP DELETE request.
  1295. <div class="source">
  1296. <div class="source">
  1297. <pre>curl -i -X DELETE &quot;http://&lt;host&gt;:&lt;port&gt;/webhdfs/v1/&lt;path&gt;?op=DELETE
  1298. [&amp;recursive=&lt;true |false&gt;]&quot;
  1299. </pre></div></div>
  1300. <p>The client receives a response with a <a href="#Boolean_JSON_Schema"><code>boolean</code> JSON object</a>:</p>
  1301. <div class="source">
  1302. <div class="source">
  1303. <pre>HTTP/1.1 200 OK
  1304. Content-Type: application/json
  1305. Transfer-Encoding: chunked
  1306. {&quot;boolean&quot;: true}
  1307. </pre></div></div>
  1308. </li>
  1309. </ul>
  1310. <p>See also: <a href="#Recursive"><code>recursive</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.delete</p></section><section>
  1311. <h3><a name="Truncate_a_File"></a>Truncate a File</h3>
  1312. <ul>
  1313. <li>Submit a HTTP POST request.
  1314. <div class="source">
  1315. <div class="source">
  1316. <pre>curl -i -X POST &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=TRUNCATE&amp;newlength=&lt;LONG&gt;&quot;
  1317. </pre></div></div>
  1318. <p>The client receives a response with a <a href="#Boolean_JSON_Schema"><code>boolean</code> JSON object</a>:</p>
  1319. <div class="source">
  1320. <div class="source">
  1321. <pre>HTTP/1.1 200 OK
  1322. Content-Type: application/json
  1323. Transfer-Encoding: chunked
  1324. {&quot;boolean&quot;: true}
  1325. </pre></div></div>
  1326. </li>
  1327. </ul>
  1328. <p>See also: <a href="#New_Length"><code>newlength</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.truncate</p></section><section>
  1329. <h3><a name="Status_of_a_File.2FDirectory"></a>Status of a File/Directory</h3>
  1330. <ul>
  1331. <li>Submit a HTTP GET request.
  1332. <div class="source">
  1333. <div class="source">
  1334. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETFILESTATUS&quot;
  1335. </pre></div></div>
  1336. <p>The client receives a response with a <a href="#FileStatus_JSON_Schema"><code>FileStatus</code> JSON object</a>:</p>
  1337. <div class="source">
  1338. <div class="source">
  1339. <pre>HTTP/1.1 200 OK
  1340. Content-Type: application/json
  1341. Transfer-Encoding: chunked
  1342. {
  1343. &quot;FileStatus&quot;:
  1344. {
  1345. &quot;accessTime&quot; : 0,
  1346. &quot;blockSize&quot; : 0,
  1347. &quot;group&quot; : &quot;supergroup&quot;,
  1348. &quot;length&quot; : 0, //in bytes, zero for directories
  1349. &quot;modificationTime&quot;: 1320173277227,
  1350. &quot;owner&quot; : &quot;webuser&quot;,
  1351. &quot;pathSuffix&quot; : &quot;&quot;,
  1352. &quot;permission&quot; : &quot;777&quot;,
  1353. &quot;replication&quot; : 0,
  1354. &quot;snapshotEnabled&quot; : true
  1355. &quot;type&quot; : &quot;DIRECTORY&quot; //enum {FILE, DIRECTORY, SYMLINK}
  1356. &quot;ecPolicy&quot; : &quot;RS-6-3-1024k&quot;
  1357. }
  1358. }
  1359. </pre></div></div>
  1360. </li>
  1361. </ul>
  1362. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileStatus</p></section><section>
  1363. <h3><a name="List_a_Directory"></a>List a Directory</h3>
  1364. <ul>
  1365. <li>Submit a HTTP GET request.
  1366. <div class="source">
  1367. <div class="source">
  1368. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=LISTSTATUS&quot;
  1369. </pre></div></div>
  1370. <p>The client receives a response with a <a href="#FileStatuses_JSON_Schema"><code>FileStatuses</code> JSON object</a>:</p>
  1371. <div class="source">
  1372. <div class="source">
  1373. <pre>HTTP/1.1 200 OK
  1374. Content-Type: application/json
  1375. Content-Length: 427
  1376. {
  1377. &quot;FileStatuses&quot;:
  1378. {
  1379. &quot;FileStatus&quot;:
  1380. [
  1381. {
  1382. &quot;accessTime&quot; : 1320171722771,
  1383. &quot;blockSize&quot; : 33554432,
  1384. &quot;childrenNum&quot; : 0,
  1385. &quot;fileId&quot; : 16388,
  1386. &quot;group&quot; : &quot;supergroup&quot;,
  1387. &quot;length&quot; : 24930,
  1388. &quot;modificationTime&quot;: 1320171722771,
  1389. &quot;owner&quot; : &quot;webuser&quot;,
  1390. &quot;pathSuffix&quot; : &quot;a.patch&quot;,
  1391. &quot;permission&quot; : &quot;644&quot;,
  1392. &quot;replication&quot; : 1,
  1393. &quot;storagePolicy&quot; : 0,
  1394. &quot;type&quot; : &quot;FILE&quot;
  1395. },
  1396. {
  1397. &quot;accessTime&quot; : 0,
  1398. &quot;blockSize&quot; : 0,
  1399. &quot;childrenNum&quot; : 0,
  1400. &quot;fileId&quot; : 16389,
  1401. &quot;group&quot; : &quot;supergroup&quot;,
  1402. &quot;length&quot; : 0,
  1403. &quot;modificationTime&quot;: 1320895981256,
  1404. &quot;owner&quot; : &quot;username&quot;,
  1405. &quot;pathSuffix&quot; : &quot;bar&quot;,
  1406. &quot;permission&quot; : &quot;711&quot;,
  1407. &quot;replication&quot; : 0,
  1408. &quot;snapshotEnabled&quot; : true
  1409. &quot;type&quot; : &quot;DIRECTORY&quot;
  1410. },
  1411. ...
  1412. ]
  1413. }
  1414. }
  1415. </pre></div></div>
  1416. </li>
  1417. </ul>
  1418. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listStatus</p></section><section>
  1419. <h3><a name="List_a_File"></a>List a File</h3>
  1420. <ul>
  1421. <li>Submit a HTTP GET request.
  1422. <div class="source">
  1423. <div class="source">
  1424. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=LISTSTATUS&quot;
  1425. </pre></div></div>
  1426. <p>The client receives a response with a <a href="#FileStatuses_JSON_Schema"><code>FileStatuses</code> JSON object</a>:</p>
  1427. <div class="source">
  1428. <div class="source">
  1429. <pre>HTTP/1.1 200 OK
  1430. Content-Type: application/json
  1431. Content-Length: 427
  1432. {
  1433. &quot;FileStatuses&quot;:
  1434. {
  1435. &quot;FileStatus&quot;:
  1436. [
  1437. {
  1438. &quot;accessTime&quot; : 1320171722771,
  1439. &quot;blockSize&quot; : 33554432,
  1440. &quot;childrenNum&quot; : 0,
  1441. &quot;fileId&quot; : 16390,
  1442. &quot;group&quot; : &quot;supergroup&quot;,
  1443. &quot;length&quot; : 1366,
  1444. &quot;modificationTime&quot;: 1501770633062,
  1445. &quot;owner&quot; : &quot;webuser&quot;,
  1446. &quot;pathSuffix&quot; : &quot;&quot;,
  1447. &quot;permission&quot; : &quot;644&quot;,
  1448. &quot;replication&quot; : 1,
  1449. &quot;storagePolicy&quot; : 0,
  1450. &quot;type&quot; : &quot;FILE&quot;
  1451. }
  1452. ]
  1453. }
  1454. }
  1455. </pre></div></div>
  1456. </li>
  1457. </ul>
  1458. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listStatus</p></section><section>
  1459. <h3><a name="Iteratively_List_a_Directory"></a>Iteratively List a Directory</h3>
  1460. <ul>
  1461. <li>Submit a HTTP GET request.
  1462. <div class="source">
  1463. <div class="source">
  1464. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=LISTSTATUS_BATCH&amp;startAfter=&lt;CHILD&gt;&quot;
  1465. </pre></div></div>
  1466. <p>The client receives a response with a <a href="#DirectoryListing_JSON_Schema"><code>DirectoryListing</code> JSON object</a>, which contains a <a href="#FileStatuses_JSON_Schema"><code>FileStatuses</code> JSON object</a>, as well as iteration information:</p>
  1467. <div class="source">
  1468. <div class="source">
  1469. <pre>HTTP/1.1 200 OK
  1470. Cache-Control: no-cache
  1471. Expires: Thu, 08 Sep 2016 03:40:38 GMT
  1472. Date: Thu, 08 Sep 2016 03:40:38 GMT
  1473. Pragma: no-cache
  1474. Expires: Thu, 08 Sep 2016 03:40:38 GMT
  1475. Date: Thu, 08 Sep 2016 03:40:38 GMT
  1476. Pragma: no-cache
  1477. Content-Type: application/json
  1478. X-FRAME-OPTIONS: SAMEORIGIN
  1479. Transfer-Encoding: chunked
  1480. Server: Jetty(6.1.26)
  1481. {
  1482. &quot;DirectoryListing&quot;: {
  1483. &quot;partialListing&quot;: {
  1484. &quot;FileStatuses&quot;: {
  1485. &quot;FileStatus&quot;: [
  1486. {
  1487. &quot;accessTime&quot;: 0,
  1488. &quot;blockSize&quot;: 0,
  1489. &quot;childrenNum&quot;: 0,
  1490. &quot;fileId&quot;: 16387,
  1491. &quot;group&quot;: &quot;supergroup&quot;,
  1492. &quot;length&quot;: 0,
  1493. &quot;modificationTime&quot;: 1473305882563,
  1494. &quot;owner&quot;: &quot;andrew&quot;,
  1495. &quot;pathSuffix&quot;: &quot;bardir&quot;,
  1496. &quot;permission&quot;: &quot;755&quot;,
  1497. &quot;replication&quot;: 0,
  1498. &quot;storagePolicy&quot;: 0,
  1499. &quot;type&quot;: &quot;DIRECTORY&quot;
  1500. },
  1501. {
  1502. &quot;accessTime&quot;: 1473305896945,
  1503. &quot;blockSize&quot;: 1024,
  1504. &quot;childrenNum&quot;: 0,
  1505. &quot;fileId&quot;: 16388,
  1506. &quot;group&quot;: &quot;supergroup&quot;,
  1507. &quot;length&quot;: 0,
  1508. &quot;modificationTime&quot;: 1473305896965,
  1509. &quot;owner&quot;: &quot;andrew&quot;,
  1510. &quot;pathSuffix&quot;: &quot;bazfile&quot;,
  1511. &quot;permission&quot;: &quot;644&quot;,
  1512. &quot;replication&quot;: 3,
  1513. &quot;storagePolicy&quot;: 0,
  1514. &quot;type&quot;: &quot;FILE&quot;
  1515. }
  1516. ]
  1517. }
  1518. },
  1519. &quot;remainingEntries&quot;: 2
  1520. }
  1521. }
  1522. </pre></div></div>
  1523. </li>
  1524. </ul>
  1525. <p>If <code>remainingEntries</code> is non-zero, there are additional entries in the directory. To query the next batch, set the <code>startAfter</code> parameter to the <code>pathSuffix</code> of the last item returned in the current batch. For example:</p>
  1526. <div class="source">
  1527. <div class="source">
  1528. <pre> curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=LISTSTATUS_BATCH&amp;startAfter=bazfile&quot;
  1529. </pre></div></div>
  1530. <p>Which will return the next batch of directory entries:</p>
  1531. <div class="source">
  1532. <div class="source">
  1533. <pre> HTTP/1.1 200 OK
  1534. Cache-Control: no-cache
  1535. Expires: Thu, 08 Sep 2016 03:43:20 GMT
  1536. Date: Thu, 08 Sep 2016 03:43:20 GMT
  1537. Pragma: no-cache
  1538. Expires: Thu, 08 Sep 2016 03:43:20 GMT
  1539. Date: Thu, 08 Sep 2016 03:43:20 GMT
  1540. Pragma: no-cache
  1541. Content-Type: application/json
  1542. X-FRAME-OPTIONS: SAMEORIGIN
  1543. Transfer-Encoding: chunked
  1544. Server: Jetty(6.1.26)
  1545. {
  1546. &quot;DirectoryListing&quot;: {
  1547. &quot;partialListing&quot;: {
  1548. &quot;FileStatuses&quot;: {
  1549. &quot;FileStatus&quot;: [
  1550. {
  1551. &quot;accessTime&quot;: 0,
  1552. &quot;blockSize&quot;: 0,
  1553. &quot;childrenNum&quot;: 0,
  1554. &quot;fileId&quot;: 16386,
  1555. &quot;group&quot;: &quot;supergroup&quot;,
  1556. &quot;length&quot;: 0,
  1557. &quot;modificationTime&quot;: 1473305878951,
  1558. &quot;owner&quot;: &quot;andrew&quot;,
  1559. &quot;pathSuffix&quot;: &quot;foodir&quot;,
  1560. &quot;permission&quot;: &quot;755&quot;,
  1561. &quot;replication&quot;: 0,
  1562. &quot;storagePolicy&quot;: 0,
  1563. &quot;type&quot;: &quot;DIRECTORY&quot;
  1564. },
  1565. {
  1566. &quot;accessTime&quot;: 1473305902864,
  1567. &quot;blockSize&quot;: 1024,
  1568. &quot;childrenNum&quot;: 0,
  1569. &quot;fileId&quot;: 16389,
  1570. &quot;group&quot;: &quot;supergroup&quot;,
  1571. &quot;length&quot;: 0,
  1572. &quot;modificationTime&quot;: 1473305902878,
  1573. &quot;owner&quot;: &quot;andrew&quot;,
  1574. &quot;pathSuffix&quot;: &quot;quxfile&quot;,
  1575. &quot;permission&quot;: &quot;644&quot;,
  1576. &quot;replication&quot;: 3,
  1577. &quot;storagePolicy&quot;: 0,
  1578. &quot;type&quot;: &quot;FILE&quot;
  1579. }
  1580. ]
  1581. }
  1582. },
  1583. &quot;remainingEntries&quot;: 0
  1584. }
  1585. }
  1586. </pre></div></div>
  1587. <p>Batch size is controlled by the <code>dfs.ls.limit</code> option on the NameNode.</p>
  1588. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listStatusIterator</p></section></section><section>
  1589. <h2><a name="Other_File_System_Operations"></a>Other File System Operations</h2><section>
  1590. <h3><a name="Get_Content_Summary_of_a_Directory"></a>Get Content Summary of a Directory</h3>
  1591. <ul>
  1592. <li>Submit a HTTP GET request.
  1593. <div class="source">
  1594. <div class="source">
  1595. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETCONTENTSUMMARY&quot;
  1596. </pre></div></div>
  1597. <p>The client receives a response with a <a href="#ContentSummary_JSON_Schema"><code>ContentSummary</code> JSON object</a>:</p>
  1598. <div class="source">
  1599. <div class="source">
  1600. <pre>HTTP/1.1 200 OK
  1601. Content-Type: application/json
  1602. Transfer-Encoding: chunked
  1603. {
  1604. &quot;ContentSummary&quot;:
  1605. {
  1606. &quot;directoryCount&quot;: 2,
  1607. &quot;ecPolicy&quot; : &quot;RS-6-3-1024k&quot;,
  1608. &quot;fileCount&quot; : 1,
  1609. &quot;length&quot; : 24930,
  1610. &quot;quota&quot; : -1,
  1611. &quot;spaceConsumed&quot; : 24930,
  1612. &quot;spaceQuota&quot; : -1,
  1613. &quot;typeQuota&quot;:
  1614. {
  1615. &quot;ARCHIVE&quot;:
  1616. {
  1617. &quot;consumed&quot;: 500,
  1618. &quot;quota&quot;: 10000
  1619. },
  1620. &quot;DISK&quot;:
  1621. {
  1622. &quot;consumed&quot;: 500,
  1623. &quot;quota&quot;: 10000
  1624. },
  1625. &quot;SSD&quot;:
  1626. {
  1627. &quot;consumed&quot;: 500,
  1628. &quot;quota&quot;: 10000
  1629. }
  1630. }
  1631. }
  1632. }
  1633. </pre></div></div>
  1634. </li>
  1635. </ul>
  1636. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getContentSummary</p></section><section>
  1637. <h3><a name="Get_Quota_Usage_of_a_Directory"></a>Get Quota Usage of a Directory</h3>
  1638. <ul>
  1639. <li>Submit a HTTP GET request.
  1640. <div class="source">
  1641. <div class="source">
  1642. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETQUOTAUSAGE&quot;
  1643. </pre></div></div>
  1644. <p>The client receives a response with a <a href="#QuotaUsage_JSON_Schema"><code>QuotaUsage</code> JSON object</a>:</p>
  1645. <div class="source">
  1646. <div class="source">
  1647. <pre>HTTP/1.1 200 OK
  1648. Content-Type: application/json
  1649. Transfer-Encoding: chunked
  1650. {
  1651. &quot;QuotaUsage&quot;:
  1652. {
  1653. &quot;fileAndDirectoryCount&quot;: 1,
  1654. &quot;quota&quot; : 100,
  1655. &quot;spaceConsumed&quot; : 24930,
  1656. &quot;spaceQuota&quot; : 100000,
  1657. &quot;typeQuota&quot;:
  1658. {
  1659. &quot;ARCHIVE&quot;:
  1660. {
  1661. &quot;consumed&quot;: 500,
  1662. &quot;quota&quot;: 10000
  1663. },
  1664. &quot;DISK&quot;:
  1665. {
  1666. &quot;consumed&quot;: 500,
  1667. &quot;quota&quot;: 10000
  1668. },
  1669. &quot;SSD&quot;:
  1670. {
  1671. &quot;consumed&quot;: 500,
  1672. &quot;quota&quot;: 10000
  1673. }
  1674. }
  1675. }
  1676. }
  1677. </pre></div></div>
  1678. </li>
  1679. </ul>
  1680. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getQuotaUsage</p></section><section>
  1681. <h3><a name="Set_Quota"></a>Set Quota</h3>
  1682. <ul>
  1683. <li>Submit a HTTP PUT request.
  1684. <div class="source">
  1685. <div class="source">
  1686. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETQUOTA
  1687. &amp;namespacequota=&lt;QUOTA&gt;[&amp;storagespacequota=&lt;QUOTA&gt;]&quot;
  1688. </pre></div></div>
  1689. <p>The client receives a response with zero content length:</p>
  1690. <div class="source">
  1691. <div class="source">
  1692. <pre>HTTP/1.1 200 OK
  1693. Content-Length: 0
  1694. </pre></div></div>
  1695. </li>
  1696. </ul>
  1697. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setQuota</p></section><section>
  1698. <h3><a name="Set_Quota_By_Storage_Type"></a>Set Quota By Storage Type</h3>
  1699. <ul>
  1700. <li>Submit a HTTP PUT request.
  1701. <div class="source">
  1702. <div class="source">
  1703. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETQUOTABYSTORAGETYPE
  1704. &amp;storagetype=&lt;STORAGETYPE&gt;&amp;storagespacequota=&lt;QUOTA&gt;&quot;
  1705. </pre></div></div>
  1706. <p>The client receives a response with zero content length:</p>
  1707. <div class="source">
  1708. <div class="source">
  1709. <pre>HTTP/1.1 200 OK
  1710. Content-Length: 0
  1711. </pre></div></div>
  1712. </li>
  1713. </ul>
  1714. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setQuotaByStorageType</p></section><section>
  1715. <h3><a name="Get_File_Checksum"></a>Get File Checksum</h3>
  1716. <ul>
  1717. <li>Submit a HTTP GET request.
  1718. <div class="source">
  1719. <div class="source">
  1720. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETFILECHECKSUM&quot;
  1721. </pre></div></div>
  1722. <p>Usually the request is redirected to a datanode:</p>
  1723. <div class="source">
  1724. <div class="source">
  1725. <pre>HTTP/1.1 307 TEMPORARY_REDIRECT
  1726. Location: http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETFILECHECKSUM...
  1727. Content-Length: 0
  1728. </pre></div></div>
  1729. <p>However, if you do not want to be automatically redirected, you can set the noredirect flag.</p>
  1730. <div class="source">
  1731. <div class="source">
  1732. <pre>HTTP/1.1 200 OK
  1733. Content-Type: application/json
  1734. {&quot;Location&quot;:&quot;http://&lt;DATANODE&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETFILECHECKSUM...&quot;}
  1735. </pre></div></div>
  1736. <p>The client follows the redirect to the datanode and receives a <a href="#FileChecksum_JSON_Schema"><code>FileChecksum</code> JSON object</a>:</p>
  1737. <div class="source">
  1738. <div class="source">
  1739. <pre>HTTP/1.1 200 OK
  1740. Content-Type: application/json
  1741. Transfer-Encoding: chunked
  1742. {
  1743. &quot;FileChecksum&quot;:
  1744. {
  1745. &quot;algorithm&quot;: &quot;MD5-of-1MD5-of-512CRC32&quot;,
  1746. &quot;bytes&quot; : &quot;eadb10de24aa315748930df6e185c0d ...&quot;,
  1747. &quot;length&quot; : 28
  1748. }
  1749. }
  1750. </pre></div></div>
  1751. </li>
  1752. </ul>
  1753. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileChecksum</p></section><section>
  1754. <h3><a name="Get_Home_Directory"></a>Get Home Directory</h3>
  1755. <ul>
  1756. <li>Submit a HTTP GET request.
  1757. <div class="source">
  1758. <div class="source">
  1759. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=GETHOMEDIRECTORY&quot;
  1760. </pre></div></div>
  1761. <p>The client receives a response with a <a href="#Path_JSON_Schema"><code>Path</code> JSON object</a>:</p>
  1762. <div class="source">
  1763. <div class="source">
  1764. <pre>HTTP/1.1 200 OK
  1765. Content-Type: application/json
  1766. Transfer-Encoding: chunked
  1767. {&quot;Path&quot;: &quot;/user/username&quot;}
  1768. </pre></div></div>
  1769. </li>
  1770. </ul>
  1771. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getHomeDirectory</p></section><section>
  1772. <h3><a name="Get_Trash_Root"></a>Get Trash Root</h3>
  1773. <ul>
  1774. <li>Submit a HTTP GET request.
  1775. <div class="source">
  1776. <div class="source">
  1777. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETTRASHROOT&quot;
  1778. </pre></div></div>
  1779. <p>The client receives a response with a <a href="#Path_JSON_Schema"><code>Path</code> JSON object</a>:</p>
  1780. <div class="source">
  1781. <div class="source">
  1782. <pre>HTTP/1.1 200 OK
  1783. Content-Type: application/json
  1784. Transfer-Encoding: chunked
  1785. {&quot;Path&quot;: &quot;/user/username/.Trash&quot;}
  1786. </pre></div></div>
  1787. <p>if the path is an encrypted zone path and user has permission of the path, the client receives a response like this:</p>
  1788. <div class="source">
  1789. <div class="source">
  1790. <pre>HTTP/1.1 200 OK
  1791. Content-Type: application/json
  1792. Transfer-Encoding: chunked
  1793. {&quot;Path&quot;: &quot;/PATH/.Trash/username&quot;}
  1794. </pre></div></div>
  1795. </li>
  1796. </ul>
  1797. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getTrashRoot</p>
  1798. <p>For more details about trash root in an encrypted zone, please refer to <a href="./TransparentEncryption.html#Rename_and_Trash_considerations">Transparent Encryption Guide</a>.</p></section><section>
  1799. <h3><a name="Set_Permission"></a>Set Permission</h3>
  1800. <ul>
  1801. <li>Submit a HTTP PUT request.
  1802. <div class="source">
  1803. <div class="source">
  1804. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETPERMISSION
  1805. [&amp;permission=&lt;OCTAL&gt;]&quot;
  1806. </pre></div></div>
  1807. <p>The client receives a response with zero content length:</p>
  1808. <div class="source">
  1809. <div class="source">
  1810. <pre>HTTP/1.1 200 OK
  1811. Content-Length: 0
  1812. </pre></div></div>
  1813. </li>
  1814. </ul>
  1815. <p>See also: <a href="#Permission"><code>permission</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setPermission</p></section><section>
  1816. <h3><a name="Set_Owner"></a>Set Owner</h3>
  1817. <ul>
  1818. <li>Submit a HTTP PUT request.
  1819. <div class="source">
  1820. <div class="source">
  1821. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETOWNER
  1822. [&amp;owner=&lt;USER&gt;][&amp;group=&lt;GROUP&gt;]&quot;
  1823. </pre></div></div>
  1824. <p>The client receives a response with zero content length:</p>
  1825. <div class="source">
  1826. <div class="source">
  1827. <pre>HTTP/1.1 200 OK
  1828. Content-Length: 0
  1829. </pre></div></div>
  1830. </li>
  1831. </ul>
  1832. <p>See also: <a href="#Owner"><code>owner</code></a>, <a href="#Group"><code>group</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setOwner</p></section><section>
  1833. <h3><a name="Set_Replication_Factor"></a>Set Replication Factor</h3>
  1834. <ul>
  1835. <li>Submit a HTTP PUT request.
  1836. <div class="source">
  1837. <div class="source">
  1838. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETREPLICATION
  1839. [&amp;replication=&lt;SHORT&gt;]&quot;
  1840. </pre></div></div>
  1841. <p>The client receives a response with a <a href="#Boolean_JSON_Schema"><code>boolean</code> JSON object</a>:</p>
  1842. <div class="source">
  1843. <div class="source">
  1844. <pre>HTTP/1.1 200 OK
  1845. Content-Type: application/json
  1846. Transfer-Encoding: chunked
  1847. {&quot;boolean&quot;: true}
  1848. </pre></div></div>
  1849. </li>
  1850. </ul>
  1851. <p>See also: <a href="#Replication"><code>replication</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setReplication</p></section><section>
  1852. <h3><a name="Set_Access_or_Modification_Time"></a>Set Access or Modification Time</h3>
  1853. <ul>
  1854. <li>Submit a HTTP PUT request.
  1855. <div class="source">
  1856. <div class="source">
  1857. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETTIMES
  1858. [&amp;modificationtime=&lt;TIME&gt;][&amp;accesstime=&lt;TIME&gt;]&quot;
  1859. </pre></div></div>
  1860. <p>The client receives a response with zero content length:</p>
  1861. <div class="source">
  1862. <div class="source">
  1863. <pre>HTTP/1.1 200 OK
  1864. Content-Length: 0
  1865. </pre></div></div>
  1866. </li>
  1867. </ul>
  1868. <p>See also: <a href="#Modification_Time"><code>modificationtime</code></a>, <a href="#Access_Time"><code>accesstime</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setTimes</p></section><section>
  1869. <h3><a name="Modify_ACL_Entries"></a>Modify ACL Entries</h3>
  1870. <ul>
  1871. <li>Submit a HTTP PUT request.
  1872. <div class="source">
  1873. <div class="source">
  1874. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=MODIFYACLENTRIES
  1875. &amp;aclspec=&lt;ACLSPEC&gt;&quot;
  1876. </pre></div></div>
  1877. <p>The client receives a response with zero content length:</p>
  1878. <div class="source">
  1879. <div class="source">
  1880. <pre>HTTP/1.1 200 OK
  1881. Content-Length: 0
  1882. </pre></div></div>
  1883. </li>
  1884. </ul>
  1885. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.modifyAclEntries</p></section><section>
  1886. <h3><a name="Remove_ACL_Entries"></a>Remove ACL Entries</h3>
  1887. <ul>
  1888. <li>Submit a HTTP PUT request.
  1889. <div class="source">
  1890. <div class="source">
  1891. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=REMOVEACLENTRIES
  1892. &amp;aclspec=&lt;ACLSPEC&gt;&quot;
  1893. </pre></div></div>
  1894. <p>The client receives a response with zero content length:</p>
  1895. <div class="source">
  1896. <div class="source">
  1897. <pre>HTTP/1.1 200 OK
  1898. Content-Length: 0
  1899. </pre></div></div>
  1900. </li>
  1901. </ul>
  1902. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.removeAclEntries</p></section><section>
  1903. <h3><a name="Remove_Default_ACL"></a>Remove Default ACL</h3>
  1904. <ul>
  1905. <li>Submit a HTTP PUT request.
  1906. <div class="source">
  1907. <div class="source">
  1908. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=REMOVEDEFAULTACL&quot;
  1909. </pre></div></div>
  1910. <p>The client receives a response with zero content length:</p>
  1911. <div class="source">
  1912. <div class="source">
  1913. <pre>HTTP/1.1 200 OK
  1914. Content-Length: 0
  1915. </pre></div></div>
  1916. </li>
  1917. </ul>
  1918. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.removeDefaultAcl</p></section><section>
  1919. <h3><a name="Remove_ACL"></a>Remove ACL</h3>
  1920. <ul>
  1921. <li>Submit a HTTP PUT request.
  1922. <div class="source">
  1923. <div class="source">
  1924. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=REMOVEACL&quot;
  1925. </pre></div></div>
  1926. <p>The client receives a response with zero content length:</p>
  1927. <div class="source">
  1928. <div class="source">
  1929. <pre>HTTP/1.1 200 OK
  1930. Content-Length: 0
  1931. </pre></div></div>
  1932. </li>
  1933. </ul>
  1934. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.removeAcl</p></section><section>
  1935. <h3><a name="Set_ACL"></a>Set ACL</h3>
  1936. <ul>
  1937. <li>Submit a HTTP PUT request.
  1938. <div class="source">
  1939. <div class="source">
  1940. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETACL
  1941. &amp;aclspec=&lt;ACLSPEC&gt;&quot;
  1942. </pre></div></div>
  1943. <p>The client receives a response with zero content length:</p>
  1944. <div class="source">
  1945. <div class="source">
  1946. <pre>HTTP/1.1 200 OK
  1947. Content-Length: 0
  1948. </pre></div></div>
  1949. </li>
  1950. </ul>
  1951. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setAcl</p></section><section>
  1952. <h3><a name="Get_ACL_Status"></a>Get ACL Status</h3>
  1953. <ul>
  1954. <li>Submit a HTTP GET request.
  1955. <div class="source">
  1956. <div class="source">
  1957. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETACLSTATUS&quot;
  1958. </pre></div></div>
  1959. <p>The client receives a response with a <a href="#ACL_Status_JSON_Schema"><code>AclStatus</code> JSON object</a>:</p>
  1960. <div class="source">
  1961. <div class="source">
  1962. <pre>HTTP/1.1 200 OK
  1963. Content-Type: application/json
  1964. Transfer-Encoding: chunked
  1965. {
  1966. &quot;AclStatus&quot;: {
  1967. &quot;entries&quot;: [
  1968. &quot;user:carla:rw-&quot;,
  1969. &quot;group::r-x&quot;
  1970. ],
  1971. &quot;group&quot;: &quot;supergroup&quot;,
  1972. &quot;owner&quot;: &quot;hadoop&quot;,
  1973. &quot;permission&quot;:&quot;775&quot;,
  1974. &quot;stickyBit&quot;: false
  1975. }
  1976. }
  1977. </pre></div></div>
  1978. </li>
  1979. </ul>
  1980. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getAclStatus</p></section><section>
  1981. <h3><a name="Check_access"></a>Check access</h3>
  1982. <ul>
  1983. <li>Submit a HTTP GET request.
  1984. <div class="source">
  1985. <div class="source">
  1986. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CHECKACCESS
  1987. &amp;fsaction=&lt;FSACTION&gt;
  1988. </pre></div></div>
  1989. <p>The client receives a response with zero content length:</p>
  1990. <div class="source">
  1991. <div class="source">
  1992. <pre>HTTP/1.1 200 OK
  1993. Content-Length: 0
  1994. </pre></div></div>
  1995. </li>
  1996. </ul>
  1997. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.access</p></section><section>
  1998. <h3><a name="Get_Server_Defaults"></a>Get Server Defaults</h3>
  1999. <ul>
  2000. <li>Submit a HTTP GET request.
  2001. <div class="source">
  2002. <div class="source">
  2003. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETSERVERDEFAULTS&quot;
  2004. </pre></div></div>
  2005. </li>
  2006. </ul>
  2007. <p>The client receives a response with a <a href="Server_Defaults_JSON_Schema"><code>ServerDefaults</code> JSON object</a>:</p>
  2008. <div class="source">
  2009. <div class="source">
  2010. <pre> HTTP/1.1 200 OK
  2011. Content-Type: application/json
  2012. Transfer-Encoding: chunked
  2013. {
  2014. &quot;FsServerDefaults&quot;: {
  2015. &quot;replication&quot;: 3,
  2016. &quot;encryptDataTransfer&quot;: &quot;false&quot;,
  2017. &quot;defaultStoragePolicyId&quot;:7,
  2018. &quot;writePacketSize&quot;: 65536,
  2019. &quot;fileBufferSize&quot;: 4096,
  2020. &quot;checksumType&quot;: 2,
  2021. &quot;trashInterval&quot;: 10080,
  2022. &quot;keyProviderUri&quot;: &quot;&quot;,
  2023. &quot;blockSize&quot;: 134217728,
  2024. &quot;bytesPerChecksum&quot;: 512
  2025. }
  2026. }
  2027. </pre></div></div>
  2028. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getServerDefaults</p></section><section>
  2029. <h3><a name="Get_Link_Target"></a>Get Link Target</h3>
  2030. <ul>
  2031. <li>Submit a HTTP GET request.
  2032. <div class="source">
  2033. <div class="source">
  2034. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETLINKTARGET&quot;
  2035. </pre></div></div>
  2036. <p>The client receives a response with a <a href="#Path_JSON_Schema"><code>Path</code> JSON object</a>:</p>
  2037. <div class="source">
  2038. <div class="source">
  2039. <pre>HTTP/1.1 200 OK
  2040. Content-Type: application/json
  2041. Transfer-Encoding: chunked
  2042. {&quot;Path&quot;: &quot;/user/username/targetFile&quot;}
  2043. </pre></div></div>
  2044. </li>
  2045. </ul>
  2046. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getLinkTarget</p></section><section>
  2047. <h3><a name="Get_File_Link_Status"></a>Get File Link Status</h3>
  2048. <ul>
  2049. <li>Submit a HTTP GET request.
  2050. <div class="source">
  2051. <div class="source">
  2052. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETFILELINKSTATUS&quot;
  2053. </pre></div></div>
  2054. </li>
  2055. </ul>
  2056. <p>The client receives a response with a <a href="#FileStatuses_JSON_Schema"><code>FileStatus</code> JSON object</a>:</p>
  2057. <div class="source">
  2058. <div class="source">
  2059. <pre> HTTP/1.1 200 OK
  2060. Content-Type: application/json
  2061. Transfer-Encoding: chunked
  2062. {
  2063. &quot;FileStatus&quot;: {
  2064. &quot;accessTime&quot;: 0,
  2065. &quot;blockSize&quot;: 0,
  2066. &quot;childrenNum&quot;:0,
  2067. &quot;fileId&quot;: 16388,
  2068. &quot;group&quot;: &quot;supergroup&quot;,
  2069. &quot;length&quot;: 0,
  2070. &quot;modificationTime&quot;: 1681916788427,
  2071. &quot;owner&quot;: &quot;hadoop&quot;,
  2072. &quot;pathSuffix&quot;: &quot;&quot;,
  2073. &quot;permission&quot;: &quot;777&quot;,
  2074. &quot;replication&quot;: 0,
  2075. &quot;storagePolicy&quot;: 0,
  2076. &quot;symlink&quot;: &quot;/webHdfsTest/file&quot;,
  2077. &quot;type&quot;: &quot;SYMLINK&quot;
  2078. }
  2079. }
  2080. </pre></div></div>
  2081. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileLinkInfo</p></section><section>
  2082. <h3><a name="Get_EC_Policies"></a>Get EC Policies</h3>
  2083. <ul>
  2084. <li>Submit a HTTP GET request.
  2085. <div class="source">
  2086. <div class="source">
  2087. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETECPOLICIES&quot;
  2088. </pre></div></div>
  2089. </li>
  2090. </ul>
  2091. <p>The client receives a response with a <a href="#EC_Policies_JSON_Schema"><code>ECPolicies</code> JSON object</a>:</p>
  2092. <div class="source">
  2093. <div class="source">
  2094. <pre> HTTP/1.1 200 OK
  2095. Content-Type: application/json
  2096. Transfer-Encoding: chunked
  2097. {
  2098. &quot;ErasureCodingPolicies&quot;: {
  2099. &quot;ErasureCodingPolicyInfo&quot;: [
  2100. {
  2101. &quot;state&quot;: &quot;ENABLED&quot;,
  2102. &quot;policy&quot;: {
  2103. &quot;name&quot;: &quot;RS-6-3-1024k&quot;,
  2104. &quot;schema&quot;: {
  2105. &quot;codecName&quot;: &quot;rs&quot;,
  2106. &quot;numDataUnits&quot;: 6,
  2107. &quot;numParityUnits&quot;: 3,
  2108. &quot;extraOptions&quot;: {}
  2109. },
  2110. &quot;cellSize&quot;: 1048576,
  2111. &quot;id&quot;: 1,
  2112. &quot;replicationPolicy&quot;: false,
  2113. &quot;codecName&quot;: &quot;rs&quot;,
  2114. &quot;numDataUnits&quot;: 6,
  2115. &quot;numParityUnits&quot;: 3,
  2116. &quot;systemPolicy&quot;: true
  2117. }
  2118. }
  2119. ]
  2120. }
  2121. }
  2122. </pre></div></div>
  2123. </section><section>
  2124. <h3><a name="Get_Status"></a>Get Status</h3>
  2125. <ul>
  2126. <li>Submit a HTTP GET request.
  2127. <div class="source">
  2128. <div class="source">
  2129. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETSTATUS&quot;
  2130. </pre></div></div>
  2131. </li>
  2132. </ul>
  2133. <p>The client receives a response with a <a href="#FsStatus_JSON_Schema"><code>FsStatus</code> JSON object</a>:</p>
  2134. <div class="source">
  2135. <div class="source">
  2136. <pre> HTTP/1.1 200 OK
  2137. Content-Type: application/json
  2138. Transfer-Encoding: chunked
  2139. {
  2140. &quot;FsStatus&quot;: {
  2141. &quot;used&quot;: 29229154304,
  2142. &quot;remaining&quot;: 292893392896,
  2143. &quot;capacity&quot;:322122547200
  2144. }
  2145. }
  2146. </pre></div></div>
  2147. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getStatus</p></section><section>
  2148. <h3><a name="Get_EC_Codecs"></a>Get EC Codecs</h3>
  2149. <ul>
  2150. <li>Submit a HTTP GET request.
  2151. <div class="source">
  2152. <div class="source">
  2153. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETALLECCODECS&quot;
  2154. </pre></div></div>
  2155. </li>
  2156. </ul>
  2157. <p>The client receives a response with a <a href="#EC_Codecs_JSON_Schema"><code>ECCodecs</code> JSON object</a>:</p>
  2158. <div class="source">
  2159. <div class="source">
  2160. <pre> HTTP/1.1 200 OK
  2161. Content-Type: application/json
  2162. Transfer-Encoding: chunked
  2163. {
  2164. &quot;ErasureCodeCodecs&quot;: {
  2165. &quot;rs&quot;: &quot;rs_native, rs_java&quot;,
  2166. &quot;rs-legacy&quot;: &quot;rs-legacy_java&quot;,
  2167. &quot;xor&quot;:&quot;xor_native, xor_java&quot;
  2168. }
  2169. }
  2170. </pre></div></div>
  2171. </section><section>
  2172. <h3><a name="Get_Trash_Roots"></a>Get Trash Roots</h3>
  2173. <ul>
  2174. <li>Submit a HTTP GET request.
  2175. <div class="source">
  2176. <div class="source">
  2177. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETTRASHROOTS
  2178. &amp;allusers=&lt;true|false&gt;&quot;
  2179. </pre></div></div>
  2180. </li>
  2181. </ul>
  2182. <p>The client receives a response with a <a href="#Paths_JSON_Schema"><code>Paths</code> JSON object</a>:</p>
  2183. <div class="source">
  2184. <div class="source">
  2185. <pre> HTTP/1.1 200 OK
  2186. Content-Type: application/json
  2187. Transfer-Encoding: chunked
  2188. {
  2189. &quot;Paths&quot;: [{
  2190. &quot;blocksize&quot;: 0,
  2191. &quot;owner&quot;: &quot;hadoop&quot;,
  2192. &quot;path&quot;: &quot;/user/user0/.Trash&quot;,
  2193. &quot;length&quot;: 0,
  2194. &quot;permission&quot;: &quot;755&quot;,
  2195. &quot;modification_time&quot;: 1693050205747,
  2196. &quot;isdir&quot;: true,
  2197. &quot;block_replication&quot;: 0,
  2198. &quot;access_time&quot;: 0,
  2199. &quot;group&quot;: &quot;supergroup&quot;
  2200. }, {
  2201. &quot;blocksize&quot;: 0,
  2202. &quot;owner&quot;: &quot;hadoop&quot;,
  2203. &quot;path&quot;: &quot;/user/user1/.Trash&quot;,
  2204. &quot;length&quot;: 0,
  2205. &quot;permission&quot;: &quot;755&quot;,
  2206. &quot;modification_time&quot;: 1693049382962,
  2207. &quot;isdir&quot;: true,
  2208. &quot;block_replication&quot;: 0,
  2209. &quot;access_time&quot;: 0,
  2210. &quot;group&quot;: &quot;supergroup&quot;
  2211. }]
  2212. }
  2213. </pre></div></div>
  2214. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getTrashRoots</p></section></section><section>
  2215. <h2><a name="Storage_Policy_Operations"></a>Storage Policy Operations</h2><section>
  2216. <h3><a name="Get_all_Storage_Policies"></a>Get all Storage Policies</h3>
  2217. <ul>
  2218. <li>Submit a HTTP GET request.
  2219. <div class="source">
  2220. <div class="source">
  2221. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1?op=GETALLSTORAGEPOLICY&quot;
  2222. </pre></div></div>
  2223. <p>The client receives a response with a <a href="#BlockStoragePolicies_JSON_Schema"><code>BlockStoragePolicies</code> JSON object</a>:</p>
  2224. <div class="source">
  2225. <div class="source">
  2226. <pre>HTTP/1.1 200 OK
  2227. Content-Type: application/json
  2228. Transfer-Encoding: chunked
  2229. {
  2230. &quot;BlockStoragePolicies&quot;: {
  2231. &quot;BlockStoragePolicy&quot;: [
  2232. {
  2233. &quot;copyOnCreateFile&quot;: false,
  2234. &quot;creationFallbacks&quot;: [],
  2235. &quot;id&quot;: 2,
  2236. &quot;name&quot;: &quot;COLD&quot;,
  2237. &quot;replicationFallbacks&quot;: [],
  2238. &quot;storageTypes&quot;: [&quot;ARCHIVE&quot;]
  2239. },
  2240. {
  2241. &quot;copyOnCreateFile&quot;: false,
  2242. &quot;creationFallbacks&quot;: [&quot;DISK&quot;,&quot;ARCHIVE&quot;],
  2243. &quot;id&quot;: 5,
  2244. &quot;name&quot;: &quot;WARM&quot;,
  2245. &quot;replicationFallbacks&quot;: [&quot;DISK&quot;,&quot;ARCHIVE&quot;],
  2246. &quot;storageTypes&quot;: [&quot;DISK&quot;,&quot;ARCHIVE&quot;]
  2247. },
  2248. {
  2249. &quot;copyOnCreateFile&quot;: false,
  2250. &quot;creationFallbacks&quot;: [],
  2251. &quot;id&quot;: 7,
  2252. &quot;name&quot;: &quot;HOT&quot;,
  2253. &quot;replicationFallbacks&quot;: [&quot;ARCHIVE&quot;],
  2254. &quot;storageTypes&quot;: [&quot;DISK&quot;]
  2255. },
  2256. {
  2257. &quot;copyOnCreateFile&quot;: false,
  2258. &quot;creationFallbacks&quot;: [&quot;SSD&quot;,&quot;DISK&quot;],
  2259. &quot;id&quot;: 10,&quot;name&quot;: &quot;ONE_SSD&quot;,
  2260. &quot;replicationFallbacks&quot;: [&quot;SSD&quot;,&quot;DISK&quot;],
  2261. &quot;storageTypes&quot;: [&quot;SSD&quot;,&quot;DISK&quot;]
  2262. },
  2263. {
  2264. &quot;copyOnCreateFile&quot;: false,
  2265. &quot;creationFallbacks&quot;: [&quot;DISK&quot;],
  2266. &quot;id&quot;: 12,
  2267. &quot;name&quot;: &quot;ALL_SSD&quot;,
  2268. &quot;replicationFallbacks&quot;: [&quot;DISK&quot;],
  2269. &quot;storageTypes&quot;: [&quot;SSD&quot;]
  2270. },
  2271. {
  2272. &quot;copyOnCreateFile&quot;: false,
  2273. &quot;creationFallbacks&quot;: [&quot;DISK&quot;],
  2274. &quot;id&quot;: 14,
  2275. &quot;name&quot;: &quot;ALL_NVDIMM&quot;,
  2276. &quot;replicationFallbacks&quot;: [&quot;DISK&quot;],
  2277. &quot;storageTypes&quot;: [&quot;NVDIMM&quot;]
  2278. },
  2279. {
  2280. &quot;copyOnCreateFile&quot;: true,
  2281. &quot;creationFallbacks&quot;: [&quot;DISK&quot;],
  2282. &quot;id&quot;: 15,
  2283. &quot;name&quot;: &quot;LAZY_PERSIST&quot;,
  2284. &quot;replicationFallbacks&quot;: [&quot;DISK&quot;],
  2285. &quot;storageTypes&quot;: [&quot;RAM_DISK&quot;,&quot;DISK&quot;]
  2286. }
  2287. ]
  2288. }
  2289. }
  2290. </pre></div></div>
  2291. </li>
  2292. </ul>
  2293. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getAllStoragePolicies</p></section><section>
  2294. <h3><a name="Set_Storage_Policy"></a>Set Storage Policy</h3>
  2295. <ul>
  2296. <li>Submit a HTTP PUT request.
  2297. <div class="source">
  2298. <div class="source">
  2299. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETSTORAGEPOLICY
  2300. &amp;storagepolicy=&lt;policy&gt;&quot;
  2301. </pre></div></div>
  2302. <p>The client receives a response with zero content length:</p>
  2303. <div class="source">
  2304. <div class="source">
  2305. <pre>HTTP/1.1 200 OK
  2306. Content-Length: 0
  2307. </pre></div></div>
  2308. </li>
  2309. </ul>
  2310. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setStoragePolicy</p></section><section>
  2311. <h3><a name="Unset_Storage_Policy"></a>Unset Storage Policy</h3>
  2312. <ul>
  2313. <li>Submit a HTTP POT request.
  2314. <div class="source">
  2315. <div class="source">
  2316. <pre>curl -i -X POST &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=UNSETSTORAGEPOLICY&quot;
  2317. </pre></div></div>
  2318. <p>The client receives a response with zero content length:</p>
  2319. <div class="source">
  2320. <div class="source">
  2321. <pre>HTTP/1.1 200 OK
  2322. Content-Length: 0
  2323. </pre></div></div>
  2324. </li>
  2325. </ul>
  2326. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.unsetStoragePolicy</p></section><section>
  2327. <h3><a name="Get_Storage_Policy"></a>Get Storage Policy</h3>
  2328. <ul>
  2329. <li>Submit a HTTP GET request.
  2330. <div class="source">
  2331. <div class="source">
  2332. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETSTORAGEPOLICY&quot;
  2333. </pre></div></div>
  2334. <p>The client receives a response with a <a href="#BlockStoragePolicy_JSON_Schema"><code>BlockStoragePolicy</code> JSON object</a>:</p>
  2335. <div class="source">
  2336. <div class="source">
  2337. <pre>HTTP/1.1 200 OK
  2338. Content-Type: application/json
  2339. Transfer-Encoding: chunked
  2340. {
  2341. &quot;BlockStoragePolicy&quot;: {
  2342. &quot;copyOnCreateFile&quot;: false,
  2343. &quot;creationFallbacks&quot;: [],
  2344. &quot;id&quot;:7,
  2345. &quot;name&quot;:&quot;HOT&quot;,
  2346. &quot;replicationFallbacks&quot;:[&quot;ARCHIVE&quot;],
  2347. &quot;storageTypes&quot;:[&quot;DISK&quot;]
  2348. }
  2349. }
  2350. </pre></div></div>
  2351. </li>
  2352. </ul>
  2353. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getStoragePolicy</p></section><section>
  2354. <h3><a name="Satisfy_Storage_Policy"></a>Satisfy Storage Policy</h3>
  2355. <ul>
  2356. <li>Submit a HTTP PUT request.
  2357. <div class="source">
  2358. <div class="source">
  2359. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SATISFYSTORAGEPOLICY&quot;
  2360. </pre></div></div>
  2361. <p>The client receives a response with zero content length:</p>
  2362. <div class="source">
  2363. <div class="source">
  2364. <pre>HTTP/1.1 200 OK
  2365. Content-Length: 0
  2366. </pre></div></div>
  2367. </li>
  2368. </ul>
  2369. <p>See also: <a href="./ArchivalStorage.html#Satisfy_Storage_Policy">ArchivalStorage</a>.satisfyStoragePolicy</p></section><section>
  2370. <h3><a name="Get_File_Block_Locations"></a>Get File Block Locations</h3>
  2371. <ul>
  2372. <li>Submit a HTTP GET request.
  2373. <div class="source">
  2374. <div class="source">
  2375. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETFILEBLOCKLOCATIONS
  2376. </pre></div></div>
  2377. <p>The client receives a response with a <a href="#Block_Locations_JSON_Schema"><code>BlockLocations</code> JSON Object</a>:</p>
  2378. <div class="source">
  2379. <div class="source">
  2380. <pre>HTTP/1.1 200 OK
  2381. Content-Type: application/json
  2382. Transfer-Encoding: chunked
  2383. {
  2384. &quot;BlockLocations&quot; :
  2385. {
  2386. &quot;BlockLocation&quot;:
  2387. [
  2388. {
  2389. &quot;cachedHosts&quot; : [],
  2390. &quot;corrupt&quot; : false,
  2391. &quot;hosts&quot; : [&quot;host&quot;],
  2392. &quot;length&quot; : 134217728, // length of this block
  2393. &quot;names&quot; : [&quot;host:ip&quot;],
  2394. &quot;offset&quot; : 0, // offset of the block in the file
  2395. &quot;storageTypes&quot; : [&quot;DISK&quot;], // enum {RAM_DISK, SSD, DISK, ARCHIVE}
  2396. &quot;topologyPaths&quot; : [&quot;/default-rack/hostname:ip&quot;]
  2397. }, {
  2398. &quot;cachedHosts&quot; : [],
  2399. &quot;corrupt&quot; : false,
  2400. &quot;hosts&quot; : [&quot;host&quot;],
  2401. &quot;length&quot; : 62599364,
  2402. &quot;names&quot; : [&quot;host:ip&quot;],
  2403. &quot;offset&quot; : 134217728,
  2404. &quot;storageTypes&quot; : [&quot;DISK&quot;],
  2405. &quot;topologyPaths&quot; : [&quot;/default-rack/hostname:ip&quot;]
  2406. },
  2407. ...
  2408. ]
  2409. }
  2410. }
  2411. </pre></div></div>
  2412. </li>
  2413. </ul>
  2414. <p>See also: <a href="#Offset"><code>offset</code></a>, <a href="#Length"><code>length</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getFileBlockLocations</p></section></section><section>
  2415. <h2><a name="Extended_Attributes.28XAttrs.29_Operations"></a>Extended Attributes(XAttrs) Operations</h2><section>
  2416. <h3><a name="Set_XAttr"></a>Set XAttr</h3>
  2417. <ul>
  2418. <li>Submit a HTTP PUT request.
  2419. <div class="source">
  2420. <div class="source">
  2421. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETXATTR
  2422. &amp;xattr.name=&lt;XATTRNAME&gt;&amp;xattr.value=&lt;XATTRVALUE&gt;
  2423. &amp;flag=&lt;FLAG&gt;&quot;
  2424. </pre></div></div>
  2425. <p>The client receives a response with zero content length:</p>
  2426. <div class="source">
  2427. <div class="source">
  2428. <pre>HTTP/1.1 200 OK
  2429. Content-Length: 0
  2430. </pre></div></div>
  2431. </li>
  2432. </ul>
  2433. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.setXAttr</p></section><section>
  2434. <h3><a name="Remove_XAttr"></a>Remove XAttr</h3>
  2435. <ul>
  2436. <li>Submit a HTTP PUT request.
  2437. <div class="source">
  2438. <div class="source">
  2439. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=REMOVEXATTR
  2440. &amp;xattr.name=&lt;XATTRNAME&gt;&quot;
  2441. </pre></div></div>
  2442. <p>The client receives a response with zero content length:</p>
  2443. <div class="source">
  2444. <div class="source">
  2445. <pre>HTTP/1.1 200 OK
  2446. Content-Length: 0
  2447. </pre></div></div>
  2448. </li>
  2449. </ul>
  2450. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.removeXAttr</p></section><section>
  2451. <h3><a name="Get_an_XAttr"></a>Get an XAttr</h3>
  2452. <ul>
  2453. <li>Submit a HTTP GET request.
  2454. <div class="source">
  2455. <div class="source">
  2456. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETXATTRS
  2457. &amp;xattr.name=&lt;XATTRNAME&gt;&amp;encoding=&lt;ENCODING&gt;&quot;
  2458. </pre></div></div>
  2459. <p>The client receives a response with a <a href="#XAttrs_JSON_Schema"><code>XAttrs</code> JSON object</a>:</p>
  2460. <div class="source">
  2461. <div class="source">
  2462. <pre>HTTP/1.1 200 OK
  2463. Content-Type: application/json
  2464. Transfer-Encoding: chunked
  2465. {
  2466. &quot;XAttrs&quot;: [
  2467. {
  2468. &quot;name&quot;:&quot;XATTRNAME&quot;,
  2469. &quot;value&quot;:&quot;XATTRVALUE&quot;
  2470. }
  2471. ]
  2472. }
  2473. </pre></div></div>
  2474. </li>
  2475. </ul>
  2476. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttr</p></section><section>
  2477. <h3><a name="Get_multiple_XAttrs"></a>Get multiple XAttrs</h3>
  2478. <ul>
  2479. <li>Submit a HTTP GET request.
  2480. <div class="source">
  2481. <div class="source">
  2482. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETXATTRS
  2483. &amp;xattr.name=&lt;XATTRNAME1&gt;&amp;xattr.name=&lt;XATTRNAME2&gt;
  2484. &amp;encoding=&lt;ENCODING&gt;&quot;
  2485. </pre></div></div>
  2486. <p>The client receives a response with a <a href="#XAttrs_JSON_Schema"><code>XAttrs</code> JSON object</a>:</p>
  2487. <div class="source">
  2488. <div class="source">
  2489. <pre>HTTP/1.1 200 OK
  2490. Content-Type: application/json
  2491. Transfer-Encoding: chunked
  2492. {
  2493. &quot;XAttrs&quot;: [
  2494. {
  2495. &quot;name&quot;:&quot;XATTRNAME1&quot;,
  2496. &quot;value&quot;:&quot;XATTRVALUE1&quot;
  2497. },
  2498. {
  2499. &quot;name&quot;:&quot;XATTRNAME2&quot;,
  2500. &quot;value&quot;:&quot;XATTRVALUE2&quot;
  2501. }
  2502. ]
  2503. }
  2504. </pre></div></div>
  2505. </li>
  2506. </ul>
  2507. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttrs</p></section><section>
  2508. <h3><a name="Get_all_XAttrs"></a>Get all XAttrs</h3>
  2509. <ul>
  2510. <li>Submit a HTTP GET request.
  2511. <div class="source">
  2512. <div class="source">
  2513. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETXATTRS
  2514. &amp;encoding=&lt;ENCODING&gt;&quot;
  2515. </pre></div></div>
  2516. <p>The client receives a response with a <a href="#XAttrs_JSON_Schema"><code>XAttrs</code> JSON object</a>:</p>
  2517. <div class="source">
  2518. <div class="source">
  2519. <pre>HTTP/1.1 200 OK
  2520. Content-Type: application/json
  2521. Transfer-Encoding: chunked
  2522. {
  2523. &quot;XAttrs&quot;: [
  2524. {
  2525. &quot;name&quot;:&quot;XATTRNAME1&quot;,
  2526. &quot;value&quot;:&quot;XATTRVALUE1&quot;
  2527. },
  2528. {
  2529. &quot;name&quot;:&quot;XATTRNAME2&quot;,
  2530. &quot;value&quot;:&quot;XATTRVALUE2&quot;
  2531. },
  2532. {
  2533. &quot;name&quot;:&quot;XATTRNAME3&quot;,
  2534. &quot;value&quot;:&quot;XATTRVALUE3&quot;
  2535. }
  2536. ]
  2537. }
  2538. </pre></div></div>
  2539. </li>
  2540. </ul>
  2541. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getXAttrs</p></section><section>
  2542. <h3><a name="List_all_XAttrs"></a>List all XAttrs</h3>
  2543. <ul>
  2544. <li>Submit a HTTP GET request.
  2545. <div class="source">
  2546. <div class="source">
  2547. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=LISTXATTRS&quot;
  2548. </pre></div></div>
  2549. <p>The client receives a response with a <a href="#XAttrNames_JSON_Schema"><code>XAttrNames</code> JSON object</a>:</p>
  2550. <div class="source">
  2551. <div class="source">
  2552. <pre>HTTP/1.1 200 OK
  2553. Content-Type: application/json
  2554. Transfer-Encoding: chunked
  2555. {
  2556. &quot;XAttrNames&quot;:&quot;[\&quot;XATTRNAME1\&quot;,\&quot;XATTRNAME2\&quot;,\&quot;XATTRNAME3\&quot;]&quot;
  2557. }
  2558. </pre></div></div>
  2559. </li>
  2560. </ul>
  2561. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.listXAttrs</p></section></section><section>
  2562. <h2><a name="Erasure_Coding_Operations"></a>Erasure Coding Operations</h2><section>
  2563. <h3><a name="Enable_EC_Policy"></a>Enable EC Policy</h3>
  2564. <ul>
  2565. <li>Submit a HTTP PUT request.
  2566. <div class="source">
  2567. <div class="source">
  2568. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=ENABLEECPOLICY
  2569. &amp;ecpolicy=&lt;policy&gt;&quot;
  2570. </pre></div></div>
  2571. <p>The client receives a response with zero content length:</p>
  2572. <div class="source">
  2573. <div class="source">
  2574. <pre>HTTP/1.1 200 OK
  2575. Content-Length: 0
  2576. </pre></div></div>
  2577. </li>
  2578. </ul>
  2579. <p>See also: <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.enablePolicy</p></section><section>
  2580. <h3><a name="Disable_EC_Policy"></a>Disable EC Policy</h3>
  2581. <ul>
  2582. <li>Submit a HTTP PUT request.
  2583. <div class="source">
  2584. <div class="source">
  2585. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=DISABLEECPOLICY
  2586. &amp;ecpolicy=&lt;policy&gt;&quot;
  2587. </pre></div></div>
  2588. <p>The client receives a response with zero content length:</p>
  2589. <div class="source">
  2590. <div class="source">
  2591. <pre>HTTP/1.1 200 OK
  2592. Content-Length: 0
  2593. </pre></div></div>
  2594. </li>
  2595. </ul>
  2596. <p>See also: <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.disablePolicy</p></section><section>
  2597. <h3><a name="Set_EC_Policy"></a>Set EC Policy</h3>
  2598. <ul>
  2599. <li>Submit a HTTP PUT request.
  2600. <div class="source">
  2601. <div class="source">
  2602. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=SETECPOLICY
  2603. &amp;ecpolicy=&lt;policy&gt;&quot;
  2604. </pre></div></div>
  2605. <p>The client receives a response with zero content length:</p>
  2606. <div class="source">
  2607. <div class="source">
  2608. <pre>HTTP/1.1 200 OK
  2609. Content-Length: 0
  2610. </pre></div></div>
  2611. </li>
  2612. </ul>
  2613. <p>See also: <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.setErasureCodingPolicy</p></section><section>
  2614. <h3><a name="Get_EC_Policy"></a>Get EC Policy</h3>
  2615. <ul>
  2616. <li>Submit a HTTP GET request.
  2617. <div class="source">
  2618. <div class="source">
  2619. <pre>curl -i -X GET &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETECPOLICY
  2620. &quot;
  2621. </pre></div></div>
  2622. </li>
  2623. </ul>
  2624. <p>The client receives a response with a <a href="#ECPolicy_JSON_Schema"><code>ECPolicy</code> JSON object</a>:</p>
  2625. <div class="source">
  2626. <div class="source">
  2627. <pre> {
  2628. &quot;name&quot;: &quot;RS-10-4-1024k&quot;,
  2629. &quot;schema&quot;:
  2630. {
  2631. &quot;codecName&quot;: &quot;rs&quot;,
  2632. &quot;numDataUnits&quot;: 10,
  2633. &quot;numParityUnits&quot;: 4,
  2634. &quot;extraOptions&quot;: {}
  2635. }
  2636. &quot;cellSize&quot;: 1048576,
  2637. &quot;id&quot;:5,
  2638. &quot;codecname&quot;:&quot;rs&quot;,
  2639. &quot;numDataUnits&quot;: 10,
  2640. &quot;numParityUnits&quot;: 4,
  2641. &quot;replicationpolicy&quot;:false,
  2642. &quot;systemPolicy&quot;:true
  2643. }
  2644. </pre></div></div>
  2645. <p>See also: <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.getErasureCodingPolicy</p></section><section>
  2646. <h3><a name="Unset_EC_Policy"></a>Unset EC Policy</h3>
  2647. <ul>
  2648. <li>Submit a HTTP POST request.
  2649. <div class="source">
  2650. <div class="source">
  2651. <pre>curl -i -X POST &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=UNSETECPOLICY
  2652. &quot;
  2653. </pre></div></div>
  2654. <p>The client receives a response with zero content length:</p>
  2655. <div class="source">
  2656. <div class="source">
  2657. <pre>HTTP/1.1 200 OK
  2658. Content-Length: 0
  2659. </pre></div></div>
  2660. </li>
  2661. </ul>
  2662. <p>See also: <a href="./HDFSErasureCoding.html#Administrative_commands">HDFSErasureCoding</a>.unsetErasureCodingPolicy</p></section></section><section>
  2663. <h2><a name="Snapshot_Operations"></a>Snapshot Operations</h2><section>
  2664. <h3><a name="Allow_Snapshot"></a>Allow Snapshot</h3>
  2665. <ul>
  2666. <li>Submit a HTTP PUT request.
  2667. <div class="source">
  2668. <div class="source">
  2669. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=ALLOWSNAPSHOT&quot;
  2670. </pre></div></div>
  2671. <p>The client receives a response with zero content length on success:</p>
  2672. <div class="source">
  2673. <div class="source">
  2674. <pre>HTTP/1.1 200 OK
  2675. Content-Length: 0
  2676. </pre></div></div>
  2677. </li>
  2678. </ul></section><section>
  2679. <h3><a name="Disallow_Snapshot"></a>Disallow Snapshot</h3>
  2680. <ul>
  2681. <li>Submit a HTTP PUT request.
  2682. <div class="source">
  2683. <div class="source">
  2684. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=DISALLOWSNAPSHOT&quot;
  2685. </pre></div></div>
  2686. <p>The client receives a response with zero content length on success:</p>
  2687. <div class="source">
  2688. <div class="source">
  2689. <pre>HTTP/1.1 200 OK
  2690. Content-Length: 0
  2691. </pre></div></div>
  2692. </li>
  2693. </ul></section><section>
  2694. <h3><a name="Create_Snapshot"></a>Create Snapshot</h3>
  2695. <ul>
  2696. <li>Submit a HTTP PUT request.
  2697. <div class="source">
  2698. <div class="source">
  2699. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=CREATESNAPSHOT[&amp;snapshotname=&lt;SNAPSHOTNAME&gt;]&quot;
  2700. </pre></div></div>
  2701. <p>The client receives a response with a <a href="#Path_JSON_Schema"><code>Path</code> JSON object</a>:</p>
  2702. <div class="source">
  2703. <div class="source">
  2704. <pre>HTTP/1.1 200 OK
  2705. Content-Type: application/json
  2706. Transfer-Encoding: chunked
  2707. {&quot;Path&quot;: &quot;/user/username/.snapshot/s1&quot;}
  2708. </pre></div></div>
  2709. </li>
  2710. </ul>
  2711. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.createSnapshot</p></section><section>
  2712. <h3><a name="Delete_Snapshot"></a>Delete Snapshot</h3>
  2713. <ul>
  2714. <li>Submit a HTTP DELETE request.
  2715. <div class="source">
  2716. <div class="source">
  2717. <pre>curl -i -X DELETE &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=DELETESNAPSHOT&amp;snapshotname=&lt;SNAPSHOTNAME&gt;&quot;
  2718. </pre></div></div>
  2719. <p>The client receives a response with zero content length:</p>
  2720. <div class="source">
  2721. <div class="source">
  2722. <pre>HTTP/1.1 200 OK
  2723. Content-Length: 0
  2724. </pre></div></div>
  2725. </li>
  2726. </ul>
  2727. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.deleteSnapshot</p></section><section>
  2728. <h3><a name="Rename_Snapshot"></a>Rename Snapshot</h3>
  2729. <ul>
  2730. <li>Submit a HTTP PUT request.
  2731. <div class="source">
  2732. <div class="source">
  2733. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=RENAMESNAPSHOT
  2734. &amp;oldsnapshotname=&lt;SNAPSHOTNAME&gt;&amp;snapshotname=&lt;SNAPSHOTNAME&gt;&quot;
  2735. </pre></div></div>
  2736. <p>The client receives a response with zero content length:</p>
  2737. <div class="source">
  2738. <div class="source">
  2739. <pre>HTTP/1.1 200 OK
  2740. Content-Length: 0
  2741. </pre></div></div>
  2742. </li>
  2743. </ul>
  2744. <p>See also: <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.renameSnapshot</p></section><section>
  2745. <h3><a name="Get_Snapshot_Diff"></a>Get Snapshot Diff</h3>
  2746. <ul>
  2747. <li>Submit a HTTP GET request.
  2748. <div class="source">
  2749. <div class="source">
  2750. <pre>curl -i GET &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETSNAPSHOTDIFF
  2751. &amp;oldsnapshotname=&lt;SNAPSHOTNAME&gt;&amp;snapshotname=&lt;SNAPSHOTNAME&gt;&quot;
  2752. </pre></div></div>
  2753. <p>The client receives a response with a <a href="#SnapshotDiffReport_JSON_Schema"><code>SnapshotDiffReport</code> JSON object</a>:</p>
  2754. <div class="source">
  2755. <div class="source">
  2756. <pre>HTTP/1.1 200 OK
  2757. Content-Type: application/json
  2758. Transfer-Encoding: chunked
  2759. {&quot;SnapshotDiffReport&quot;:{&quot;diffList&quot;:[],&quot;fromSnapshot&quot;:&quot;s3&quot;,&quot;snapshotRoot&quot;:&quot;/foo&quot;,&quot;toSnapshot&quot;:&quot;s4&quot;}}
  2760. </pre></div></div>
  2761. </li>
  2762. </ul></section><section>
  2763. <h3><a name="Get_Snapshot_Diff_Iteratively"></a>Get Snapshot Diff Iteratively</h3>
  2764. <ul>
  2765. <li>Submit a HTTP GET request.
  2766. <div class="source">
  2767. <div class="source">
  2768. <pre>curl -i -X GET &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?op=GETSNAPSHOTDIFFLISTING
  2769. &amp;oldsnapshotname=&lt;SNAPSHOTNAME&gt;&amp;snapshotname=&lt;SNAPSHOTNAME&gt;&amp;snapshotdiffstartpath=&lt;STARTPATH&gt;&amp;snapshotdiffindex=&lt;STARTINDEX&gt;
  2770. </pre></div></div>
  2771. <p>If <code>snapshotdiffstartpath</code> and <code>snapshotdiffindex</code> are not given, <code>&quot;&quot;</code> (empty string) and <code>-1</code> are used respectively implying the first iteration.</p>
  2772. <p>The client receives a response with a <a href="#SnapshotDiffReportListing_JSON_Schema"><code>SnapshotDiffReportListing</code> JSON object</a>. The value of <code>lastPath</code> and <code>lastIndex</code> must be specified as the value of <code>snapshotdiffstartpath</code> and <code>snapshotdiffindex</code> respectively on next iteration.</p>
  2773. <div class="source">
  2774. <div class="source">
  2775. <pre>HTTP/1.1 200 OK
  2776. Content-Type: application/json
  2777. Transfer-Encoding: chunked
  2778. {&quot;SnapshotDiffReportListing&quot;:{&quot;createList&quot;:[],&quot;deleteList&quot;:[],&quot;isFromEarlier&quot;:true,&quot;lastIndex&quot;:-1,&quot;lastPath&quot;:&quot;&quot;,&quot;modifyList&quot;:[]}}
  2779. </pre></div></div>
  2780. </li>
  2781. </ul></section><section>
  2782. <h3><a name="Get_Snapshottable_Directory_List"></a>Get Snapshottable Directory List</h3>
  2783. <ul>
  2784. <li>Submit a HTTP GET request.
  2785. <div class="source">
  2786. <div class="source">
  2787. <pre>curl -i GET &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?user.name=&lt;USER&gt;&amp;op=GETSNAPSHOTTABLEDIRECTORYLIST&quot;
  2788. </pre></div></div>
  2789. <p>If the USER is not the hdfs super user, the call lists only the snapshottable directories owned by the user. If the USER is the hdfs super user, the call lists all the snapshottable directories. The client receives a response with a <a href="#SnapshottableDirectoryList_JSON_Schema"><code>SnapshottableDirectoryList</code> JSON object</a>:</p>
  2790. <div class="source">
  2791. <div class="source">
  2792. <pre>HTTP/1.1 200 OK
  2793. Content-Type: application/json
  2794. Transfer-Encoding: chunked
  2795. {
  2796. &quot;SnapshottableDirectoryList&quot;:
  2797. [
  2798. {
  2799. &quot;dirStatus&quot;:
  2800. {
  2801. &quot;accessTime&quot;:0,
  2802. &quot;blockSize&quot;:0,
  2803. &quot;childrenNum&quot;:0,
  2804. &quot;fileId&quot;:16386,
  2805. &quot;group&quot;:&quot;hadoop&quot;,
  2806. &quot;length&quot;:0,
  2807. &quot;modificationTime&quot;:1520761889225,
  2808. &quot;owner&quot;:&quot;random&quot;,
  2809. &quot;pathSuffix&quot;:&quot;bar&quot;,
  2810. &quot;permission&quot;:&quot;755&quot;,
  2811. &quot;replication&quot;:0,
  2812. &quot;storagePolicy&quot;:0,
  2813. &quot;type&quot;:&quot;DIRECTORY&quot;
  2814. },
  2815. &quot;parentFullPath&quot;:&quot;/&quot;,
  2816. &quot;snapshotNumber&quot;:0,
  2817. &quot;snapshotQuota&quot;:65536
  2818. }
  2819. ]
  2820. }
  2821. </pre></div></div>
  2822. </li>
  2823. </ul></section><section>
  2824. <h3><a name="Get_Snapshot_List"></a>Get Snapshot List</h3>
  2825. <ul>
  2826. <li>Submit a HTTP GET request.
  2827. <div class="source">
  2828. <div class="source">
  2829. <pre>curl -i GET &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/&lt;PATH&gt;?&quot;
  2830. </pre></div></div>
  2831. <p>The call lists the snapshots for a snapshottable directory. The client receives a response with a <a href="#SnapshotList_JSON_Schema"><code>SnapshotList</code> JSON object</a>:</p>
  2832. <div class="source">
  2833. <div class="source">
  2834. <pre>HTTP/1.1 200 OK
  2835. Content-Type: application/json
  2836. Transfer-Encoding: chunked
  2837. {
  2838. &quot;SnapshotList&quot;:
  2839. [
  2840. {
  2841. &quot;dirStatus&quot;:
  2842. {
  2843. &quot;accessTime&quot;:0,
  2844. &quot;blockSize&quot;:0,
  2845. &quot;childrenNum&quot;:0,
  2846. &quot;fileId&quot;:16386,
  2847. &quot;group&quot;:&quot;hadoop&quot;,
  2848. &quot;length&quot;:0,
  2849. &quot;modificationTime&quot;:1520761889225,
  2850. &quot;owner&quot;:&quot;random&quot;,
  2851. &quot;pathSuffix&quot;:&quot;bar&quot;,
  2852. &quot;permission&quot;:&quot;755&quot;,
  2853. &quot;replication&quot;:0,
  2854. &quot;storagePolicy&quot;:0,
  2855. &quot;type&quot;:&quot;DIRECTORY&quot;
  2856. },
  2857. &quot;fullPath&quot;:&quot;/&quot;,
  2858. &quot;snapshotID&quot;:0,
  2859. &quot;deletionStatus&quot;:ACTIVE
  2860. }
  2861. ]
  2862. }
  2863. </pre></div></div>
  2864. </li>
  2865. </ul></section></section><section>
  2866. <h2><a name="Delegation_Token_Operations"></a>Delegation Token Operations</h2><section>
  2867. <h3><a name="Get_Delegation_Token"></a>Get Delegation Token</h3>
  2868. <ul>
  2869. <li>Submit a HTTP GET request.
  2870. <div class="source">
  2871. <div class="source">
  2872. <pre>curl -i &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=GETDELEGATIONTOKEN
  2873. [&amp;renewer=&lt;USER&gt;][&amp;service=&lt;SERVICE&gt;][&amp;kind=&lt;KIND&gt;]&quot;
  2874. </pre></div></div>
  2875. <p>The client receives a response with a <a href="#Token_JSON_Schema"><code>Token</code> JSON object</a>:</p>
  2876. <div class="source">
  2877. <div class="source">
  2878. <pre>HTTP/1.1 200 OK
  2879. Content-Type: application/json
  2880. Transfer-Encoding: chunked
  2881. {
  2882. &quot;Token&quot;:
  2883. {
  2884. &quot;urlString&quot;: &quot;JQAIaG9y...&quot;
  2885. }
  2886. }
  2887. </pre></div></div>
  2888. </li>
  2889. </ul>
  2890. <p>See also: <a href="#Renewer"><code>renewer</code></a>, <a href="../../api/org/apache/hadoop/fs/FileSystem.html">FileSystem</a>.getDelegationToken, <a href="#Token_Kind"><code>kind</code></a>, <a href="#Token_Service"><code>service</code></a></p></section><section>
  2891. <h3><a name="Renew_Delegation_Token"></a>Renew Delegation Token</h3>
  2892. <ul>
  2893. <li>Submit a HTTP PUT request.
  2894. <div class="source">
  2895. <div class="source">
  2896. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=RENEWDELEGATIONTOKEN&amp;token=&lt;TOKEN&gt;&quot;
  2897. </pre></div></div>
  2898. <p>The client receives a response with a <a href="#Long_JSON_Schema"><code>long</code> JSON object</a>:</p>
  2899. <div class="source">
  2900. <div class="source">
  2901. <pre>HTTP/1.1 200 OK
  2902. Content-Type: application/json
  2903. Transfer-Encoding: chunked
  2904. {&quot;long&quot;: 1320962673997} //the new expiration time
  2905. </pre></div></div>
  2906. </li>
  2907. </ul>
  2908. <p>See also: <a href="#Token"><code>token</code></a>, <a href="../../api/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticator.html">DelegationTokenAuthenticator</a>.renewDelegationToken</p></section><section>
  2909. <h3><a name="Cancel_Delegation_Token"></a>Cancel Delegation Token</h3>
  2910. <ul>
  2911. <li>Submit a HTTP PUT request.
  2912. <div class="source">
  2913. <div class="source">
  2914. <pre>curl -i -X PUT &quot;http://&lt;HOST&gt;:&lt;PORT&gt;/webhdfs/v1/?op=CANCELDELEGATIONTOKEN&amp;token=&lt;TOKEN&gt;&quot;
  2915. </pre></div></div>
  2916. <p>The client receives a response with zero content length:</p>
  2917. <div class="source">
  2918. <div class="source">
  2919. <pre>HTTP/1.1 200 OK
  2920. Content-Length: 0
  2921. </pre></div></div>
  2922. </li>
  2923. </ul>
  2924. <p>See also: <a href="#Token"><code>token</code></a>, <a href="../../api/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticator.html">DelegationTokenAuthenticator</a>.cancelDelegationToken</p></section></section><section>
  2925. <h2><a name="Error_Responses"></a>Error Responses</h2>
  2926. <p>When an operation fails, the server may throw an exception. The JSON schema of error responses is defined in <a href="#RemoteException_JSON_Schema">RemoteException JSON Schema</a>. The table below shows the mapping from exceptions to HTTP response codes.</p><section>
  2927. <h3><a name="HTTP_Response_Codes"></a>HTTP Response Codes</h3>
  2928. <table border="0" class="bodyTable">
  2929. <thead>
  2930. <tr class="a">
  2931. <th align="left"> Exceptions </th>
  2932. <th align="left"> HTTP Response Codes </th></tr>
  2933. </thead><tbody>
  2934. <tr class="b">
  2935. <td align="left"> <code>IllegalArgumentException</code> </td>
  2936. <td align="left"> <code>400 Bad Request</code> </td></tr>
  2937. <tr class="a">
  2938. <td align="left"> <code>UnsupportedOperationException</code> </td>
  2939. <td align="left"> <code>400 Bad Request</code> </td></tr>
  2940. <tr class="b">
  2941. <td align="left"> <code>SecurityException</code> </td>
  2942. <td align="left"> <code>401 Unauthorized</code> </td></tr>
  2943. <tr class="a">
  2944. <td align="left"> <code>IOException</code> </td>
  2945. <td align="left"> <code>403 Forbidden</code> </td></tr>
  2946. <tr class="b">
  2947. <td align="left"> <code>FileNotFoundException</code> </td>
  2948. <td align="left"> <code>404 Not Found</code> </td></tr>
  2949. <tr class="a">
  2950. <td align="left"> <code>RuntimeException</code> </td>
  2951. <td align="left"> <code>500 Internal Server Error</code> </td></tr>
  2952. </tbody>
  2953. </table>
  2954. <p>Below are examples of exception responses.</p><section>
  2955. <h4><a name="Illegal_Argument_Exception"></a>Illegal Argument Exception</h4>
  2956. <div class="source">
  2957. <div class="source">
  2958. <pre>HTTP/1.1 400 Bad Request
  2959. Content-Type: application/json
  2960. Transfer-Encoding: chunked
  2961. {
  2962. &quot;RemoteException&quot;:
  2963. {
  2964. &quot;exception&quot; : &quot;IllegalArgumentException&quot;,
  2965. &quot;javaClassName&quot;: &quot;java.lang.IllegalArgumentException&quot;,
  2966. &quot;message&quot; : &quot;Invalid value for webhdfs parameter \&quot;permission\&quot;: ...&quot;
  2967. }
  2968. }
  2969. </pre></div></div>
  2970. </section><section>
  2971. <h4><a name="Security_Exception"></a>Security Exception</h4>
  2972. <div class="source">
  2973. <div class="source">
  2974. <pre>HTTP/1.1 401 Unauthorized
  2975. Content-Type: application/json
  2976. Transfer-Encoding: chunked
  2977. {
  2978. &quot;RemoteException&quot;:
  2979. {
  2980. &quot;exception&quot; : &quot;SecurityException&quot;,
  2981. &quot;javaClassName&quot;: &quot;java.lang.SecurityException&quot;,
  2982. &quot;message&quot; : &quot;Failed to obtain user group information: ...&quot;
  2983. }
  2984. }
  2985. </pre></div></div>
  2986. </section><section>
  2987. <h4><a name="Access_Control_Exception"></a>Access Control Exception</h4>
  2988. <div class="source">
  2989. <div class="source">
  2990. <pre>HTTP/1.1 403 Forbidden
  2991. Content-Type: application/json
  2992. Transfer-Encoding: chunked
  2993. {
  2994. &quot;RemoteException&quot;:
  2995. {
  2996. &quot;exception&quot; : &quot;AccessControlException&quot;,
  2997. &quot;javaClassName&quot;: &quot;org.apache.hadoop.security.AccessControlException&quot;,
  2998. &quot;message&quot; : &quot;Permission denied: ...&quot;
  2999. }
  3000. }
  3001. </pre></div></div>
  3002. </section><section>
  3003. <h4><a name="File_Not_Found_Exception"></a>File Not Found Exception</h4>
  3004. <div class="source">
  3005. <div class="source">
  3006. <pre>HTTP/1.1 404 Not Found
  3007. Content-Type: application/json
  3008. Transfer-Encoding: chunked
  3009. {
  3010. &quot;RemoteException&quot;:
  3011. {
  3012. &quot;exception&quot; : &quot;FileNotFoundException&quot;,
  3013. &quot;javaClassName&quot;: &quot;java.io.FileNotFoundException&quot;,
  3014. &quot;message&quot; : &quot;File does not exist: /foo/a.patch&quot;
  3015. }
  3016. }
  3017. </pre></div></div>
  3018. </section></section></section><section>
  3019. <h2><a name="JSON_Schemas"></a>JSON Schemas</h2>
  3020. <p>All operations, except for <a href="#Open_and_Read_a_File"><code>OPEN</code></a>, either return a zero-length response or a JSON response. For <a href="#Open_and_Read_a_File"><code>OPEN</code></a>, the response is an octet-stream. The JSON schemas are shown below. See <a class="externalLink" href="http://tools.ietf.org/id/draft-zyp-json-schema-03.html">draft-zyp-json-schema-03</a> for the syntax definitions of the JSON schemas.</p>
  3021. <p><b>Note</b> that the default value of <a class="externalLink" href="http://tools.ietf.org/id/draft-zyp-json-schema-03.html#additionalProperties"><code>additionalProperties</code></a> is an empty schema which allows any value for additional properties. Therefore, all WebHDFS JSON responses allow any additional property. However, if additional properties are included in the responses, they are considered as optional properties in order to maintain compatibility.</p><section>
  3022. <h3><a name="ACL_Status_JSON_Schema"></a>ACL Status JSON Schema</h3>
  3023. <div class="source">
  3024. <div class="source">
  3025. <pre>{
  3026. &quot;name&quot; : &quot;AclStatus&quot;,
  3027. &quot;properties&quot;:
  3028. {
  3029. &quot;AclStatus&quot;:
  3030. {
  3031. &quot;type&quot; : &quot;object&quot;,
  3032. &quot;properties&quot;:
  3033. {
  3034. &quot;entries&quot;:
  3035. {
  3036. &quot;type&quot;: &quot;array&quot;,
  3037. &quot;items&quot;:
  3038. {
  3039. &quot;description&quot;: &quot;ACL entry.&quot;,
  3040. &quot;type&quot;: &quot;string&quot;
  3041. }
  3042. },
  3043. &quot;group&quot;:
  3044. {
  3045. &quot;description&quot;: &quot;The group owner.&quot;,
  3046. &quot;type&quot; : &quot;string&quot;,
  3047. &quot;required&quot; : true
  3048. },
  3049. &quot;owner&quot;:
  3050. {
  3051. &quot;description&quot;: &quot;The user who is the owner.&quot;,
  3052. &quot;type&quot; : &quot;string&quot;,
  3053. &quot;required&quot; : true
  3054. },
  3055. &quot;stickyBit&quot;:
  3056. {
  3057. &quot;description&quot;: &quot;True if the sticky bit is on.&quot;,
  3058. &quot;type&quot; : &quot;boolean&quot;,
  3059. &quot;required&quot; : true
  3060. }
  3061. }
  3062. }
  3063. }
  3064. }
  3065. </pre></div></div>
  3066. </section><section>
  3067. <h3><a name="XAttrs_JSON_Schema"></a>XAttrs JSON Schema</h3>
  3068. <div class="source">
  3069. <div class="source">
  3070. <pre>{
  3071. &quot;name&quot; : &quot;XAttrs&quot;,
  3072. &quot;properties&quot;:
  3073. {
  3074. &quot;XAttrs&quot;:
  3075. {
  3076. &quot;type&quot; : &quot;array&quot;,
  3077. &quot;items&quot;:
  3078. {
  3079. &quot;type&quot; : &quot;object&quot;,
  3080. &quot;properties&quot;:
  3081. {
  3082. &quot;name&quot;:
  3083. {
  3084. &quot;description&quot;: &quot;XAttr name.&quot;,
  3085. &quot;type&quot; : &quot;string&quot;,
  3086. &quot;required&quot; : true
  3087. },
  3088. &quot;value&quot;:
  3089. {
  3090. &quot;description&quot;: &quot;XAttr value.&quot;,
  3091. &quot;type&quot; : &quot;string&quot;
  3092. }
  3093. }
  3094. }
  3095. }
  3096. }
  3097. }
  3098. </pre></div></div>
  3099. </section><section>
  3100. <h3><a name="XAttrNames_JSON_Schema"></a>XAttrNames JSON Schema</h3>
  3101. <div class="source">
  3102. <div class="source">
  3103. <pre>{
  3104. &quot;name&quot; : &quot;XAttrNames&quot;,
  3105. &quot;properties&quot;:
  3106. {
  3107. &quot;XAttrNames&quot;:
  3108. {
  3109. &quot;description&quot;: &quot;XAttr names.&quot;,
  3110. &quot;type&quot; : &quot;string&quot;,
  3111. &quot;required&quot; : true
  3112. }
  3113. }
  3114. }
  3115. </pre></div></div>
  3116. </section><section>
  3117. <h3><a name="Boolean_JSON_Schema"></a>Boolean JSON Schema</h3>
  3118. <div class="source">
  3119. <div class="source">
  3120. <pre>{
  3121. &quot;name&quot; : &quot;boolean&quot;,
  3122. &quot;properties&quot;:
  3123. {
  3124. &quot;boolean&quot;:
  3125. {
  3126. &quot;description&quot;: &quot;A boolean value&quot;,
  3127. &quot;type&quot; : &quot;boolean&quot;,
  3128. &quot;required&quot; : true
  3129. }
  3130. }
  3131. }
  3132. </pre></div></div>
  3133. <p>See also: <a href="#Make_a_Directory"><code>MKDIRS</code></a>, <a href="#Rename_a_FileDirectory"><code>RENAME</code></a>, <a href="#Delete_a_FileDirectory"><code>DELETE</code></a>, <a href="#Set_Replication_Factor"><code>SETREPLICATION</code></a></p></section><section>
  3134. <h3><a name="ContentSummary_JSON_Schema"></a>ContentSummary JSON Schema</h3>
  3135. <div class="source">
  3136. <div class="source">
  3137. <pre>{
  3138. &quot;name&quot; : &quot;ContentSummary&quot;,
  3139. &quot;properties&quot;:
  3140. {
  3141. &quot;ContentSummary&quot;:
  3142. {
  3143. &quot;type&quot; : &quot;object&quot;,
  3144. &quot;properties&quot;:
  3145. {
  3146. &quot;directoryCount&quot;:
  3147. {
  3148. &quot;description&quot;: &quot;The number of directories.&quot;,
  3149. &quot;type&quot; : &quot;integer&quot;,
  3150. &quot;required&quot; : true
  3151. },
  3152. &quot;fileCount&quot;:
  3153. {
  3154. &quot;description&quot;: &quot;The number of files.&quot;,
  3155. &quot;type&quot; : &quot;integer&quot;,
  3156. &quot;required&quot; : true
  3157. },
  3158. &quot;length&quot;:
  3159. {
  3160. &quot;description&quot;: &quot;The number of bytes used by the content.&quot;,
  3161. &quot;type&quot; : &quot;integer&quot;,
  3162. &quot;required&quot; : true
  3163. },
  3164. &quot;quota&quot;:
  3165. {
  3166. &quot;description&quot;: &quot;The namespace quota of this directory.&quot;,
  3167. &quot;type&quot; : &quot;integer&quot;,
  3168. &quot;required&quot; : true
  3169. },
  3170. &quot;spaceConsumed&quot;:
  3171. {
  3172. &quot;description&quot;: &quot;The disk space consumed by the content.&quot;,
  3173. &quot;type&quot; : &quot;integer&quot;,
  3174. &quot;required&quot; : true
  3175. },
  3176. &quot;spaceQuota&quot;:
  3177. {
  3178. &quot;description&quot;: &quot;The disk space quota.&quot;,
  3179. &quot;type&quot; : &quot;integer&quot;,
  3180. &quot;required&quot; : true
  3181. },
  3182. &quot;typeQuota&quot;:
  3183. {
  3184. &quot;type&quot; : &quot;object&quot;,
  3185. &quot;properties&quot;:
  3186. {
  3187. &quot;ARCHIVE&quot;:
  3188. {
  3189. &quot;type&quot; : &quot;object&quot;,
  3190. &quot;properties&quot;:
  3191. {
  3192. &quot;consumed&quot;:
  3193. {
  3194. &quot;description&quot;: &quot;The storage type space consumed.&quot;,
  3195. &quot;type&quot; : &quot;integer&quot;,
  3196. &quot;required&quot; : true
  3197. },
  3198. &quot;quota&quot;:
  3199. {
  3200. &quot;description&quot;: &quot;The storage type quota.&quot;,
  3201. &quot;type&quot; : &quot;integer&quot;,
  3202. &quot;required&quot; : true
  3203. }
  3204. }
  3205. },
  3206. &quot;DISK&quot;:
  3207. {
  3208. &quot;type&quot; : &quot;object&quot;,
  3209. &quot;properties&quot;:
  3210. {
  3211. &quot;consumed&quot;:
  3212. {
  3213. &quot;description&quot;: &quot;The storage type space consumed.&quot;,
  3214. &quot;type&quot; : &quot;integer&quot;,
  3215. &quot;required&quot; : true
  3216. },
  3217. &quot;quota&quot;:
  3218. {
  3219. &quot;description&quot;: &quot;The storage type quota.&quot;,
  3220. &quot;type&quot; : &quot;integer&quot;,
  3221. &quot;required&quot; : true
  3222. }
  3223. }
  3224. },
  3225. &quot;SSD&quot;:
  3226. {
  3227. &quot;type&quot; : &quot;object&quot;,
  3228. &quot;properties&quot;:
  3229. {
  3230. &quot;consumed&quot;:
  3231. {
  3232. &quot;description&quot;: &quot;The storage type space consumed.&quot;,
  3233. &quot;type&quot; : &quot;integer&quot;,
  3234. &quot;required&quot; : true
  3235. },
  3236. &quot;quota&quot;:
  3237. {
  3238. &quot;description&quot;: &quot;The storage type quota.&quot;,
  3239. &quot;type&quot; : &quot;integer&quot;,
  3240. &quot;required&quot; : true
  3241. }
  3242. }
  3243. }
  3244. }
  3245. }
  3246. }
  3247. }
  3248. }
  3249. }
  3250. </pre></div></div>
  3251. <p>See also: <a href="#Get_Content_Summary_of_a_Directory"><code>GETCONTENTSUMMARY</code></a></p></section><section>
  3252. <h3><a name="QuotaUsage_JSON_Schema"></a>QuotaUsage JSON Schema</h3>
  3253. <div class="source">
  3254. <div class="source">
  3255. <pre>{
  3256. &quot;name&quot; : &quot;QuotaUsage&quot;,
  3257. &quot;properties&quot;:
  3258. {
  3259. &quot;QuotaUsage&quot;:
  3260. {
  3261. &quot;type&quot; : &quot;object&quot;,
  3262. &quot;properties&quot;:
  3263. {
  3264. &quot;fileAndDirectoryCount&quot;:
  3265. {
  3266. &quot;description&quot;: &quot;The number of files and directories.&quot;,
  3267. &quot;type&quot; : &quot;integer&quot;,
  3268. &quot;required&quot; : true
  3269. },
  3270. &quot;quota&quot;:
  3271. {
  3272. &quot;description&quot;: &quot;The namespace quota of this directory.&quot;,
  3273. &quot;type&quot; : &quot;integer&quot;,
  3274. &quot;required&quot; : true
  3275. },
  3276. &quot;spaceConsumed&quot;:
  3277. {
  3278. &quot;description&quot;: &quot;The disk space consumed by the content.&quot;,
  3279. &quot;type&quot; : &quot;integer&quot;,
  3280. &quot;required&quot; : true
  3281. },
  3282. &quot;spaceQuota&quot;:
  3283. {
  3284. &quot;description&quot;: &quot;The disk space quota.&quot;,
  3285. &quot;type&quot; : &quot;integer&quot;,
  3286. &quot;required&quot; : true
  3287. },
  3288. &quot;typeQuota&quot;:
  3289. {
  3290. &quot;type&quot; : &quot;object&quot;,
  3291. &quot;properties&quot;:
  3292. {
  3293. &quot;ARCHIVE&quot;:
  3294. {
  3295. &quot;type&quot; : &quot;object&quot;,
  3296. &quot;properties&quot;:
  3297. {
  3298. &quot;consumed&quot;:
  3299. {
  3300. &quot;description&quot;: &quot;The storage type space consumed.&quot;,
  3301. &quot;type&quot; : &quot;integer&quot;,
  3302. &quot;required&quot; : true
  3303. },
  3304. &quot;quota&quot;:
  3305. {
  3306. &quot;description&quot;: &quot;The storage type quota.&quot;,
  3307. &quot;type&quot; : &quot;integer&quot;,
  3308. &quot;required&quot; : true
  3309. }
  3310. }
  3311. },
  3312. &quot;DISK&quot;:
  3313. {
  3314. &quot;type&quot; : &quot;object&quot;,
  3315. &quot;properties&quot;:
  3316. {
  3317. &quot;consumed&quot;:
  3318. {
  3319. &quot;description&quot;: &quot;The storage type space consumed.&quot;,
  3320. &quot;type&quot; : &quot;integer&quot;,
  3321. &quot;required&quot; : true
  3322. },
  3323. &quot;quota&quot;:
  3324. {
  3325. &quot;description&quot;: &quot;The storage type quota.&quot;,
  3326. &quot;type&quot; : &quot;integer&quot;,
  3327. &quot;required&quot; : true
  3328. }
  3329. }
  3330. },
  3331. &quot;SSD&quot;:
  3332. {
  3333. &quot;type&quot; : &quot;object&quot;,
  3334. &quot;properties&quot;:
  3335. {
  3336. &quot;consumed&quot;:
  3337. {
  3338. &quot;description&quot;: &quot;The storage type space consumed.&quot;,
  3339. &quot;type&quot; : &quot;integer&quot;,
  3340. &quot;required&quot; : true
  3341. },
  3342. &quot;quota&quot;:
  3343. {
  3344. &quot;description&quot;: &quot;The storage type quota.&quot;,
  3345. &quot;type&quot; : &quot;integer&quot;,
  3346. &quot;required&quot; : true
  3347. }
  3348. }
  3349. }
  3350. }
  3351. }
  3352. }
  3353. }
  3354. }
  3355. }
  3356. </pre></div></div>
  3357. <p>See also: <a href="#Get_Quota_Usage_of_a_Directory"><code>GETQUOTAUSAGE</code></a></p></section><section>
  3358. <h3><a name="FileChecksum_JSON_Schema"></a>FileChecksum JSON Schema</h3>
  3359. <div class="source">
  3360. <div class="source">
  3361. <pre>{
  3362. &quot;name&quot; : &quot;FileChecksum&quot;,
  3363. &quot;properties&quot;:
  3364. {
  3365. &quot;FileChecksum&quot;:
  3366. {
  3367. &quot;type&quot; : &quot;object&quot;,
  3368. &quot;properties&quot;:
  3369. {
  3370. &quot;algorithm&quot;:
  3371. {
  3372. &quot;description&quot;: &quot;The name of the checksum algorithm.&quot;,
  3373. &quot;type&quot; : &quot;string&quot;,
  3374. &quot;required&quot; : true
  3375. },
  3376. &quot;bytes&quot;:
  3377. {
  3378. &quot;description&quot;: &quot;The byte sequence of the checksum in hexadecimal.&quot;,
  3379. &quot;type&quot; : &quot;string&quot;,
  3380. &quot;required&quot; : true
  3381. },
  3382. &quot;length&quot;:
  3383. {
  3384. &quot;description&quot;: &quot;The length of the bytes (not the length of the string).&quot;,
  3385. &quot;type&quot; : &quot;integer&quot;,
  3386. &quot;required&quot; : true
  3387. }
  3388. }
  3389. }
  3390. }
  3391. }
  3392. </pre></div></div>
  3393. </section><section>
  3394. <h3><a name="FileStatus_JSON_Schema"></a>FileStatus JSON Schema</h3>
  3395. <div class="source">
  3396. <div class="source">
  3397. <pre>{
  3398. &quot;name&quot; : &quot;FileStatus&quot;,
  3399. &quot;properties&quot;:
  3400. {
  3401. &quot;FileStatus&quot;: fileStatusProperties //See FileStatus Properties
  3402. }
  3403. }
  3404. </pre></div></div>
  3405. <p>See also: <a href="#FileStatus_Properties"><code>FileStatus</code> Properties</a>, <a href="#Status_of_a_FileDirectory"><code>GETFILESTATUS</code></a>, <a href="../../api/org/apache/hadoop/fs/FileStatus.html">FileStatus</a></p><section>
  3406. <h4><a name="FileStatus_Properties"></a>FileStatus Properties</h4>
  3407. <p>JavaScript syntax is used to define <code>fileStatusProperties</code> so that it can be referred in both <code>FileStatus</code> and <code>FileStatuses</code> JSON schemas.</p>
  3408. <div class="source">
  3409. <div class="source">
  3410. <pre>var fileStatusProperties =
  3411. {
  3412. &quot;type&quot; : &quot;object&quot;,
  3413. &quot;properties&quot;:
  3414. {
  3415. &quot;accessTime&quot;:
  3416. {
  3417. &quot;description&quot;: &quot;The access time.&quot;,
  3418. &quot;type&quot; : &quot;integer&quot;,
  3419. &quot;required&quot; : true
  3420. },
  3421. &quot;blockSize&quot;:
  3422. {
  3423. &quot;description&quot;: &quot;The block size of a file.&quot;,
  3424. &quot;type&quot; : &quot;integer&quot;,
  3425. &quot;required&quot; : true
  3426. },
  3427. &quot;group&quot;:
  3428. {
  3429. &quot;description&quot;: &quot;The group owner.&quot;,
  3430. &quot;type&quot; : &quot;string&quot;,
  3431. &quot;required&quot; : true
  3432. },
  3433. &quot;length&quot;:
  3434. {
  3435. &quot;description&quot;: &quot;The number of bytes in a file.&quot;,
  3436. &quot;type&quot; : &quot;integer&quot;,
  3437. &quot;required&quot; : true
  3438. },
  3439. &quot;modificationTime&quot;:
  3440. {
  3441. &quot;description&quot;: &quot;The modification time.&quot;,
  3442. &quot;type&quot; : &quot;integer&quot;,
  3443. &quot;required&quot; : true
  3444. },
  3445. &quot;owner&quot;:
  3446. {
  3447. &quot;description&quot;: &quot;The user who is the owner.&quot;,
  3448. &quot;type&quot; : &quot;string&quot;,
  3449. &quot;required&quot; : true
  3450. },
  3451. &quot;pathSuffix&quot;:
  3452. {
  3453. &quot;description&quot;: &quot;The path suffix.&quot;,
  3454. &quot;type&quot; : &quot;string&quot;,
  3455. &quot;required&quot; : true
  3456. },
  3457. &quot;permission&quot;:
  3458. {
  3459. &quot;description&quot;: &quot;The permission represented as a octal string.&quot;,
  3460. &quot;type&quot; : &quot;string&quot;,
  3461. &quot;required&quot; : true
  3462. },
  3463. &quot;replication&quot;:
  3464. {
  3465. &quot;description&quot;: &quot;The number of replication of a file.&quot;,
  3466. &quot;type&quot; : &quot;integer&quot;,
  3467. &quot;required&quot; : true
  3468. },
  3469. &quot;symlink&quot;: //an optional property
  3470. {
  3471. &quot;description&quot;: &quot;The link target of a symlink.&quot;,
  3472. &quot;type&quot; : &quot;string&quot;
  3473. },
  3474. &quot;type&quot;:
  3475. {
  3476. &quot;description&quot;: &quot;The type of the path object.&quot;,
  3477. &quot;enum&quot; : [&quot;FILE&quot;, &quot;DIRECTORY&quot;, &quot;SYMLINK&quot;],
  3478. &quot;required&quot; : true
  3479. },
  3480. &quot;aclBit&quot;:
  3481. {
  3482. &quot;description&quot;: &quot;Has ACLs set or not.&quot;,
  3483. &quot;type&quot; : &quot;boolean&quot;,
  3484. },
  3485. &quot;encBit&quot;:
  3486. {
  3487. &quot;description&quot;: &quot;Is Encrypted or not.&quot;,
  3488. &quot;type&quot; : &quot;boolean&quot;,
  3489. },
  3490. &quot;ecBit&quot;:
  3491. {
  3492. &quot;description&quot;: &quot;Is ErasureCoded or not.&quot;,
  3493. &quot;type&quot; : &quot;boolean&quot;,
  3494. },
  3495. &quot;ecPolicy&quot;:
  3496. {
  3497. &quot;description&quot;: &quot;The namenode of ErasureCodePolicy.&quot;,
  3498. &quot;type&quot; : &quot;String&quot;,
  3499. }
  3500. }
  3501. };
  3502. </pre></div></div>
  3503. </section></section><section>
  3504. <h3><a name="FileStatuses_JSON_Schema"></a>FileStatuses JSON Schema</h3>
  3505. <p>A <code>FileStatuses</code> JSON object represents an array of <code>FileStatus</code> JSON objects.</p>
  3506. <div class="source">
  3507. <div class="source">
  3508. <pre>{
  3509. &quot;name&quot; : &quot;FileStatuses&quot;,
  3510. &quot;properties&quot;:
  3511. {
  3512. &quot;FileStatuses&quot;:
  3513. {
  3514. &quot;type&quot; : &quot;object&quot;,
  3515. &quot;properties&quot;:
  3516. {
  3517. &quot;FileStatus&quot;:
  3518. {
  3519. &quot;description&quot;: &quot;An array of FileStatus&quot;,
  3520. &quot;type&quot; : &quot;array&quot;,
  3521. &quot;items&quot; : fileStatusProperties //See FileStatus Properties
  3522. }
  3523. }
  3524. }
  3525. }
  3526. }
  3527. </pre></div></div>
  3528. <p>See also: <a href="#FileStatus_Properties"><code>FileStatus</code> Properties</a>, <a href="#List_a_Directory"><code>LISTSTATUS</code></a>, <a href="../../api/org/apache/hadoop/fs/FileStatus.html">FileStatus</a></p></section><section>
  3529. <h3><a name="DirectoryListing_JSON_Schema"></a>DirectoryListing JSON Schema</h3>
  3530. <p>A <code>DirectoryListing</code> JSON object represents a batch of directory entries while iteratively listing a directory. It contains a <code>FileStatuses</code> JSON object as well as iteration information.</p>
  3531. <div class="source">
  3532. <div class="source">
  3533. <pre>{
  3534. &quot;name&quot; : &quot;DirectoryListing&quot;,
  3535. &quot;properties&quot;:
  3536. {
  3537. &quot;DirectoryListing&quot;:
  3538. {
  3539. &quot;type&quot; : &quot;object&quot;,
  3540. &quot;properties&quot;:
  3541. {
  3542. &quot;partialListing&quot;:
  3543. {
  3544. &quot;description&quot;: &quot;A partial directory listing&quot;,
  3545. &quot;type&quot; : &quot;object&quot;, // A FileStatuses object
  3546. &quot;required&quot; : true
  3547. },
  3548. &quot;remainingEntries&quot;:
  3549. {
  3550. &quot;description&quot;: &quot;Number of remaining entries&quot;,
  3551. &quot;type&quot; : &quot;integer&quot;,
  3552. &quot;required&quot; : true
  3553. }
  3554. }
  3555. }
  3556. }
  3557. }
  3558. </pre></div></div>
  3559. <p>See also: <a href="#FileStatuses_JSON_Schema"><code>FileStatuses</code> JSON Schema</a>, <a href="#Iteratively_List_a_Directory"><code>LISTSTATUS_BATCH</code></a>, <a href="../../api/org/apache/hadoop/fs/FileStatus.html">FileStatus</a></p></section><section>
  3560. <h3><a name="Long_JSON_Schema"></a>Long JSON Schema</h3>
  3561. <div class="source">
  3562. <div class="source">
  3563. <pre>{
  3564. &quot;name&quot; : &quot;long&quot;,
  3565. &quot;properties&quot;:
  3566. {
  3567. &quot;long&quot;:
  3568. {
  3569. &quot;description&quot;: &quot;A long integer value&quot;,
  3570. &quot;type&quot; : &quot;integer&quot;,
  3571. &quot;required&quot; : true
  3572. }
  3573. }
  3574. }
  3575. </pre></div></div>
  3576. <p>See also: <a href="#Renew_Delegation_Token"><code>RENEWDELEGATIONTOKEN</code></a>,</p></section><section>
  3577. <h3><a name="Path_JSON_Schema"></a>Path JSON Schema</h3>
  3578. <div class="source">
  3579. <div class="source">
  3580. <pre>{
  3581. &quot;name&quot; : &quot;Path&quot;,
  3582. &quot;properties&quot;:
  3583. {
  3584. &quot;Path&quot;:
  3585. {
  3586. &quot;description&quot;: &quot;The string representation a Path.&quot;,
  3587. &quot;type&quot; : &quot;string&quot;,
  3588. &quot;required&quot; : true
  3589. }
  3590. }
  3591. }
  3592. </pre></div></div>
  3593. <p>See also: <a href="#Get_Home_Directory"><code>GETHOMEDIRECTORY</code></a>, <a href="../../api/org/apache/hadoop/fs/Path.html">Path</a></p></section><section>
  3594. <h3><a name="RemoteException_JSON_Schema"></a>RemoteException JSON Schema</h3>
  3595. <div class="source">
  3596. <div class="source">
  3597. <pre>{
  3598. &quot;name&quot; : &quot;RemoteException&quot;,
  3599. &quot;properties&quot;:
  3600. {
  3601. &quot;RemoteException&quot;:
  3602. {
  3603. &quot;type&quot; : &quot;object&quot;,
  3604. &quot;properties&quot;:
  3605. {
  3606. &quot;exception&quot;:
  3607. {
  3608. &quot;description&quot;: &quot;Name of the exception&quot;,
  3609. &quot;type&quot; : &quot;string&quot;,
  3610. &quot;required&quot; : true
  3611. },
  3612. &quot;message&quot;:
  3613. {
  3614. &quot;description&quot;: &quot;Exception message&quot;,
  3615. &quot;type&quot; : &quot;string&quot;,
  3616. &quot;required&quot; : true
  3617. },
  3618. &quot;javaClassName&quot;: //an optional property
  3619. {
  3620. &quot;description&quot;: &quot;Java class name of the exception&quot;,
  3621. &quot;type&quot; : &quot;string&quot;
  3622. }
  3623. }
  3624. }
  3625. }
  3626. }
  3627. </pre></div></div>
  3628. <p>See also: <a href="#Error_Responses">Error Responses</a></p></section><section>
  3629. <h3><a name="Token_JSON_Schema"></a>Token JSON Schema</h3>
  3630. <div class="source">
  3631. <div class="source">
  3632. <pre>{
  3633. &quot;name&quot; : &quot;Token&quot;,
  3634. &quot;properties&quot;:
  3635. {
  3636. &quot;Token&quot;: tokenProperties //See Token Properties
  3637. }
  3638. }
  3639. </pre></div></div>
  3640. <p>See also: <a href="#Token_Properties"><code>Token</code> Properties</a>, <a href="#Get_Delegation_Token"><code>GETDELEGATIONTOKEN</code></a>, the note in <a href="#Delegation">Delegation</a>.</p><section>
  3641. <h4><a name="Token_Properties"></a>Token Properties</h4>
  3642. <p>JavaScript syntax is used to define <code>tokenProperties</code> so that it can be referred in <code>Token</code> JSON schema.</p>
  3643. <div class="source">
  3644. <div class="source">
  3645. <pre>var tokenProperties =
  3646. {
  3647. &quot;type&quot; : &quot;object&quot;,
  3648. &quot;properties&quot;:
  3649. {
  3650. &quot;urlString&quot;:
  3651. {
  3652. &quot;description&quot;: &quot;A delegation token encoded as a URL safe string.&quot;,
  3653. &quot;type&quot; : &quot;string&quot;,
  3654. &quot;required&quot; : true
  3655. }
  3656. }
  3657. }
  3658. </pre></div></div>
  3659. <p>See also: <a href="#Token_Properties"><code>Token</code> Properties</a>, the note in <a href="#Delegation">Delegation</a>.</p></section></section><section>
  3660. <h3><a name="BlockStoragePolicy_JSON_Schema"></a>BlockStoragePolicy JSON Schema</h3>
  3661. <div class="source">
  3662. <div class="source">
  3663. <pre>{
  3664. &quot;name&quot; : &quot;BlockStoragePolicy&quot;,
  3665. &quot;properties&quot;:
  3666. {
  3667. &quot;BlockStoragePolicy&quot;: blockStoragePolicyProperties //See BlockStoragePolicy Properties
  3668. }
  3669. }
  3670. </pre></div></div>
  3671. <p>See also: <a href="#BlockStoragePolicy_Properties"><code>BlockStoragePolicy</code> Properties</a>, <a href="#Get_Storage_Policy"><code>GETSTORAGEPOLICY</code></a></p><section>
  3672. <h4><a name="BlockStoragePolicy_Properties"></a>BlockStoragePolicy Properties</h4>
  3673. <p>JavaScript syntax is used to define <code>blockStoragePolicyProperties</code> so that it can be referred in both <code>BlockStoragePolicy</code> and <code>BlockStoragePolicies</code> JSON schemas.</p>
  3674. <div class="source">
  3675. <div class="source">
  3676. <pre>var blockStoragePolicyProperties =
  3677. {
  3678. &quot;type&quot; : &quot;object&quot;,
  3679. &quot;properties&quot;:
  3680. {
  3681. &quot;id&quot;:
  3682. {
  3683. &quot;description&quot;: &quot;Policy ID.&quot;,
  3684. &quot;type&quot; : &quot;integer&quot;,
  3685. &quot;required&quot; : true
  3686. },
  3687. &quot;name&quot;:
  3688. {
  3689. &quot;description&quot;: &quot;Policy name.&quot;,
  3690. &quot;type&quot; : &quot;string&quot;,
  3691. &quot;required&quot; : true
  3692. },
  3693. &quot;storageTypes&quot;:
  3694. {
  3695. &quot;description&quot;: &quot;An array of storage types for block placement.&quot;,
  3696. &quot;type&quot; : &quot;array&quot;,
  3697. &quot;required&quot; : true
  3698. &quot;items&quot; :
  3699. {
  3700. &quot;type&quot;: &quot;string&quot;
  3701. }
  3702. },
  3703. &quot;replicationFallbacks&quot;:
  3704. {
  3705. &quot;description&quot;: &quot;An array of fallback storage types for replication.&quot;,
  3706. &quot;type&quot; : &quot;array&quot;,
  3707. &quot;required&quot; : true
  3708. &quot;items&quot; :
  3709. {
  3710. &quot;type&quot;: &quot;string&quot;
  3711. }
  3712. },
  3713. &quot;creationFallbacks&quot;:
  3714. {
  3715. &quot;description&quot;: &quot;An array of fallback storage types for file creation.&quot;,
  3716. &quot;type&quot; : &quot;array&quot;,
  3717. &quot;required&quot; : true
  3718. &quot;items&quot; :
  3719. {
  3720. &quot;type&quot;: &quot;string&quot;
  3721. }
  3722. },
  3723. &quot;copyOnCreateFile&quot;:
  3724. {
  3725. &quot;description&quot;: &quot;If set then the policy cannot be changed after file creation.&quot;,
  3726. &quot;type&quot; : &quot;boolean&quot;,
  3727. &quot;required&quot; : true
  3728. }
  3729. }
  3730. };
  3731. </pre></div></div>
  3732. </section></section><section>
  3733. <h3><a name="ECPolicy_JSON_Schema"></a>ECPolicy JSON Schema</h3>
  3734. <div class="source">
  3735. <div class="source">
  3736. <pre>{
  3737. &quot;name&quot;: &quot;RS-10-4-1024k&quot;,
  3738. schema {
  3739. &quot;codecName&quot;: &quot;rs&quot;,
  3740. &quot;numDataUnits&quot;: 10,
  3741. &quot;numParityUnits&quot;: 4,
  3742. &quot;extraOptions&quot;: {}
  3743. }
  3744. &quot;cellSize&quot;: 1048576,
  3745. &quot;id&quot;:5,
  3746. &quot;codecname&quot;:&quot;rs&quot;,
  3747. &quot;numDataUnits&quot;: 10,
  3748. &quot;numParityUnits&quot;: 4,
  3749. &quot;replicationpolicy&quot;:false,
  3750. &quot;systemPolicy&quot;:true
  3751. }
  3752. </pre></div></div>
  3753. </section><section>
  3754. <h3><a name="BlockStoragePolicies_JSON_Schema"></a>BlockStoragePolicies JSON Schema</h3>
  3755. <p>A <code>BlockStoragePolicies</code> JSON object represents an array of <code>BlockStoragePolicy</code> JSON objects.</p>
  3756. <div class="source">
  3757. <div class="source">
  3758. <pre>{
  3759. &quot;name&quot; : &quot;BlockStoragePolicies&quot;,
  3760. &quot;properties&quot;:
  3761. {
  3762. &quot;BlockStoragePolicies&quot;:
  3763. {
  3764. &quot;type&quot; : &quot;object&quot;,
  3765. &quot;properties&quot;:
  3766. {
  3767. &quot;BlockStoragePolicy&quot;:
  3768. {
  3769. &quot;description&quot;: &quot;An array of BlockStoragePolicy&quot;,
  3770. &quot;type&quot; : &quot;array&quot;,
  3771. &quot;items&quot; : blockStoragePolicyProperties //See BlockStoragePolicy Properties
  3772. }
  3773. }
  3774. }
  3775. }
  3776. }
  3777. </pre></div></div>
  3778. </section><section>
  3779. <h3><a name="SnapshotDiffReport_JSON_Schema"></a>SnapshotDiffReport JSON Schema</h3>
  3780. <div class="source">
  3781. <div class="source">
  3782. <pre>{
  3783. &quot;name&quot;: &quot;SnapshotDiffReport&quot;,
  3784. &quot;type&quot;: &quot;object&quot;,
  3785. &quot;properties&quot;:
  3786. {
  3787. &quot;SnapshotDiffReport&quot;:
  3788. {
  3789. &quot;type&quot; : &quot;object&quot;,
  3790. &quot;properties&quot; :
  3791. {
  3792. &quot;diffList&quot;:
  3793. {
  3794. &quot;description&quot;: &quot;An array of DiffReportEntry&quot;,
  3795. &quot;type&quot; : &quot;array&quot;,
  3796. &quot;items&quot; : diffReportEntries,
  3797. &quot;required&quot; : true
  3798. },
  3799. &quot;fromSnapshot&quot;:
  3800. {
  3801. &quot;description&quot;: &quot;Source snapshot&quot;,
  3802. &quot;type&quot; : &quot;string&quot;,
  3803. &quot;required&quot; : true
  3804. },
  3805. &quot;snapshotRoot&quot;:
  3806. {
  3807. &quot;description&quot; : &quot;String representation of snapshot root path&quot;,
  3808. &quot;type&quot; : &quot;string&quot;,
  3809. &quot;required&quot; : true
  3810. },
  3811. &quot;toSnapshot&quot;:
  3812. {
  3813. &quot;description&quot; : &quot;Destination snapshot&quot;,
  3814. &quot;type&quot; : &quot;string&quot;,
  3815. &quot;required&quot; : true
  3816. }
  3817. }
  3818. }
  3819. }
  3820. }
  3821. </pre></div></div>
  3822. <section>
  3823. <h4><a name="DiffReport_Entries"></a>DiffReport Entries</h4>
  3824. <p>JavaScript syntax is used to define <code>diffReportEntries</code> so that it can be referred in <code>SnapshotDiffReport</code> JSON schema.</p>
  3825. <div class="source">
  3826. <div class="source">
  3827. <pre>var diffReportEntries =
  3828. {
  3829. &quot;type&quot;: &quot;object&quot;,
  3830. &quot;properties&quot;:
  3831. {
  3832. &quot;sourcePath&quot;:
  3833. {
  3834. &quot;description&quot; : &quot;Source path name relative to snapshot root&quot;,
  3835. &quot;type&quot; : &quot;string&quot;,
  3836. &quot;required&quot; : true
  3837. },
  3838. &quot;targetPath&quot;:
  3839. {
  3840. &quot;description&quot; : &quot;Target path relative to snapshot root used for renames&quot;,
  3841. &quot;type&quot; : &quot;string&quot;,
  3842. &quot;required&quot; : true
  3843. },
  3844. &quot;type&quot;:
  3845. {
  3846. &quot;description&quot; : &quot;Type of diff report entry&quot;,
  3847. &quot;enum&quot; : [&quot;CREATE&quot;, &quot;MODIFY&quot;, &quot;DELETE&quot;, &quot;RENAME&quot;],
  3848. &quot;required&quot; : true
  3849. }
  3850. }
  3851. }
  3852. </pre></div></div>
  3853. </section></section><section>
  3854. <h3><a name="SnapshotDiffReportListing_JSON_Schema"></a>SnapshotDiffReportListing JSON Schema</h3>
  3855. <div class="source">
  3856. <div class="source">
  3857. <pre>{
  3858. &quot;name&quot;: &quot;SnapshotDiffReportListing&quot;,
  3859. &quot;type&quot;: &quot;object&quot;,
  3860. &quot;properties&quot;:
  3861. {
  3862. &quot;SnapshotDiffReportListing&quot;:
  3863. {
  3864. &quot;type&quot; : &quot;object&quot;,
  3865. &quot;properties&quot; :
  3866. {
  3867. &quot;isFromEarlier&quot;:
  3868. {
  3869. &quot;description&quot; : &quot;the diff is calculated from older to newer snapshot or not&quot;,
  3870. &quot;type&quot; : &quot;boolean&quot;,
  3871. &quot;required&quot; : true
  3872. },
  3873. &quot;lastIndex&quot;:
  3874. {
  3875. &quot;description&quot; : &quot;the last index of listing iteration&quot;,
  3876. &quot;type&quot; : &quot;integer&quot;,
  3877. &quot;required&quot; : true
  3878. },
  3879. &quot;lastPath&quot;:
  3880. {
  3881. &quot;description&quot; : &quot;String representation of the last path of the listing iteration&quot;,
  3882. &quot;type&quot; : &quot;string&quot;,
  3883. &quot;required&quot; : true
  3884. },
  3885. &quot;modifyList&quot;:
  3886. {
  3887. &quot;description&quot;: &quot;An array of DiffReportListingEntry&quot;,
  3888. &quot;type&quot; : &quot;array&quot;,
  3889. &quot;items&quot; : diffReportListingEntries,
  3890. &quot;required&quot; : true
  3891. },
  3892. &quot;createList&quot;:
  3893. {
  3894. &quot;description&quot;: &quot;An array of DiffReportListingEntry&quot;,
  3895. &quot;type&quot; : &quot;array&quot;,
  3896. &quot;items&quot; : diffReportListingEntries,
  3897. &quot;required&quot; : true
  3898. },
  3899. &quot;deleteList&quot;:
  3900. {
  3901. &quot;description&quot;: &quot;An array of DiffReportListingEntry&quot;,
  3902. &quot;type&quot; : &quot;array&quot;,
  3903. &quot;items&quot; : diffReportListingEntries,
  3904. &quot;required&quot; : true
  3905. }
  3906. }
  3907. }
  3908. }
  3909. }
  3910. </pre></div></div>
  3911. <section>
  3912. <h4><a name="DiffReportListing_Entries"></a>DiffReportListing Entries</h4>
  3913. <p>JavaScript syntax is used to define <code>diffReportEntries</code> so that it can be referred in <code>SnapshotDiffReport</code> JSON schema.</p>
  3914. <div class="source">
  3915. <div class="source">
  3916. <pre>var diffReportListingEntries =
  3917. {
  3918. &quot;type&quot;: &quot;object&quot;,
  3919. &quot;properties&quot;:
  3920. {
  3921. &quot;dirId&quot;:
  3922. {
  3923. &quot;description&quot; : &quot;inode id of the directory&quot;,
  3924. &quot;type&quot; : &quot;integer&quot;,
  3925. &quot;required&quot; : true
  3926. },
  3927. &quot;fileId&quot;:
  3928. {
  3929. &quot;description&quot; : &quot;inode id of the file&quot;,
  3930. &quot;type&quot; : &quot;integer&quot;,
  3931. &quot;required&quot; : true
  3932. },
  3933. &quot;isRereference&quot;:
  3934. {
  3935. &quot;description&quot; : &quot;this is reference or not&quot;,
  3936. &quot;type&quot; : &quot;boolean&quot;,
  3937. &quot;required&quot; : true
  3938. },
  3939. &quot;sourcePath&quot;:
  3940. {
  3941. &quot;description&quot; : &quot;string representation of path where changes have happened&quot;,
  3942. &quot;type&quot; : &quot;string&quot;,
  3943. &quot;required&quot; : true
  3944. },
  3945. &quot;targetPath&quot;:
  3946. {
  3947. &quot;description&quot; : &quot;string representation of target path of rename op&quot;,
  3948. &quot;type&quot; : &quot;string&quot;,
  3949. &quot;required&quot; : false
  3950. }
  3951. }
  3952. }
  3953. </pre></div></div>
  3954. </section></section><section>
  3955. <h3><a name="SnapshottableDirectoryList_JSON_Schema"></a>SnapshottableDirectoryList JSON Schema</h3>
  3956. <div class="source">
  3957. <div class="source">
  3958. <pre>{
  3959. &quot;name&quot;: &quot;SnapshottableDirectoryList&quot;,
  3960. &quot;type&quot;: &quot;object&quot;,
  3961. &quot;properties&quot;:
  3962. {
  3963. &quot;SnapshottableDirectoryList&quot;:
  3964. {
  3965. &quot;description&quot;: &quot;An array of SnapshottableDirectoryStatus&quot;,
  3966. &quot;type&quot; : &quot;array&quot;,
  3967. &quot;items&quot; : snapshottableDirectoryStatus,
  3968. &quot;required&quot; : true
  3969. }
  3970. }
  3971. }
  3972. </pre></div></div>
  3973. <section>
  3974. <h4><a name="SnapshottableDirectoryStatus"></a>SnapshottableDirectoryStatus</h4>
  3975. <p>JavaScript syntax is used to define <code>snapshottableDirectoryStatus</code> so that it can be referred in <code>SnapshottableDirectoryList</code> JSON schema.</p>
  3976. <div class="source">
  3977. <div class="source">
  3978. <pre>var snapshottableDirectoryStatus =
  3979. {
  3980. &quot;type&quot;: &quot;object&quot;,
  3981. &quot;properties&quot;:
  3982. {
  3983. &quot;dirStatus&quot;: fileStatusProperties,
  3984. &quot;parentFullPath&quot;:
  3985. {
  3986. &quot;description&quot; : &quot;Full path of the parent of snapshottable directory&quot;,
  3987. &quot;type&quot; : &quot;string&quot;,
  3988. &quot;required&quot; : true
  3989. },
  3990. &quot;snapshotNumber&quot;:
  3991. {
  3992. &quot;description&quot; : &quot;Number of snapshots created on the snapshottable directory&quot;,
  3993. &quot;type&quot; : &quot;integer&quot;,
  3994. &quot;required&quot; : true
  3995. },
  3996. &quot;snapshotQuota&quot;:
  3997. {
  3998. &quot;description&quot; : &quot;Total number of snapshots allowed on the snapshottable directory&quot;,
  3999. &quot;type&quot; : &quot;integer&quot;,
  4000. &quot;required&quot; : true
  4001. }
  4002. }
  4003. }
  4004. </pre></div></div>
  4005. </section></section><section>
  4006. <h3><a name="SnapshotList_JSON_Schema"></a>SnapshotList JSON Schema</h3>
  4007. <div class="source">
  4008. <div class="source">
  4009. <pre>{
  4010. &quot;name&quot;: &quot;SnapshotList&quot;,
  4011. &quot;type&quot;: &quot;object&quot;,
  4012. &quot;properties&quot;:
  4013. {
  4014. &quot;SnapshotList&quot;:
  4015. {
  4016. &quot;description&quot;: &quot;An array of SnapshotStatus&quot;,
  4017. &quot;type&quot; : &quot;array&quot;,
  4018. &quot;items&quot; : snapshotStatus,
  4019. &quot;required&quot; : true
  4020. }
  4021. }
  4022. }
  4023. </pre></div></div>
  4024. <section>
  4025. <h4><a name="SnapshotStatus"></a>SnapshotStatus</h4>
  4026. <p>JavaScript syntax is used to define <code>snapshotStatus</code> so that it can be referred in <code>SnapshotList</code> JSON schema.</p>
  4027. <div class="source">
  4028. <div class="source">
  4029. <pre>var snapshotStatus =
  4030. {
  4031. &quot;type&quot;: &quot;object&quot;,
  4032. &quot;properties&quot;:
  4033. {
  4034. &quot;dirStatus&quot;: fileStatusProperties,
  4035. &quot;fullPath&quot;:
  4036. {
  4037. &quot;description&quot; : &quot;Full path of the parent of the snapshot&quot;,
  4038. &quot;type&quot; : &quot;string&quot;,
  4039. &quot;required&quot; : true
  4040. },
  4041. &quot;snapshotID&quot;:
  4042. {
  4043. &quot;description&quot; : &quot;snapshot ID for the snapshot&quot;,
  4044. &quot;type&quot; : &quot;integer&quot;,
  4045. &quot;required&quot; : true
  4046. },
  4047. &quot;deletionStatus&quot;:
  4048. {
  4049. &quot;description&quot; : &quot;Status showing whether the snapshot is active or in deleted state&quot;,
  4050. &quot;type&quot; : &quot;string&quot;,
  4051. &quot;required&quot; : true
  4052. }
  4053. }
  4054. }
  4055. </pre></div></div>
  4056. </section></section><section>
  4057. <h3><a name="BlockLocations_JSON_Schema"></a>BlockLocations JSON Schema</h3>
  4058. <p>A <code>BlockLocations</code> JSON object represents an array of <code>BlockLocation</code> JSON objects.</p>
  4059. <div class="source">
  4060. <div class="source">
  4061. <pre>{
  4062. &quot;name&quot; : &quot;BlockLocations&quot;,
  4063. &quot;properties&quot;:
  4064. {
  4065. &quot;BlockLocations&quot;:
  4066. {
  4067. &quot;type&quot; : &quot;object&quot;,
  4068. &quot;properties&quot;:
  4069. {
  4070. &quot;BlockLocation&quot;:
  4071. {
  4072. &quot;description&quot;: &quot;An array of BlockLocation&quot;,
  4073. &quot;type&quot; : &quot;array&quot;,
  4074. &quot;items&quot; : blockLocationProperties //See BlockLocation Properties
  4075. }
  4076. }
  4077. }
  4078. }
  4079. }
  4080. </pre></div></div>
  4081. <p>See also <a href="#BlockLocation_Properties"><code>BlockLocation</code> Properties</a>, <a href="#Get_File_Block_Locations"><code>GETFILEBLOCKLOCATIONS</code></a>, <a href="../../api/org/apache/hadoop/fs/BlockLocation.html">BlockLocation</a></p></section><section>
  4082. <h3><a name="BlockLocation_JSON_Schema"></a>BlockLocation JSON Schema</h3>
  4083. <div class="source">
  4084. <div class="source">
  4085. <pre>{
  4086. &quot;name&quot; : &quot;BlockLocation&quot;,
  4087. &quot;properties&quot;:
  4088. {
  4089. &quot;BlockLocation&quot;: blockLocationProperties //See BlockLocation Properties
  4090. }
  4091. }
  4092. </pre></div></div>
  4093. <p>See also <a href="#BlockLocation_Properties"><code>BlockLocation</code> Properties</a>, <a href="#Get_File_Block_Locations"><code>GETFILEBLOCKLOCATIONS</code></a>, <a href="../../api/org/apache/hadoop/fs/BlockLocation.html">BlockLocation</a></p><section>
  4094. <h4><a name="BlockLocation_Properties"></a>BlockLocation Properties</h4>
  4095. <p>JavaScript syntax is used to define <code>blockLocationProperties</code> so that it can be referred in both <code>BlockLocation</code> and <code>BlockLocations</code> JSON schemas.</p>
  4096. <div class="source">
  4097. <div class="source">
  4098. <pre>var blockLocationProperties =
  4099. {
  4100. &quot;type&quot; : &quot;object&quot;,
  4101. &quot;properties&quot;:
  4102. {
  4103. &quot;cachedHosts&quot;:
  4104. {
  4105. &quot;description&quot;: &quot;Datanode hostnames with a cached replica&quot;,
  4106. &quot;type&quot; : &quot;array&quot;,
  4107. &quot;required&quot; : &quot;true&quot;,
  4108. &quot;items&quot; :
  4109. {
  4110. &quot;description&quot;: &quot;A datanode hostname&quot;,
  4111. &quot;type&quot; : &quot;string&quot;
  4112. }
  4113. },
  4114. &quot;corrupt&quot;:
  4115. {
  4116. &quot;description&quot;: &quot;True if the block is corrupted&quot;,
  4117. &quot;type&quot; : &quot;boolean&quot;,
  4118. &quot;required&quot; : &quot;true&quot;
  4119. },
  4120. &quot;hosts&quot;:
  4121. {
  4122. &quot;description&quot;: &quot;Datanode hostnames store the block&quot;,
  4123. &quot;type&quot; : &quot;array&quot;,
  4124. &quot;required&quot; : &quot;true&quot;,
  4125. &quot;items&quot; :
  4126. {
  4127. &quot;description&quot;: &quot;A datanode hostname&quot;,
  4128. &quot;type&quot; : &quot;string&quot;
  4129. }
  4130. },
  4131. &quot;length&quot;:
  4132. {
  4133. &quot;description&quot;: &quot;Length of the block&quot;,
  4134. &quot;type&quot; : &quot;integer&quot;,
  4135. &quot;required&quot; : &quot;true&quot;
  4136. },
  4137. &quot;names&quot;:
  4138. {
  4139. &quot;description&quot;: &quot;Datanode IP:xferPort for accessing the block&quot;,
  4140. &quot;type&quot; : &quot;array&quot;,
  4141. &quot;required&quot; : &quot;true&quot;,
  4142. &quot;items&quot; :
  4143. {
  4144. &quot;description&quot;: &quot;DatanodeIP:xferPort&quot;,
  4145. &quot;type&quot; : &quot;string&quot;
  4146. }
  4147. },
  4148. &quot;offset&quot;:
  4149. {
  4150. &quot;description&quot;: &quot;Offset of the block in the file&quot;,
  4151. &quot;type&quot; : &quot;integer&quot;,
  4152. &quot;required&quot; : &quot;true&quot;
  4153. },
  4154. &quot;storageTypes&quot;:
  4155. {
  4156. &quot;description&quot;: &quot;Storage type of each replica&quot;,
  4157. &quot;type&quot; : &quot;array&quot;,
  4158. &quot;required&quot; : &quot;true&quot;,
  4159. &quot;items&quot; :
  4160. {
  4161. &quot;description&quot;: &quot;Storage type&quot;,
  4162. &quot;enum&quot; : [&quot;RAM_DISK&quot;, &quot;SSD&quot;, &quot;DISK&quot;, &quot;ARCHIVE&quot;]
  4163. }
  4164. },
  4165. &quot;topologyPaths&quot;:
  4166. {
  4167. &quot;description&quot;: &quot;Datanode addresses in network topology&quot;,
  4168. &quot;type&quot; : &quot;array&quot;,
  4169. &quot;required&quot; : &quot;true&quot;,
  4170. &quot;items&quot; :
  4171. {
  4172. &quot;description&quot;: &quot;/rack/host:ip&quot;,
  4173. &quot;type&quot; : &quot;string&quot;
  4174. }
  4175. }
  4176. }
  4177. };
  4178. </pre></div></div>
  4179. </section></section><section>
  4180. <h3><a name="Server_Defaults_JSON_Schema"></a>Server Defaults JSON Schema</h3>
  4181. <div class="source">
  4182. <div class="source">
  4183. <pre>{
  4184. &quot;FsServerDefaults&quot;: {
  4185. &quot;replication&quot;: 3,
  4186. &quot;encryptDataTransfer&quot;: false,
  4187. &quot;defaultStoragePolicyId&quot;: 7,
  4188. &quot;writePacketSize&quot;: 65536,
  4189. &quot;fileBufferSize&quot;: 4096,
  4190. &quot;checksumType&quot;: 2,
  4191. &quot;trashInterval&quot;: 10080,
  4192. &quot;keyProviderUri&quot;: &quot;&quot;,
  4193. &quot;blockSize&quot;: 134217728,
  4194. &quot;bytesPerChecksum&quot;: 512
  4195. }
  4196. }
  4197. </pre></div></div>
  4198. </section><section>
  4199. <h3><a name="FsStatus_JSON_Schema"></a>FsStatus JSON Schema</h3>
  4200. <div class="source">
  4201. <div class="source">
  4202. <pre>{
  4203. &quot;FsStatus&quot;: {
  4204. &quot;used&quot;: 29229154304,
  4205. &quot;remaining&quot;: 292893392896,
  4206. &quot;capacity&quot;: 322122547200
  4207. }
  4208. }
  4209. </pre></div></div>
  4210. </section><section>
  4211. <h3><a name="EC_Policies_JSON_Schema"></a>EC Policies JSON Schema</h3>
  4212. <div class="source">
  4213. <div class="source">
  4214. <pre>{
  4215. &quot;ErasureCodingPolicies&quot;: {
  4216. &quot;ErasureCodingPolicyInfo&quot;: [
  4217. {
  4218. &quot;state&quot;: &quot;ENABLED&quot;,
  4219. &quot;policy&quot;: {
  4220. &quot;name&quot;: &quot;RS-6-3-1024k&quot;,
  4221. &quot;schema&quot;: {
  4222. &quot;codecName&quot;: &quot;rs&quot;,
  4223. &quot;numDataUnits&quot;: 6,
  4224. &quot;numParityUnits&quot;: 3,
  4225. &quot;extraOptions&quot;: {}
  4226. },
  4227. &quot;cellSize&quot;: 1048576,
  4228. &quot;id&quot;: 1,
  4229. &quot;replicationPolicy&quot;: false,
  4230. &quot;codecName&quot;: &quot;rs&quot;,
  4231. &quot;numDataUnits&quot;: 6,
  4232. &quot;numParityUnits&quot;: 3,
  4233. &quot;systemPolicy&quot;: true
  4234. }
  4235. }
  4236. ]
  4237. }
  4238. }
  4239. </pre></div></div>
  4240. </section><section>
  4241. <h3><a name="EC_Codecs_JSON_Schema"></a>EC Codecs JSON Schema</h3>
  4242. <div class="source">
  4243. <div class="source">
  4244. <pre>{
  4245. &quot;ErasureCodingCodecs&quot;: {
  4246. &quot;rs&quot;: &quot;rs_native, rs_java&quot;,
  4247. &quot;rs-legacy&quot;: &quot;rs-legacy_java&quot;,
  4248. &quot;xor&quot;: &quot;xor_native, xor_java&quot;
  4249. }
  4250. }
  4251. </pre></div></div>
  4252. </section><section>
  4253. <h3><a name="Paths_JSON_Schema"></a>Paths JSON Schema</h3>
  4254. <div class="source">
  4255. <div class="source">
  4256. <pre>{
  4257. &quot;Paths&quot;: [{
  4258. &quot;blocksize&quot;: 0,
  4259. &quot;owner&quot;: &quot;hadoop&quot;,
  4260. &quot;path&quot;: &quot;/user/user0/.Trash&quot;,
  4261. &quot;length&quot;: 0,
  4262. &quot;permission&quot;: &quot;755&quot;,
  4263. &quot;modification_time&quot;: 1693050205747,
  4264. &quot;isdir&quot;: true,
  4265. &quot;block_replication&quot;: 0,
  4266. &quot;access_time&quot;: 0,
  4267. &quot;group&quot;: &quot;supergroup&quot;
  4268. }]
  4269. }
  4270. </pre></div></div>
  4271. </section></section><section>
  4272. <h2><a name="HTTP_Query_Parameter_Dictionary"></a>HTTP Query Parameter Dictionary</h2><section>
  4273. <h3><a name="ACL_Spec"></a>ACL Spec</h3>
  4274. <table border="0" class="bodyTable">
  4275. <thead>
  4276. <tr class="a">
  4277. <th align="left"> Name </th>
  4278. <th align="left"> <code>aclspec</code> </th></tr>
  4279. </thead><tbody>
  4280. <tr class="b">
  4281. <td align="left"> Description </td>
  4282. <td align="left"> The ACL spec included in ACL modification operations. </td></tr>
  4283. <tr class="a">
  4284. <td align="left"> Type </td>
  4285. <td align="left"> String </td></tr>
  4286. <tr class="b">
  4287. <td align="left"> Default Value </td>
  4288. <td align="left"> &lt;empty&gt; </td></tr>
  4289. <tr class="a">
  4290. <td align="left"> Valid Values </td>
  4291. <td align="left"> See <a href="./HdfsPermissionsGuide.html">Permissions and HDFS</a>. </td></tr>
  4292. <tr class="b">
  4293. <td align="left"> Syntax </td>
  4294. <td align="left"> See <a href="./HdfsPermissionsGuide.html">Permissions and HDFS</a>. </td></tr>
  4295. </tbody>
  4296. </table></section><section>
  4297. <h3><a name="XAttr_Name"></a>XAttr Name</h3>
  4298. <table border="0" class="bodyTable">
  4299. <thead>
  4300. <tr class="a">
  4301. <th align="left"> Name </th>
  4302. <th align="left"> <code>xattr.name</code> </th></tr>
  4303. </thead><tbody>
  4304. <tr class="b">
  4305. <td align="left"> Description </td>
  4306. <td align="left"> The XAttr name of a file/directory. </td></tr>
  4307. <tr class="a">
  4308. <td align="left"> Type </td>
  4309. <td align="left"> String </td></tr>
  4310. <tr class="b">
  4311. <td align="left"> Default Value </td>
  4312. <td align="left"> &lt;empty&gt; </td></tr>
  4313. <tr class="a">
  4314. <td align="left"> Valid Values </td>
  4315. <td align="left"> Any string prefixed with user./trusted./system./security.. </td></tr>
  4316. <tr class="b">
  4317. <td align="left"> Syntax </td>
  4318. <td align="left"> Any string prefixed with user./trusted./system./security.. </td></tr>
  4319. </tbody>
  4320. </table></section><section>
  4321. <h3><a name="XAttr_Value"></a>XAttr Value</h3>
  4322. <table border="0" class="bodyTable">
  4323. <thead>
  4324. <tr class="a">
  4325. <th align="left"> Name </th>
  4326. <th align="left"> <code>xattr.value</code> </th></tr>
  4327. </thead><tbody>
  4328. <tr class="b">
  4329. <td align="left"> Description </td>
  4330. <td align="left"> The XAttr value of a file/directory. </td></tr>
  4331. <tr class="a">
  4332. <td align="left"> Type </td>
  4333. <td align="left"> String </td></tr>
  4334. <tr class="b">
  4335. <td align="left"> Default Value </td>
  4336. <td align="left"> &lt;empty&gt; </td></tr>
  4337. <tr class="a">
  4338. <td align="left"> Valid Values </td>
  4339. <td align="left"> An encoded value. </td></tr>
  4340. <tr class="b">
  4341. <td align="left"> Syntax </td>
  4342. <td align="left"> Enclosed in double quotes or prefixed with 0x or 0s. </td></tr>
  4343. </tbody>
  4344. </table>
  4345. <p>See also: <a href="./ExtendedAttributes.html">Extended Attributes</a></p></section><section>
  4346. <h3><a name="XAttr_set_flag"></a>XAttr set flag</h3>
  4347. <table border="0" class="bodyTable">
  4348. <thead>
  4349. <tr class="a">
  4350. <th align="left"> Name </th>
  4351. <th align="left"> <code>flag</code> </th></tr>
  4352. </thead><tbody>
  4353. <tr class="b">
  4354. <td align="left"> Description </td>
  4355. <td align="left"> The XAttr set flag. </td></tr>
  4356. <tr class="a">
  4357. <td align="left"> Type </td>
  4358. <td align="left"> String </td></tr>
  4359. <tr class="b">
  4360. <td align="left"> Default Value </td>
  4361. <td align="left"> &lt;empty&gt; </td></tr>
  4362. <tr class="a">
  4363. <td align="left"> Valid Values </td>
  4364. <td align="left"> CREATE,REPLACE. </td></tr>
  4365. <tr class="b">
  4366. <td align="left"> Syntax </td>
  4367. <td align="left"> CREATE,REPLACE. </td></tr>
  4368. </tbody>
  4369. </table>
  4370. <p>See also: <a href="./ExtendedAttributes.html">Extended Attributes</a></p></section><section>
  4371. <h3><a name="XAttr_value_encoding"></a>XAttr value encoding</h3>
  4372. <table border="0" class="bodyTable">
  4373. <thead>
  4374. <tr class="a">
  4375. <th align="left"> Name </th>
  4376. <th align="left"> <code>encoding</code> </th></tr>
  4377. </thead><tbody>
  4378. <tr class="b">
  4379. <td align="left"> Description </td>
  4380. <td align="left"> The XAttr value encoding. </td></tr>
  4381. <tr class="a">
  4382. <td align="left"> Type </td>
  4383. <td align="left"> String </td></tr>
  4384. <tr class="b">
  4385. <td align="left"> Default Value </td>
  4386. <td align="left"> &lt;empty&gt; </td></tr>
  4387. <tr class="a">
  4388. <td align="left"> Valid Values </td>
  4389. <td align="left"> text </td>
  4390. <td> hex </td>
  4391. <td> base64 </td></tr>
  4392. <tr class="b">
  4393. <td align="left"> Syntax </td>
  4394. <td align="left"> text </td>
  4395. <td> hex </td>
  4396. <td> base64 </td></tr>
  4397. </tbody>
  4398. </table>
  4399. <p>See also: <a href="./ExtendedAttributes.html">Extended Attributes</a></p></section><section>
  4400. <h3><a name="Access_Time"></a>Access Time</h3>
  4401. <table border="0" class="bodyTable">
  4402. <thead>
  4403. <tr class="a">
  4404. <th align="left"> Name </th>
  4405. <th align="left"> <code>accesstime</code> </th></tr>
  4406. </thead><tbody>
  4407. <tr class="b">
  4408. <td align="left"> Description </td>
  4409. <td align="left"> The access time of a file/directory. </td></tr>
  4410. <tr class="a">
  4411. <td align="left"> Type </td>
  4412. <td align="left"> long </td></tr>
  4413. <tr class="b">
  4414. <td align="left"> Default Value </td>
  4415. <td align="left"> -1 (means keeping it unchanged) </td></tr>
  4416. <tr class="a">
  4417. <td align="left"> Valid Values </td>
  4418. <td align="left"> -1 or a timestamp </td></tr>
  4419. <tr class="b">
  4420. <td align="left"> Syntax </td>
  4421. <td align="left"> Any integer. </td></tr>
  4422. </tbody>
  4423. </table>
  4424. <p>See also: <a href="#Set_Access_or_Modification_Time"><code>SETTIMES</code></a></p></section><section>
  4425. <h3><a name="Block_Size"></a>Block Size</h3>
  4426. <table border="0" class="bodyTable">
  4427. <thead>
  4428. <tr class="a">
  4429. <th align="left"> Name </th>
  4430. <th align="left"> <code>blocksize</code> </th></tr>
  4431. </thead><tbody>
  4432. <tr class="b">
  4433. <td align="left"> Description </td>
  4434. <td align="left"> The block size of a file. </td></tr>
  4435. <tr class="a">
  4436. <td align="left"> Type </td>
  4437. <td align="left"> long </td></tr>
  4438. <tr class="b">
  4439. <td align="left"> Default Value </td>
  4440. <td align="left"> Specified in the configuration. </td></tr>
  4441. <tr class="a">
  4442. <td align="left"> Valid Values </td>
  4443. <td align="left"> &gt; 0 </td></tr>
  4444. <tr class="b">
  4445. <td align="left"> Syntax </td>
  4446. <td align="left"> Any integer. </td></tr>
  4447. </tbody>
  4448. </table>
  4449. <p>See also: <a href="#Create_and_Write_to_a_File"><code>CREATE</code></a></p></section><section>
  4450. <h3><a name="Buffer_Size"></a>Buffer Size</h3>
  4451. <table border="0" class="bodyTable">
  4452. <thead>
  4453. <tr class="a">
  4454. <th align="left"> Name </th>
  4455. <th align="left"> <code>buffersize</code> </th></tr>
  4456. </thead><tbody>
  4457. <tr class="b">
  4458. <td align="left"> Description </td>
  4459. <td align="left"> The size of the buffer used in transferring data. </td></tr>
  4460. <tr class="a">
  4461. <td align="left"> Type </td>
  4462. <td align="left"> int </td></tr>
  4463. <tr class="b">
  4464. <td align="left"> Default Value </td>
  4465. <td align="left"> Specified in the configuration. </td></tr>
  4466. <tr class="a">
  4467. <td align="left"> Valid Values </td>
  4468. <td align="left"> &gt; 0 </td></tr>
  4469. <tr class="b">
  4470. <td align="left"> Syntax </td>
  4471. <td align="left"> Any integer. </td></tr>
  4472. </tbody>
  4473. </table>
  4474. <p>See also: <a href="#Create_and_Write_to_a_File"><code>CREATE</code></a>, <a href="#Append_to_a_File"><code>APPEND</code></a>, <a href="#Open_and_Read_a_File"><code>OPEN</code></a></p></section><section>
  4475. <h3><a name="Create_Flag"></a>Create Flag</h3>
  4476. <table border="0" class="bodyTable">
  4477. <thead>
  4478. <tr class="a">
  4479. <th align="left"> Name </th>
  4480. <th align="left"> <code>createflag</code> </th></tr>
  4481. </thead><tbody>
  4482. <tr class="b">
  4483. <td align="left"> Description </td>
  4484. <td align="left"> Enum of possible flags to process while creating a file </td></tr>
  4485. <tr class="a">
  4486. <td align="left"> Type </td>
  4487. <td align="left"> enumerated strings </td></tr>
  4488. <tr class="b">
  4489. <td align="left"> Default Value </td>
  4490. <td align="left"> &lt;empty&gt; </td></tr>
  4491. <tr class="a">
  4492. <td align="left"> Valid Values </td>
  4493. <td align="left"> Legal combinations of create, overwrite, append and sync_block </td></tr>
  4494. <tr class="b">
  4495. <td align="left"> Syntax </td>
  4496. <td align="left"> See note below </td></tr>
  4497. </tbody>
  4498. </table>
  4499. <p>The following combinations are not valid: * append,create * create,append,overwrite</p>
  4500. <p>See also: <a href="#Create_and_Write_to_a_File"><code>CREATE</code></a></p></section><section>
  4501. <h3><a name="Create_Parent"></a>Create Parent</h3>
  4502. <table border="0" class="bodyTable">
  4503. <thead>
  4504. <tr class="a">
  4505. <th align="left"> Name </th>
  4506. <th align="left"> <code>createparent</code> </th></tr>
  4507. </thead><tbody>
  4508. <tr class="b">
  4509. <td align="left"> Description </td>
  4510. <td align="left"> If the parent directories do not exist, should they be created? </td></tr>
  4511. <tr class="a">
  4512. <td align="left"> Type </td>
  4513. <td align="left"> boolean </td></tr>
  4514. <tr class="b">
  4515. <td align="left"> Default Value </td>
  4516. <td align="left"> true </td></tr>
  4517. <tr class="a">
  4518. <td align="left"> Valid Values </td>
  4519. <td align="left"> true, false </td></tr>
  4520. <tr class="b">
  4521. <td align="left"> Syntax </td>
  4522. <td align="left"> true </td></tr>
  4523. </tbody>
  4524. </table>
  4525. <p>See also: <a href="#Create_a_Symbolic_Link"><code>CREATESYMLINK</code></a></p></section><section>
  4526. <h3><a name="Delegation"></a>Delegation</h3>
  4527. <table border="0" class="bodyTable">
  4528. <thead>
  4529. <tr class="a">
  4530. <th align="left"> Name </th>
  4531. <th align="left"> <code>delegation</code> </th></tr>
  4532. </thead><tbody>
  4533. <tr class="b">
  4534. <td align="left"> Description </td>
  4535. <td align="left"> The delegation token used for authentication. </td></tr>
  4536. <tr class="a">
  4537. <td align="left"> Type </td>
  4538. <td align="left"> String </td></tr>
  4539. <tr class="b">
  4540. <td align="left"> Default Value </td>
  4541. <td align="left"> &lt;empty&gt; </td></tr>
  4542. <tr class="a">
  4543. <td align="left"> Valid Values </td>
  4544. <td align="left"> An encoded token. </td></tr>
  4545. <tr class="b">
  4546. <td align="left"> Syntax </td>
  4547. <td align="left"> See the note below. </td></tr>
  4548. </tbody>
  4549. </table>
  4550. <p><b>Note</b> that delegation tokens are encoded as a URL safe string; see <code>encodeToUrlString()</code> and <code>decodeFromUrlString(String)</code> in <code>org.apache.hadoop.security.token.Token</code> for the details of the encoding.</p>
  4551. <p>See also: <a href="#Authentication">Authentication</a></p></section><section>
  4552. <h3><a name="Destination"></a>Destination</h3>
  4553. <table border="0" class="bodyTable">
  4554. <thead>
  4555. <tr class="a">
  4556. <th align="left"> Name </th>
  4557. <th align="left"> <code>destination</code> </th></tr>
  4558. </thead><tbody>
  4559. <tr class="b">
  4560. <td align="left"> Description </td>
  4561. <td align="left"> The destination path. </td></tr>
  4562. <tr class="a">
  4563. <td align="left"> Type </td>
  4564. <td align="left"> Path </td></tr>
  4565. <tr class="b">
  4566. <td align="left"> Default Value </td>
  4567. <td align="left"> &lt;empty&gt; (an invalid path) </td></tr>
  4568. <tr class="a">
  4569. <td align="left"> Valid Values </td>
  4570. <td align="left"> An absolute FileSystem path without scheme and authority. </td></tr>
  4571. <tr class="b">
  4572. <td align="left"> Syntax </td>
  4573. <td align="left"> Any path. </td></tr>
  4574. </tbody>
  4575. </table>
  4576. <p>See also: <a href="#Create_a_Symbolic_Link"><code>CREATESYMLINK</code></a>, <a href="#Rename_a_FileDirectory"><code>RENAME</code></a></p></section><section>
  4577. <h3><a name="Do_As"></a>Do As</h3>
  4578. <table border="0" class="bodyTable">
  4579. <thead>
  4580. <tr class="a">
  4581. <th align="left"> Name </th>
  4582. <th align="left"> <code>doas</code> </th></tr>
  4583. </thead><tbody>
  4584. <tr class="b">
  4585. <td align="left"> Description </td>
  4586. <td align="left"> Allowing a proxy user to do as another user. </td></tr>
  4587. <tr class="a">
  4588. <td align="left"> Type </td>
  4589. <td align="left"> String </td></tr>
  4590. <tr class="b">
  4591. <td align="left"> Default Value </td>
  4592. <td align="left"> null </td></tr>
  4593. <tr class="a">
  4594. <td align="left"> Valid Values </td>
  4595. <td align="left"> Any valid username. </td></tr>
  4596. <tr class="b">
  4597. <td align="left"> Syntax </td>
  4598. <td align="left"> Any string. </td></tr>
  4599. </tbody>
  4600. </table>
  4601. <p>See also: <a href="#Proxy_Users">Proxy Users</a></p></section><section>
  4602. <h3><a name="Fs_Action"></a>Fs Action</h3>
  4603. <table border="0" class="bodyTable">
  4604. <thead>
  4605. <tr class="a">
  4606. <th align="left"> Name </th>
  4607. <th align="left"> <code>fsaction</code> </th></tr>
  4608. </thead><tbody>
  4609. <tr class="b">
  4610. <td align="left"> Description </td>
  4611. <td align="left"> File system operation read/write/execute </td></tr>
  4612. <tr class="a">
  4613. <td align="left"> Type </td>
  4614. <td align="left"> String </td></tr>
  4615. <tr class="b">
  4616. <td align="left"> Default Value </td>
  4617. <td align="left"> null (an invalid value) </td></tr>
  4618. <tr class="a">
  4619. <td align="left"> Valid Values </td>
  4620. <td align="left"> Strings matching regex pattern &#xa0;&quot;[r-][w-][x-]&#xa0;&quot; </td></tr>
  4621. <tr class="b">
  4622. <td align="left"> Syntax </td>
  4623. <td align="left"> &#xa0;&quot;[r-][w-][x-]&#xa0;&quot; </td></tr>
  4624. </tbody>
  4625. </table>
  4626. <p>See also: <a href="#Check_access"><code>CHECKACCESS</code></a>,</p></section><section>
  4627. <h3><a name="Group"></a>Group</h3>
  4628. <table border="0" class="bodyTable">
  4629. <thead>
  4630. <tr class="a">
  4631. <th align="left"> Name </th>
  4632. <th align="left"> <code>group</code> </th></tr>
  4633. </thead><tbody>
  4634. <tr class="b">
  4635. <td align="left"> Description </td>
  4636. <td align="left"> The name of a group. </td></tr>
  4637. <tr class="a">
  4638. <td align="left"> Type </td>
  4639. <td align="left"> String </td></tr>
  4640. <tr class="b">
  4641. <td align="left"> Default Value </td>
  4642. <td align="left"> &lt;empty&gt; (means keeping it unchanged) </td></tr>
  4643. <tr class="a">
  4644. <td align="left"> Valid Values </td>
  4645. <td align="left"> Any valid group name. </td></tr>
  4646. <tr class="b">
  4647. <td align="left"> Syntax </td>
  4648. <td align="left"> Any string. </td></tr>
  4649. </tbody>
  4650. </table>
  4651. <p>See also: <a href="#Set_Owner"><code>SETOWNER</code></a></p></section><section>
  4652. <h3><a name="Length"></a>Length</h3>
  4653. <table border="0" class="bodyTable">
  4654. <thead>
  4655. <tr class="a">
  4656. <th align="left"> Name </th>
  4657. <th align="left"> <code>length</code> </th></tr>
  4658. </thead><tbody>
  4659. <tr class="b">
  4660. <td align="left"> Description </td>
  4661. <td align="left"> The number of bytes to be processed. </td></tr>
  4662. <tr class="a">
  4663. <td align="left"> Type </td>
  4664. <td align="left"> long </td></tr>
  4665. <tr class="b">
  4666. <td align="left"> Default Value </td>
  4667. <td align="left"> null (means the entire file) </td></tr>
  4668. <tr class="a">
  4669. <td align="left"> Valid Values </td>
  4670. <td align="left"> &gt;= 0 or null </td></tr>
  4671. <tr class="b">
  4672. <td align="left"> Syntax </td>
  4673. <td align="left"> Any integer. </td></tr>
  4674. </tbody>
  4675. </table>
  4676. <p>See also: <a href="#Open_and_Read_a_File"><code>OPEN</code></a></p></section><section>
  4677. <h3><a name="Modification_Time"></a>Modification Time</h3>
  4678. <table border="0" class="bodyTable">
  4679. <thead>
  4680. <tr class="a">
  4681. <th align="left"> Name </th>
  4682. <th align="left"> <code>modificationtime</code> </th></tr>
  4683. </thead><tbody>
  4684. <tr class="b">
  4685. <td align="left"> Description </td>
  4686. <td align="left"> The modification time of a file/directory. </td></tr>
  4687. <tr class="a">
  4688. <td align="left"> Type </td>
  4689. <td align="left"> long </td></tr>
  4690. <tr class="b">
  4691. <td align="left"> Default Value </td>
  4692. <td align="left"> -1 (means keeping it unchanged) </td></tr>
  4693. <tr class="a">
  4694. <td align="left"> Valid Values </td>
  4695. <td align="left"> -1 or a timestamp </td></tr>
  4696. <tr class="b">
  4697. <td align="left"> Syntax </td>
  4698. <td align="left"> Any integer. </td></tr>
  4699. </tbody>
  4700. </table>
  4701. <p>See also: <a href="#Set_Access_or_Modification_Time"><code>SETTIMES</code></a></p></section><section>
  4702. <h3><a name="New_Length"></a>New Length</h3>
  4703. <table border="0" class="bodyTable">
  4704. <thead>
  4705. <tr class="a">
  4706. <th align="left"> Name </th>
  4707. <th align="left"> <code>newlength</code> </th></tr>
  4708. </thead><tbody>
  4709. <tr class="b">
  4710. <td align="left"> Description </td>
  4711. <td align="left"> The size the file is to be truncated to. </td></tr>
  4712. <tr class="a">
  4713. <td align="left"> Type </td>
  4714. <td align="left"> long </td></tr>
  4715. <tr class="b">
  4716. <td align="left"> Valid Values </td>
  4717. <td align="left"> &gt;= 0 </td></tr>
  4718. <tr class="a">
  4719. <td align="left"> Syntax </td>
  4720. <td align="left"> Any long. </td></tr>
  4721. </tbody>
  4722. </table></section><section>
  4723. <h3><a name="Offset"></a>Offset</h3>
  4724. <table border="0" class="bodyTable">
  4725. <thead>
  4726. <tr class="a">
  4727. <th align="left"> Name </th>
  4728. <th align="left"> <code>offset</code> </th></tr>
  4729. </thead><tbody>
  4730. <tr class="b">
  4731. <td align="left"> Description </td>
  4732. <td align="left"> The starting byte position. </td></tr>
  4733. <tr class="a">
  4734. <td align="left"> Type </td>
  4735. <td align="left"> long </td></tr>
  4736. <tr class="b">
  4737. <td align="left"> Default Value </td>
  4738. <td align="left"> 0 </td></tr>
  4739. <tr class="a">
  4740. <td align="left"> Valid Values </td>
  4741. <td align="left"> &gt;= 0 </td></tr>
  4742. <tr class="b">
  4743. <td align="left"> Syntax </td>
  4744. <td align="left"> Any integer. </td></tr>
  4745. </tbody>
  4746. </table>
  4747. <p>See also: <a href="#Open_and_Read_a_File"><code>OPEN</code></a></p></section><section>
  4748. <h3><a name="Old_Snapshot_Name"></a>Old Snapshot Name</h3>
  4749. <table border="0" class="bodyTable">
  4750. <thead>
  4751. <tr class="a">
  4752. <th align="left"> Name </th>
  4753. <th align="left"> <code>oldsnapshotname</code> </th></tr>
  4754. </thead><tbody>
  4755. <tr class="b">
  4756. <td align="left"> Description </td>
  4757. <td align="left"> The old name of the snapshot to be renamed. </td></tr>
  4758. <tr class="a">
  4759. <td align="left"> Type </td>
  4760. <td align="left"> String </td></tr>
  4761. <tr class="b">
  4762. <td align="left"> Default Value </td>
  4763. <td align="left"> null </td></tr>
  4764. <tr class="a">
  4765. <td align="left"> Valid Values </td>
  4766. <td align="left"> An existing snapshot name. </td></tr>
  4767. <tr class="b">
  4768. <td align="left"> Syntax </td>
  4769. <td align="left"> Any string. </td></tr>
  4770. </tbody>
  4771. </table>
  4772. <p>See also: <a href="#Rename_Snapshot"><code>RENAMESNAPSHOT</code></a></p></section><section>
  4773. <h3><a name="Op"></a>Op</h3>
  4774. <table border="0" class="bodyTable">
  4775. <thead>
  4776. <tr class="a">
  4777. <th align="left"> Name </th>
  4778. <th align="left"> <code>op</code> </th></tr>
  4779. </thead><tbody>
  4780. <tr class="b">
  4781. <td align="left"> Description </td>
  4782. <td align="left"> The name of the operation to be executed. </td></tr>
  4783. <tr class="a">
  4784. <td align="left"> Type </td>
  4785. <td align="left"> enum </td></tr>
  4786. <tr class="b">
  4787. <td align="left"> Default Value </td>
  4788. <td align="left"> null (an invalid value) </td></tr>
  4789. <tr class="a">
  4790. <td align="left"> Valid Values </td>
  4791. <td align="left"> Any valid operation name. </td></tr>
  4792. <tr class="b">
  4793. <td align="left"> Syntax </td>
  4794. <td align="left"> Any string. </td></tr>
  4795. </tbody>
  4796. </table>
  4797. <p>See also: <a href="#Operations">Operations</a></p></section><section>
  4798. <h3><a name="Overwrite"></a>Overwrite</h3>
  4799. <table border="0" class="bodyTable">
  4800. <thead>
  4801. <tr class="a">
  4802. <th align="left"> Name </th>
  4803. <th align="left"> <code>overwrite</code> </th></tr>
  4804. </thead><tbody>
  4805. <tr class="b">
  4806. <td align="left"> Description </td>
  4807. <td align="left"> If a file already exists, should it be overwritten? </td></tr>
  4808. <tr class="a">
  4809. <td align="left"> Type </td>
  4810. <td align="left"> boolean </td></tr>
  4811. <tr class="b">
  4812. <td align="left"> Default Value </td>
  4813. <td align="left"> false </td></tr>
  4814. <tr class="a">
  4815. <td align="left"> Valid Values </td>
  4816. <td align="left"> true </td></tr>
  4817. <tr class="b">
  4818. <td align="left"> Syntax </td>
  4819. <td align="left"> true </td></tr>
  4820. </tbody>
  4821. </table>
  4822. <p>See also: <a href="#Create_and_Write_to_a_File"><code>CREATE</code></a></p></section><section>
  4823. <h3><a name="Owner"></a>Owner</h3>
  4824. <table border="0" class="bodyTable">
  4825. <thead>
  4826. <tr class="a">
  4827. <th align="left"> Name </th>
  4828. <th align="left"> <code>owner</code> </th></tr>
  4829. </thead><tbody>
  4830. <tr class="b">
  4831. <td align="left"> Description </td>
  4832. <td align="left"> The username who is the owner of a file/directory. </td></tr>
  4833. <tr class="a">
  4834. <td align="left"> Type </td>
  4835. <td align="left"> String </td></tr>
  4836. <tr class="b">
  4837. <td align="left"> Default Value </td>
  4838. <td align="left"> &lt;empty&gt; (means keeping it unchanged) </td></tr>
  4839. <tr class="a">
  4840. <td align="left"> Valid Values </td>
  4841. <td align="left"> Any valid username. </td></tr>
  4842. <tr class="b">
  4843. <td align="left"> Syntax </td>
  4844. <td align="left"> Any string. </td></tr>
  4845. </tbody>
  4846. </table>
  4847. <p>See also: <a href="#Set_Owner"><code>SETOWNER</code></a></p></section><section>
  4848. <h3><a name="Permission"></a>Permission</h3>
  4849. <table border="0" class="bodyTable">
  4850. <thead>
  4851. <tr class="a">
  4852. <th align="left"> Name </th>
  4853. <th align="left"> <code>permission</code> </th></tr>
  4854. </thead><tbody>
  4855. <tr class="b">
  4856. <td align="left"> Description </td>
  4857. <td align="left"> The permission of a file/directory. </td></tr>
  4858. <tr class="a">
  4859. <td align="left"> Type </td>
  4860. <td align="left"> Octal </td></tr>
  4861. <tr class="b">
  4862. <td align="left"> Default Value </td>
  4863. <td align="left"> 644 for files, 755 for directories </td></tr>
  4864. <tr class="a">
  4865. <td align="left"> Valid Values </td>
  4866. <td align="left"> 0 - 1777 </td></tr>
  4867. <tr class="b">
  4868. <td align="left"> Syntax </td>
  4869. <td align="left"> Any radix-8 integer (leading zeros may be omitted.) </td></tr>
  4870. </tbody>
  4871. </table>
  4872. <p>See also: <a href="#Create_and_Write_to_a_File"><code>CREATE</code></a>, <a href="#Make_a_Directory"><code>MKDIRS</code></a>, <a href="#Set_Permission"><code>SETPERMISSION</code></a></p></section><section>
  4873. <h3><a name="Recursive"></a>Recursive</h3>
  4874. <table border="0" class="bodyTable">
  4875. <thead>
  4876. <tr class="a">
  4877. <th align="left"> Name </th>
  4878. <th align="left"> <code>recursive</code> </th></tr>
  4879. </thead><tbody>
  4880. <tr class="b">
  4881. <td align="left"> Description </td>
  4882. <td align="left"> Should the operation act on the content in the subdirectories? </td></tr>
  4883. <tr class="a">
  4884. <td align="left"> Type </td>
  4885. <td align="left"> boolean </td></tr>
  4886. <tr class="b">
  4887. <td align="left"> Default Value </td>
  4888. <td align="left"> false </td></tr>
  4889. <tr class="a">
  4890. <td align="left"> Valid Values </td>
  4891. <td align="left"> true </td></tr>
  4892. <tr class="b">
  4893. <td align="left"> Syntax </td>
  4894. <td align="left"> true </td></tr>
  4895. </tbody>
  4896. </table>
  4897. <p>See also: <a href="#Rename_a_FileDirectory"><code>RENAME</code></a></p></section><section>
  4898. <h3><a name="Renewer"></a>Renewer</h3>
  4899. <table border="0" class="bodyTable">
  4900. <thead>
  4901. <tr class="a">
  4902. <th align="left"> Name </th>
  4903. <th align="left"> <code>renewer</code> </th></tr>
  4904. </thead><tbody>
  4905. <tr class="b">
  4906. <td align="left"> Description </td>
  4907. <td align="left"> The username of the renewer of a delegation token. </td></tr>
  4908. <tr class="a">
  4909. <td align="left"> Type </td>
  4910. <td align="left"> String </td></tr>
  4911. <tr class="b">
  4912. <td align="left"> Default Value </td>
  4913. <td align="left"> &lt;empty&gt; (means the current user) </td></tr>
  4914. <tr class="a">
  4915. <td align="left"> Valid Values </td>
  4916. <td align="left"> Any valid username. </td></tr>
  4917. <tr class="b">
  4918. <td align="left"> Syntax </td>
  4919. <td align="left"> Any string. </td></tr>
  4920. </tbody>
  4921. </table>
  4922. <p>See also: <a href="#Get_Delegation_Token"><code>GETDELEGATIONTOKEN</code></a></p></section><section>
  4923. <h3><a name="Replication"></a>Replication</h3>
  4924. <table border="0" class="bodyTable">
  4925. <thead>
  4926. <tr class="a">
  4927. <th align="left"> Name </th>
  4928. <th align="left"> <code>replication</code> </th></tr>
  4929. </thead><tbody>
  4930. <tr class="b">
  4931. <td align="left"> Description </td>
  4932. <td align="left"> The number of replications of a file. </td></tr>
  4933. <tr class="a">
  4934. <td align="left"> Type </td>
  4935. <td align="left"> short </td></tr>
  4936. <tr class="b">
  4937. <td align="left"> Default Value </td>
  4938. <td align="left"> Specified in the configuration. </td></tr>
  4939. <tr class="a">
  4940. <td align="left"> Valid Values </td>
  4941. <td align="left"> &gt; 0 </td></tr>
  4942. <tr class="b">
  4943. <td align="left"> Syntax </td>
  4944. <td align="left"> Any integer. </td></tr>
  4945. </tbody>
  4946. </table>
  4947. <p>See also: <a href="#Create_and_Write_to_a_File"><code>CREATE</code></a>, <a href="#Set_Replication_Factor"><code>SETREPLICATION</code></a></p></section><section>
  4948. <h3><a name="Snapshot_Name"></a>Snapshot Name</h3>
  4949. <table border="0" class="bodyTable">
  4950. <thead>
  4951. <tr class="a">
  4952. <th align="left"> Name </th>
  4953. <th align="left"> <code>snapshotname</code> </th></tr>
  4954. </thead><tbody>
  4955. <tr class="b">
  4956. <td align="left"> Description </td>
  4957. <td align="left"> The name of the snapshot to be created/deleted. Or the new name for snapshot rename. </td></tr>
  4958. <tr class="a">
  4959. <td align="left"> Type </td>
  4960. <td align="left"> String </td></tr>
  4961. <tr class="b">
  4962. <td align="left"> Default Value </td>
  4963. <td align="left"> null </td></tr>
  4964. <tr class="a">
  4965. <td align="left"> Valid Values </td>
  4966. <td align="left"> Any valid snapshot name. </td></tr>
  4967. <tr class="b">
  4968. <td align="left"> Syntax </td>
  4969. <td align="left"> Any string. </td></tr>
  4970. </tbody>
  4971. </table>
  4972. <p>See also: <a href="#Create_Snapshot"><code>CREATESNAPSHOT</code></a>, <a href="#Delete_Snapshot"><code>DELETESNAPSHOT</code></a>, <a href="#Rename_Snapshot"><code>RENAMESNAPSHOT</code></a></p></section><section>
  4973. <h3><a name="Sources"></a>Sources</h3>
  4974. <table border="0" class="bodyTable">
  4975. <thead>
  4976. <tr class="a">
  4977. <th align="left"> Name </th>
  4978. <th align="left"> <code>sources</code> </th></tr>
  4979. </thead><tbody>
  4980. <tr class="b">
  4981. <td align="left"> Description </td>
  4982. <td align="left"> A list of source paths. </td></tr>
  4983. <tr class="a">
  4984. <td align="left"> Type </td>
  4985. <td align="left"> String </td></tr>
  4986. <tr class="b">
  4987. <td align="left"> Default Value </td>
  4988. <td align="left"> &lt;empty&gt; </td></tr>
  4989. <tr class="a">
  4990. <td align="left"> Valid Values </td>
  4991. <td align="left"> A list of comma separated absolute FileSystem paths without scheme and authority. </td></tr>
  4992. <tr class="b">
  4993. <td align="left"> Syntax </td>
  4994. <td align="left"> Any string. </td></tr>
  4995. </tbody>
  4996. </table>
  4997. <p>See also: <a href="#Concat_Files"><code>CONCAT</code></a></p></section><section>
  4998. <h3><a name="Token"></a>Token</h3>
  4999. <table border="0" class="bodyTable">
  5000. <thead>
  5001. <tr class="a">
  5002. <th align="left"> Name </th>
  5003. <th align="left"> <code>token</code> </th></tr>
  5004. </thead><tbody>
  5005. <tr class="b">
  5006. <td align="left"> Description </td>
  5007. <td align="left"> The delegation token used for the operation. </td></tr>
  5008. <tr class="a">
  5009. <td align="left"> Type </td>
  5010. <td align="left"> String </td></tr>
  5011. <tr class="b">
  5012. <td align="left"> Default Value </td>
  5013. <td align="left"> &lt;empty&gt; </td></tr>
  5014. <tr class="a">
  5015. <td align="left"> Valid Values </td>
  5016. <td align="left"> An encoded token. </td></tr>
  5017. <tr class="b">
  5018. <td align="left"> Syntax </td>
  5019. <td align="left"> See the note in <a href="#Delegation">Delegation</a>. </td></tr>
  5020. </tbody>
  5021. </table>
  5022. <p>See also: <a href="#Renew_Delegation_Token"><code>RENEWDELEGATIONTOKEN</code></a>, <a href="#Cancel_Delegation_Token"><code>CANCELDELEGATIONTOKEN</code></a></p></section><section>
  5023. <h3><a name="Token_Kind"></a>Token Kind</h3>
  5024. <table border="0" class="bodyTable">
  5025. <thead>
  5026. <tr class="a">
  5027. <th align="left"> Name </th>
  5028. <th align="left"> <code>kind</code> </th></tr>
  5029. </thead><tbody>
  5030. <tr class="b">
  5031. <td align="left"> Description </td>
  5032. <td align="left"> The kind of the delegation token requested </td></tr>
  5033. <tr class="a">
  5034. <td align="left"> Type </td>
  5035. <td align="left"> String </td></tr>
  5036. <tr class="b">
  5037. <td align="left"> Default Value </td>
  5038. <td align="left"> &lt;empty&gt; (Server sets the default kind for the service) </td></tr>
  5039. <tr class="a">
  5040. <td align="left"> Valid Values </td>
  5041. <td align="left"> A string that represents token kind e.g &#x201c;HDFS_DELEGATION_TOKEN&#x201d; or &#x201c;WEBHDFS delegation&#x201d; </td></tr>
  5042. <tr class="b">
  5043. <td align="left"> Syntax </td>
  5044. <td align="left"> Any string. </td></tr>
  5045. </tbody>
  5046. </table>
  5047. <p>See also: <a href="#Get_Delegation_Token"><code>GETDELEGATIONTOKEN</code></a></p></section><section>
  5048. <h3><a name="Token_Service"></a>Token Service</h3>
  5049. <table border="0" class="bodyTable">
  5050. <thead>
  5051. <tr class="a">
  5052. <th align="left"> Name </th>
  5053. <th align="left"> <code>service</code> </th></tr>
  5054. </thead><tbody>
  5055. <tr class="b">
  5056. <td align="left"> Description </td>
  5057. <td align="left"> The name of the service where the token is supposed to be used, e.g. ip:port of the namenode </td></tr>
  5058. <tr class="a">
  5059. <td align="left"> Type </td>
  5060. <td align="left"> String </td></tr>
  5061. <tr class="b">
  5062. <td align="left"> Default Value </td>
  5063. <td align="left"> &lt;empty&gt; </td></tr>
  5064. <tr class="a">
  5065. <td align="left"> Valid Values </td>
  5066. <td align="left"> ip:port in string format or logical name of the service </td></tr>
  5067. <tr class="b">
  5068. <td align="left"> Syntax </td>
  5069. <td align="left"> Any string. </td></tr>
  5070. </tbody>
  5071. </table>
  5072. <p>See also: <a href="#Get_Delegation_Token"><code>GETDELEGATIONTOKEN</code></a></p></section><section>
  5073. <h3><a name="Username"></a>Username</h3>
  5074. <table border="0" class="bodyTable">
  5075. <thead>
  5076. <tr class="a">
  5077. <th align="left"> Name </th>
  5078. <th align="left"> <code>user.name</code> </th></tr>
  5079. </thead><tbody>
  5080. <tr class="b">
  5081. <td align="left"> Description </td>
  5082. <td align="left"> The authenticated user; see <a href="#Authentication">Authentication</a>. </td></tr>
  5083. <tr class="a">
  5084. <td align="left"> Type </td>
  5085. <td align="left"> String </td></tr>
  5086. <tr class="b">
  5087. <td align="left"> Default Value </td>
  5088. <td align="left"> null </td></tr>
  5089. <tr class="a">
  5090. <td align="left"> Valid Values </td>
  5091. <td align="left"> Any valid username. </td></tr>
  5092. <tr class="b">
  5093. <td align="left"> Syntax </td>
  5094. <td align="left"> Any string. </td></tr>
  5095. </tbody>
  5096. </table>
  5097. <p>See also: <a href="#Authentication">Authentication</a></p></section><section>
  5098. <h3><a name="NoRedirect"></a>NoRedirect</h3>
  5099. <table border="0" class="bodyTable">
  5100. <thead>
  5101. <tr class="a">
  5102. <th align="left"> Name </th>
  5103. <th align="left"> <code>noredirect</code> </th></tr>
  5104. </thead><tbody>
  5105. <tr class="b">
  5106. <td align="left"> Description </td>
  5107. <td align="left"> Whether the response should return an HTTP 307 redirect or HTTP 200 OK. See <a href="#Create_and_Write_to_a_File">Create and Write to a File</a>. </td></tr>
  5108. <tr class="a">
  5109. <td align="left"> Type </td>
  5110. <td align="left"> boolean </td></tr>
  5111. <tr class="b">
  5112. <td align="left"> Default Value </td>
  5113. <td align="left"> false </td></tr>
  5114. <tr class="a">
  5115. <td align="left"> Valid Values </td>
  5116. <td align="left"> true </td></tr>
  5117. <tr class="b">
  5118. <td align="left"> Syntax </td>
  5119. <td align="left"> true </td></tr>
  5120. </tbody>
  5121. </table>
  5122. <p>See also: <a href="#Create_and_Write_to_a_File">Create and Write to a File</a></p></section><section>
  5123. <h3><a name="Namespace_Quota"></a>Namespace Quota</h3>
  5124. <table border="0" class="bodyTable">
  5125. <thead>
  5126. <tr class="a">
  5127. <th align="left"> Name </th>
  5128. <th align="left"> <code>namespacequota</code> </th></tr>
  5129. </thead><tbody>
  5130. <tr class="b">
  5131. <td align="left"> Description </td>
  5132. <td align="left"> Limit on the namespace usage, i.e., number of files/directories, under a directory. </td></tr>
  5133. <tr class="a">
  5134. <td align="left"> Type </td>
  5135. <td align="left"> String </td></tr>
  5136. <tr class="b">
  5137. <td align="left"> Default Value </td>
  5138. <td align="left"> Long.MAX_VALUE </td></tr>
  5139. <tr class="a">
  5140. <td align="left"> Valid Values </td>
  5141. <td align="left"> &gt; 0. </td></tr>
  5142. <tr class="b">
  5143. <td align="left"> Syntax </td>
  5144. <td align="left"> Any integer. </td></tr>
  5145. </tbody>
  5146. </table>
  5147. <p>See also: <a href="#Set_Quota"><code>SETQUOTA</code></a></p></section><section>
  5148. <h3><a name="Storage_Space_Quota"></a>Storage Space Quota</h3>
  5149. <table border="0" class="bodyTable">
  5150. <thead>
  5151. <tr class="a">
  5152. <th align="left"> Name </th>
  5153. <th align="left"> <code>storagespacequota</code> </th></tr>
  5154. </thead><tbody>
  5155. <tr class="b">
  5156. <td align="left"> Description </td>
  5157. <td align="left"> Limit on storage space usage (in bytes, including replication) under a directory. </td></tr>
  5158. <tr class="a">
  5159. <td align="left"> Type </td>
  5160. <td align="left"> String </td></tr>
  5161. <tr class="b">
  5162. <td align="left"> Default Value </td>
  5163. <td align="left"> Long.MAX_VALUE </td></tr>
  5164. <tr class="a">
  5165. <td align="left"> Valid Values </td>
  5166. <td align="left"> &gt; 0. </td></tr>
  5167. <tr class="b">
  5168. <td align="left"> Syntax </td>
  5169. <td align="left"> Any integer. </td></tr>
  5170. </tbody>
  5171. </table>
  5172. <p>See also: <a href="#Set_Quota"><code>SETQUOTA</code></a>, <a href="#Set_Quota_By_Storage_Type"><code>SETQUOTABYSTORAGETYPE</code></a></p></section><section>
  5173. <h3><a name="Storage_Type"></a>Storage Type</h3>
  5174. <table border="0" class="bodyTable">
  5175. <thead>
  5176. <tr class="a">
  5177. <th align="left"> Name </th>
  5178. <th align="left"> <code>storagetype</code> </th></tr>
  5179. </thead><tbody>
  5180. <tr class="b">
  5181. <td align="left"> Description </td>
  5182. <td align="left"> Storage type of the specific storage type quota to be modified. </td></tr>
  5183. <tr class="a">
  5184. <td align="left"> Type </td>
  5185. <td align="left"> String </td></tr>
  5186. <tr class="b">
  5187. <td align="left"> Default Value </td>
  5188. <td align="left"> &lt;empty&gt; </td></tr>
  5189. <tr class="a">
  5190. <td align="left"> Valid Values </td>
  5191. <td align="left"> Any valid storage type. </td></tr>
  5192. <tr class="b">
  5193. <td align="left"> Syntax </td>
  5194. <td align="left"> Any string. </td></tr>
  5195. </tbody>
  5196. </table>
  5197. <p>See also: <a href="#Set_Quota_By_Storage_Type"><code>SETQUOTABYSTORAGETYPE</code></a></p></section><section>
  5198. <h3><a name="Storage_Policy"></a>Storage Policy</h3>
  5199. <table border="0" class="bodyTable">
  5200. <thead>
  5201. <tr class="a">
  5202. <th align="left"> Name </th>
  5203. <th align="left"> <code>storagepolicy</code> </th></tr>
  5204. </thead><tbody>
  5205. <tr class="b">
  5206. <td align="left"> Description </td>
  5207. <td align="left"> The name of the storage policy. </td></tr>
  5208. <tr class="a">
  5209. <td align="left"> Type </td>
  5210. <td align="left"> String </td></tr>
  5211. <tr class="b">
  5212. <td align="left"> Default Value </td>
  5213. <td align="left"> &lt;empty&gt; </td></tr>
  5214. <tr class="a">
  5215. <td align="left"> Valid Values </td>
  5216. <td align="left"> Any valid storage policy name; see <a href="#Get_all_Storage_Policies">GETALLSTORAGEPOLICY</a>. </td></tr>
  5217. <tr class="b">
  5218. <td align="left"> Syntax </td>
  5219. <td align="left"> Any string. </td></tr>
  5220. </tbody>
  5221. </table>
  5222. <p>See also: <a href="#Set_Storage_Policy"><code>SETSTORAGEPOLICY</code></a></p></section><section>
  5223. <h3><a name="Erasure_Coding_Policy"></a>Erasure Coding Policy</h3>
  5224. <table border="0" class="bodyTable">
  5225. <thead>
  5226. <tr class="a">
  5227. <th align="left"> Name </th>
  5228. <th align="left"> <code>ecpolicy</code> </th></tr>
  5229. </thead><tbody>
  5230. <tr class="b">
  5231. <td align="left"> Description </td>
  5232. <td align="left"> The name of the erasure coding policy. </td></tr>
  5233. <tr class="a">
  5234. <td align="left"> Type </td>
  5235. <td align="left"> String </td></tr>
  5236. <tr class="b">
  5237. <td align="left"> Default Value </td>
  5238. <td align="left"> &lt;empty&gt; </td></tr>
  5239. <tr class="a">
  5240. <td align="left"> Valid Values </td>
  5241. <td align="left"> Any valid erasure coding policy name; </td></tr>
  5242. <tr class="b">
  5243. <td align="left"> Syntax </td>
  5244. <td align="left"> Any string. </td></tr>
  5245. </tbody>
  5246. </table>
  5247. <p>See also: <a href="#Enable_EC_Policy"><code>ENABLEECPOLICY</code></a> or <a href="#Disable_EC_Policy"><code>DISABLEECPOLICY</code></a></p></section><section>
  5248. <h3><a name="Start_After"></a>Start After</h3>
  5249. <table border="0" class="bodyTable">
  5250. <thead>
  5251. <tr class="a">
  5252. <th align="left"> Name </th>
  5253. <th align="left"> <code>startAfter</code> </th></tr>
  5254. </thead><tbody>
  5255. <tr class="b">
  5256. <td align="left"> Description </td>
  5257. <td align="left"> The last item returned in the liststatus batch. </td></tr>
  5258. <tr class="a">
  5259. <td align="left"> Type </td>
  5260. <td align="left"> String </td></tr>
  5261. <tr class="b">
  5262. <td align="left"> Default Value </td>
  5263. <td align="left"> &lt;empty&gt; </td></tr>
  5264. <tr class="a">
  5265. <td align="left"> Valid Values </td>
  5266. <td align="left"> Any valid file/directory name. </td></tr>
  5267. <tr class="b">
  5268. <td align="left"> Syntax </td>
  5269. <td align="left"> Any string. </td></tr>
  5270. </tbody>
  5271. </table>
  5272. <p>See also: <a href="#Iteratively_List_a_Directory"><code>LISTSTATUS_BATCH</code></a></p></section></section>
  5273. </div>
  5274. </div>
  5275. <div class="clear">
  5276. <hr/>
  5277. </div>
  5278. <div id="footer">
  5279. <div class="xright">
  5280. &#169; 2008-2025
  5281. Apache Software Foundation
  5282. - <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>.
  5283. Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation.
  5284. </div>
  5285. <div class="clear">
  5286. <hr/>
  5287. </div>
  5288. </div>
  5289. </body>
  5290. </html>