diff --git a/README.md b/README.md index 92959f12..259b01d7 100644 --- a/README.md +++ b/README.md @@ -210,9 +210,10 @@ Topograph offers three endpoints for interacting with the service. Below are the - **URL Query Parameters:** - **uid**: Specifies the request ID returned by the topology request endpoint. - **Response:** Depending on the request's execution stage, this endpoint can return: - - "404 NotFound" if the configuration is not ready yet. - - "200 OK" if the request has been completed successfully. - - "500 InternalServerError" if there was an error during request execution. + - "200 OK" - The request has completed successfully. + - "102 Processing" - The request is still in progress and has not completed yet. + - "404 Not Found" - The specified request ID does not exist. + - Other error responses encountered by Topograph during request execution. Example usage: diff --git a/pkg/server/trailing_delay_queue.go b/pkg/server/trailing_delay_queue.go index 14c9b5ce..ced1a1b6 100644 --- a/pkg/server/trailing_delay_queue.go +++ b/pkg/server/trailing_delay_queue.go @@ -126,10 +126,12 @@ func (q *TrailingDelayQueue) Get(uid string) *Completion { return res.(*Completion) } - completion := &Completion{Message: fmt.Sprintf("no data for request ID %s", uid)} + completion := &Completion{} if uid == q.uid { - completion.Status = http.StatusAccepted + completion.Message = fmt.Sprintf("request ID %s has not completed yet", uid) + completion.Status = http.StatusProcessing } else { + completion.Message = fmt.Sprintf("request ID %s not found", uid) completion.Status = http.StatusNotFound }