Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions crates/admin/src/rest_api/invocations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use crate::generate_meta_api_error;
use crate::rest_api::create_envelope_header;
use crate::state::AdminServiceState;

#[derive(Debug, Default, Deserialize, utoipa::ToSchema)]
#[derive(Debug, Default, Deserialize)]
pub enum DeletionMode {
#[default]
#[serde(alias = "cancel")]
Expand All @@ -46,34 +46,14 @@ pub enum DeletionMode {
#[serde(alias = "purge")]
Purge,
}
#[derive(Debug, Default, Deserialize, utoipa::ToSchema)]
#[derive(Debug, Default, Deserialize)]
pub struct DeleteInvocationParams {
pub mode: Option<DeletionMode>,
}

/// Delete an invocation
///
/// Use kill_invocation/cancel_invocation/purge_invocation instead.
#[utoipa::path(
delete,
path = "/invocations/{invocation_id}",
operation_id = "delete_invocation",
tag = "invocation",
params(
("invocation_id" = String, Path, description = "Invocation identifier."),
(
"mode" = Option<DeletionMode>, Query,
description = "If cancel, it will gracefully terminate the invocation. \
If kill, it will terminate the invocation with a hard stop. \
If purge, it will only cleanup the response for completed invocations,
and leave unaffected an in-flight invocation."
),
),
responses(
(status = 202, description = "Accepted"),
MetaApiError
)
)]
#[deprecated]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That is marked as deprecated in the open API spec is not enough? Why is removing it needed?

Copy link
Copy Markdown
Contributor Author

@slinkydeveloper slinkydeveloper Apr 2, 2026

Choose a reason for hiding this comment

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

I removed it because the DeletionMode was not generating the schema correctly, and then i figured that instead of fixing it i would just remove it from openapi given it's deprecated 🤷.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We've already told at least 1 release ago people to stop using this endpoint anyway 🤷 i think it's still here for cli compat (which maybe we can also remove now...)

pub async fn delete_invocation<Metadata, Discovery, Telemetry, Invocations, Transport>(
State(mut state): State<
Expand Down
7 changes: 6 additions & 1 deletion crates/admin/src/rest_api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ where
.routes(routes!(handlers::list_service_handlers))
.routes(routes!(handlers::get_service_handler))
// Invocation endpoints
.routes(routes!(invocations::delete_invocation))
.routes(routes!(invocations::kill_invocation))
.routes(routes!(invocations::cancel_invocation))
.routes(routes!(invocations::purge_invocation))
Expand Down Expand Up @@ -135,6 +134,12 @@ where
"/deployments/{deployment}",
axum::routing::put(deployments::update_deployment),
)
// Deprecated DELETE invocation
.route(
"/invocations/{invocation_id}",
#[allow(deprecated)]
axum::routing::delete(invocations::delete_invocation),
)
// Internal batch operation routes (for UI only, not documented in OpenAPI)
.route(
"/internal/invocations_batch_operations/kill",
Expand Down
Loading