WebHDFS.apt.vm 78 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538
  1. ~~ Licensed under the Apache License, Version 2.0 (the "License");
  2. ~~ you may not use this file except in compliance with the License.
  3. ~~ You may obtain a copy of the License at
  4. ~~
  5. ~~ http://www.apache.org/licenses/LICENSE-2.0
  6. ~~
  7. ~~ Unless required by applicable law or agreed to in writing, software
  8. ~~ distributed under the License is distributed on an "AS IS" BASIS,
  9. ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. ~~ See the License for the specific language governing permissions and
  11. ~~ limitations under the License. See accompanying LICENSE file.
  12. ---
  13. Hadoop Distributed File System-${project.version} - WebHDFS REST API
  14. ---
  15. ---
  16. ${maven.build.timestamp}
  17. WebHDFS REST API
  18. %{toc|section=1|fromDepth=0}
  19. * {Document Conventions}
  20. *----------------------+-------------------------------------------------------------------------------+
  21. | <<<Monospaced>>> | Used for commands, HTTP request and responses and code blocks. |
  22. *----------------------+-------------------------------------------------------------------------------+
  23. | <<<\<Monospaced\>>>> | User entered values. |
  24. *----------------------+-------------------------------------------------------------------------------+
  25. | <<<[Monospaced]>>> | Optional values. When the value is not specified, the default value is used. |
  26. *----------------------+-------------------------------------------------------------------------------+
  27. | <Italics> | Important phrases and words. |
  28. *----------------------+-------------------------------------------------------------------------------+
  29. * {Introduction}
  30. The HTTP REST API supports the complete
  31. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}/{{{../../api/org/apache/hadoop/fs/FileContext.html}FileContext}}
  32. interface for HDFS.
  33. The operations and the corresponding FileSystem/FileContext methods are shown in the next section.
  34. The Section {{HTTP Query Parameter Dictionary}} specifies the parameter details
  35. such as the defaults and the valid values.
  36. ** {Operations}
  37. * HTTP GET
  38. * {{{Open and Read a File}<<<OPEN>>>}}
  39. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.open)
  40. * {{{Status of a File/Directory}<<<GETFILESTATUS>>>}}
  41. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileStatus)
  42. * {{{List a Directory}<<<LISTSTATUS>>>}}
  43. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.listStatus)
  44. * {{{Get Content Summary of a Directory}<<<GETCONTENTSUMMARY>>>}}
  45. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getContentSummary)
  46. * {{{Get File Checksum}<<<GETFILECHECKSUM>>>}}
  47. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileChecksum)
  48. * {{{Get Home Directory}<<<GETHOMEDIRECTORY>>>}}
  49. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getHomeDirectory)
  50. * {{{Get Delegation Token}<<<GETDELEGATIONTOKEN>>>}}
  51. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationToken)
  52. * {{{Get Delegation Tokens}<<<GETDELEGATIONTOKENS>>>}}
  53. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationTokens)
  54. * {{{Get an XAttr}<<<GETXATTRS>>>}}
  55. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getXAttr)
  56. * {{{Get multiple XAttrs}<<<GETXATTRS>>>}}
  57. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getXAttrs)
  58. * {{{Get all XAttrs}<<<GETXATTRS>>>}}
  59. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getXAttrs)
  60. * {{{List all XAttrs}<<<LISTXATTRS>>>}}
  61. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.listXAttrs)
  62. * {{{Check access}<<<CHECKACCESS>>>}}
  63. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.access)
  64. * HTTP PUT
  65. * {{{Create and Write to a File}<<<CREATE>>>}}
  66. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.create)
  67. * {{{Make a Directory}<<<MKDIRS>>>}}
  68. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.mkdirs)
  69. * {{{Create a Symbolic Link}<<<CREATESYMLINK>>>}}
  70. (see {{{../../api/org/apache/hadoop/fs/FileContext.html}FileContext}}.createSymlink)
  71. * {{{Rename a File/Directory}<<<RENAME>>>}}
  72. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.rename)
  73. * {{{Set Replication Factor}<<<SETREPLICATION>>>}}
  74. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setReplication)
  75. * {{{Set Owner}<<<SETOWNER>>>}}
  76. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setOwner)
  77. * {{{Set Permission}<<<SETPERMISSION>>>}}
  78. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setPermission)
  79. * {{{Set Access or Modification Time}<<<SETTIMES>>>}}
  80. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setTimes)
  81. * {{{Renew Delegation Token}<<<RENEWDELEGATIONTOKEN>>>}}
  82. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.renewDelegationToken)
  83. * {{{Cancel Delegation Token}<<<CANCELDELEGATIONTOKEN>>>}}
  84. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.cancelDelegationToken)
  85. * {{{Create Snapshot}<<<CREATESNAPSHOT>>>}}
  86. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.createSnapshot)
  87. * {{{Rename Snapshot}<<<RENAMESNAPSHOT>>>}}
  88. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.renameSnapshot)
  89. * {{{Set XAttr}<<<SETXATTR>>>}}
  90. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setXAttr)
  91. * {{{Remove XAttr}<<<REMOVEXATTR>>>}}
  92. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.removeXAttr)
  93. * HTTP POST
  94. * {{{Append to a File}<<<APPEND>>>}}
  95. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.append)
  96. * {{{Concat File(s)}<<<CONCAT>>>}}
  97. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.concat)
  98. * HTTP DELETE
  99. * {{{Delete a File/Directory}<<<DELETE>>>}}
  100. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.delete)
  101. * {{{Delete Snapshot}<<<DELETESNAPSHOT>>>}}
  102. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.deleteSnapshot)
  103. ** {FileSystem URIs vs HTTP URLs}
  104. The FileSystem scheme of WebHDFS is "<<<webhdfs://>>>".
  105. A WebHDFS FileSystem URI has the following format.
  106. +---------------------------------
  107. webhdfs://<HOST>:<HTTP_PORT>/<PATH>
  108. +---------------------------------
  109. The above WebHDFS URI corresponds to the below HDFS URI.
  110. +---------------------------------
  111. hdfs://<HOST>:<RPC_PORT>/<PATH>
  112. +---------------------------------
  113. In the REST API, the prefix "<<</webhdfs/v1>>>" is inserted in the path and a query is appended at the end.
  114. Therefore, the corresponding HTTP URL has the following format.
  115. +---------------------------------
  116. http://<HOST>:<HTTP_PORT>/webhdfs/v1/<PATH>?op=...
  117. +---------------------------------
  118. ** {HDFS Configuration Options}
  119. Below are the HDFS configuration options for WebHDFS.
  120. *-------------------------------------------------+---------------------------------------------------+
  121. || Property Name || Description |
  122. *-------------------------------------------------+---------------------------------------------------+
  123. | <<<dfs.webhdfs.enabled >>> | Enable/disable WebHDFS in Namenodes and Datanodes |
  124. *-------------------------------------------------+---------------------------------------------------+
  125. | <<<dfs.web.authentication.kerberos.principal>>> | The HTTP Kerberos principal used by Hadoop-Auth in the HTTP endpoint. The HTTP Kerberos principal MUST start with 'HTTP/' per Kerberos HTTP SPNEGO specification. A value of "*" will use all HTTP principals found in the keytab. |
  126. *-------------------------------------------------+---------------------------------------------------+
  127. | <<<dfs.web.authentication.kerberos.keytab >>> | The Kerberos keytab file with the credentials for the HTTP Kerberos principal used by Hadoop-Auth in the HTTP endpoint. |
  128. *-------------------------------------------------+---------------------------------------------------+
  129. * {Authentication}
  130. When security is <off>, the authenticated user is the username specified in the <<<user.name>>> query parameter.
  131. If the <<<user.name>>> parameter is not set,
  132. the server may either set the authenticated user to a default web user, if there is any, or return an error response.
  133. When security is <on>, authentication is performed by either Hadoop delegation token or Kerberos SPNEGO.
  134. If a token is set in the <<<delegation>>> query parameter, the authenticated user is the user encoded in the token.
  135. If the <<<delegation>>> parameter is not set, the user is authenticated by Kerberos SPNEGO.
  136. Below are examples using the <<<curl>>> command tool.
  137. [[1]] Authentication when security is off:
  138. +---------------------------------
  139. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?[user.name=<USER>&]op=..."
  140. +---------------------------------
  141. [[1]] Authentication using Kerberos SPNEGO when security is on:
  142. +---------------------------------
  143. curl -i --negotiate -u : "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=..."
  144. +---------------------------------
  145. [[1]] Authentication using Hadoop delegation token when security is on:
  146. +---------------------------------
  147. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?delegation=<TOKEN>&op=..."
  148. +---------------------------------
  149. []
  150. See also: {{{../hadoop-common/HttpAuthentication.html}Authentication for Hadoop HTTP web-consoles}}
  151. * {Proxy Users}
  152. When the proxy user feature is enabled, a proxy user <P> may submit a request on behalf of another user <U>.
  153. The username of <U> must be specified in the <<<doas>>> query parameter unless a delegation token is presented in authentication.
  154. In such case, the information of both users <P> and <U> must be encoded in the delegation token.
  155. [[1]] A proxy request when security is off:
  156. +---------------------------------
  157. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?[user.name=<USER>&]doas=<USER>&op=..."
  158. +---------------------------------
  159. [[1]] A proxy request using Kerberos SPNEGO when security is on:
  160. +---------------------------------
  161. curl -i --negotiate -u : "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?doas=<USER>&op=..."
  162. +---------------------------------
  163. [[1]] A proxy request using Hadoop delegation token when security is on:
  164. +---------------------------------
  165. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?delegation=<TOKEN>&op=..."
  166. +---------------------------------
  167. * {File and Directory Operations}
  168. ** {Create and Write to a File}
  169. * Step 1: Submit a HTTP PUT request without automatically following redirects and without sending the file data.
  170. +---------------------------------
  171. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CREATE
  172. [&overwrite=<true|false>][&blocksize=<LONG>][&replication=<SHORT>]
  173. [&permission=<OCTAL>][&buffersize=<INT>]"
  174. +---------------------------------
  175. The request is redirected to a datanode where the file data is to be written:
  176. +---------------------------------
  177. HTTP/1.1 307 TEMPORARY_REDIRECT
  178. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE...
  179. Content-Length: 0
  180. +---------------------------------
  181. * Step 2: Submit another HTTP PUT request using the URL in the <<<Location>>> header with the file data to be written.
  182. +---------------------------------
  183. curl -i -X PUT -T <LOCAL_FILE> "http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE..."
  184. +---------------------------------
  185. The client receives a <<<201 Created>>> response with zero content length
  186. and the WebHDFS URI of the file in the <<<Location>>> header:
  187. +---------------------------------
  188. HTTP/1.1 201 Created
  189. Location: webhdfs://<HOST>:<PORT>/<PATH>
  190. Content-Length: 0
  191. +---------------------------------
  192. []
  193. <<Note>> that the reason of having two-step create/append is
  194. for preventing clients to send out data before the redirect.
  195. This issue is addressed by the "<<<Expect: 100-continue>>>" header in HTTP/1.1;
  196. see {{{http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3}RFC 2616, Section 8.2.3}}.
  197. Unfortunately, there are software library bugs (e.g. Jetty 6 HTTP server and Java 6 HTTP client),
  198. which do not correctly implement "<<<Expect: 100-continue>>>".
  199. The two-step create/append is a temporary workaround for the software library bugs.
  200. See also:
  201. {{{Overwrite}<<<overwrite>>>}},
  202. {{{Block Size}<<<blocksize>>>}},
  203. {{{Replication}<<<replication>>>}},
  204. {{{Permission}<<<permission>>>}},
  205. {{{Buffer Size}<<<buffersize>>>}},
  206. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.create
  207. ** {Append to a File}
  208. * Step 1: Submit a HTTP POST request without automatically following redirects and without sending the file data.
  209. +---------------------------------
  210. curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=APPEND[&buffersize=<INT>]"
  211. +---------------------------------
  212. The request is redirected to a datanode where the file data is to be appended:
  213. +---------------------------------
  214. HTTP/1.1 307 TEMPORARY_REDIRECT
  215. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=APPEND...
  216. Content-Length: 0
  217. +---------------------------------
  218. * Step 2: Submit another HTTP POST request using the URL in the <<<Location>>> header with the file data to be appended.
  219. +---------------------------------
  220. curl -i -X POST -T <LOCAL_FILE> "http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=APPEND..."
  221. +---------------------------------
  222. The client receives a response with zero content length:
  223. +---------------------------------
  224. HTTP/1.1 200 OK
  225. Content-Length: 0
  226. +---------------------------------
  227. []
  228. See the note in the previous section for the description of why this operation requires two steps.
  229. See also:
  230. {{{Buffer Size}<<<buffersize>>>}},
  231. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.append
  232. ** {Concat File(s)}
  233. * Submit a HTTP POST request.
  234. +---------------------------------
  235. curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CONCAT&sources=<PATHS>"
  236. +---------------------------------
  237. The client receives a response with zero content length:
  238. +---------------------------------
  239. HTTP/1.1 200 OK
  240. Content-Length: 0
  241. +---------------------------------
  242. []
  243. See also:
  244. {{{Sources}<<<sources>>>}},
  245. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.concat
  246. ** {Open and Read a File}
  247. * Submit a HTTP GET request with automatically following redirects.
  248. +---------------------------------
  249. curl -i -L "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=OPEN
  250. [&offset=<LONG>][&length=<LONG>][&buffersize=<INT>]"
  251. +---------------------------------
  252. The request is redirected to a datanode where the file data can be read:
  253. +---------------------------------
  254. HTTP/1.1 307 TEMPORARY_REDIRECT
  255. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=OPEN...
  256. Content-Length: 0
  257. +---------------------------------
  258. The client follows the redirect to the datanode and receives the file data:
  259. +---------------------------------
  260. HTTP/1.1 200 OK
  261. Content-Type: application/octet-stream
  262. Content-Length: 22
  263. Hello, webhdfs user!
  264. +---------------------------------
  265. []
  266. See also:
  267. {{{Offset}<<<offset>>>}},
  268. {{{Length}<<<length>>>}},
  269. {{{Buffer Size}<<<buffersize>>>}},
  270. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.open
  271. ** {Make a Directory}
  272. * Submit a HTTP PUT request.
  273. +---------------------------------
  274. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=MKDIRS[&permission=<OCTAL>]"
  275. +---------------------------------
  276. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  277. +---------------------------------
  278. HTTP/1.1 200 OK
  279. Content-Type: application/json
  280. Transfer-Encoding: chunked
  281. {"boolean": true}
  282. +---------------------------------
  283. []
  284. See also:
  285. {{{Permission}<<<permission>>>}},
  286. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.mkdirs
  287. ** {Create a Symbolic Link}
  288. * Submit a HTTP PUT request.
  289. +---------------------------------
  290. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CREATESYMLINK
  291. &destination=<PATH>[&createParent=<true|false>]"
  292. +---------------------------------
  293. The client receives a response with zero content length:
  294. +---------------------------------
  295. HTTP/1.1 200 OK
  296. Content-Length: 0
  297. +---------------------------------
  298. []
  299. See also:
  300. {{{Destination}<<<destination>>>}},
  301. {{{Create Parent}<<<createParent>>>}},
  302. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.createSymlink
  303. ** {Rename a File/Directory}
  304. * Submit a HTTP PUT request.
  305. +---------------------------------
  306. curl -i -X PUT "<HOST>:<PORT>/webhdfs/v1/<PATH>?op=RENAME&destination=<PATH>"
  307. +---------------------------------
  308. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  309. +---------------------------------
  310. HTTP/1.1 200 OK
  311. Content-Type: application/json
  312. Transfer-Encoding: chunked
  313. {"boolean": true}
  314. +---------------------------------
  315. []
  316. See also:
  317. {{{Destination}<<<destination>>>}},
  318. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.rename
  319. ** {Delete a File/Directory}
  320. * Submit a HTTP DELETE request.
  321. +---------------------------------
  322. curl -i -X DELETE "http://<host>:<port>/webhdfs/v1/<path>?op=DELETE
  323. [&recursive=<true|false>]"
  324. +---------------------------------
  325. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  326. +---------------------------------
  327. HTTP/1.1 200 OK
  328. Content-Type: application/json
  329. Transfer-Encoding: chunked
  330. {"boolean": true}
  331. +---------------------------------
  332. []
  333. See also:
  334. {{{Recursive}<<<recursive>>>}},
  335. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.delete
  336. ** {Status of a File/Directory}
  337. * Submit a HTTP GET request.
  338. +---------------------------------
  339. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETFILESTATUS"
  340. +---------------------------------
  341. The client receives a response with a {{{FileStatus JSON Schema}<<<FileStatus>>> JSON object}}:
  342. +---------------------------------
  343. HTTP/1.1 200 OK
  344. Content-Type: application/json
  345. Transfer-Encoding: chunked
  346. {
  347. "FileStatus":
  348. {
  349. "accessTime" : 0,
  350. "blockSize" : 0,
  351. "childrenNum" : 1,
  352. "fileId" : 16386,
  353. "group" : "supergroup",
  354. "length" : 0, //in bytes, zero for directories
  355. "modificationTime": 1320173277227,
  356. "owner" : "webuser",
  357. "pathSuffix" : "",
  358. "permission" : "777",
  359. "replication" : 0,
  360. "type" : "DIRECTORY" //enum {FILE, DIRECTORY, SYMLINK}
  361. }
  362. }
  363. +---------------------------------
  364. []
  365. See also:
  366. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileStatus
  367. ** {List a Directory}
  368. * Submit a HTTP GET request.
  369. +---------------------------------
  370. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=LISTSTATUS"
  371. +---------------------------------
  372. The client receives a response with a {{{FileStatuses JSON Schema}<<<FileStatuses>>> JSON object}}:
  373. +---------------------------------
  374. HTTP/1.1 200 OK
  375. Content-Type: application/json
  376. Content-Length: 427
  377. {
  378. "FileStatuses":
  379. {
  380. "FileStatus":
  381. [
  382. {
  383. "accessTime" : 1320171722771,
  384. "blockSize" : 33554432,
  385. "childrenNum" : 0,
  386. "fileId" : 16387,
  387. "group" : "supergroup",
  388. "length" : 24930,
  389. "modificationTime": 1320171722771,
  390. "owner" : "webuser",
  391. "pathSuffix" : "a.patch",
  392. "permission" : "644",
  393. "replication" : 1,
  394. "type" : "FILE"
  395. },
  396. {
  397. "accessTime" : 0,
  398. "blockSize" : 0,
  399. "childrenNum" : 2,
  400. "fileId" : 16388,
  401. "group" : "supergroup",
  402. "length" : 0,
  403. "modificationTime": 1320895981256,
  404. "owner" : "szetszwo",
  405. "pathSuffix" : "bar",
  406. "permission" : "711",
  407. "replication" : 0,
  408. "type" : "DIRECTORY"
  409. },
  410. ...
  411. ]
  412. }
  413. }
  414. +---------------------------------
  415. []
  416. See also:
  417. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.listStatus
  418. * {Other File System Operations}
  419. ** {Get Content Summary of a Directory}
  420. * Submit a HTTP GET request.
  421. +---------------------------------
  422. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETCONTENTSUMMARY"
  423. +---------------------------------
  424. The client receives a response with a {{{ContentSummary JSON Schema}<<<ContentSummary>>> JSON object}}:
  425. +---------------------------------
  426. HTTP/1.1 200 OK
  427. Content-Type: application/json
  428. Transfer-Encoding: chunked
  429. {
  430. "ContentSummary":
  431. {
  432. "directoryCount": 2,
  433. "fileCount" : 1,
  434. "length" : 24930,
  435. "quota" : -1,
  436. "spaceConsumed" : 24930,
  437. "spaceQuota" : -1
  438. }
  439. }
  440. +---------------------------------
  441. []
  442. See also:
  443. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getContentSummary
  444. ** {Get File Checksum}
  445. * Submit a HTTP GET request.
  446. +---------------------------------
  447. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETFILECHECKSUM"
  448. +---------------------------------
  449. The request is redirected to a datanode:
  450. +---------------------------------
  451. HTTP/1.1 307 TEMPORARY_REDIRECT
  452. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=GETFILECHECKSUM...
  453. Content-Length: 0
  454. +---------------------------------
  455. The client follows the redirect to the datanode and receives a {{{FileChecksum JSON Schema}<<<FileChecksum>>> JSON object}}:
  456. +---------------------------------
  457. HTTP/1.1 200 OK
  458. Content-Type: application/json
  459. Transfer-Encoding: chunked
  460. {
  461. "FileChecksum":
  462. {
  463. "algorithm": "MD5-of-1MD5-of-512CRC32",
  464. "bytes" : "eadb10de24aa315748930df6e185c0d ...",
  465. "length" : 28
  466. }
  467. }
  468. +---------------------------------
  469. []
  470. See also:
  471. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileChecksum
  472. ** {Get Home Directory}
  473. * Submit a HTTP GET request.
  474. +---------------------------------
  475. curl -i "http://<HOST>:<PORT>/webhdfs/v1/?op=GETHOMEDIRECTORY"
  476. +---------------------------------
  477. The client receives a response with a {{{Path JSON Schema}<<<Path>>> JSON object}}:
  478. +---------------------------------
  479. HTTP/1.1 200 OK
  480. Content-Type: application/json
  481. Transfer-Encoding: chunked
  482. {"Path": "/user/szetszwo"}
  483. +---------------------------------
  484. []
  485. See also:
  486. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getHomeDirectory
  487. ** {Set Permission}
  488. * Submit a HTTP PUT request.
  489. +---------------------------------
  490. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETPERMISSION
  491. [&permission=<OCTAL>]"
  492. +---------------------------------
  493. The client receives a response with zero content length:
  494. +---------------------------------
  495. HTTP/1.1 200 OK
  496. Content-Length: 0
  497. +---------------------------------
  498. []
  499. See also:
  500. {{{Permission}<<<permission>>>}},
  501. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setPermission
  502. ** {Set Owner}
  503. * Submit a HTTP PUT request.
  504. +---------------------------------
  505. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETOWNER
  506. [&owner=<USER>][&group=<GROUP>]"
  507. +---------------------------------
  508. The client receives a response with zero content length:
  509. +---------------------------------
  510. HTTP/1.1 200 OK
  511. Content-Length: 0
  512. +---------------------------------
  513. []
  514. See also:
  515. {{{Owner}<<<owner>>>}},
  516. {{{Group}<<<group>>>}},
  517. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setOwner
  518. ** {Set Replication Factor}
  519. * Submit a HTTP PUT request.
  520. +---------------------------------
  521. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETREPLICATION
  522. [&replication=<SHORT>]"
  523. +---------------------------------
  524. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  525. +---------------------------------
  526. HTTP/1.1 200 OK
  527. Content-Type: application/json
  528. Transfer-Encoding: chunked
  529. {"boolean": true}
  530. +---------------------------------
  531. []
  532. See also:
  533. {{{Replication}<<<replication>>>}},
  534. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setReplication
  535. ** {Set Access or Modification Time}
  536. * Submit a HTTP PUT request.
  537. +---------------------------------
  538. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETTIMES
  539. [&modificationtime=<TIME>][&accesstime=<TIME>]"
  540. +---------------------------------
  541. The client receives a response with zero content length:
  542. +---------------------------------
  543. HTTP/1.1 200 OK
  544. Content-Length: 0
  545. +---------------------------------
  546. []
  547. See also:
  548. {{{Modification Time}<<<modificationtime>>>}},
  549. {{{Access Time}<<<accesstime>>>}},
  550. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setTimes
  551. ** {Modify ACL Entries}
  552. * Submit a HTTP PUT request.
  553. +---------------------------------
  554. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=MODIFYACLENTRIES
  555. &aclspec=<ACLSPEC>"
  556. +---------------------------------
  557. The client receives a response with zero content length:
  558. +---------------------------------
  559. HTTP/1.1 200 OK
  560. Content-Length: 0
  561. +---------------------------------
  562. []
  563. See also:
  564. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.modifyAclEntries
  565. ** {Remove ACL Entries}
  566. * Submit a HTTP PUT request.
  567. +---------------------------------
  568. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEACLENTRIES
  569. &aclspec=<ACLSPEC>"
  570. +---------------------------------
  571. The client receives a response with zero content length:
  572. +---------------------------------
  573. HTTP/1.1 200 OK
  574. Content-Length: 0
  575. +---------------------------------
  576. []
  577. See also:
  578. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.removeAclEntries
  579. ** {Remove Default ACL}
  580. * Submit a HTTP PUT request.
  581. +---------------------------------
  582. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEDEFAULTACL"
  583. +---------------------------------
  584. The client receives a response with zero content length:
  585. +---------------------------------
  586. HTTP/1.1 200 OK
  587. Content-Length: 0
  588. +---------------------------------
  589. []
  590. See also:
  591. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.removeDefaultAcl
  592. ** {Remove ACL}
  593. * Submit a HTTP PUT request.
  594. +---------------------------------
  595. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEACL"
  596. +---------------------------------
  597. The client receives a response with zero content length:
  598. +---------------------------------
  599. HTTP/1.1 200 OK
  600. Content-Length: 0
  601. +---------------------------------
  602. []
  603. See also:
  604. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.removeAcl
  605. ** {Set ACL}
  606. * Submit a HTTP PUT request.
  607. +---------------------------------
  608. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETACL
  609. &aclspec=<ACLSPEC>"
  610. +---------------------------------
  611. The client receives a response with zero content length:
  612. +---------------------------------
  613. HTTP/1.1 200 OK
  614. Content-Length: 0
  615. +---------------------------------
  616. []
  617. See also:
  618. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setAcl
  619. ** {Get ACL Status}
  620. * Submit a HTTP GET request.
  621. +---------------------------------
  622. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETACLSTATUS"
  623. +---------------------------------
  624. The client receives a response with a {{{ACL Status JSON Schema}<<<AclStatus>>> JSON object}}:
  625. +---------------------------------
  626. HTTP/1.1 200 OK
  627. Content-Type: application/json
  628. Transfer-Encoding: chunked
  629. {
  630. "AclStatus": {
  631. "entries": [
  632. "user:carla:rw-",
  633. "group::r-x"
  634. ],
  635. "group": "supergroup",
  636. "owner": "hadoop",
  637. "stickyBit": false
  638. }
  639. }
  640. +---------------------------------
  641. []
  642. See also:
  643. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getAclStatus
  644. ** {Check access}
  645. * Submit a HTTP GET request.
  646. +---------------------------------
  647. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CHECKACCESS
  648. &fsaction=<FSACTION>
  649. +---------------------------------
  650. The client receives a response with zero content length:
  651. +---------------------------------
  652. HTTP/1.1 200 OK
  653. Content-Length: 0
  654. +---------------------------------
  655. []
  656. See also:
  657. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.access
  658. * {Extended Attributes(XAttrs) Operations}
  659. ** {Set XAttr}
  660. * Submit a HTTP PUT request.
  661. +---------------------------------
  662. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETXATTR
  663. &xattr.name=<XATTRNAME>&xattr.value=<XATTRVALUE>
  664. &flag=<FLAG>"
  665. +---------------------------------
  666. The client receives a response with zero content length:
  667. +---------------------------------
  668. HTTP/1.1 200 OK
  669. Content-Length: 0
  670. +---------------------------------
  671. []
  672. See also:
  673. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setXAttr
  674. ** {Remove XAttr}
  675. * Submit a HTTP PUT request.
  676. +---------------------------------
  677. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=REMOVEXATTR
  678. &xattr.name=<XATTRNAME>"
  679. +---------------------------------
  680. The client receives a response with zero content length:
  681. +---------------------------------
  682. HTTP/1.1 200 OK
  683. Content-Length: 0
  684. +---------------------------------
  685. []
  686. See also:
  687. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.removeXAttr
  688. ** {Get an XAttr}
  689. * Submit a HTTP GET request.
  690. +---------------------------------
  691. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETXATTRS
  692. &xattr.name=<XATTRNAME>&encoding=<ENCODING>"
  693. +---------------------------------
  694. The client receives a response with a {{{XAttrs JSON Schema}<<<XAttrs>>> JSON object}}:
  695. +---------------------------------
  696. HTTP/1.1 200 OK
  697. Content-Type: application/json
  698. Transfer-Encoding: chunked
  699. {
  700. "XAttrs": [
  701. {
  702. "name":"XATTRNAME",
  703. "value":"XATTRVALUE"
  704. }
  705. ]
  706. }
  707. +---------------------------------
  708. []
  709. See also:
  710. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getXAttr
  711. ** {Get multiple XAttrs}
  712. * Submit a HTTP GET request.
  713. +---------------------------------
  714. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETXATTRS
  715. &xattr.name=<XATTRNAME1>&xattr.name=<XATTRNAME2>
  716. &encoding=<ENCODING>"
  717. +---------------------------------
  718. The client receives a response with a {{{XAttrs JSON Schema}<<<XAttrs>>> JSON object}}:
  719. +---------------------------------
  720. HTTP/1.1 200 OK
  721. Content-Type: application/json
  722. Transfer-Encoding: chunked
  723. {
  724. "XAttrs": [
  725. {
  726. "name":"XATTRNAME1",
  727. "value":"XATTRVALUE1"
  728. },
  729. {
  730. "name":"XATTRNAME2",
  731. "value":"XATTRVALUE2"
  732. }
  733. ]
  734. }
  735. +---------------------------------
  736. []
  737. See also:
  738. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getXAttrs
  739. ** {Get all XAttrs}
  740. * Submit a HTTP GET request.
  741. +---------------------------------
  742. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETXATTRS
  743. &encoding=<ENCODING>"
  744. +---------------------------------
  745. The client receives a response with a {{{XAttrs JSON Schema}<<<XAttrs>>> JSON object}}:
  746. +---------------------------------
  747. HTTP/1.1 200 OK
  748. Content-Type: application/json
  749. Transfer-Encoding: chunked
  750. {
  751. "XAttrs": [
  752. {
  753. "name":"XATTRNAME1",
  754. "value":"XATTRVALUE1"
  755. },
  756. {
  757. "name":"XATTRNAME2",
  758. "value":"XATTRVALUE2"
  759. },
  760. {
  761. "name":"XATTRNAME3",
  762. "value":"XATTRVALUE3"
  763. }
  764. ]
  765. }
  766. +---------------------------------
  767. []
  768. See also:
  769. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getXAttrs
  770. ** {List all XAttrs}
  771. * Submit a HTTP GET request.
  772. +---------------------------------
  773. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=LISTXATTRS"
  774. +---------------------------------
  775. The client receives a response with a {{{XAttrNames JSON Schema}<<<XAttrNames>>> JSON object}}:
  776. +---------------------------------
  777. HTTP/1.1 200 OK
  778. Content-Type: application/json
  779. Transfer-Encoding: chunked
  780. {
  781. "XAttrNames":"[\"XATTRNAME1\",\"XATTRNAME2\",\"XATTRNAME3\"]"
  782. }
  783. +---------------------------------
  784. []
  785. See also:
  786. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.listXAttrs
  787. * {Snapshot Operations}
  788. ** {Create Snapshot}
  789. * Submit a HTTP PUT request.
  790. +---------------------------------
  791. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CREATESNAPSHOT[&snapshotname=<SNAPSHOTNAME>]"
  792. +---------------------------------
  793. The client receives a response with a {{{Path JSON Schema}<<<Path>>> JSON object}}:
  794. +---------------------------------
  795. HTTP/1.1 200 OK
  796. Content-Type: application/json
  797. Transfer-Encoding: chunked
  798. {"Path": "/user/szetszwo/.snapshot/s1"}
  799. +---------------------------------
  800. []
  801. See also:
  802. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.createSnapshot
  803. ** {Delete Snapshot}
  804. * Submit a HTTP DELETE request.
  805. +---------------------------------
  806. curl -i -X DELETE "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=DELETESNAPSHOT&snapshotname=<SNAPSHOTNAME>"
  807. +---------------------------------
  808. The client receives a response with zero content length:
  809. +---------------------------------
  810. HTTP/1.1 200 OK
  811. Content-Length: 0
  812. +---------------------------------
  813. []
  814. See also:
  815. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.deleteSnapshot
  816. ** {Rename Snapshot}
  817. * Submit a HTTP PUT request.
  818. +---------------------------------
  819. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=RENAMESNAPSHOT
  820. &oldsnapshotname=<SNAPSHOTNAME>&snapshotname=<SNAPSHOTNAME>"
  821. +---------------------------------
  822. The client receives a response with zero content length:
  823. +---------------------------------
  824. HTTP/1.1 200 OK
  825. Content-Length: 0
  826. +---------------------------------
  827. []
  828. See also:
  829. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.renameSnapshot
  830. * {Delegation Token Operations}
  831. ** {Get Delegation Token}
  832. * Submit a HTTP GET request.
  833. +---------------------------------
  834. curl -i "http://<HOST>:<PORT>/webhdfs/v1/?op=GETDELEGATIONTOKEN&renewer=<USER>"
  835. +---------------------------------
  836. The client receives a response with a {{{Token JSON Schema}<<<Token>>> JSON object}}:
  837. +---------------------------------
  838. HTTP/1.1 200 OK
  839. Content-Type: application/json
  840. Transfer-Encoding: chunked
  841. {
  842. "Token":
  843. {
  844. "urlString": "JQAIaG9y..."
  845. }
  846. }
  847. +---------------------------------
  848. []
  849. See also:
  850. {{{Renewer}<<<renewer>>>}},
  851. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationToken
  852. ** {Get Delegation Tokens}
  853. * Submit a HTTP GET request.
  854. +---------------------------------
  855. curl -i "http://<HOST>:<PORT>/webhdfs/v1/?op=GETDELEGATIONTOKENS&renewer=<USER>"
  856. +---------------------------------
  857. The client receives a response with a {{{Tokens JSON Schema}<<<Tokens>>> JSON object}}:
  858. +---------------------------------
  859. HTTP/1.1 200 OK
  860. Content-Type: application/json
  861. Transfer-Encoding: chunked
  862. {
  863. "Tokens":
  864. {
  865. "Token":
  866. [
  867. {
  868. "urlString":"KAAKSm9i ..."
  869. }
  870. ]
  871. }
  872. }
  873. +---------------------------------
  874. []
  875. See also:
  876. {{{Renewer}<<<renewer>>>}},
  877. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationTokens
  878. ** {Renew Delegation Token}
  879. * Submit a HTTP PUT request.
  880. +---------------------------------
  881. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=RENEWDELEGATIONTOKEN&token=<TOKEN>"
  882. +---------------------------------
  883. The client receives a response with a {{{Long JSON Schema}<<<long>>> JSON object}}:
  884. +---------------------------------
  885. HTTP/1.1 200 OK
  886. Content-Type: application/json
  887. Transfer-Encoding: chunked
  888. {"long": 1320962673997} //the new expiration time
  889. +---------------------------------
  890. []
  891. See also:
  892. {{{Token}<<<token>>>}},
  893. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.renewDelegationToken
  894. ** {Cancel Delegation Token}
  895. * Submit a HTTP PUT request.
  896. +---------------------------------
  897. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=CANCELDELEGATIONTOKEN&token=<TOKEN>"
  898. +---------------------------------
  899. The client receives a response with zero content length:
  900. +---------------------------------
  901. HTTP/1.1 200 OK
  902. Content-Length: 0
  903. +---------------------------------
  904. []
  905. See also:
  906. {{{Token}<<<token>>>}},
  907. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.cancelDelegationToken
  908. * {Error Responses}
  909. When an operation fails, the server may throw an exception.
  910. The JSON schema of error responses is defined in {{RemoteException JSON Schema}}.
  911. The table below shows the mapping from exceptions to HTTP response codes.
  912. ** {HTTP Response Codes}
  913. *-------------------------------------+---------------------------------+
  914. || Exceptions || HTTP Response Codes |
  915. *-------------------------------------+---------------------------------+
  916. | <<<IllegalArgumentException >>> | <<<400 Bad Request >>> |
  917. *-------------------------------------+---------------------------------+
  918. | <<<UnsupportedOperationException>>> | <<<400 Bad Request >>> |
  919. *-------------------------------------+---------------------------------+
  920. | <<<SecurityException >>> | <<<401 Unauthorized >>> |
  921. *-------------------------------------+---------------------------------+
  922. | <<<IOException >>> | <<<403 Forbidden >>> |
  923. *-------------------------------------+---------------------------------+
  924. | <<<FileNotFoundException >>> | <<<404 Not Found >>> |
  925. *-------------------------------------+---------------------------------+
  926. | <<<RumtimeException >>> | <<<500 Internal Server Error>>> |
  927. *-------------------------------------+---------------------------------+
  928. Below are examples of exception responses.
  929. *** {Illegal Argument Exception}
  930. +---------------------------------
  931. HTTP/1.1 400 Bad Request
  932. Content-Type: application/json
  933. Transfer-Encoding: chunked
  934. {
  935. "RemoteException":
  936. {
  937. "exception" : "IllegalArgumentException",
  938. "javaClassName": "java.lang.IllegalArgumentException",
  939. "message" : "Invalid value for webhdfs parameter \"permission\": ..."
  940. }
  941. }
  942. +---------------------------------
  943. *** {Security Exception}
  944. +---------------------------------
  945. HTTP/1.1 401 Unauthorized
  946. Content-Type: application/json
  947. Transfer-Encoding: chunked
  948. {
  949. "RemoteException":
  950. {
  951. "exception" : "SecurityException",
  952. "javaClassName": "java.lang.SecurityException",
  953. "message" : "Failed to obtain user group information: ..."
  954. }
  955. }
  956. +---------------------------------
  957. *** {Access Control Exception}
  958. +---------------------------------
  959. HTTP/1.1 403 Forbidden
  960. Content-Type: application/json
  961. Transfer-Encoding: chunked
  962. {
  963. "RemoteException":
  964. {
  965. "exception" : "AccessControlException",
  966. "javaClassName": "org.apache.hadoop.security.AccessControlException",
  967. "message" : "Permission denied: ..."
  968. }
  969. }
  970. +---------------------------------
  971. *** {File Not Found Exception}
  972. +---------------------------------
  973. HTTP/1.1 404 Not Found
  974. Content-Type: application/json
  975. Transfer-Encoding: chunked
  976. {
  977. "RemoteException":
  978. {
  979. "exception" : "FileNotFoundException",
  980. "javaClassName": "java.io.FileNotFoundException",
  981. "message" : "File does not exist: /foo/a.patch"
  982. }
  983. }
  984. +---------------------------------
  985. * {JSON Schemas}
  986. All operations, except for {{{Open and Read a File}<<<OPEN>>>}},
  987. either return a zero-length response or a JSON response.
  988. For {{{Open and Read a File}<<<OPEN>>>}}, the response is an octet-stream.
  989. The JSON schemas are shown below.
  990. See {{{http://tools.ietf.org/id/draft-zyp-json-schema-03.html}draft-zyp-json-schema-03}}
  991. for the syntax definitions of the JSON schemas.
  992. <<Note>> that the default value of
  993. {{{http://tools.ietf.org/id/draft-zyp-json-schema-03.html#additionalProperties}<<<additionalProperties>>>}}
  994. is an empty schema which allows any value for additional properties.
  995. Therefore, all WebHDFS JSON responses allow any additional property.
  996. However, if additional properties are included in the responses, they are
  997. considered as optional properties in order to maintain compatibility.
  998. ** {ACL Status JSON Schema}
  999. +---------------------------------
  1000. {
  1001. "name" : "AclStatus",
  1002. "properties":
  1003. {
  1004. "AclStatus":
  1005. {
  1006. "type" : "object",
  1007. "properties":
  1008. {
  1009. "entries":
  1010. {
  1011. "type": "array"
  1012. "items":
  1013. {
  1014. "description": "ACL entry.",
  1015. "type": "string"
  1016. }
  1017. },
  1018. "group":
  1019. {
  1020. "description": "The group owner.",
  1021. "type" : "string",
  1022. "required" : true
  1023. },
  1024. "owner":
  1025. {
  1026. "description": "The user who is the owner.",
  1027. "type" : "string",
  1028. "required" : true
  1029. },
  1030. "stickyBit":
  1031. {
  1032. "description": "True if the sticky bit is on.",
  1033. "type" : "boolean",
  1034. "required" : true
  1035. },
  1036. }
  1037. }
  1038. }
  1039. }
  1040. +---------------------------------
  1041. ** {XAttrs JSON Schema}
  1042. +---------------------------------
  1043. {
  1044. "name" : "XAttrs",
  1045. "properties":
  1046. {
  1047. "XAttrs":
  1048. {
  1049. "type" : "array",
  1050. "items":
  1051. {
  1052. "type" " "object",
  1053. "properties":
  1054. {
  1055. "name":
  1056. {
  1057. "description": "XAttr name.",
  1058. "type" : "string",
  1059. "required" : true
  1060. },
  1061. "value":
  1062. {
  1063. "description": "XAttr value.",
  1064. "type" : "string"
  1065. }
  1066. }
  1067. }
  1068. }
  1069. }
  1070. }
  1071. +---------------------------------
  1072. ** {XAttrNames JSON Schema}
  1073. +---------------------------------
  1074. {
  1075. "name" : "XAttrNames",
  1076. "properties":
  1077. {
  1078. "XAttrNames":
  1079. {
  1080. "description": "XAttr names.",
  1081. "type" : "string"
  1082. "required" : true
  1083. }
  1084. }
  1085. }
  1086. +---------------------------------
  1087. ** {Boolean JSON Schema}
  1088. +---------------------------------
  1089. {
  1090. "name" : "boolean",
  1091. "properties":
  1092. {
  1093. "boolean":
  1094. {
  1095. "description": "A boolean value",
  1096. "type" : "boolean",
  1097. "required" : true
  1098. }
  1099. }
  1100. }
  1101. +---------------------------------
  1102. See also:
  1103. {{{Make a Directory}<<<MKDIRS>>>}},
  1104. {{{Rename a File/Directory}<<<RENAME>>>}},
  1105. {{{Delete a File/Directory}<<<DELETE>>>}},
  1106. {{{Set Replication Factor}<<<SETREPLICATION>>>}}
  1107. ** {ContentSummary JSON Schema}
  1108. +---------------------------------
  1109. {
  1110. "name" : "ContentSummary",
  1111. "properties":
  1112. {
  1113. "ContentSummary":
  1114. {
  1115. "type" : "object",
  1116. "properties":
  1117. {
  1118. "directoryCount":
  1119. {
  1120. "description": "The number of directories.",
  1121. "type" : "integer",
  1122. "required" : true
  1123. },
  1124. "fileCount":
  1125. {
  1126. "description": "The number of files.",
  1127. "type" : "integer",
  1128. "required" : true
  1129. },
  1130. "length":
  1131. {
  1132. "description": "The number of bytes used by the content.",
  1133. "type" : "integer",
  1134. "required" : true
  1135. },
  1136. "quota":
  1137. {
  1138. "description": "The namespace quota of this directory.",
  1139. "type" : "integer",
  1140. "required" : true
  1141. },
  1142. "spaceConsumed":
  1143. {
  1144. "description": "The disk space consumed by the content.",
  1145. "type" : "integer",
  1146. "required" : true
  1147. },
  1148. "spaceQuota":
  1149. {
  1150. "description": "The disk space quota.",
  1151. "type" : "integer",
  1152. "required" : true
  1153. }
  1154. }
  1155. }
  1156. }
  1157. }
  1158. +---------------------------------
  1159. See also:
  1160. {{{Get Content Summary of a Directory}<<<GETCONTENTSUMMARY>>>}}
  1161. ** {FileChecksum JSON Schema}
  1162. +---------------------------------
  1163. {
  1164. "name" : "FileChecksum",
  1165. "properties":
  1166. {
  1167. "FileChecksum":
  1168. {
  1169. "type" : "object",
  1170. "properties":
  1171. {
  1172. "algorithm":
  1173. {
  1174. "description": "The name of the checksum algorithm.",
  1175. "type" : "string",
  1176. "required" : true
  1177. },
  1178. "bytes":
  1179. {
  1180. "description": "The byte sequence of the checksum in hexadecimal.",
  1181. "type" : "string",
  1182. "required" : true
  1183. },
  1184. "length":
  1185. {
  1186. "description": "The length of the bytes (not the length of the string).",
  1187. "type" : "integer",
  1188. "required" : true
  1189. }
  1190. }
  1191. }
  1192. }
  1193. }
  1194. +---------------------------------
  1195. See also:
  1196. {{{Get File Checksum}<<<GETFILECHECKSUM>>>}}
  1197. ** {FileStatus JSON Schema}
  1198. +---------------------------------
  1199. {
  1200. "name" : "FileStatus",
  1201. "properties":
  1202. {
  1203. "FileStatus": fileStatusProperties //See FileStatus Properties
  1204. }
  1205. }
  1206. +---------------------------------
  1207. See also:
  1208. {{{FileStatus Properties}<<<FileStatus>>> Properties}},
  1209. {{{Status of a File/Directory}<<<GETFILESTATUS>>>}},
  1210. {{{../../api/org/apache/hadoop/fs/FileStatus.html}FileStatus}}
  1211. *** {FileStatus Properties}
  1212. JavaScript syntax is used to define <<<fileStatusProperties>>>
  1213. so that it can be referred in both <<<FileStatus>>> and <<<FileStatuses>>> JSON schemas.
  1214. +---------------------------------
  1215. var fileStatusProperties =
  1216. {
  1217. "type" : "object",
  1218. "properties":
  1219. {
  1220. "accessTime":
  1221. {
  1222. "description": "The access time.",
  1223. "type" : "integer",
  1224. "required" : true
  1225. },
  1226. "blockSize":
  1227. {
  1228. "description": "The block size of a file.",
  1229. "type" : "integer",
  1230. "required" : true
  1231. },
  1232. "childrenNum":
  1233. {
  1234. "description": "The number of children.",
  1235. "type" : "integer",
  1236. "required" : true
  1237. },
  1238. "fileId":
  1239. {
  1240. "description": "The inode ID.",
  1241. "type" : "integer",
  1242. "required" : true
  1243. },
  1244. "group":
  1245. {
  1246. "description": "The group owner.",
  1247. "type" : "string",
  1248. "required" : true
  1249. },
  1250. "length":
  1251. {
  1252. "description": "The number of bytes in a file.",
  1253. "type" : "integer",
  1254. "required" : true
  1255. },
  1256. "modificationTime":
  1257. {
  1258. "description": "The modification time.",
  1259. "type" : "integer",
  1260. "required" : true
  1261. },
  1262. "owner":
  1263. {
  1264. "description": "The user who is the owner.",
  1265. "type" : "string",
  1266. "required" : true
  1267. },
  1268. "pathSuffix":
  1269. {
  1270. "description": "The path suffix.",
  1271. "type" : "string",
  1272. "required" : true
  1273. },
  1274. "permission":
  1275. {
  1276. "description": "The permission represented as a octal string.",
  1277. "type" : "string",
  1278. "required" : true
  1279. },
  1280. "replication":
  1281. {
  1282. "description": "The number of replication of a file.",
  1283. "type" : "integer",
  1284. "required" : true
  1285. },
  1286. "symlink": //an optional property
  1287. {
  1288. "description": "The link target of a symlink.",
  1289. "type" : "string"
  1290. },
  1291. "type":
  1292. {
  1293. "description": "The type of the path object.",
  1294. "enum" : ["FILE", "DIRECTORY", "SYMLINK"],
  1295. "required" : true
  1296. }
  1297. }
  1298. };
  1299. +---------------------------------
  1300. ** {FileStatuses JSON Schema}
  1301. A <<<FileStatuses>>> JSON object represents an array of <<<FileStatus>>> JSON objects.
  1302. +---------------------------------
  1303. {
  1304. "name" : "FileStatuses",
  1305. "properties":
  1306. {
  1307. "FileStatuses":
  1308. {
  1309. "type" : "object",
  1310. "properties":
  1311. {
  1312. "FileStatus":
  1313. {
  1314. "description": "An array of FileStatus",
  1315. "type" : "array",
  1316. "items" : fileStatusProperties //See FileStatus Properties
  1317. }
  1318. }
  1319. }
  1320. }
  1321. }
  1322. +---------------------------------
  1323. See also:
  1324. {{{FileStatus Properties}<<<FileStatus>>> Properties}},
  1325. {{{List a Directory}<<<LISTSTATUS>>>}},
  1326. {{{../../api/org/apache/hadoop/fs/FileStatus.html}FileStatus}}
  1327. ** {Long JSON Schema}
  1328. +---------------------------------
  1329. {
  1330. "name" : "long",
  1331. "properties":
  1332. {
  1333. "long":
  1334. {
  1335. "description": "A long integer value",
  1336. "type" : "integer",
  1337. "required" : true
  1338. }
  1339. }
  1340. }
  1341. +---------------------------------
  1342. See also:
  1343. {{{Renew Delegation Token}<<<RENEWDELEGATIONTOKEN>>>}},
  1344. ** {Path JSON Schema}
  1345. +---------------------------------
  1346. {
  1347. "name" : "Path",
  1348. "properties":
  1349. {
  1350. "Path":
  1351. {
  1352. "description": "The string representation a Path.",
  1353. "type" : "string",
  1354. "required" : true
  1355. }
  1356. }
  1357. }
  1358. +---------------------------------
  1359. See also:
  1360. {{{Get Home Directory}<<<GETHOMEDIRECTORY>>>}},
  1361. {{{../../api/org/apache/hadoop/fs/Path.html}Path}}
  1362. ** {RemoteException JSON Schema}
  1363. +---------------------------------
  1364. {
  1365. "name" : "RemoteException",
  1366. "properties":
  1367. {
  1368. "RemoteException":
  1369. {
  1370. "type" : "object",
  1371. "properties":
  1372. {
  1373. "exception":
  1374. {
  1375. "description": "Name of the exception",
  1376. "type" : "string",
  1377. "required" : true
  1378. },
  1379. "message":
  1380. {
  1381. "description": "Exception message",
  1382. "type" : "string",
  1383. "required" : true
  1384. },
  1385. "javaClassName": //an optional property
  1386. {
  1387. "description": "Java class name of the exception",
  1388. "type" : "string",
  1389. }
  1390. }
  1391. }
  1392. }
  1393. }
  1394. +---------------------------------
  1395. See also:
  1396. {{Error Responses}}
  1397. ** {Token JSON Schema}
  1398. +---------------------------------
  1399. {
  1400. "name" : "Token",
  1401. "properties":
  1402. {
  1403. "Token": tokenProperties //See Token Properties
  1404. }
  1405. }
  1406. +---------------------------------
  1407. See also:
  1408. {{{Token Properties}<<<Token>>> Properties}},
  1409. {{{Get Delegation Token}<<<GETDELEGATIONTOKEN>>>}},
  1410. the note in {{Delegation}}.
  1411. *** {Token Properties}
  1412. JavaScript syntax is used to define <<<tokenProperties>>>
  1413. so that it can be referred in both <<<Token>>> and <<<Tokens>>> JSON schemas.
  1414. +---------------------------------
  1415. var tokenProperties =
  1416. {
  1417. "type" : "object",
  1418. "properties":
  1419. {
  1420. "urlString":
  1421. {
  1422. "description": "A delegation token encoded as a URL safe string.",
  1423. "type" : "string",
  1424. "required" : true
  1425. }
  1426. }
  1427. }
  1428. +---------------------------------
  1429. ** {Tokens JSON Schema}
  1430. A <<<Tokens>>> JSON object represents an array of <<<Token>>> JSON objects.
  1431. +---------------------------------
  1432. {
  1433. "name" : "Tokens",
  1434. "properties":
  1435. {
  1436. "Tokens":
  1437. {
  1438. "type" : "object",
  1439. "properties":
  1440. {
  1441. "Token":
  1442. {
  1443. "description": "An array of Token",
  1444. "type" : "array",
  1445. "items" : "Token": tokenProperties //See Token Properties
  1446. }
  1447. }
  1448. }
  1449. }
  1450. }
  1451. +---------------------------------
  1452. See also:
  1453. {{{Token Properties}<<<Token>>> Properties}},
  1454. {{{Get Delegation Tokens}<<<GETDELEGATIONTOKENS>>>}},
  1455. the note in {{Delegation}}.
  1456. * {HTTP Query Parameter Dictionary}
  1457. ** {ACL Spec}
  1458. *----------------+-------------------------------------------------------------------+
  1459. || Name | <<<aclspec>>> |
  1460. *----------------+-------------------------------------------------------------------+
  1461. || Description | The ACL spec included in ACL modification operations. |
  1462. *----------------+-------------------------------------------------------------------+
  1463. || Type | String |
  1464. *----------------+-------------------------------------------------------------------+
  1465. || Default Value | \<empty\> |
  1466. *----------------+-------------------------------------------------------------------+
  1467. || Valid Values | See {{{./HdfsPermissionsGuide.html}Permissions and HDFS}}. |
  1468. *----------------+-------------------------------------------------------------------+
  1469. || Syntax | See {{{./HdfsPermissionsGuide.html}Permissions and HDFS}}. |
  1470. *----------------+-------------------------------------------------------------------+
  1471. ** {XAttr Name}
  1472. *----------------+-------------------------------------------------------------------+
  1473. || Name | <<<xattr.name>>> |
  1474. *----------------+-------------------------------------------------------------------+
  1475. || Description | The XAttr name of a file/directory. |
  1476. *----------------+-------------------------------------------------------------------+
  1477. || Type | String |
  1478. *----------------+-------------------------------------------------------------------+
  1479. || Default Value | \<empty\> |
  1480. *----------------+-------------------------------------------------------------------+
  1481. || Valid Values | Any string prefixed with user./trusted./system./security.. |
  1482. *----------------+-------------------------------------------------------------------+
  1483. || Syntax | Any string prefixed with user./trusted./system./security.. |
  1484. *----------------+-------------------------------------------------------------------+
  1485. ** {XAttr Value}
  1486. *----------------+-------------------------------------------------------------------+
  1487. || Name | <<<xattr.value>>> |
  1488. *----------------+-------------------------------------------------------------------+
  1489. || Description | The XAttr value of a file/directory. |
  1490. *----------------+-------------------------------------------------------------------+
  1491. || Type | String |
  1492. *----------------+-------------------------------------------------------------------+
  1493. || Default Value | \<empty\> |
  1494. *----------------+-------------------------------------------------------------------+
  1495. || Valid Values | An encoded value. |
  1496. *----------------+-------------------------------------------------------------------+
  1497. || Syntax | Enclosed in double quotes or prefixed with 0x or 0s. |
  1498. *----------------+-------------------------------------------------------------------+
  1499. See also:
  1500. {{{./ExtendedAttributes.html}Extended Attributes}}
  1501. ** {XAttr set flag}
  1502. *----------------+-------------------------------------------------------------------+
  1503. || Name | <<<flag>>> |
  1504. *----------------+-------------------------------------------------------------------+
  1505. || Description | The XAttr set flag. |
  1506. *----------------+-------------------------------------------------------------------+
  1507. || Type | String |
  1508. *----------------+-------------------------------------------------------------------+
  1509. || Default Value | \<empty\> |
  1510. *----------------+-------------------------------------------------------------------+
  1511. || Valid Values | CREATE,REPLACE. |
  1512. *----------------+-------------------------------------------------------------------+
  1513. || Syntax | CREATE,REPLACE. |
  1514. *----------------+-------------------------------------------------------------------+
  1515. See also:
  1516. {{{./ExtendedAttributes.html}Extended Attributes}}
  1517. ** {XAttr value encoding}
  1518. *----------------+-------------------------------------------------------------------+
  1519. || Name | <<<encoding>>> |
  1520. *----------------+-------------------------------------------------------------------+
  1521. || Description | The XAttr value encoding. |
  1522. *----------------+-------------------------------------------------------------------+
  1523. || Type | String |
  1524. *----------------+-------------------------------------------------------------------+
  1525. || Default Value | \<empty\> |
  1526. *----------------+-------------------------------------------------------------------+
  1527. || Valid Values | text \| hex \| base64 |
  1528. *----------------+-------------------------------------------------------------------+
  1529. || Syntax | text \| hex \| base64 |
  1530. *----------------+-------------------------------------------------------------------+
  1531. See also:
  1532. {{{./ExtendedAttributes.html}Extended Attributes}}
  1533. ** {Access Time}
  1534. *----------------+-------------------------------------------------------------------+
  1535. || Name | <<<accesstime>>> |
  1536. *----------------+-------------------------------------------------------------------+
  1537. || Description | The access time of a file/directory. |
  1538. *----------------+-------------------------------------------------------------------+
  1539. || Type | long |
  1540. *----------------+-------------------------------------------------------------------+
  1541. || Default Value | -1 (means keeping it unchanged) |
  1542. *----------------+-------------------------------------------------------------------+
  1543. || Valid Values | -1 or a timestamp |
  1544. *----------------+-------------------------------------------------------------------+
  1545. || Syntax | Any integer. |
  1546. *----------------+-------------------------------------------------------------------+
  1547. See also:
  1548. {{{Set Access or Modification Time}<<<SETTIMES>>>}}
  1549. ** {Block Size}
  1550. *----------------+-------------------------------------------------------------------+
  1551. || Name | <<<blocksize>>> |
  1552. *----------------+-------------------------------------------------------------------+
  1553. || Description | The block size of a file. |
  1554. *----------------+-------------------------------------------------------------------+
  1555. || Type | long |
  1556. *----------------+-------------------------------------------------------------------+
  1557. || Default Value | Specified in the configuration. |
  1558. *----------------+-------------------------------------------------------------------+
  1559. || Valid Values | \> 0 |
  1560. *----------------+-------------------------------------------------------------------+
  1561. || Syntax | Any integer. |
  1562. *----------------+-------------------------------------------------------------------+
  1563. See also:
  1564. {{{Create and Write to a File}<<<CREATE>>>}}
  1565. ** {Buffer Size}
  1566. *----------------+-------------------------------------------------------------------+
  1567. || Name | <<<buffersize>>> |
  1568. *----------------+-------------------------------------------------------------------+
  1569. || Description | The size of the buffer used in transferring data. |
  1570. *----------------+-------------------------------------------------------------------+
  1571. || Type | int |
  1572. *----------------+-------------------------------------------------------------------+
  1573. || Default Value | Specified in the configuration. |
  1574. *----------------+-------------------------------------------------------------------+
  1575. || Valid Values | \> 0 |
  1576. *----------------+-------------------------------------------------------------------+
  1577. || Syntax | Any integer. |
  1578. *----------------+-------------------------------------------------------------------+
  1579. See also:
  1580. {{{Create and Write to a File}<<<CREATE>>>}},
  1581. {{{Append to a File}<<<APPEND>>>}},
  1582. {{{Open and Read a File}<<<OPEN>>>}}
  1583. ** {Create Parent}
  1584. *----------------+-------------------------------------------------------------------+
  1585. || Name | <<<createparent>>> |
  1586. *----------------+-------------------------------------------------------------------+
  1587. || Description | If the parent directories do not exist, should they be created? |
  1588. *----------------+-------------------------------------------------------------------+
  1589. || Type | boolean |
  1590. *----------------+-------------------------------------------------------------------+
  1591. || Default Value | false |
  1592. *----------------+-------------------------------------------------------------------+
  1593. || Valid Values | true | false |
  1594. *----------------+-------------------------------------------------------------------+
  1595. || Syntax | true | false |
  1596. *----------------+-------------------------------------------------------------------+
  1597. See also:
  1598. {{{Create a Symbolic Link}<<<CREATESYMLINK>>>}}
  1599. ** {Delegation}
  1600. *----------------+-------------------------------------------------------------------+
  1601. || Name | <<<delegation>>> |
  1602. *----------------+-------------------------------------------------------------------+
  1603. || Description | The delegation token used for authentication. |
  1604. *----------------+-------------------------------------------------------------------+
  1605. || Type | String |
  1606. *----------------+-------------------------------------------------------------------+
  1607. || Default Value | \<empty\> |
  1608. *----------------+-------------------------------------------------------------------+
  1609. || Valid Values | An encoded token. |
  1610. *----------------+-------------------------------------------------------------------+
  1611. || Syntax | See the note below. |
  1612. *----------------+-------------------------------------------------------------------+
  1613. <<Note>> that delegation tokens are encoded as a URL safe string;
  1614. see <<<encodeToUrlString()>>>
  1615. and <<<decodeFromUrlString(String)>>>
  1616. in <<<org.apache.hadoop.security.token.Token>>> for the details of the encoding.
  1617. See also:
  1618. {{Authentication}}
  1619. ** {Destination}
  1620. *----------------+-------------------------------------------------------------------+
  1621. || Name | <<<destination>>> |
  1622. *----------------+-------------------------------------------------------------------+
  1623. || Description | The destination path. |
  1624. *----------------+-------------------------------------------------------------------+
  1625. || Type | Path |
  1626. *----------------+-------------------------------------------------------------------+
  1627. || Default Value | \<empty\> (an invalid path) |
  1628. *----------------+-------------------------------------------------------------------+
  1629. || Valid Values | An absolute FileSystem path without scheme and authority. |
  1630. *----------------+-------------------------------------------------------------------+
  1631. || Syntax | Any path. |
  1632. *----------------+-------------------------------------------------------------------+
  1633. See also:
  1634. {{{Create a Symbolic Link}<<<CREATESYMLINK>>>}},
  1635. {{{Rename a File/Directory}<<<RENAME>>>}}
  1636. ** {Do As}
  1637. *----------------+-------------------------------------------------------------------+
  1638. || Name | <<<doas>>> |
  1639. *----------------+-------------------------------------------------------------------+
  1640. || Description | Allowing a proxy user to do as another user. |
  1641. *----------------+-------------------------------------------------------------------+
  1642. || Type | String |
  1643. *----------------+-------------------------------------------------------------------+
  1644. || Default Value | null |
  1645. *----------------+-------------------------------------------------------------------+
  1646. || Valid Values | Any valid username. |
  1647. *----------------+-------------------------------------------------------------------+
  1648. || Syntax | Any string. |
  1649. *----------------+-------------------------------------------------------------------+
  1650. See also:
  1651. {{Proxy Users}}
  1652. ** {Fs Action}
  1653. *----------------+-------------------------------------------------------------------+
  1654. || Name | <<<fsaction>>> |
  1655. *----------------+-------------------------------------------------------------------+
  1656. || Description | File system operation read/write/execute |
  1657. *----------------+-------------------------------------------------------------------+
  1658. || Type | String |
  1659. *----------------+-------------------------------------------------------------------+
  1660. || Default Value | null (an invalid value) |
  1661. *----------------+-------------------------------------------------------------------+
  1662. || Valid Values | Strings matching regex pattern \"[rwx-]\{3\}\" |
  1663. *----------------+-------------------------------------------------------------------+
  1664. || Syntax | \"[rwx-]\{3\}\" |
  1665. *----------------+-------------------------------------------------------------------+
  1666. See also:
  1667. {{{Check access}<<<CHECKACCESS>>>}},
  1668. ** {Group}
  1669. *----------------+-------------------------------------------------------------------+
  1670. || Name | <<<group>>> |
  1671. *----------------+-------------------------------------------------------------------+
  1672. || Description | The name of a group. |
  1673. *----------------+-------------------------------------------------------------------+
  1674. || Type | String |
  1675. *----------------+-------------------------------------------------------------------+
  1676. || Default Value | \<empty\> (means keeping it unchanged) |
  1677. *----------------+-------------------------------------------------------------------+
  1678. || Valid Values | Any valid group name. |
  1679. *----------------+-------------------------------------------------------------------+
  1680. || Syntax | Any string. |
  1681. *----------------+-------------------------------------------------------------------+
  1682. See also:
  1683. {{{Set Owner}<<<SETOWNER>>>}}
  1684. ** {Length}
  1685. *----------------+-------------------------------------------------------------------+
  1686. || Name | <<<length>>> |
  1687. *----------------+-------------------------------------------------------------------+
  1688. || Description | The number of bytes to be processed. |
  1689. *----------------+-------------------------------------------------------------------+
  1690. || Type | long |
  1691. *----------------+-------------------------------------------------------------------+
  1692. || Default Value | null (means the entire file) |
  1693. *----------------+-------------------------------------------------------------------+
  1694. || Valid Values | \>= 0 or null |
  1695. *----------------+-------------------------------------------------------------------+
  1696. || Syntax | Any integer. |
  1697. *----------------+-------------------------------------------------------------------+
  1698. See also:
  1699. {{{Open and Read a File}<<<OPEN>>>}}
  1700. ** {Modification Time}
  1701. *----------------+-------------------------------------------------------------------+
  1702. || Name | <<<modificationtime>>> |
  1703. *----------------+-------------------------------------------------------------------+
  1704. || Description | The modification time of a file/directory. |
  1705. *----------------+-------------------------------------------------------------------+
  1706. || Type | long |
  1707. *----------------+-------------------------------------------------------------------+
  1708. || Default Value | -1 (means keeping it unchanged) |
  1709. *----------------+-------------------------------------------------------------------+
  1710. || Valid Values | -1 or a timestamp |
  1711. *----------------+-------------------------------------------------------------------+
  1712. || Syntax | Any integer. |
  1713. *----------------+-------------------------------------------------------------------+
  1714. See also:
  1715. {{{Set Access or Modification Time}<<<SETTIMES>>>}}
  1716. ** {Offset}
  1717. *----------------+-------------------------------------------------------------------+
  1718. || Name | <<<offset>>> |
  1719. *----------------+-------------------------------------------------------------------+
  1720. || Description | The starting byte position. |
  1721. *----------------+-------------------------------------------------------------------+
  1722. || Type | long |
  1723. *----------------+-------------------------------------------------------------------+
  1724. || Default Value | 0 |
  1725. *----------------+-------------------------------------------------------------------+
  1726. || Valid Values | \>= 0 |
  1727. *----------------+-------------------------------------------------------------------+
  1728. || Syntax | Any integer. |
  1729. *----------------+-------------------------------------------------------------------+
  1730. See also:
  1731. {{{Open and Read a File}<<<OPEN>>>}}
  1732. ** {Old Snapshot Name}
  1733. *----------------+-------------------------------------------------------------------+
  1734. || Name | <<<oldsnapshotname>>> |
  1735. *----------------+-------------------------------------------------------------------+
  1736. || Description | The old name of the snapshot to be renamed. |
  1737. *----------------+-------------------------------------------------------------------+
  1738. || Type | String |
  1739. *----------------+-------------------------------------------------------------------+
  1740. || Default Value | null |
  1741. *----------------+-------------------------------------------------------------------+
  1742. || Valid Values | An existing snapshot name. |
  1743. *----------------+-------------------------------------------------------------------+
  1744. || Syntax | Any string. |
  1745. *----------------+-------------------------------------------------------------------+
  1746. See also:
  1747. {{{Rename Snapshot}<<<RENAMESNAPSHOT>>>}}
  1748. ** {Op}
  1749. *----------------+-------------------------------------------------------------------+
  1750. || Name | <<<op>>> |
  1751. *----------------+-------------------------------------------------------------------+
  1752. || Description | The name of the operation to be executed. |
  1753. *----------------+-------------------------------------------------------------------+
  1754. || Type | enum |
  1755. *----------------+-------------------------------------------------------------------+
  1756. || Default Value | null (an invalid value) |
  1757. *----------------+-------------------------------------------------------------------+
  1758. || Valid Values | Any valid operation name. |
  1759. *----------------+-------------------------------------------------------------------+
  1760. || Syntax | Any string. |
  1761. *----------------+-------------------------------------------------------------------+
  1762. See also:
  1763. {{Operations}}
  1764. ** {Overwrite}
  1765. *----------------+-------------------------------------------------------------------+
  1766. || Name | <<<overwrite>>> |
  1767. *----------------+-------------------------------------------------------------------+
  1768. || Description | If a file already exists, should it be overwritten? |
  1769. *----------------+-------------------------------------------------------------------+
  1770. || Type | boolean |
  1771. *----------------+-------------------------------------------------------------------+
  1772. || Default Value | false |
  1773. *----------------+-------------------------------------------------------------------+
  1774. || Valid Values | true | false |
  1775. *----------------+-------------------------------------------------------------------+
  1776. || Syntax | true | false |
  1777. *----------------+-------------------------------------------------------------------+
  1778. See also:
  1779. {{{Create and Write to a File}<<<CREATE>>>}}
  1780. ** {Owner}
  1781. *----------------+-------------------------------------------------------------------+
  1782. || Name | <<<owner>>> |
  1783. *----------------+-------------------------------------------------------------------+
  1784. || Description | The username who is the owner of a file/directory. |
  1785. *----------------+-------------------------------------------------------------------+
  1786. || Type | String |
  1787. *----------------+-------------------------------------------------------------------+
  1788. || Default Value | \<empty\> (means keeping it unchanged) |
  1789. *----------------+-------------------------------------------------------------------+
  1790. || Valid Values | Any valid username. |
  1791. *----------------+-------------------------------------------------------------------+
  1792. || Syntax | Any string. |
  1793. *----------------+-------------------------------------------------------------------+
  1794. See also:
  1795. {{{Set Owner}<<<SETOWNER>>>}}
  1796. ** {Permission}
  1797. *----------------+-------------------------------------------------------------------+
  1798. || Name | <<<permission>>> |
  1799. *----------------+-------------------------------------------------------------------+
  1800. || Description | The permission of a file/directory. |
  1801. *----------------+-------------------------------------------------------------------+
  1802. || Type | Octal |
  1803. *----------------+-------------------------------------------------------------------+
  1804. || Default Value | 755 |
  1805. *----------------+-------------------------------------------------------------------+
  1806. || Valid Values | 0 - 1777 |
  1807. *----------------+-------------------------------------------------------------------+
  1808. || Syntax | Any radix-8 integer (leading zeros may be omitted.) |
  1809. *----------------+-------------------------------------------------------------------+
  1810. See also:
  1811. {{{Create and Write to a File}<<<CREATE>>>}},
  1812. {{{Make a Directory}<<<MKDIRS>>>}},
  1813. {{{Set Permission}<<<SETPERMISSION>>>}}
  1814. ** {Recursive}
  1815. *----------------+-------------------------------------------------------------------+
  1816. || Name | <<<recursive>>> |
  1817. *----------------+-------------------------------------------------------------------+
  1818. || Description | Should the operation act on the content in the subdirectories? |
  1819. *----------------+-------------------------------------------------------------------+
  1820. || Type | boolean |
  1821. *----------------+-------------------------------------------------------------------+
  1822. || Default Value | false |
  1823. *----------------+-------------------------------------------------------------------+
  1824. || Valid Values | true | false |
  1825. *----------------+-------------------------------------------------------------------+
  1826. || Syntax | true | false |
  1827. *----------------+-------------------------------------------------------------------+
  1828. See also:
  1829. {{{Rename a File/Directory}<<<RENAME>>>}}
  1830. ** {Renewer}
  1831. *----------------+-------------------------------------------------------------------+
  1832. || Name | <<<renewer>>> |
  1833. *----------------+-------------------------------------------------------------------+
  1834. || Description | The username of the renewer of a delegation token. |
  1835. *----------------+-------------------------------------------------------------------+
  1836. || Type | String |
  1837. *----------------+-------------------------------------------------------------------+
  1838. || Default Value | \<empty\> (means the current user) |
  1839. *----------------+-------------------------------------------------------------------+
  1840. || Valid Values | Any valid username. |
  1841. *----------------+-------------------------------------------------------------------+
  1842. || Syntax | Any string. |
  1843. *----------------+-------------------------------------------------------------------+
  1844. See also:
  1845. {{{Get Delegation Token}<<<GETDELEGATIONTOKEN>>>}},
  1846. {{{Get Delegation Tokens}<<<GETDELEGATIONTOKENS>>>}}
  1847. ** {Replication}
  1848. *----------------+-------------------------------------------------------------------+
  1849. || Name | <<<replication>>> |
  1850. *----------------+-------------------------------------------------------------------+
  1851. || Description | The number of replications of a file. |
  1852. *----------------+-------------------------------------------------------------------+
  1853. || Type | short |
  1854. *----------------+-------------------------------------------------------------------+
  1855. || Default Value | Specified in the configuration. |
  1856. *----------------+-------------------------------------------------------------------+
  1857. || Valid Values | \> 0 |
  1858. *----------------+-------------------------------------------------------------------+
  1859. || Syntax | Any integer. |
  1860. *----------------+-------------------------------------------------------------------+
  1861. See also:
  1862. {{{Create and Write to a File}<<<CREATE>>>}},
  1863. {{{Set Replication Factor}<<<SETREPLICATION>>>}}
  1864. ** {Snapshot Name}
  1865. *----------------+-------------------------------------------------------------------+
  1866. || Name | <<<snapshotname>>> |
  1867. *----------------+-------------------------------------------------------------------+
  1868. || Description | The name of the snapshot to be created/deleted. |
  1869. || | Or the new name for snapshot rename. |
  1870. *----------------+-------------------------------------------------------------------+
  1871. || Type | String |
  1872. *----------------+-------------------------------------------------------------------+
  1873. || Default Value | null |
  1874. *----------------+-------------------------------------------------------------------+
  1875. || Valid Values | Any valid snapshot name. |
  1876. *----------------+-------------------------------------------------------------------+
  1877. || Syntax | Any string. |
  1878. *----------------+-------------------------------------------------------------------+
  1879. See also:
  1880. {{{Create Snapshot}<<<CREATESNAPSHOT>>>}},
  1881. {{{Delete Snapshot}<<<DELETESNAPSHOT>>>}},
  1882. {{{Rename Snapshot}<<<RENAMESNAPSHOT>>>}}
  1883. ** {Sources}
  1884. *----------------+-------------------------------------------------------------------+
  1885. || Name | <<<sources>>> |
  1886. *----------------+-------------------------------------------------------------------+
  1887. || Description | A list of source paths. |
  1888. *----------------+-------------------------------------------------------------------+
  1889. || Type | String |
  1890. *----------------+-------------------------------------------------------------------+
  1891. || Default Value | \<empty\> |
  1892. *----------------+-------------------------------------------------------------------+
  1893. || Valid Values | A list of comma seperated absolute FileSystem paths without scheme and authority. |
  1894. *----------------+-------------------------------------------------------------------+
  1895. || Syntax | Any string. |
  1896. *----------------+-------------------------------------------------------------------+
  1897. See also:
  1898. {{{Concat File(s)}<<<CONCAT>>>}}
  1899. ** {Token}
  1900. *----------------+-------------------------------------------------------------------+
  1901. || Name | <<<token>>> |
  1902. *----------------+-------------------------------------------------------------------+
  1903. || Description | The delegation token used for the operation. |
  1904. *----------------+-------------------------------------------------------------------+
  1905. || Type | String |
  1906. *----------------+-------------------------------------------------------------------+
  1907. || Default Value | \<empty\> |
  1908. *----------------+-------------------------------------------------------------------+
  1909. || Valid Values | An encoded token. |
  1910. *----------------+-------------------------------------------------------------------+
  1911. || Syntax | See the note in {{Delegation}}. |
  1912. *----------------+-------------------------------------------------------------------+
  1913. See also:
  1914. {{{Renew Delegation Token}<<<RENEWDELEGATIONTOKEN>>>}},
  1915. {{{Cancel Delegation Token}<<<CANCELDELEGATIONTOKEN>>>}}
  1916. ** {Username}
  1917. *----------------+-------------------------------------------------------------------+
  1918. || Name | <<<user.name>>> |
  1919. *----------------+-------------------------------------------------------------------+
  1920. || Description | The authenticated user; see {{Authentication}}. |
  1921. *----------------+-------------------------------------------------------------------+
  1922. || Type | String |
  1923. *----------------+-------------------------------------------------------------------+
  1924. || Default Value | null |
  1925. *----------------+-------------------------------------------------------------------+
  1926. || Valid Values | Any valid username. |
  1927. *----------------+-------------------------------------------------------------------+
  1928. || Syntax | Any string. |
  1929. *----------------+-------------------------------------------------------------------+
  1930. See also:
  1931. {{Authentication}}