smengcl commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r694488241



##########
File path: hadoop-hdds/docs/content/interface/ReconApi.md
##########
@@ -232,7 +232,170 @@ Returns the UnhealthyContainerMetadata objects for all 
the unhealthycontainers.
 Returns the UnhealthyContainerMetadata objects for the containers in the 
givenstate.
 Possible unhealthy container states are `MISSING`, 
`MIS_REPLICATED`,`UNDER_REPLICATED`, `OVER_REPLICATED`.
 The response structure is same as `/containers/unhealthy`.
-     
+
+## Namespace Metadata
+
+### GET /api/v1/namespace/summary
+
+**Parameters**
+
+* path
+
+   The path request in string without any protocol prefix.
+
+**Returns**
+
+Returns a basic summary of the path, including entity type and aggregate count 
+of objects under the path.
+
+`status` is `OK` if path exists, `PATH_NOT_FOUND` otherwise.
+
+```json
+     {
+       "status": OK,
+       "type": ROOT,
+       "numVolume": 10,
+        "numBucket": 100,
+        "numDir": 1000,
+        "numKey": 10000
+     }
+```
+
+If any `num` field is `-1`, the path request is not applicable to such an 
entity type.
+
+### GET /api/v1/namespace/du
+
+**Parameters**
+
+* path
+
+  The path request in string without any protocol prefix.
+
+* files (optional)
+
+  A boolean with a default value of `false`. If set to `true`, compute disk 
usage for keys 
+  directly under the path.
+
+* replica (optional)
+
+  A boolean with a default value of `false`. If set to `true`, compute disk 
usage with replicated
+size of keys.
+
+**Returns**
+
+Returns disk usage of all sub-paths under the path. Normalizes `path` fields, 
returns
+total size of keys directly under the path as `sizeDirectKey`, and returns 
+`size`/`sizeWithReplica` in number of bytes. 
+
+`status` is `OK` if path exists, 
+`PATH_NOT_FOUND` otherwise.
+
+```json
+     {
+       "status": OK,
+        "path": "/vol1/bucket1",
+        "size": 100000,
+        "sizeWithReplica": 300000,
+        "subPathCount": 4,
+        "subPaths": [
+          {
+            "path": "/vol1/bucket1/dir1-1",
+            "size": 30000,
+            "sizeWithReplica": 90000,
+            "isKey": false
+          },
+          {
+            "path": "/vol1/bucket1/dir1-2",
+            "size": 30000,
+            "sizeWithReplica": 90000,
+            "isKey": false
+          },
+          {
+            "path": "/vol1/bucket1/dir1-3",
+            "size": 30000,
+            "sizeWithReplica": 90000,
+            "isKey": false
+          },
+          {
+            "path": "/vol1/bucket1/key1-1",
+            "size": 10000,
+            "sizeWithReplica": 30000,
+            "isKey": true
+          }
+        ],
+        "sizeDirectKey": 10000
+     }
+```
+If `files` is set to `false`, sub-path `/vol1/bucket1/key1-1` is omitted.
+If `replica` is set to `false`, `sizeWithReplica` returns `-1`. If the path's 
entity type
+cannot have direct keys (Root, Volume), `sizeDirectKey` returns `-1`.
+
+### GET /api/v1/namespace/quota
+
+**Parameters**
+
+* path
+
+  The path request in string without any protocol prefix.
+
+**Returns**
+
+Returns the quota allowed and used under the path. Only volumes and buckets
+have quota. Other types are not applicable to the quota request.
+
+`status` is `OK` if the request is valid, `PATH_NOT_FOUND` if path doesn't 
exist,
+`TYPE_NOT_APPLIABLE` if path exists, but the path's entity type is not 
applicable

Review comment:
       Typo?
   ```suggestion
   `TYPE_NOT_APPLICABLE` if path exists, but the path's entity type is not 
applicable
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to