Skip to content

api: add status query parameter for the scheduler API#3055

Merged
ti-srebot merged 3 commits intotikv:masterfrom
rleungx:scheduler-status
Oct 10, 2020
Merged

api: add status query parameter for the scheduler API#3055
ti-srebot merged 3 commits intotikv:masterfrom
rleungx:scheduler-status

Conversation

@rleungx
Copy link
Member

@rleungx rleungx commented Oct 9, 2020

What problem does this PR solve?

Closes #3052.

What is changed and how it works?

This PR supports the status query parameter for the scheduler API. For now, it only supports the paused status. If there is no status query parameter, the default behavior is the same as before.

Check List

Tests

  • Manual test

Release note

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@rleungx rleungx added the component/api HTTP API. label Oct 9, 2020
@rleungx rleungx requested review from HunDunDM and nolouch October 9, 2020 08:55
return
default:
}
h.r.JSON(w, http.StatusOK, schedulers)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this line after default:?

status := r.URL.Query().Get("status")
switch status {
case "paused":
var pausedScehdulers []string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var pausedScehdulers []string
var pausedSchedulers []string

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@howardlau1999
Copy link
Contributor

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 9, 2020
}
}
h.r.JSON(w, http.StatusOK, pausedSchedulers)
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need return now.

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Oct 10, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Oct 10, 2020
@nolouch
Copy link
Contributor

nolouch commented Oct 10, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 10, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #3066

rleungx added a commit to ti-srebot/pd that referenced this pull request Oct 13, 2020
Signed-off-by: Ryan Leung <rleungx@gmail.com>
ti-srebot added a commit that referenced this pull request Oct 15, 2020
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/api HTTP API. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an interface to check the status of paused scheduler.

5 participants