Browse Source

HDFS-16951. Add description of GETSERVERDEFAULTS to WebHDFS doc (#5491)

Co-authored-by: Zhtttylz <hualong.z@hotmail.com>
Reviewed-by: Shilun Fan <slfan1989@apache.org>
Signed-off-by: Shilun Fan <slfan1989@apache.org>
zhtttylz 2 years ago
parent
commit
811441d5bc
1 changed files with 48 additions and 0 deletions
  1. 48 0
      hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/WebHDFS.md

+ 48 - 0
hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/WebHDFS.md

@@ -57,6 +57,7 @@ The HTTP REST API supports the complete [FileSystem](../../api/org/apache/hadoop
     * [`GETSNAPSHOTLIST`](#Get_Snapshot_List)
     * [`GETSNAPSHOTLIST`](#Get_Snapshot_List)
     * [`GETFILEBLOCKLOCATIONS`](#Get_File_Block_Locations) (see [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).getFileBlockLocations)
     * [`GETFILEBLOCKLOCATIONS`](#Get_File_Block_Locations) (see [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).getFileBlockLocations)
     * [`GETECPOLICY`](#Get_EC_Policy) (see [HDFSErasureCoding](./HDFSErasureCoding.html#Administrative_commands).getErasureCodingPolicy)
     * [`GETECPOLICY`](#Get_EC_Policy) (see [HDFSErasureCoding](./HDFSErasureCoding.html#Administrative_commands).getErasureCodingPolicy)
+    * [`GETSERVERDEFAULTS`](#Get_Server_Defaults) (see [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).getServerDefaults)
 *   HTTP PUT
 *   HTTP PUT
     * [`CREATE`](#Create_and_Write_to_a_File) (see [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).create)
     * [`CREATE`](#Create_and_Write_to_a_File) (see [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).create)
     * [`MKDIRS`](#Make_a_Directory) (see [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).mkdirs)
     * [`MKDIRS`](#Make_a_Directory) (see [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).mkdirs)
@@ -1109,6 +1110,35 @@ See also: [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).getAclSta
 
 
 See also: [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).access
 See also: [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).access
 
 
+### Get Server Defaults
+
+* Submit a HTTP GET request.
+
+        curl -i "http://<HOST>:<PORT>/webhdfs/v1/<PATH>?op=GETSERVERDEFAULTS"
+
+  The client receives a response with a [`ServerDefaults` JSON object](Server_Defaults_JSON_Schema):
+
+        HTTP/1.1 200 OK
+        Content-Type: application/json
+        Transfer-Encoding: chunked
+
+        {
+            "FsServerDefaults": {
+                "replication": 3,
+                "encryptDataTransfer": "false",
+                "defaultStoragePolicyId":7,
+                "writePacketSize": 65536,
+                "fileBufferSize": 4096,
+                "checksumType": 2,
+                "trashInterval": 10080,
+                "keyProviderUri": "",
+                "blockSize": 134217728,
+                "bytesPerChecksum": 512
+            }
+        }
+
+See also: [FileSystem](../../api/org/apache/hadoop/fs/FileSystem.html).getServerDefaults
+
 Storage Policy Operations
 Storage Policy Operations
 -------------------------
 -------------------------
 
 
@@ -3042,6 +3072,24 @@ var blockLocationProperties =
   }
   }
 };
 };
 ```
 ```
+### Server Defaults JSON Schema
+
+```json
+{
+  "FsServerDefaults": {
+    "replication": 3,
+    "encryptDataTransfer": false,
+    "defaultStoragePolicyId": 7,
+    "writePacketSize": 65536,
+    "fileBufferSize": 4096,
+    "checksumType": 2,
+    "trashInterval": 10080,
+    "keyProviderUri": "",
+    "blockSize": 134217728,
+    "bytesPerChecksum": 512
+  }
+}
+```
 
 
 HTTP Query Parameter Dictionary
 HTTP Query Parameter Dictionary
 -------------------------------
 -------------------------------