Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

POST: http://{jm_rest_address:port}/blocklist/taskmanagers

Request

Request body:

Code Block
titleRequest Example
{
    [
        {
            "id" : "node1/container1",
            "action" : "MARK_BLOCKED",
            "endTimestamp" : "1652317200000",
            "cause" : "Hot machine",
			"mergeOnConflict" : "true"
        },
        {
            "id" : "node2/container2",
            "action" : "MARK_BLOCKED_AND_EVACUATE_TASKS",
            "timeout" : "3600000",
            "cause" : "No space left on device"
        }, 
        ...
    ]
}

...

  1. If field mergeOnConflict is false, return error. 
  2. If field mergeOnConflict is true. The newly added item and the existing item will be merged into one. Regarding the 3 fields, the merging algorithm:
    1. For action, merge(MARK_BLOCKED, MARK_BLOCKED_AND_EVACUATE_TASKS) = MARK_BLOCKED_AND_EVACUATE_TASKS
    2. For endTimestamp, merge(endTimestampA, endTimestampB) = max(endTimestampA, endTimestampB)
    3. For cause, we will combine all causes, merge("causeA", "causeB") = "causeA,causeB"

Response

  1. If no conflict, the response code is 201(CREATED), the response body is empty.
  2. If conflict occurs:
    1. If mergeOnConflict is false, the response code is 409(CONFLICT), and returns error.
    2. if mergeOnConflict is true, the response code is 202(ACCEPTED), the response body is the merged result.

Remove

DELETE: http://{jm_rest_address:port}/blocklist/node/<id>

...