WebHDFS.apt.vm 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824
  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. \[ {{{./index.html}Go Back}} \]
  19. %{toc|section=1|fromDepth=0}
  20. * {Document Conventions}
  21. *----------------------+-------------------------------------------------------------------------------+
  22. | <<<Monospaced>>> | Used for commands, HTTP request and responses and code blocks. |
  23. *----------------------+-------------------------------------------------------------------------------+
  24. | <<<\<Monospaced\>>>> | User entered values. |
  25. *----------------------+-------------------------------------------------------------------------------+
  26. | <<<[Monospaced]>>> | Optional values. When the value is not specified, the default value is used. |
  27. *----------------------+-------------------------------------------------------------------------------+
  28. | <Italics> | Important phrases and words. |
  29. *----------------------+-------------------------------------------------------------------------------+
  30. * {Introduction}
  31. The HTTP REST API supports the complete
  32. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}/{{{../../api/org/apache/hadoop/fs/FileContext.html}FileContext}}
  33. interface for HDFS.
  34. The operations and the corresponding FileSystem/FileContext methods are shown in the next section.
  35. The Section {{HTTP Query Parameter Dictionary}} specifies the parameter details
  36. such as the defaults and the valid values.
  37. ** {Operations}
  38. * HTTP GET
  39. * {{{Open and Read a File}<<<OPEN>>>}}
  40. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.open)
  41. * {{{Status of a File/Directory}<<<GETFILESTATUS>>>}}
  42. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileStatus)
  43. * {{<<<LISTSTATUS>>>}}
  44. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.listStatus)
  45. * {{{Get Content Summary of a Directory}<<<GETCONTENTSUMMARY>>>}}
  46. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getContentSummary)
  47. * {{{Get File Checksum}<<<GETFILECHECKSUM>>>}}
  48. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileChecksum)
  49. * {{{Get Home Directory}<<<GETHOMEDIRECTORY>>>}}
  50. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getHomeDirectory)
  51. * {{{Get Delegation Token}<<<GETDELEGATIONTOKEN>>>}}
  52. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationToken)
  53. * {{{Get Delegation Tokens}<<<GETDELEGATIONTOKENS>>>}}
  54. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationTokens)
  55. * HTTP PUT
  56. * {{{Create and Write to a File}<<<CREATE>>>}}
  57. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.create)
  58. * {{{Make a Directory}<<<MKDIRS>>>}}
  59. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.mkdirs)
  60. * {{{Create a Symbolic Link}<<<CREATESYMLINK>>>}}
  61. (see {{{../../api/org/apache/hadoop/fs/FileContext.html}FileContext}}.createSymlink)
  62. * {{{Rename a File/Directory}<<<RENAME>>>}}
  63. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.rename)
  64. * {{{Set Replication Factor}<<<SETREPLICATION>>>}}
  65. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setReplication)
  66. * {{{Set Owner}<<<SETOWNER>>>}}
  67. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setOwner)
  68. * {{{Set Permission}<<<SETPERMISSION>>>}}
  69. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setPermission)
  70. * {{{Set Access or Modification Time}<<<SETTIMES>>>}}
  71. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setTimes)
  72. * {{{Renew Delegation Token}<<<RENEWDELEGATIONTOKEN>>>}}
  73. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.renewDelegationToken)
  74. * {{{Cancel Delegation Token}<<<CANCELDELEGATIONTOKEN>>>}}
  75. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.cancelDelegationToken)
  76. * HTTP POST
  77. * {{{Append to a File}<<<APPEND>>>}}
  78. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.append)
  79. * {{{Concatenate Files}<<<CONCAT>>>}}
  80. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.concat)
  81. * HTTP DELETE
  82. * {{{Delete a File/Directory}<<<DELETE>>>}}
  83. (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.delete)
  84. ** {FileSystem URIs vs HTTP URLs}
  85. The FileSystem scheme of WebHDFS is "<<<webhdfs://>>>".
  86. A WebHDFS FileSystem URI has the following format.
  87. +---------------------------------
  88. webhdfs://<HOST>:<HTTP_PORT>/<PATH>
  89. +---------------------------------
  90. The above WebHDFS URI corresponds to the below HDFS URI.
  91. +---------------------------------
  92. hdfs://<HOST>:<RPC_PORT>/<PATH>
  93. +---------------------------------
  94. In the REST API, the prefix "<<</webhdfs/v1>>>" is inserted in the path and a query is appended at the end.
  95. Therefore, the corresponding HTTP URL has the following format.
  96. +---------------------------------
  97. http://<HOST>:<HTTP_PORT>/webhdfs/v1/<PATH>?op=...
  98. +---------------------------------
  99. ** {HDFS Configuration Options}
  100. Below are the HDFS configuration options for WebHDFS.
  101. *-------------------------------------------------+---------------------------------------------------+
  102. || Property Name || Description |
  103. *-------------------------------------------------+---------------------------------------------------+
  104. | <<<dfs.webhdfs.enabled >>> | Enable/disable WebHDFS in Namenodes and Datanodes |
  105. *-------------------------------------------------+---------------------------------------------------+
  106. | <<<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. |
  107. *-------------------------------------------------+---------------------------------------------------+
  108. | <<<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. |
  109. *-------------------------------------------------+---------------------------------------------------+
  110. * {Authentication}
  111. When security is <off>, the authenticated user is the username specified in the <<<user.name>>> query parameter.
  112. If the <<<user.name>>> parameter is not set,
  113. the server may either set the authenticated user to a default web user, if there is any, or return an error response.
  114. When security is <on>, authentication is performed by either Hadoop delegation token or Kerberos SPNEGO.
  115. If a token is set in the <<<delegation>>> query parameter, the authenticated user is the user encoded in the token.
  116. If the <<<delegation>>> parameter is not set, the user is authenticated by Kerberos SPNEGO.
  117. Below are examples using the <<<curl>>> command tool.
  118. [[1]] Authentication when security is off:
  119. +---------------------------------
  120. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?[user.name=<USER>&]op=..."
  121. +---------------------------------
  122. [[1]] Authentication using Kerberos SPNEGO when security is on:
  123. +---------------------------------
  124. curl -i --negotiate -u : "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=..."
  125. +---------------------------------
  126. [[1]] Authentication using Hadoop delegation token when security is on:
  127. +---------------------------------
  128. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?delegation=<TOKEN>&op=..."
  129. +---------------------------------
  130. []
  131. See also: {{{../hadoop-common/HttpAuthentication.html}Authentication for Hadoop HTTP web-consoles}}
  132. * {Proxy Users}
  133. When the proxy user feature is enabled, a proxy user <P> may submit a request on behalf of another user <U>.
  134. The username of <U> must be specified in the <<<doas>>> query parameter unless a delegation token is presented in authentication.
  135. In such case, the information of both users <P> and <U> must be encoded in the delegation token.
  136. [[1]] A proxy request when security is off:
  137. +---------------------------------
  138. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?[user.name=<USER>&]doas=<USER>&op=..."
  139. +---------------------------------
  140. [[1]] A proxy request using Kerberos SPNEGO when security is on:
  141. +---------------------------------
  142. curl -i --negotiate -u : "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?doas=<USER>&op=..."
  143. +---------------------------------
  144. [[1]] A proxy request using Hadoop delegation token when security is on:
  145. +---------------------------------
  146. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?delegation=<TOKEN>&op=..."
  147. +---------------------------------
  148. * {File and Directory Operations}
  149. ** {Create and Write to a File}
  150. * Step 1: Submit a HTTP PUT request without automatically following redirects and without sending the file data.
  151. +---------------------------------
  152. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CREATE
  153. [&overwrite=<true|false>][&blocksize=<LONG>][&replication=<SHORT>]
  154. [&permission=<OCTAL>][&buffersize=<INT>]"
  155. +---------------------------------
  156. The request is redirected to a datanode where the file data is to be written:
  157. +---------------------------------
  158. HTTP/1.1 307 TEMPORARY_REDIRECT
  159. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE...
  160. Content-Length: 0
  161. +---------------------------------
  162. * Step 2: Submit another HTTP PUT request using the URL in the <<<Location>>> header with the file data to be written.
  163. +---------------------------------
  164. curl -i -X PUT -T <LOCAL_FILE> "http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=CREATE..."
  165. +---------------------------------
  166. The client receives a <<<201 Created>>> response with zero content length
  167. and the WebHDFS URI of the file in the <<<Location>>> header:
  168. +---------------------------------
  169. HTTP/1.1 201 Created
  170. Location: webhdfs://<HOST>:<PORT>/<PATH>
  171. Content-Length: 0
  172. +---------------------------------
  173. []
  174. <<Note>> that the reason of having two-step create/append is
  175. for preventing clients to send out data before the redirect.
  176. This issue is addressed by the "<<<Expect: 100-continue>>>" header in HTTP/1.1;
  177. see {{{http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3}RFC 2616, Section 8.2.3}}.
  178. Unfortunately, there are software library bugs (e.g. Jetty 6 HTTP server and Java 6 HTTP client),
  179. which do not correctly implement "<<<Expect: 100-continue>>>".
  180. The two-step create/append is a temporary workaround for the software library bugs.
  181. See also:
  182. {{{Overwrite}<<<overwrite>>>}},
  183. {{{Block Size}<<<blocksize>>>}},
  184. {{{Replication}<<<replication>>>}},
  185. {{{Permission}<<<permission>>>}},
  186. {{{Buffer Size}<<<buffersize>>>}},
  187. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.create
  188. ** {Append to a File}
  189. * Step 1: Submit a HTTP POST request without automatically following redirects and without sending the file data.
  190. +---------------------------------
  191. curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=APPEND[&buffersize=<INT>]"
  192. +---------------------------------
  193. The request is redirected to a datanode where the file data is to be appended:
  194. +---------------------------------
  195. HTTP/1.1 307 TEMPORARY_REDIRECT
  196. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=APPEND...
  197. Content-Length: 0
  198. +---------------------------------
  199. * Step 2: Submit another HTTP POST request using the URL in the <<<Location>>> header with the file data to be appended.
  200. +---------------------------------
  201. curl -i -X POST -T <LOCAL_FILE> "http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=APPEND..."
  202. +---------------------------------
  203. The client receives a response with zero content length:
  204. +---------------------------------
  205. HTTP/1.1 200 OK
  206. Content-Length: 0
  207. +---------------------------------
  208. []
  209. See the note in the previous section for the description of why this operation requires two steps.
  210. See also:
  211. {{{Buffer Size}<<<buffersize>>>}},
  212. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.append
  213. ** {Concat File(s)}
  214. * Submit a HTTP POST request.
  215. +---------------------------------
  216. curl -i -X POST "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=CONCAT&sources=<PATHS>"
  217. +---------------------------------
  218. The client receives a response with zero content length:
  219. +---------------------------------
  220. HTTP/1.1 200 OK
  221. Content-Length: 0
  222. +---------------------------------
  223. []
  224. See also:
  225. {{{Sources}<<<sources>>>}},
  226. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.concat
  227. ** {Open and Read a File}
  228. * Submit a HTTP GET request with automatically following redirects.
  229. +---------------------------------
  230. curl -i -L "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=OPEN
  231. [&offset=<LONG>][&length=<LONG>][&buffersize=<INT>]"
  232. +---------------------------------
  233. The request is redirected to a datanode where the file data can be read:
  234. +---------------------------------
  235. HTTP/1.1 307 TEMPORARY_REDIRECT
  236. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=OPEN...
  237. Content-Length: 0
  238. +---------------------------------
  239. The client follows the redirect to the datanode and receives the file data:
  240. +---------------------------------
  241. HTTP/1.1 200 OK
  242. Content-Type: application/octet-stream
  243. Content-Length: 22
  244. Hello, webhdfs user!
  245. +---------------------------------
  246. []
  247. See also:
  248. {{{Offset}<<<offset>>>}},
  249. {{{Length}<<<length>>>}},
  250. {{{Buffer Size}<<<buffersize>>>}},
  251. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.open
  252. ** {Make a Directory}
  253. * Submit a HTTP PUT request.
  254. +---------------------------------
  255. curl -i -X PUT "http://<HOST>:<PORT>/<PATH>?op=MKDIRS[&permission=<OCTAL>]"
  256. +---------------------------------
  257. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  258. +---------------------------------
  259. HTTP/1.1 200 OK
  260. Content-Type: application/json
  261. Transfer-Encoding: chunked
  262. {"boolean": true}
  263. +---------------------------------
  264. []
  265. See also:
  266. {{{Permission}<<<permission>>>}},
  267. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.mkdirs
  268. ** {Create a Symbolic Link}
  269. * Submit a HTTP PUT request.
  270. +---------------------------------
  271. curl -i -X PUT "http://<HOST>:<PORT>/<PATH>?op=CREATESYMLINK
  272. &destination=<PATH>[&createParent=<true|false>]"
  273. +---------------------------------
  274. The client receives a response with zero content length:
  275. +---------------------------------
  276. HTTP/1.1 200 OK
  277. Content-Length: 0
  278. +---------------------------------
  279. []
  280. See also:
  281. {{{Destination}<<<destination>>>}},
  282. {{{Create Parent}<<<createParent>>>}},
  283. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.createSymlink
  284. ** {Rename a File/Directory}
  285. * Submit a HTTP PUT request.
  286. +---------------------------------
  287. curl -i -X PUT "<HOST>:<PORT>/webhdfs/v1/<PATH>?op=RENAME&destination=<PATH>"
  288. +---------------------------------
  289. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  290. +---------------------------------
  291. HTTP/1.1 200 OK
  292. Content-Type: application/json
  293. Transfer-Encoding: chunked
  294. {"boolean": true}
  295. +---------------------------------
  296. []
  297. See also:
  298. {{{Destination}<<<destination>>>}},
  299. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.rename
  300. ** {Delete a File/Directory}
  301. * Submit a HTTP DELETE request.
  302. +---------------------------------
  303. curl -i -X DELETE "http://<host>:<port>/webhdfs/v1/<path>?op=DELETE
  304. [&recursive=<true|false>]"
  305. +---------------------------------
  306. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  307. +---------------------------------
  308. HTTP/1.1 200 OK
  309. Content-Type: application/json
  310. Transfer-Encoding: chunked
  311. {"boolean": true}
  312. +---------------------------------
  313. []
  314. See also:
  315. {{{Recursive}<<<recursive>>>}},
  316. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.delete
  317. ** {Status of a File/Directory}
  318. * Submit a HTTP GET request.
  319. +---------------------------------
  320. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETFILESTATUS"
  321. +---------------------------------
  322. The client receives a response with a {{{FileStatus JSON Schema}<<<FileStatus>>> JSON object}}:
  323. +---------------------------------
  324. HTTP/1.1 200 OK
  325. Content-Type: application/json
  326. Transfer-Encoding: chunked
  327. {
  328. "FileStatus":
  329. {
  330. "accessTime" : 0,
  331. "blockSize" : 0,
  332. "group" : "supergroup",
  333. "length" : 0, //in bytes, zero for directories
  334. "modificationTime": 1320173277227,
  335. "owner" : "webuser",
  336. "pathSuffix" : "",
  337. "permission" : "777",
  338. "replication" : 0,
  339. "type" : "DIRECTORY" //enum {FILE, DIRECTORY, SYMLINK}
  340. }
  341. }
  342. +---------------------------------
  343. []
  344. See also:
  345. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileStatus
  346. ** {List a Directory}
  347. * Submit a HTTP GET request.
  348. +---------------------------------
  349. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=LISTSTATUS"
  350. +---------------------------------
  351. The client receives a response with a {{{FileStatuses JSON Schema}<<<FileStatuses>>> JSON object}}:
  352. +---------------------------------
  353. HTTP/1.1 200 OK
  354. Content-Type: application/json
  355. Content-Length: 427
  356. {
  357. "FileStatuses":
  358. {
  359. "FileStatus":
  360. [
  361. {
  362. "accessTime" : 1320171722771,
  363. "blockSize" : 33554432,
  364. "group" : "supergroup",
  365. "length" : 24930,
  366. "modificationTime": 1320171722771,
  367. "owner" : "webuser",
  368. "pathSuffix" : "a.patch",
  369. "permission" : "644",
  370. "replication" : 1,
  371. "type" : "FILE"
  372. },
  373. {
  374. "accessTime" : 0,
  375. "blockSize" : 0,
  376. "group" : "supergroup",
  377. "length" : 0,
  378. "modificationTime": 1320895981256,
  379. "owner" : "szetszwo",
  380. "pathSuffix" : "bar",
  381. "permission" : "711",
  382. "replication" : 0,
  383. "type" : "DIRECTORY"
  384. },
  385. ...
  386. ]
  387. }
  388. }
  389. +---------------------------------
  390. []
  391. See also:
  392. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.listStatus
  393. * {Other File System Operations}
  394. ** {Get Content Summary of a Directory}
  395. * Submit a HTTP GET request.
  396. +---------------------------------
  397. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETCONTENTSUMMARY"
  398. +---------------------------------
  399. The client receives a response with a {{{ContentSummary JSON Schema}<<<ContentSummary>>> JSON object}}:
  400. +---------------------------------
  401. HTTP/1.1 200 OK
  402. Content-Type: application/json
  403. Transfer-Encoding: chunked
  404. {
  405. "ContentSummary":
  406. {
  407. "directoryCount": 2,
  408. "fileCount" : 1,
  409. "length" : 24930,
  410. "quota" : -1,
  411. "spaceConsumed" : 24930,
  412. "spaceQuota" : -1
  413. }
  414. }
  415. +---------------------------------
  416. []
  417. See also:
  418. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getContentSummary
  419. ** {Get File Checksum}
  420. * Submit a HTTP GET request.
  421. +---------------------------------
  422. curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETFILECHECKSUM"
  423. +---------------------------------
  424. The request is redirected to a datanode:
  425. +---------------------------------
  426. HTTP/1.1 307 TEMPORARY_REDIRECT
  427. Location: http://<DATANODE>:<PORT>/webhdfs/v1/<PATH>?op=GETFILECHECKSUM...
  428. Content-Length: 0
  429. +---------------------------------
  430. The client follows the redirect to the datanode and receives a {{{FileChecksum JSON Schema}<<<FileChecksum>>> JSON object}}:
  431. +---------------------------------
  432. HTTP/1.1 200 OK
  433. Content-Type: application/json
  434. Transfer-Encoding: chunked
  435. {
  436. "FileChecksum":
  437. {
  438. "algorithm": "MD5-of-1MD5-of-512CRC32",
  439. "bytes" : "eadb10de24aa315748930df6e185c0d ...",
  440. "length" : 28
  441. }
  442. }
  443. +---------------------------------
  444. []
  445. See also:
  446. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getFileChecksum
  447. ** {Get Home Directory}
  448. * Submit a HTTP GET request.
  449. +---------------------------------
  450. curl -i "http://<HOST>:<PORT>/webhdfs/v1/?op=GETHOMEDIRECTORY"
  451. +---------------------------------
  452. The client receives a response with a {{{Path JSON Schema}<<<Path>>> JSON object}}:
  453. +---------------------------------
  454. HTTP/1.1 200 OK
  455. Content-Type: application/json
  456. Transfer-Encoding: chunked
  457. {"Path": "/user/szetszwo"}
  458. +---------------------------------
  459. []
  460. See also:
  461. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getHomeDirectory
  462. ** {Set Permission}
  463. * Submit a HTTP PUT request.
  464. +---------------------------------
  465. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETPERMISSION
  466. [&permission=<OCTAL>]"
  467. +---------------------------------
  468. The client receives a response with zero content length:
  469. +---------------------------------
  470. HTTP/1.1 200 OK
  471. Content-Length: 0
  472. +---------------------------------
  473. []
  474. See also:
  475. {{{Permission}<<<permission>>>}},
  476. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setPermission
  477. ** {Set Owner}
  478. * Submit a HTTP PUT request.
  479. +---------------------------------
  480. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETOWNER
  481. [&owner=<USER>][&group=<GROUP>]"
  482. +---------------------------------
  483. The client receives a response with zero content length:
  484. +---------------------------------
  485. HTTP/1.1 200 OK
  486. Content-Length: 0
  487. +---------------------------------
  488. []
  489. See also:
  490. {{{Owner}<<<owner>>>}},
  491. {{{Group}<<<group>>>}},
  492. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setOwner
  493. ** {Set Replication Factor}
  494. * Submit a HTTP PUT request.
  495. +---------------------------------
  496. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETREPLICATION
  497. [&replication=<SHORT>]"
  498. +---------------------------------
  499. The client receives a response with a {{{Boolean JSON Schema}<<<boolean>>> JSON object}}:
  500. +---------------------------------
  501. HTTP/1.1 200 OK
  502. Content-Type: application/json
  503. Transfer-Encoding: chunked
  504. {"boolean": true}
  505. +---------------------------------
  506. []
  507. See also:
  508. {{{Replication}<<<replication>>>}},
  509. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setReplication
  510. ** {Set Access or Modification Time}
  511. * Submit a HTTP PUT request.
  512. +---------------------------------
  513. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=SETTIMES
  514. [&modificationtime=<TIME>][&accesstime=<TIME>]"
  515. +---------------------------------
  516. The client receives a response with zero content length:
  517. +---------------------------------
  518. HTTP/1.1 200 OK
  519. Content-Length: 0
  520. +---------------------------------
  521. []
  522. See also:
  523. {{{Modification Time}<<<modificationtime>>>}},
  524. {{{Access Time}<<<accesstime>>>}},
  525. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.setTimes
  526. * {Delegation Token Operations}
  527. ** {Get Delegation Token}
  528. * Submit a HTTP GET request.
  529. +---------------------------------
  530. curl -i "http://<HOST>:<PORT>/webhdfs/v1/?op=GETDELEGATIONTOKEN&renewer=<USER>"
  531. +---------------------------------
  532. The client receives a response with a {{{Token JSON Schema}<<<Token>>> JSON object}}:
  533. +---------------------------------
  534. HTTP/1.1 200 OK
  535. Content-Type: application/json
  536. Transfer-Encoding: chunked
  537. {
  538. "Token":
  539. {
  540. "urlString": "JQAIaG9y..."
  541. }
  542. }
  543. +---------------------------------
  544. []
  545. See also:
  546. {{{Renewer}<<<renewer>>>}},
  547. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationToken
  548. ** {Get Delegation Tokens}
  549. * Submit a HTTP GET request.
  550. +---------------------------------
  551. curl -i "http://<HOST>:<PORT>/webhdfs/v1/?op=GETDELEGATIONTOKENS&renewer=<USER>"
  552. +---------------------------------
  553. The client receives a response with a {{{Tokens JSON Schema}<<<Tokens>>> JSON object}}:
  554. +---------------------------------
  555. HTTP/1.1 200 OK
  556. Content-Type: application/json
  557. Transfer-Encoding: chunked
  558. {
  559. "Tokens":
  560. {
  561. "Token":
  562. [
  563. {
  564. "urlString":"KAAKSm9i ..."
  565. }
  566. ]
  567. }
  568. }
  569. +---------------------------------
  570. []
  571. See also:
  572. {{{Renewer}<<<renewer>>>}},
  573. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.getDelegationTokens
  574. ** {Renew Delegation Token}
  575. * Submit a HTTP PUT request.
  576. +---------------------------------
  577. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=RENEWDELEGATIONTOKEN&token=<TOKEN>"
  578. +---------------------------------
  579. The client receives a response with a {{{Long JSON Schema}<<<long>>> JSON object}}:
  580. +---------------------------------
  581. HTTP/1.1 200 OK
  582. Content-Type: application/json
  583. Transfer-Encoding: chunked
  584. {"long": 1320962673997} //the new expiration time
  585. +---------------------------------
  586. []
  587. See also:
  588. {{{Token}<<<token>>>}},
  589. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.renewDelegationToken
  590. ** {Cancel Delegation Token}
  591. * Submit a HTTP PUT request.
  592. +---------------------------------
  593. curl -i -X PUT "http://<HOST>:<PORT>/webhdfs/v1/?op=CANCELDELEGATIONTOKEN&token=<TOKEN>"
  594. +---------------------------------
  595. The client receives a response with zero content length:
  596. +---------------------------------
  597. HTTP/1.1 200 OK
  598. Content-Length: 0
  599. +---------------------------------
  600. []
  601. See also:
  602. {{{Token}<<<token>>>}},
  603. {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.cancelDelegationToken
  604. * {Error Responses}
  605. When an operation fails, the server may throw an exception.
  606. The JSON schema of error responses is defined in {{<<<RemoteException>>> JSON schema}}.
  607. The table below shows the mapping from exceptions to HTTP response codes.
  608. ** {HTTP Response Codes}
  609. *-------------------------------------+---------------------------------+
  610. || Exceptions || HTTP Response Codes |
  611. *-------------------------------------+---------------------------------+
  612. | <<<IllegalArgumentException >>> | <<<400 Bad Request >>> |
  613. *-------------------------------------+---------------------------------+
  614. | <<<UnsupportedOperationException>>> | <<<400 Bad Request >>> |
  615. *-------------------------------------+---------------------------------+
  616. | <<<SecurityException >>> | <<<401 Unauthorized >>> |
  617. *-------------------------------------+---------------------------------+
  618. | <<<IOException >>> | <<<403 Forbidden >>> |
  619. *-------------------------------------+---------------------------------+
  620. | <<<FileNotFoundException >>> | <<<404 Not Found >>> |
  621. *-------------------------------------+---------------------------------+
  622. | <<<RumtimeException >>> | <<<500 Internal Server Error>>> |
  623. *-------------------------------------+---------------------------------+
  624. Below are examples of exception responses.
  625. *** {Illegal Argument Exception}
  626. +---------------------------------
  627. HTTP/1.1 400 Bad Request
  628. Content-Type: application/json
  629. Transfer-Encoding: chunked
  630. {
  631. "RemoteException":
  632. {
  633. "exception" : "IllegalArgumentException",
  634. "javaClassName": "java.lang.IllegalArgumentException",
  635. "message" : "Invalid value for webhdfs parameter \"permission\": ..."
  636. }
  637. }
  638. +---------------------------------
  639. *** {Security Exception}
  640. +---------------------------------
  641. HTTP/1.1 401 Unauthorized
  642. Content-Type: application/json
  643. Transfer-Encoding: chunked
  644. {
  645. "RemoteException":
  646. {
  647. "exception" : "SecurityException",
  648. "javaClassName": "java.lang.SecurityException",
  649. "message" : "Failed to obtain user group information: ..."
  650. }
  651. }
  652. +---------------------------------
  653. *** {Access Control Exception}
  654. +---------------------------------
  655. HTTP/1.1 403 Forbidden
  656. Content-Type: application/json
  657. Transfer-Encoding: chunked
  658. {
  659. "RemoteException":
  660. {
  661. "exception" : "AccessControlException",
  662. "javaClassName": "org.apache.hadoop.security.AccessControlException",
  663. "message" : "Permission denied: ..."
  664. }
  665. }
  666. +---------------------------------
  667. *** {File Not Found Exception}
  668. +---------------------------------
  669. HTTP/1.1 404 Not Found
  670. Content-Type: application/json
  671. Transfer-Encoding: chunked
  672. {
  673. "RemoteException":
  674. {
  675. "exception" : "FileNotFoundException",
  676. "javaClassName": "java.io.FileNotFoundException",
  677. "message" : "File does not exist: /foo/a.patch"
  678. }
  679. }
  680. +---------------------------------
  681. * {JSON Schemas}
  682. All operations, except for {{{Open and Read a File}<<<OPEN>>>}},
  683. either return a zero-length response or a JSON response.
  684. For {{{Open and Read a File}<<<OPEN>>>}}, the response is an octet-stream.
  685. The JSON schemas are shown below.
  686. See {{{http://tools.ietf.org/id/draft-zyp-json-schema-03.html}draft-zyp-json-schema-03}}
  687. for the syntax definitions of the JSON schemas.
  688. <<Note>> that the default value of
  689. {{{http://tools.ietf.org/id/draft-zyp-json-schema-03.html#additionalProperties}<<<additionalProperties>>>}}
  690. is an empty schema which allows any value for additional properties.
  691. Therefore, all WebHDFS JSON responses allow any additional property.
  692. However, if additional properties are included in the responses, they are
  693. considered as optional properties in order to maintain compatibility.
  694. ** {Boolean JSON Schema}
  695. +---------------------------------
  696. {
  697. "name" : "boolean",
  698. "properties":
  699. {
  700. "boolean":
  701. {
  702. "description": "A boolean value",
  703. "type" : "boolean",
  704. "required" : true
  705. }
  706. }
  707. }
  708. +---------------------------------
  709. See also:
  710. {{{Make a Directory}<<<MKDIRS>>>}},
  711. {{{Rename a File/Directory}<<<RENAME>>>}},
  712. {{{Delete a File/Directory}<<<DELETE>>>}},
  713. {{{Set Replication Factor}<<<SETREPLICATION>>>}}
  714. ** {ContentSummary JSON Schema}
  715. +---------------------------------
  716. {
  717. "name" : "ContentSummary",
  718. "properties":
  719. {
  720. "ContentSummary":
  721. {
  722. "type" : "object",
  723. "properties":
  724. {
  725. "directoryCount":
  726. {
  727. "description": "The number of directories.",
  728. "type" : "integer",
  729. "required" : true
  730. },
  731. "fileCount":
  732. {
  733. "description": "The number of files.",
  734. "type" : "integer",
  735. "required" : true
  736. },
  737. "length":
  738. {
  739. "description": "The number of bytes used by the content.",
  740. "type" : "integer",
  741. "required" : true
  742. },
  743. "quota":
  744. {
  745. "description": "The namespace quota of this directory.",
  746. "type" : "integer",
  747. "required" : true
  748. },
  749. "spaceConsumed":
  750. {
  751. "description": "The disk space consumed by the content.",
  752. "type" : "integer",
  753. "required" : true
  754. },
  755. "spaceQuota":
  756. {
  757. "description": "The disk space quota.",
  758. "type" : "integer",
  759. "required" : true
  760. }
  761. }
  762. }
  763. }
  764. }
  765. +---------------------------------
  766. See also:
  767. {{{Get Content Summary of a Directory}<<<GETCONTENTSUMMARY>>>}}
  768. ** {FileChecksum JSON Schema}
  769. +---------------------------------
  770. {
  771. "name" : "FileChecksum",
  772. "properties":
  773. {
  774. "FileChecksum":
  775. {
  776. "type" : "object",
  777. "properties":
  778. {
  779. "algorithm":
  780. {
  781. "description": "The name of the checksum algorithm.",
  782. "type" : "string",
  783. "required" : true
  784. },
  785. "bytes":
  786. {
  787. "description": "The byte sequence of the checksum in hexadecimal.",
  788. "type" : "string",
  789. "required" : true
  790. },
  791. "length":
  792. {
  793. "description": "The length of the bytes (not the length of the string).",
  794. "type" : "integer",
  795. "required" : true
  796. }
  797. }
  798. }
  799. }
  800. }
  801. +---------------------------------
  802. See also:
  803. {{{Get File Checksum}<<<GETFILECHECKSUM>>>}}
  804. ** {FileStatus JSON Schema}
  805. +---------------------------------
  806. {
  807. "name" : "FileStatus",
  808. "properties":
  809. {
  810. "FileStatus": fileStatusProperties //See FileStatus Properties
  811. }
  812. }
  813. +---------------------------------
  814. See also:
  815. {{{FileStatus Properties}<<<FileStatus>>> Properties}},
  816. {{{Status of a File/Directory}<<<GETFILESTATUS>>>}},
  817. {{{../../api/org/apache/hadoop/fs/FileStatus}FileStatus}}
  818. *** {FileStatus Properties}
  819. JavaScript syntax is used to define <<<fileStatusProperties>>>
  820. so that it can be referred in both <<<FileStatus>>> and <<<FileStatuses>>> JSON schemas.
  821. +---------------------------------
  822. var fileStatusProperties =
  823. {
  824. "type" : "object",
  825. "properties":
  826. {
  827. "accessTime":
  828. {
  829. "description": "The access time.",
  830. "type" : "integer",
  831. "required" : true
  832. },
  833. "blockSize":
  834. {
  835. "description": "The block size of a file.",
  836. "type" : "integer",
  837. "required" : true
  838. },
  839. "group":
  840. {
  841. "description": "The group owner.",
  842. "type" : "string",
  843. "required" : true
  844. },
  845. "length":
  846. {
  847. "description": "The number of bytes in a file.",
  848. "type" : "integer",
  849. "required" : true
  850. },
  851. "modificationTime":
  852. {
  853. "description": "The modification time.",
  854. "type" : "integer",
  855. "required" : true
  856. },
  857. "owner":
  858. {
  859. "description": "The user who is the owner.",
  860. "type" : "string",
  861. "required" : true
  862. },
  863. "pathSuffix":
  864. {
  865. "description": "The path suffix.",
  866. "type" : "string",
  867. "required" : true
  868. },
  869. "permission":
  870. {
  871. "description": "The permission represented as a octal string.",
  872. "type" : "string",
  873. "required" : true
  874. },
  875. "replication":
  876. {
  877. "description": "The number of replication of a file.",
  878. "type" : "integer",
  879. "required" : true
  880. },
  881. "symlink": //an optional property
  882. {
  883. "description": "The link target of a symlink.",
  884. "type" : "string"
  885. },
  886. "type":
  887. {
  888. "description": "The type of the path object.",
  889. "enum" : ["FILE", "DIRECTORY", "SYMLINK"],
  890. "required" : true
  891. }
  892. }
  893. };
  894. +---------------------------------
  895. ** {FileStatuses JSON Schema}
  896. A <<<FileStatuses>>> JSON object represents an array of <<<FileStatus>>> JSON objects.
  897. +---------------------------------
  898. {
  899. "name" : "FileStatuses",
  900. "properties":
  901. {
  902. "FileStatuses":
  903. {
  904. "type" : "object",
  905. "properties":
  906. {
  907. "FileStatus":
  908. {
  909. "description": "An array of FileStatus",
  910. "type" : "array",
  911. "items" : fileStatusProperties //See FileStatus Properties
  912. }
  913. }
  914. }
  915. }
  916. }
  917. +---------------------------------
  918. See also:
  919. {{{FileStatus Properties}<<<FileStatus>>> Properties}},
  920. {{{List a Directory}<<<LISTSTATUS>>>}},
  921. {{{../../api/org/apache/hadoop/fs/FileStatus}FileStatus}}
  922. ** {Long JSON Schema}
  923. +---------------------------------
  924. {
  925. "name" : "long",
  926. "properties":
  927. {
  928. "long":
  929. {
  930. "description": "A long integer value",
  931. "type" : "integer",
  932. "required" : true
  933. }
  934. }
  935. }
  936. +---------------------------------
  937. See also:
  938. {{{Renew Delegation Token}<<<RENEWDELEGATIONTOKEN>>>}},
  939. ** {Path JSON Schema}
  940. +---------------------------------
  941. {
  942. "name" : "Path",
  943. "properties":
  944. {
  945. "Path":
  946. {
  947. "description": "The string representation a Path.",
  948. "type" : "string",
  949. "required" : true
  950. }
  951. }
  952. }
  953. +---------------------------------
  954. See also:
  955. {{{Get Home Directory}<<<GETHOMEDIRECTORY>>>}},
  956. {{{../../api/org/apache/hadoop/fs/Path}Path}}
  957. ** {RemoteException JSON Schema}
  958. +---------------------------------
  959. {
  960. "name" : "RemoteException",
  961. "properties":
  962. {
  963. "RemoteException":
  964. {
  965. "type" : "object",
  966. "properties":
  967. {
  968. "exception":
  969. {
  970. "description": "Name of the exception",
  971. "type" : "string",
  972. "required" : true
  973. },
  974. "message":
  975. {
  976. "description": "Exception message",
  977. "type" : "string",
  978. "required" : true
  979. },
  980. "javaClassName": //an optional property
  981. {
  982. "description": "Java class name of the exception",
  983. "type" : "string",
  984. }
  985. }
  986. }
  987. }
  988. }
  989. +---------------------------------
  990. See also:
  991. {{Error Responses}}
  992. ** {Token JSON Schema}
  993. +---------------------------------
  994. {
  995. "name" : "Token",
  996. "properties":
  997. {
  998. "Token": tokenProperties //See Token Properties
  999. }
  1000. }
  1001. +---------------------------------
  1002. See also:
  1003. {{{Token Properties}<<<Token>>> Properties}},
  1004. {{{Get Delegation Token}<<<GETDELEGATIONTOKEN>>>}},
  1005. the note in {{Delegation}}.
  1006. *** {Token Properties}
  1007. JavaScript syntax is used to define <<<tokenProperties>>>
  1008. so that it can be referred in both <<<Token>>> and <<<Tokens>>> JSON schemas.
  1009. +---------------------------------
  1010. var tokenProperties =
  1011. {
  1012. "type" : "object",
  1013. "properties":
  1014. {
  1015. "urlString":
  1016. {
  1017. "description": "A delegation token encoded as a URL safe string.",
  1018. "type" : "string",
  1019. "required" : true
  1020. }
  1021. }
  1022. }
  1023. +---------------------------------
  1024. ** {Tokens JSON Schema}
  1025. A <<<Tokens>>> JSON object represents an array of <<<Token>>> JSON objects.
  1026. +---------------------------------
  1027. {
  1028. "name" : "Tokens",
  1029. "properties":
  1030. {
  1031. "Tokens":
  1032. {
  1033. "type" : "object",
  1034. "properties":
  1035. {
  1036. "Token":
  1037. {
  1038. "description": "An array of Token",
  1039. "type" : "array",
  1040. "items" : "Token": tokenProperties //See Token Properties
  1041. }
  1042. }
  1043. }
  1044. }
  1045. }
  1046. +---------------------------------
  1047. See also:
  1048. {{{Token Properties}<<<Token>>> Properties}},
  1049. {{{Get Delegation Tokens}<<<GETDELEGATIONTOKENS>>>}},
  1050. the note in {{Delegation}}.
  1051. * {HTTP Query Parameter Dictionary}
  1052. ** {Access Time}
  1053. *----------------+-------------------------------------------------------------------+
  1054. || Name | <<<accesstime>>> |
  1055. *----------------+-------------------------------------------------------------------+
  1056. || Description | The access time of a file/directory. |
  1057. *----------------+-------------------------------------------------------------------+
  1058. || Type | long |
  1059. *----------------+-------------------------------------------------------------------+
  1060. || Default Value | -1 (means keeping it unchanged) |
  1061. *----------------+-------------------------------------------------------------------+
  1062. || Valid Values | -1 or a timestamp |
  1063. *----------------+-------------------------------------------------------------------+
  1064. || Syntax | Any integer. |
  1065. *----------------+-------------------------------------------------------------------+
  1066. See also:
  1067. {{{Set Access or Modification Time}<<<SETTIMES>>>}}
  1068. ** {Block Size}
  1069. *----------------+-------------------------------------------------------------------+
  1070. || Name | <<<blocksize>>> |
  1071. *----------------+-------------------------------------------------------------------+
  1072. || Description | The block size of a file. |
  1073. *----------------+-------------------------------------------------------------------+
  1074. || Type | long |
  1075. *----------------+-------------------------------------------------------------------+
  1076. || Default Value | Specified in the configuration. |
  1077. *----------------+-------------------------------------------------------------------+
  1078. || Valid Values | \> 0 |
  1079. *----------------+-------------------------------------------------------------------+
  1080. || Syntax | Any integer. |
  1081. *----------------+-------------------------------------------------------------------+
  1082. See also:
  1083. {{{Create and Write to a File}<<<CREATE>>>}}
  1084. ** {Buffer Size}
  1085. *----------------+-------------------------------------------------------------------+
  1086. || Name | <<<buffersize>>> |
  1087. *----------------+-------------------------------------------------------------------+
  1088. || Description | The size of the buffer used in transferring data. |
  1089. *----------------+-------------------------------------------------------------------+
  1090. || Type | int |
  1091. *----------------+-------------------------------------------------------------------+
  1092. || Default Value | Specified in the configuration. |
  1093. *----------------+-------------------------------------------------------------------+
  1094. || Valid Values | \> 0 |
  1095. *----------------+-------------------------------------------------------------------+
  1096. || Syntax | Any integer. |
  1097. *----------------+-------------------------------------------------------------------+
  1098. See also:
  1099. {{{Create and Write to a File}<<<CREATE>>>}},
  1100. {{{Append to a File}<<<APPEND>>>}},
  1101. {{{Open and Read a File}<<<OPEN>>>}}
  1102. ** {Create Parent}
  1103. *----------------+-------------------------------------------------------------------+
  1104. || Name | <<<createparent>>> |
  1105. *----------------+-------------------------------------------------------------------+
  1106. || Description | If the parent directories do not exist, should they be created? |
  1107. *----------------+-------------------------------------------------------------------+
  1108. || Type | boolean |
  1109. *----------------+-------------------------------------------------------------------+
  1110. || Default Value | false |
  1111. *----------------+-------------------------------------------------------------------+
  1112. || Valid Values | true | false |
  1113. *----------------+-------------------------------------------------------------------+
  1114. || Syntax | true | false |
  1115. *----------------+-------------------------------------------------------------------+
  1116. See also:
  1117. {{{Create a Symbolic Link}<<<CREATESYMLINK>>>}}
  1118. ** {Delegation}
  1119. *----------------+-------------------------------------------------------------------+
  1120. || Name | <<<delegation>>> |
  1121. *----------------+-------------------------------------------------------------------+
  1122. || Description | The delegation token used for authentication. |
  1123. *----------------+-------------------------------------------------------------------+
  1124. || Type | String |
  1125. *----------------+-------------------------------------------------------------------+
  1126. || Default Value | \<empty\> |
  1127. *----------------+-------------------------------------------------------------------+
  1128. || Valid Values | An encoded token. |
  1129. *----------------+-------------------------------------------------------------------+
  1130. || Syntax | See the note below. |
  1131. *----------------+-------------------------------------------------------------------+
  1132. <<Note>> that delegation tokens are encoded as a URL safe string;
  1133. see <<<encodeToUrlString()>>>
  1134. and <<<decodeFromUrlString(String)>>>
  1135. in <<<org.apache.hadoop.security.token.Token>>> for the details of the encoding.
  1136. See also:
  1137. {{Authentication}}
  1138. ** {Destination}
  1139. *----------------+-------------------------------------------------------------------+
  1140. || Name | <<<destination>>> |
  1141. *----------------+-------------------------------------------------------------------+
  1142. || Description | The destination path. |
  1143. *----------------+-------------------------------------------------------------------+
  1144. || Type | Path |
  1145. *----------------+-------------------------------------------------------------------+
  1146. || Default Value | \<empty\> (an invalid path) |
  1147. *----------------+-------------------------------------------------------------------+
  1148. || Valid Values | An absolute FileSystem path without scheme and authority. |
  1149. *----------------+-------------------------------------------------------------------+
  1150. || Syntax | Any path. |
  1151. *----------------+-------------------------------------------------------------------+
  1152. See also:
  1153. {{{Create a Symbolic Link}<<<CREATESYMLINK>>>}},
  1154. {{{Rename a File/Directory}<<<RENAME>>>}}
  1155. ** {Do As}
  1156. *----------------+-------------------------------------------------------------------+
  1157. || Name | <<<doas>>> |
  1158. *----------------+-------------------------------------------------------------------+
  1159. || Description | Allowing a proxy user to do as another user. |
  1160. *----------------+-------------------------------------------------------------------+
  1161. || Type | String |
  1162. *----------------+-------------------------------------------------------------------+
  1163. || Default Value | null |
  1164. *----------------+-------------------------------------------------------------------+
  1165. || Valid Values | Any valid username. |
  1166. *----------------+-------------------------------------------------------------------+
  1167. || Syntax | Any string. |
  1168. *----------------+-------------------------------------------------------------------+
  1169. See also:
  1170. {{Proxy Users}}
  1171. ** {Group}
  1172. *----------------+-------------------------------------------------------------------+
  1173. || Name | <<<group>>> |
  1174. *----------------+-------------------------------------------------------------------+
  1175. || Description | The name of a group. |
  1176. *----------------+-------------------------------------------------------------------+
  1177. || Type | String |
  1178. *----------------+-------------------------------------------------------------------+
  1179. || Default Value | \<empty\> (means keeping it unchanged) |
  1180. *----------------+-------------------------------------------------------------------+
  1181. || Valid Values | Any valid group name. |
  1182. *----------------+-------------------------------------------------------------------+
  1183. || Syntax | Any string. |
  1184. *----------------+-------------------------------------------------------------------+
  1185. See also:
  1186. {{{Set Owner}<<<SETOWNER>>>}}
  1187. ** {Length}
  1188. *----------------+-------------------------------------------------------------------+
  1189. || Name | <<<length>>> |
  1190. *----------------+-------------------------------------------------------------------+
  1191. || Description | The number of bytes to be processed. |
  1192. *----------------+-------------------------------------------------------------------+
  1193. || Type | long |
  1194. *----------------+-------------------------------------------------------------------+
  1195. || Default Value | null (means the entire file) |
  1196. *----------------+-------------------------------------------------------------------+
  1197. || Valid Values | \>= 0 or null |
  1198. *----------------+-------------------------------------------------------------------+
  1199. || Syntax | Any integer. |
  1200. *----------------+-------------------------------------------------------------------+
  1201. See also:
  1202. {{{Open and Read a File}<<<OPEN>>>}}
  1203. ** {Modification Time}
  1204. *----------------+-------------------------------------------------------------------+
  1205. || Name | <<<modificationtime>>> |
  1206. *----------------+-------------------------------------------------------------------+
  1207. || Description | The modification time of a file/directory. |
  1208. *----------------+-------------------------------------------------------------------+
  1209. || Type | long |
  1210. *----------------+-------------------------------------------------------------------+
  1211. || Default Value | -1 (means keeping it unchanged) |
  1212. *----------------+-------------------------------------------------------------------+
  1213. || Valid Values | -1 or a timestamp |
  1214. *----------------+-------------------------------------------------------------------+
  1215. || Syntax | Any integer. |
  1216. *----------------+-------------------------------------------------------------------+
  1217. See also:
  1218. {{{Set Access or Modification Time}<<<SETTIMES>>>}}
  1219. ** {Offset}
  1220. *----------------+-------------------------------------------------------------------+
  1221. || Name | <<<offset>>> |
  1222. *----------------+-------------------------------------------------------------------+
  1223. || Description | The starting byte position. |
  1224. *----------------+-------------------------------------------------------------------+
  1225. || Type | long |
  1226. *----------------+-------------------------------------------------------------------+
  1227. || Default Value | 0 |
  1228. *----------------+-------------------------------------------------------------------+
  1229. || Valid Values | \>= 0 |
  1230. *----------------+-------------------------------------------------------------------+
  1231. || Syntax | Any integer. |
  1232. *----------------+-------------------------------------------------------------------+
  1233. See also:
  1234. {{{Open and Read a File}<<<OPEN>>>}}
  1235. ** {Op}
  1236. *----------------+-------------------------------------------------------------------+
  1237. || Name | <<<op>>> |
  1238. *----------------+-------------------------------------------------------------------+
  1239. || Description | The name of the operation to be executed. |
  1240. *----------------+-------------------------------------------------------------------+
  1241. || Type | enum |
  1242. *----------------+-------------------------------------------------------------------+
  1243. || Default Value | null (an invalid value) |
  1244. *----------------+-------------------------------------------------------------------+
  1245. || Valid Values | Any valid operation name. |
  1246. *----------------+-------------------------------------------------------------------+
  1247. || Syntax | Any string. |
  1248. *----------------+-------------------------------------------------------------------+
  1249. See also:
  1250. {{Operations}}
  1251. ** {Overwrite}
  1252. *----------------+-------------------------------------------------------------------+
  1253. || Name | <<<overwrite>>> |
  1254. *----------------+-------------------------------------------------------------------+
  1255. || Description | If a file already exists, should it be overwritten? |
  1256. *----------------+-------------------------------------------------------------------+
  1257. || Type | boolean |
  1258. *----------------+-------------------------------------------------------------------+
  1259. || Default Value | false |
  1260. *----------------+-------------------------------------------------------------------+
  1261. || Valid Values | true | false |
  1262. *----------------+-------------------------------------------------------------------+
  1263. || Syntax | true | false |
  1264. *----------------+-------------------------------------------------------------------+
  1265. See also:
  1266. {{{Create and Write to a File}<<<CREATE>>>}}
  1267. ** {Owner}
  1268. *----------------+-------------------------------------------------------------------+
  1269. || Name | <<<owner>>> |
  1270. *----------------+-------------------------------------------------------------------+
  1271. || Description | The username who is the owner of a file/directory. |
  1272. *----------------+-------------------------------------------------------------------+
  1273. || Type | String |
  1274. *----------------+-------------------------------------------------------------------+
  1275. || Default Value | \<empty\> (means keeping it unchanged) |
  1276. *----------------+-------------------------------------------------------------------+
  1277. || Valid Values | Any valid username. |
  1278. *----------------+-------------------------------------------------------------------+
  1279. || Syntax | Any string. |
  1280. *----------------+-------------------------------------------------------------------+
  1281. See also:
  1282. {{{Set Owner}<<<SETOWNER>>>}}
  1283. ** {Permission}
  1284. *----------------+-------------------------------------------------------------------+
  1285. || Name | <<<permission>>> |
  1286. *----------------+-------------------------------------------------------------------+
  1287. || Description | The permission of a file/directory. |
  1288. *----------------+-------------------------------------------------------------------+
  1289. || Type | Octal |
  1290. *----------------+-------------------------------------------------------------------+
  1291. || Default Value | 755 |
  1292. *----------------+-------------------------------------------------------------------+
  1293. || Valid Values | 0 - 1777 |
  1294. *----------------+-------------------------------------------------------------------+
  1295. || Syntax | Any radix-8 integer (leading zeros may be omitted.) |
  1296. *----------------+-------------------------------------------------------------------+
  1297. See also:
  1298. {{{Create and Write to a File}<<<CREATE>>>}},
  1299. {{{Make a Directory}<<<MKDIRS>>>}},
  1300. {{{Set Permission}<<<SETPERMISSION>>>}}
  1301. ** {Recursive}
  1302. *----------------+-------------------------------------------------------------------+
  1303. || Name | <<<recursive>>> |
  1304. *----------------+-------------------------------------------------------------------+
  1305. || Description | Should the operation act on the content in the subdirectories? |
  1306. *----------------+-------------------------------------------------------------------+
  1307. || Type | boolean |
  1308. *----------------+-------------------------------------------------------------------+
  1309. || Default Value | false |
  1310. *----------------+-------------------------------------------------------------------+
  1311. || Valid Values | true | false |
  1312. *----------------+-------------------------------------------------------------------+
  1313. || Syntax | true | false |
  1314. *----------------+-------------------------------------------------------------------+
  1315. See also:
  1316. {{{Rename a File/Directory}<<<RENAME>>>}}
  1317. ** {Renewer}
  1318. *----------------+-------------------------------------------------------------------+
  1319. || Name | <<<renewer>>> |
  1320. *----------------+-------------------------------------------------------------------+
  1321. || Description | The username of the renewer of a delegation token. |
  1322. *----------------+-------------------------------------------------------------------+
  1323. || Type | String |
  1324. *----------------+-------------------------------------------------------------------+
  1325. || Default Value | \<empty\> (means the current user) |
  1326. *----------------+-------------------------------------------------------------------+
  1327. || Valid Values | Any valid username. |
  1328. *----------------+-------------------------------------------------------------------+
  1329. || Syntax | Any string. |
  1330. *----------------+-------------------------------------------------------------------+
  1331. See also:
  1332. {{{Get Delegation Token}<<<GETDELEGATIONTOKEN>>>}},
  1333. {{{Get Delegation Tokens}<<<GETDELEGATIONTOKENS>>>}}
  1334. ** {Replication}
  1335. *----------------+-------------------------------------------------------------------+
  1336. || Name | <<<replication>>> |
  1337. *----------------+-------------------------------------------------------------------+
  1338. || Description | The number of replications of a file. |
  1339. *----------------+-------------------------------------------------------------------+
  1340. || Type | short |
  1341. *----------------+-------------------------------------------------------------------+
  1342. || Default Value | Specified in the configuration. |
  1343. *----------------+-------------------------------------------------------------------+
  1344. || Valid Values | \> 0 |
  1345. *----------------+-------------------------------------------------------------------+
  1346. || Syntax | Any integer. |
  1347. *----------------+-------------------------------------------------------------------+
  1348. See also:
  1349. {{{Create and Write to a File}<<<CREATE>>>}},
  1350. {{{Set Replication Factor}<<<SETREPLICATION>>>}}
  1351. ** {Sources}
  1352. *----------------+-------------------------------------------------------------------+
  1353. || Name | <<<sources>>> |
  1354. *----------------+-------------------------------------------------------------------+
  1355. || Description | A list of source paths. |
  1356. *----------------+-------------------------------------------------------------------+
  1357. || Type | String |
  1358. *----------------+-------------------------------------------------------------------+
  1359. || Default Value | \<empty\> |
  1360. *----------------+-------------------------------------------------------------------+
  1361. || Valid Values | A list of comma seperated absolute FileSystem paths without scheme and authority. |
  1362. *----------------+-------------------------------------------------------------------+
  1363. || Syntax | Any string. |
  1364. *----------------+-------------------------------------------------------------------+
  1365. See also:
  1366. {{{Concat File(s)}<<<CONCAT>>>}}
  1367. ** {Token}
  1368. *----------------+-------------------------------------------------------------------+
  1369. || Name | <<<token>>> |
  1370. *----------------+-------------------------------------------------------------------+
  1371. || Description | The delegation token used for the operation. |
  1372. *----------------+-------------------------------------------------------------------+
  1373. || Type | String |
  1374. *----------------+-------------------------------------------------------------------+
  1375. || Default Value | \<empty\> |
  1376. *----------------+-------------------------------------------------------------------+
  1377. || Valid Values | An encoded token. |
  1378. *----------------+-------------------------------------------------------------------+
  1379. || Syntax | See the note in {{Delegation}}. |
  1380. *----------------+-------------------------------------------------------------------+
  1381. See also:
  1382. {{{Renew Delegation Token}<<<RENEWDELEGATIONTOKEN>>>}},
  1383. {{{Cancel Delegation Token}<<<CANCELDELEGATIONTOKEN>>>}}
  1384. ** {Username}
  1385. *----------------+-------------------------------------------------------------------+
  1386. || Name | <<<user.name>>> |
  1387. *----------------+-------------------------------------------------------------------+
  1388. || Description | The authenticated user; see {{Authentication}}. |
  1389. *----------------+-------------------------------------------------------------------+
  1390. || Type | String |
  1391. *----------------+-------------------------------------------------------------------+
  1392. || Default Value | null |
  1393. *----------------+-------------------------------------------------------------------+
  1394. || Valid Values | Any valid username. |
  1395. *----------------+-------------------------------------------------------------------+
  1396. || Syntax | Any string. |
  1397. *----------------+-------------------------------------------------------------------+
  1398. See also:
  1399. {{Authentication}}