You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/08/23 22:04:00 UTC

[GitHub] [ozone] yuangu002 opened a new pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

yuangu002 opened a new pull request #2566:
URL: https://github.com/apache/ozone/pull/2566


   ## What changes were proposed in this pull request?
   
   Add docs for Recon namespace-related REST APIs
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5637
   
   ## How was this patch tested?
   No need
   
   [Backlog] Add `zh` doc if needed.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r694487876



##########
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.

Review comment:
       ```suggestion
   `status` is `OK` if path exists, `PATH_NOT_FOUND` otherwise.
   ```




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r694486925



##########
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
+to the request.
+
+```json
+     {
+     	"status": OK,
+        "allowed": 200000,
+        "used": 160000

Review comment:
       Why indent 3 spaces for `allowed` and `used` instead of 2?
   
   ```suggestion
          "allowed": 200000,
          "used": 160000
   ```




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl merged pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl merged pull request #2566:
URL: https://github.com/apache/ozone/pull/2566


   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r694488318



##########
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
+to the request.
+
+```json
+     {
+     	"status": OK,
+        "allowed": 200000,
+        "used": 160000
+     }
+```
+
+If quota is not set, `allowed` returns `-1`. More on [Quota in Ozone]
+(https://ci-hadoop.apache.org/view/Hadoop%20Ozone/job/ozone-doc-master/lastSuccessfulBuild/artifact/hadoop-hdds/docs/public/feature/quota.html)
+
+
+### GET /api/v1/namespace/dist
+
+**Parameters**
+
+* path
+
+  The path request in string without any protocol prefix.
+
+**Returns**
+
+Returns the file size distribution of all keys under the path.
+
+`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 is a key, which does not have

Review comment:
       Another typo?
   ```suggestion
   `TYPE_NOT_APPLICABLE` if path exists, but the path is a key, which does not have
   ```




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] kerneltime commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
kerneltime commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r695232123



##########
File path: hadoop-hdds/docs/content/interface/ReconApi.md
##########
@@ -232,7 +232,174 @@ 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.
+
+Example: /api/v1/namespace/summary?path=/

Review comment:
       Please include another example for a non root path.




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r694487743



##########
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

Review comment:
       Indentation




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r694487518



##########
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
+to the request.
+
+```json
+     {
+     	"status": OK,
+        "allowed": 200000,
+        "used": 160000
+     }
+```
+
+If quota is not set, `allowed` returns `-1`. More on [Quota in Ozone]
+(https://ci-hadoop.apache.org/view/Hadoop%20Ozone/job/ozone-doc-master/lastSuccessfulBuild/artifact/hadoop-hdds/docs/public/feature/quota.html)
+
+
+### GET /api/v1/namespace/dist
+
+**Parameters**
+
+* path
+
+  The path request in string without any protocol prefix.
+
+**Returns**
+
+Returns the file size distribution of all keys under the path.
+
+`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 is a key, which does not have
+a file size distribution.
+
+```json
+     {
+     	"status": OK,
+        "dist": [
+          0,
+          0,
+          10,
+          20,
+          0,
+          30,
+          0,
+          100,
+          ...
+        ]

Review comment:
       Same here.




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r694485621



##########
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
+to the request.
+

Review comment:
       Same here.

##########
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
+to the request.
+
+```json
+     {
+     	"status": OK,
+        "allowed": 200000,
+        "used": 160000
+     }
+```
+
+If quota is not set, `allowed` returns `-1`. More on [Quota in Ozone]
+(https://ci-hadoop.apache.org/view/Hadoop%20Ozone/job/ozone-doc-master/lastSuccessfulBuild/artifact/hadoop-hdds/docs/public/feature/quota.html)
+
+
+### GET /api/v1/namespace/dist
+
+**Parameters**
+
+* path
+
+  The path request in string without any protocol prefix.
+
+**Returns**
+
+Returns the file size distribution of all keys under the path.
+
+`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 is a key, which does not have
+a file size distribution.
+

Review comment:
       Same




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r694484640



##########
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.
+

Review comment:
       ```suggestion
   Example: /api/v1/namespace/summary?path=/
   
   ```




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] yuangu002 commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
yuangu002 commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r695244671



##########
File path: hadoop-hdds/docs/content/interface/ReconApi.md
##########
@@ -232,7 +232,174 @@ 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.
+
+Example: /api/v1/namespace/summary?path=/

Review comment:
       Thanks @kerneltime for taking a look! Do we need examples of non-root path for all endpoints?




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] kerneltime commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
kerneltime commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r695233729



##########
File path: hadoop-hdds/docs/content/interface/ReconApi.md
##########
@@ -232,7 +232,174 @@ 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.
+
+Example: /api/v1/namespace/summary?path=/
+```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.

Review comment:
       A boolean with a default value of `false`. If set to `true`, _computes_ disk usage for keys 
      under the path.




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl commented on pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#issuecomment-904945693


   Thanks @yuangu002 for the contribution!


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r694488009



##########
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

Review comment:
       Indentation




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r694488837



##########
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
+to the request.
+
+```json
+     {
+     	"status": OK,
+        "allowed": 200000,
+        "used": 160000
+     }
+```
+
+If quota is not set, `allowed` returns `-1`. More on [Quota in Ozone]
+(https://ci-hadoop.apache.org/view/Hadoop%20Ozone/job/ozone-doc-master/lastSuccessfulBuild/artifact/hadoop-hdds/docs/public/feature/quota.html)
+
+
+### GET /api/v1/namespace/dist
+
+**Parameters**
+
+* path
+
+  The path request in string without any protocol prefix.
+
+**Returns**
+
+Returns the file size distribution of all keys under the path.
+
+`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 is a key, which does not have
+a file size distribution.
+
+```json
+     {
+     	"status": OK,
+        "dist": [
+          0,
+          0,
+          10,
+          20,
+          0,
+          30,
+          0,
+          100,
+          ...
+        ]
+     }
+```
+Recon keeps track of all keys with size from `1KB` to `1PB`. For keys smaller than `1KB`,
+map to the first bin (index); for keys larger than `1PB`, map to the last bin (index).
+
+Each index of `dist` is mapped to a file size range (e.g. `1MB` - `2MB`).

Review comment:
       ```suggestion
   
   Recon keeps track of all keys with size from `1 KB` to `1 PB`. For keys smaller than `1 KB`,
   map to the first bin (index); for keys larger than `1 PB`, map to the last bin (index).
   
   Each index of `dist` is mapped to a file size range (e.g. `1 MB` - `2 MB`).
   ```




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] smengcl commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
smengcl commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r694485583



##########
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.
+

Review comment:
       Let's put the example query path & params that gives the result below here as well.




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] yuangu002 commented on a change in pull request #2566: HDDS-5637. Add documentation for Recon Namespace REST APIs

Posted by GitBox <gi...@apache.org>.
yuangu002 commented on a change in pull request #2566:
URL: https://github.com/apache/ozone/pull/2566#discussion_r695244671



##########
File path: hadoop-hdds/docs/content/interface/ReconApi.md
##########
@@ -232,7 +232,174 @@ 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.
+
+Example: /api/v1/namespace/summary?path=/

Review comment:
       Thanks @kerneltime for taking a look! Do we need examples of non-root path for all APIs?




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org