You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Casey Brotherton (JIRA)" <ji...@apache.org> on 2013/12/21 03:56:10 UTC

[jira] [Created] (HDFS-5696) Examples for httpfs REST API incorrect on apache.org

Casey Brotherton created HDFS-5696:
--------------------------------------

             Summary: Examples for httpfs REST API incorrect on apache.org
                 Key: HDFS-5696
                 URL: https://issues.apache.org/jira/browse/HDFS-5696
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: documentation
    Affects Versions: 2.2.0
         Environment: NA
            Reporter: Casey Brotherton
            Priority: Minor


The examples provided for the httpfs REST API are incorrect.

http://hadoop.apache.org/docs/r2.2.0/hadoop-hdfs-httpfs/index.html
http://hadoop.apache.org/docs/r2.0.5-alpha/hadoop-hdfs-httpfs/index.html
>From the documentation:
*****************************
HttpFS is a separate service from Hadoop NameNode.
HttpFS itself is Java web-application and it runs using a preconfigured Tomcat bundled with HttpFS binary distribution.
HttpFS HTTP web-service API calls are HTTP REST calls that map to a HDFS file system operation. For example, using the curl Unix command:
$ curl http://httpfs-host:14000/webhdfs/v1/user/foo/README.txt returns the contents of the HDFS /user/foo/README.txt file.
$ curl http://httpfs-host:14000/webhdfs/v1/user/foo?op=list returns the contents of the HDFS /user/foo directory in JSON format.
$ curl -X POST http://httpfs-host:14000/webhdfs/v1/user/foo/bar?op=mkdirs creates the HDFS /user/foo.bar directory.
*******************
The commands have incorrect "op"erations. ( Verified through source code in HttpFSFileSystem.java )
In addition, although the webhdfs documentation specifies user.name as optional, on my cluster, each action required a "user.name"
It should be included in the short examples to allow for the greatest chance of success.
Three examples rewritten:
curl -i -L "http://httpfs-host:14000/webhdfs/v1/user/foo/README.txt?op=open&user.name=hdfsuser"
curl -i "http://httpfs-host:14000/webhdfs/v1/user/foo/?op=liststatus&user.name=hdfsuser"
curl -i -X PUT "http://httpfs-host:14000/webhdfs/v1/user/foo/bar?op=mkdirs&user.name=hdfsuser"
Not sure what the convention should be for specifying the user.name. Use hdfs? or a name that is obviously an example?
It would also be beneficial if the HTTPfs page linked to the webhdfs documentation page in the text instead of just on the menu sidebar.

http://hadoop.apache.org/docs/r2.2.0/hadoop-project-dist/hadoop-hdfs/WebHDFS.html




--
This message was sent by Atlassian JIRA
(v6.1.4#6159)