Craig Welch commented on YARN-2505:

So, suggesting a slight modification to achieve greater "restiness", and for 
practical reasons - I think PUT and DELETE operations should operate on only a 
single element in a path-oriented style, POST with a serialized payload should 
be used for batch operations.  I think that addition and removal of labels on a 
node do not presently need a batch operation.  So:

GET .../cluster/node-label/a 
return value indicates presence or absense of a

PUT .../cluster/node-label/a 
creates a new node label, "a"

DELETE .../cluster/node-label/a 
deletes and existing node label, "a"

POST .../cluster/node-labels 
(serialized data) adds multiple labels in an operation

GET .../cluster/node-labels
returns multiple labels as serialized data (all labels)

GET .../cluster/node/id/label/a
indicates existance of label on node by return value

PUT .../cluster/node/id/label/a
ads label "a" to node "id"

DELETE .../cluster/node/id/label/a
deletes label "a" from node "id"

GET .../cluster/node/id/labels
returns serialized set of all labels for node

(I don't think we need the post for individual nodes, if we did it, it would be 
a serialized set of labels to add to the node at: POST 

I notice that what I think should be /node/ is presently /nodes/, I could keep 
it so for consistency (but I'd rather do the above, which is what I think it 
should be for individual node manipulations)

> Support get/add/remove/change labels in RM REST API
> ---------------------------------------------------
>                 Key: YARN-2505
>                 URL: https://issues.apache.org/jira/browse/YARN-2505
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: resourcemanager
>            Reporter: Wangda Tan
>            Assignee: Craig Welch
>         Attachments: YARN-2505.1.patch, YARN-2505.patch

This message was sent by Atlassian JIRA

Reply via email to