[ 
https://issues.apache.org/jira/browse/YUNIKORN-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17498173#comment-17498173
 ] 

Wilfred Spiegelenburg commented on YUNIKORN-165:
------------------------------------------------

The only field that is free text which should not be are the resource fields. 
The rest are just text nothing that is structured.

Partition is not a map it is the name of the partition. it looks like a map in 
json but it is not.
It is {{[RMID]partitionName}}

We also specifically do not use json for timestamps as there is no pre-defined 
format and the standard int64 from go gives a better resolution.

I do think that we should do this before 1.0 and we can be backwards 
incompatible only now before we do the 1.0 release We can easily leave the 
deprecated APIs as they are.

> API response fields can be returned as proper data structure rather than free 
> text
> ----------------------------------------------------------------------------------
>
>                 Key: YUNIKORN-165
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-165
>             Project: Apache YuniKorn
>          Issue Type: Improvement
>          Components: core - common, webapp
>            Reporter: Ayub Pathan
>            Priority: Major
>
> For most of the APIs, some of the fields are recorded as free text, this can 
> be improved by sending them as proper data structure like map etc. This helps 
> in easy consumption of the REST aPI response.
> For example:
>  * Some fields from Apps API like resource,usedResource, partition can be 
> returned as maps..
> {noformat}
>     {
>         "allocations": [
>             {
>                 "allocationKey": "1e5225f7-4d60-400f-8b9b-5b7027b4c394",
>                 "allocationTags": null,
>                 "applicationId": "abcd",
>                 "nodeId": "docker-desktop",
>                 "partition": "default",
>                 "priority": "<nil>",
>                 "queueName": "root.development",
>                 "resource": "[memory:100 vcore:200]",
>                 "uuid": "b1b89eaf-81fb-4b2b-b20a-bf7bd96d3430"
>             }
>         ],
>         "applicationID": "abcd",
>         "applicationState": "Running",
>         "partition": "[mycluster]default",
>         "queueName": "root.development",
>         "submissionTime": 1589740021170274400,
>         "usedResource": "[memory:100 vcore:200]"
>     }, {noformat}
>  
>  *  same for nodes API response(fields like available, capacity, occupied, 
> allocated) as well.
> {noformat}
>     [
>     {
>         "nodesInfo": [
>             {
>                 "RackName": "/rack-default",
>                 "allocated": "[memory:0 vcore:0]",
>                 "allocations": null,
>                 "available": "[ephemeral-storage:56450230179 hugepages-1Gi:0 
> hugepages-2Mi:0 memory:1824 pods:110 vcore:3250]",
>                 "capacity": "[ephemeral-storage:56450230179 hugepages-1Gi:0 
> hugepages-2Mi:0 memory:1982 pods:110 vcore:4000]",
>                 "hostName": "docker-desktop",   
>                 "nodeID": "docker-desktop",
>                 "occupied": "[memory:158 vcore:750]",
>                 "schedulable": true
>             }
>         ],
>         "partitionName": "[mycluster]default"
>     }
> ] {noformat}
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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

Reply via email to