worker/api: drop /job-queue/v1 from api paths
This kind of common base path is better set in the top-level `server.url` field, so that it can be adjusted. For now, drop it completely, as we already broke the consistency when introducing the `/status` route. This change breaks backwards compatibility, but we're not yet promising a stable worker API to anyone.
This commit is contained in:
parent
c07674e1f4
commit
bf0dd66382
3 changed files with 27 additions and 27 deletions
|
|
@ -248,7 +248,7 @@ func NewPostJobQueueV1JobsRequestWithBody(server string, contentType string, bod
|
|||
return nil, err
|
||||
}
|
||||
|
||||
basePath := fmt.Sprintf("/job-queue/v1/jobs")
|
||||
basePath := fmt.Sprintf("/jobs")
|
||||
if basePath[0] == '/' {
|
||||
basePath = basePath[1:]
|
||||
}
|
||||
|
|
@ -283,7 +283,7 @@ func NewGetJobQueueV1JobsJobIdRequest(server string, jobId string) (*http.Reques
|
|||
return nil, err
|
||||
}
|
||||
|
||||
basePath := fmt.Sprintf("/job-queue/v1/jobs/%s", pathParam0)
|
||||
basePath := fmt.Sprintf("/jobs/%s", pathParam0)
|
||||
if basePath[0] == '/' {
|
||||
basePath = basePath[1:]
|
||||
}
|
||||
|
|
@ -328,7 +328,7 @@ func NewPatchJobQueueV1JobsJobIdRequestWithBody(server string, jobId string, con
|
|||
return nil, err
|
||||
}
|
||||
|
||||
basePath := fmt.Sprintf("/job-queue/v1/jobs/%s", pathParam0)
|
||||
basePath := fmt.Sprintf("/jobs/%s", pathParam0)
|
||||
if basePath[0] == '/' {
|
||||
basePath = basePath[1:]
|
||||
}
|
||||
|
|
@ -370,7 +370,7 @@ func NewPostJobQueueV1JobsJobIdArtifactsNameRequestWithBody(server string, jobId
|
|||
return nil, err
|
||||
}
|
||||
|
||||
basePath := fmt.Sprintf("/job-queue/v1/jobs/%s/artifacts/%s", pathParam0, pathParam1)
|
||||
basePath := fmt.Sprintf("/jobs/%s/artifacts/%s", pathParam0, pathParam1)
|
||||
if basePath[0] == '/' {
|
||||
basePath = basePath[1:]
|
||||
}
|
||||
|
|
@ -771,16 +771,16 @@ func ParseGetStatusResponse(rsp *http.Response) (*GetStatusResponse, error) {
|
|||
// ServerInterface represents all server handlers.
|
||||
type ServerInterface interface {
|
||||
// create-job
|
||||
// (POST /job-queue/v1/jobs)
|
||||
// (POST /jobs)
|
||||
PostJobQueueV1Jobs(ctx echo.Context) error
|
||||
// get-job
|
||||
// (GET /job-queue/v1/jobs/{job_id})
|
||||
// (GET /jobs/{job_id})
|
||||
GetJobQueueV1JobsJobId(ctx echo.Context, jobId string) error
|
||||
// update-job
|
||||
// (PATCH /job-queue/v1/jobs/{job_id})
|
||||
// (PATCH /jobs/{job_id})
|
||||
PatchJobQueueV1JobsJobId(ctx echo.Context, jobId string) error
|
||||
// add-image
|
||||
// (POST /job-queue/v1/jobs/{job_id}/artifacts/{name})
|
||||
// (POST /jobs/{job_id}/artifacts/{name})
|
||||
PostJobQueueV1JobsJobIdArtifactsName(ctx echo.Context, jobId string, name string) error
|
||||
// status
|
||||
// (GET /status)
|
||||
|
|
@ -888,10 +888,10 @@ func RegisterHandlers(router EchoRouter, si ServerInterface) {
|
|||
Handler: si,
|
||||
}
|
||||
|
||||
router.POST("/job-queue/v1/jobs", wrapper.PostJobQueueV1Jobs)
|
||||
router.GET("/job-queue/v1/jobs/:job_id", wrapper.GetJobQueueV1JobsJobId)
|
||||
router.PATCH("/job-queue/v1/jobs/:job_id", wrapper.PatchJobQueueV1JobsJobId)
|
||||
router.POST("/job-queue/v1/jobs/:job_id/artifacts/:name", wrapper.PostJobQueueV1JobsJobIdArtifactsName)
|
||||
router.POST("/jobs", wrapper.PostJobQueueV1Jobs)
|
||||
router.GET("/jobs/:job_id", wrapper.GetJobQueueV1JobsJobId)
|
||||
router.PATCH("/jobs/:job_id", wrapper.PatchJobQueueV1JobsJobId)
|
||||
router.POST("/jobs/:job_id/artifacts/:name", wrapper.PostJobQueueV1JobsJobIdArtifactsName)
|
||||
router.GET("/status", wrapper.GetStatus)
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ paths:
|
|||
- status
|
||||
operationId: get-status
|
||||
description: Simple status handler to check whether the service is up.
|
||||
/job-queue/v1/jobs:
|
||||
/jobs:
|
||||
post:
|
||||
summary: create-job
|
||||
tags: []
|
||||
|
|
@ -56,7 +56,7 @@ paths:
|
|||
schema:
|
||||
type: object
|
||||
properties: {}
|
||||
'/job-queue/v1/jobs/{job_id}':
|
||||
'/jobs/{job_id}':
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
|
|
@ -105,7 +105,7 @@ paths:
|
|||
required:
|
||||
- status
|
||||
- result
|
||||
'/job-queue/v1/jobs/{job_id}/artifacts/{name}':
|
||||
'/jobs/{job_id}/artifacts/{name}':
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue