diff --git a/pageserver/src/http/openapi_spec.yml b/pageserver/src/http/openapi_spec.yml index a9101d4bd6..b2760efe85 100644 --- a/pageserver/src/http/openapi_spec.yml +++ b/pageserver/src/http/openapi_spec.yml @@ -18,7 +18,7 @@ paths: schema: type: object required: - - id + - id properties: id: type: integer @@ -122,6 +122,110 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" + + + /v1/tenant/{tenant_id}/timeline/{timeline_id}/attach: + parameters: + - name: tenant_id + in: path + required: true + schema: + type: string + format: hex + - name: timeline_id + in: path + required: true + schema: + type: string + format: hex + post: + description: Attach remote timeline + responses: + "200": + description: Timeline attaching scheduled + "400": + description: Error when no tenant id found in path or no timeline id + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "401": + description: Unauthorized Error + content: + application/json: + schema: + $ref: "#/components/schemas/UnauthorizedError" + "403": + description: Forbidden Error + content: + application/json: + schema: + $ref: "#/components/schemas/ForbiddenError" + "404": + description: Timeline not found + content: + application/json: + schema: + $ref: "#/components/schemas/NotFoundError" + "409": + description: Timeline download is already in progress + content: + application/json: + schema: + $ref: "#/components/schemas/ConflictError" + "500": + description: Generic operation error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + + /v1/tenant/{tenant_id}/timeline/{timeline_id}/detach: + parameters: + - name: tenant_id + in: path + required: true + schema: + type: string + format: hex + - name: timeline_id + in: path + required: true + schema: + type: string + format: hex + post: + description: Detach local timeline + responses: + "200": + description: Timeline detached + "400": + description: Error when no tenant id found in path or no timeline id + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "401": + description: Unauthorized Error + content: + application/json: + schema: + $ref: "#/components/schemas/UnauthorizedError" + "403": + description: Forbidden Error + content: + application/json: + schema: + $ref: "#/components/schemas/ForbiddenError" + "500": + description: Generic operation error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v1/tenant/{tenant_id}/timeline/: parameters: - name: tenant_id @@ -179,7 +283,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/AlreadyExistsError" + $ref: "#/components/schemas/ConflictError" "500": description: Generic operation error content: @@ -260,7 +364,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/AlreadyExistsError" + $ref: "#/components/schemas/ConflictError" "500": description: Generic operation error content: @@ -354,14 +458,21 @@ components: properties: msg: type: string - AlreadyExistsError: + ForbiddenError: type: object required: - msg properties: msg: type: string - ForbiddenError: + NotFoundError: + type: object + required: + - msg + properties: + msg: + type: string + ConflictError: type: object required: - msg diff --git a/pageserver/src/http/routes.rs b/pageserver/src/http/routes.rs index 82e818a47b..207d2420bd 100644 --- a/pageserver/src/http/routes.rs +++ b/pageserver/src/http/routes.rs @@ -220,6 +220,7 @@ async fn timeline_attach_handler(request: Request
) -> Result