Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 10 additions & 4 deletions out/openapi.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions packages/core/api-public/src/runner_configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
use axum::{
http::HeaderMap,
response::{IntoResponse, Response},
};

Check warning on line 7 in packages/core/api-public/src/runner_configs.rs

View workflow job for this annotation

GitHub Actions / Rustfmt

Diff in /home/runner/work/engine/engine/packages/core/api-public/src/runner_configs.rs
use reqwest::header::{HeaderMap as ReqwestHeaderMap, HeaderName, HeaderValue};
use rivet_api_builder::{
ApiError,
extract::{Extension, Json, Path, Query},
ApiError,
};
use rivet_api_peer::runner_configs::*;
use rivet_api_types::{pagination::Pagination, runner_configs::list::*};
use rivet_api_util::{fanout_to_datacenters, request_remote_datacenter};
use serde::{Deserialize, Serialize};
use utoipa::IntoParams;
use utoipa::ToSchema;

use crate::ctx::ApiCtx;
Expand Down Expand Up @@ -264,6 +265,14 @@
Ok(DeleteResponse {})
}

#[derive(Debug, Serialize, Deserialize, Clone, IntoParams)]
#[serde(deny_unknown_fields)]
#[into_params(parameter_in = Query)]
pub struct ServerlessHealthCheckQuery {
// NOTE: Only used in ee for ACL
pub namespace: String,
}

Comment on lines +268 to +275
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't we move this to ee if it does nothing here?

#[derive(Deserialize, Serialize, ToSchema)]
#[serde(deny_unknown_fields)]
#[schema(as = RunnerConfigsServerlessHealthCheckRequest)]
Expand Down Expand Up @@ -326,6 +335,9 @@
post,
operation_id = "runner_configs_serverless_health_check",
path = "/runner-configs/serverless-health-check",
params(
UpsertQuery,
),
request_body(content = ServerlessHealthCheckRequest, content_type = "application/json"),
responses(
(status = 200, body = ServerlessHealthCheckResponse),
Expand All @@ -334,16 +346,18 @@
)]
pub async fn serverless_health_check(
Extension(ctx): Extension<ApiCtx>,
Query(query): Query<ServerlessHealthCheckQuery>,
Json(body): Json<ServerlessHealthCheckRequest>,
) -> Response {
match serverless_health_check_inner(ctx, body).await {
match serverless_health_check_inner(ctx, query, body).await {
Ok(response) => Json(response).into_response(),
Err(err) => ApiError::from(err).into_response(),
}
}

async fn serverless_health_check_inner(
ctx: ApiCtx,
_query: ServerlessHealthCheckQuery,
body: ServerlessHealthCheckRequest,
) -> Result<ServerlessHealthCheckResponse> {
ctx.auth().await?;
Expand Down
Loading