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

WebHDFS: Document ALLOWSNAPSHOT and DISALLOWSNAPSHOT API doc

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.8.0
    • 2.10.0, 3.3.0
    • documentation, webhdfs
    • None
    • Reviewed

    Description

      Adding ALLOWSNAPSHOT and DISALLOWSNAPSHOT (since 2.8.0, HDFS-9057) to WebHDFS REST API doc.

      Below are my examples of the APIs:

      # ALLOWSNAPSHOT uses http method PUT.
      curl -X "PUT" "http://<SERVER>:<PORT>/webhdfs/v1/snaptest/?op=ALLOWSNAPSHOT&user.name=hdfs"
      
      Response on success:
      
      HTTP/1.1 200 OK
      Content-Type: application/octet-stream
      
      # DISALLOWSNAPSHOT uses http method PUT.
      curl -X "PUT" "http://<SERVER>:<PORT>/webhdfs/v1/snaptest/?op=DISALLOWSNAPSHOT&user.name=hdfs"
      
      Response on success:
      
      HTTP/1.1 200 OK
      Content-Type: application/octet-stream
      

      Note: GETSNAPSHOTDIFF and GETSNAPSHOTTABLEDIRECTORYLIST are already documented.

      # GETSNAPSHOTDIFF uses GET.
      curl "http://<SERVER>:<PORT>/webhdfs/v1/snaptest/?op=GETSNAPSHOTDIFF&user.name=hdfs&oldsnapshotname=snap1&snapshotname=snap2"
      
      Response on success (example):
      
      HTTP/1.1 200 OK
      Content-Type: application/json
      
      {"SnapshotDiffReport":{"diffList":[{"sourcePath":"","type":"MODIFY"},{"sourcePath":"newfile.txt","type":"CREATE"}],"fromSnapshot":"snapOld","snapshotRoot":"/snaptest","toSnapshot":"snapNew"}}
      
      # GETSNAPSHOTTABLEDIRECTORYLIST uses GET.
      curl "http://<SERVER>:<PORT>/webhdfs/v1/snaptest/?op=GETSNAPSHOTTABLEDIRECTORYLIST&user.name=hdfs"
      
      Response on success (example):
      
      HTTP/1.1 200 OK
      Content-Type: application/json
      
      {"SnapshottableDirectoryList":[{"dirStatus":{"accessTime":0,"blockSize":0,"childrenNum":0,"fileId":16392,"group":"supergroup","length":0,"modificationTime":1535151813500,"owner":"hdfs","pathSuffix":"snaptest","permission":"755","replication":0,"storagePolicy":0,"type":"DIRECTORY"},"parentFullPath":"/","snapshotNumber":2,"snapshotQuota":65536}]}
      

      Attachments

        1. HDFS-13870.001.patch
          2 kB
          Siyao Meng

        Issue Links

          Activity

            People

              smeng Siyao Meng
              smeng Siyao Meng
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: