You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2020/10/19 10:35:10 UTC

[GitHub] [incubator-yunikorn-site] wilfred-s commented on a change in pull request #29: [YUNIKORN-405] Document config update API

wilfred-s commented on a change in pull request #29:
URL: https://github.com/apache/incubator-yunikorn-site/pull/29#discussion_r507643258



##########
File path: docs/api/scheduler.md
##########
@@ -433,6 +433,141 @@ Reponse
     "reason": "yaml: unmarshal errors:\n  line 7: cannot unmarshal !!str `wrong_text` into configs.PartitionConfig"
 }
 ```
+## Configuration
+
+Endpoint to retrieve the current scheduler configuration
+
+**URL** : `/ws/v1/config`
+
+**Method** : `GET`
+
+**Auth required** : NO
+
+### Success response
+
+**Code** : `200 OK`
+
+**Content example**
+
+```json
+partitions:
+- name: default
+  queues:
+  - name: root
+    parent: true
+    submitacl: '*'
+  placementrules:
+  - name: tag
+    create: true
+    value: namespace
+checksum:
+- 186
+- 179
+- 215
+- 100
+- 2
+- 130
+- 126
+- 171
+- 230
+- 47
+- 167
+- 228
+- 198
+- 188
+- 244
+- 216
+- 221
+- 149
+- 82
+- 131
+- 69
+- 97
+- 182
+- 182
+- 96
+- 239
+- 55
+- 254
+- 217
+- 41
+- 151
+- 145
+
+sha256 checksum: BAB3D76402827EABE62FA7E4C6BCF4D8DD9552834561B6B660EF37FED9299791

Review comment:
       That is the way the json marshaller does the `[]byte` marshalling. It converts every value in the array to a 8bit integer (0-255) and prints the value on a line. Unmarshalling probably gives you the right thing back again but it is not readable.
   In the `getClusterConfig()` call I thus opted for a printed format using the standard base 16, upper-case, two characters per byte conversion.
   The config also has ``` Checksum   [32]byte `yaml:"-" json:"-"` ``` added so the marshaller leaves it alone. The yaml version is slightly different than what I added but still human readable. We can use the `TestGetConfigYAML` and `TestGetConfigJSON` to see the impact of the marshaller




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

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