mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 03:05:53 +08:00
Use a : character followed by the custom verb in HTTP URL
Following the recommendation from google.aip.dev/136
This commit is contained in:
parent
ef0ff2512b
commit
1ffe9f75f5
7
main.go
7
main.go
@ -71,15 +71,16 @@ func main() {
|
||||
api.HandleFunc("/queues", newListQueuesHandlerFunc(inspector)).Methods("GET")
|
||||
api.HandleFunc("/queues/{qname}", newGetQueueHandlerFunc(inspector)).Methods("GET")
|
||||
api.HandleFunc("/queues/{qname}", newDeleteQueueHandlerFunc(inspector)).Methods("DELETE")
|
||||
api.HandleFunc("/queues/{qname}/pause", newPauseQueueHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/resume", newResumeQueueHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}:pause", newPauseQueueHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}:resume", newResumeQueueHandlerFunc(inspector)).Methods("POST")
|
||||
|
||||
// Task endpoints.
|
||||
api.HandleFunc("/queues/{qname}/active_tasks", newListActiveTasksHandlerFunc(inspector)).Methods("GET")
|
||||
api.HandleFunc("/queues/{qname}/active_tasks/{task_id}/cancel", newCancelActiveTaskHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/active_tasks/{task_id}:cancel", newCancelActiveTaskHandlerFunc(inspector)).Methods("POST")
|
||||
api.HandleFunc("/queues/{qname}/pending_tasks", newListPendingTasksHandlerFunc(inspector)).Methods("GET")
|
||||
api.HandleFunc("/queues/{qname}/scheduled_tasks", newListScheduledTasksHandlerFunc(inspector)).Methods("GET")
|
||||
api.HandleFunc("/queues/{qname}/scheduled_tasks/{task_key}", newDeleteTaskHandlerFunc(inspector)).Methods("DELETE")
|
||||
// api.HandleFunc("/queues/{qname}/scheduled_tasks:delete_all", newDeleteAllScheduledTasksTaskHandlerFunc(inspector)).Methods("DELETE")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks", newListRetryTasksHandlerFunc(inspector)).Methods("GET")
|
||||
api.HandleFunc("/queues/{qname}/retry_tasks/{task_key}", newDeleteTaskHandlerFunc(inspector)).Methods("DELETE")
|
||||
api.HandleFunc("/queues/{qname}/dead_tasks", newListDeadTasksHandlerFunc(inspector)).Methods("GET")
|
||||
|
@ -144,14 +144,14 @@ export async function deleteQueue(qname: string): Promise<void> {
|
||||
export async function pauseQueue(qname: string): Promise<void> {
|
||||
await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/pause`,
|
||||
url: `${BASE_URL}/queues/${qname}:pause`,
|
||||
});
|
||||
}
|
||||
|
||||
export async function resumeQueue(qname: string): Promise<void> {
|
||||
await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/resume`,
|
||||
url: `${BASE_URL}/queues/${qname}:resume`,
|
||||
});
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ export async function cancelActiveTask(
|
||||
): Promise<void> {
|
||||
await axios({
|
||||
method: "post",
|
||||
url: `${BASE_URL}/queues/${qname}/active_tasks/${taskId}/cancel`,
|
||||
url: `${BASE_URL}/queues/${qname}/active_tasks/${taskId}:cancel`,
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user