Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-5696

Examples for httpfs REST API incorrect on apache.org

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Duplicate
    • 2.2.0
    • None
    • documentation
    • None
    • NA

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              caseyjbrotherton Casey Brotherton
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: