layover-http 0.23.1

The Layover Tower HTTP surface, generated from api/openapi.yaml.
Documentation

The Layover Tower HTTP surface.

Everything in [generated] comes from api/openapi.yaml by way of cargo xtask generate-api. The specification is the contract: cargo xtask verify regenerates the module and fails if it differs, so the server cannot drift away from the document that describes it.

This crate provides the shape of the API and nothing behind it. Implement [Api] to serve it; the Tower will, once it exists.

# use std::sync::Arc;
# use layover_http::{Api, Health, Problem, Status, router};
struct Stub;

impl Api for Stub {
    async fn get_health(&self) -> Result<Health, Problem> {
        Ok(Health {
            status: Status::Ok,
            version: env!("CARGO_PKG_VERSION").to_owned(),
            ground_stop: false,
        })
    }
    # async fn list_agents(&self) -> Result<layover_http::AgentList, Problem> { todo!() }
    # async fn list_pipelines(&self) -> Result<layover_http::PipelineList, Problem> { todo!() }
    # async fn get_graph(&self, _: layover_http::GetGraphQuery) -> Result<layover_http::RouteMap, Problem> { todo!() }
    # async fn list_help(&self, _: layover_http::ListHelpQuery) -> Result<layover_http::HelpList, Problem> { todo!() }
    # async fn list_learnings(&self, _: layover_http::ListLearningsQuery) -> Result<layover_http::LearningList, Problem> { todo!() }
    # async fn get_costs(&self, _: layover_http::GetCostsQuery) -> Result<layover_http::CostReport, Problem> { todo!() }
    # async fn send_flight(&self, _: layover_http::SendFlightRequest) -> Result<layover_http::FlightAccepted, Problem> { todo!() }
    # async fn list_runs(&self, _: layover_http::ListRunsQuery) -> Result<layover_http::RunList, Problem> { todo!() }
    # async fn get_run(&self, _: layover_http::GetRunPath) -> Result<layover_http::Run, Problem> { todo!() }
    # async fn stream_run(&self, _: layover_http::StreamRunPath) -> Result<layover_http::EventStream, Problem> { todo!() }
    # async fn list_pending(&self) -> Result<layover_http::PendingList, Problem> { todo!() }
    # async fn resolve_help(&self, _: layover_http::ResolveHelpRequest) -> Result<layover_http::HelpResolved, Problem> { todo!() }
    # async fn judge_learning(&self, _: layover_http::JudgeLearningPath, _: layover_http::JudgeLearningRequest) -> Result<layover_http::Learning, Problem> { todo!() }
    # async fn cancel_flight(&self, _: layover_http::CancelFlightPath) -> Result<layover_http::PendingList, Problem> { todo!() }
    # async fn list_itineraries(&self, _: layover_http::ListItinerariesQuery) -> Result<layover_http::ItineraryList, Problem> { todo!() }
    # async fn get_report(&self, _: layover_http::GetReportPath) -> Result<layover_http::Report, Problem> { todo!() }
    # async fn engage_ground_stop(&self) -> Result<layover_http::GroundStop, Problem> { todo!() }
    # async fn release_ground_stop(&self) -> Result<layover_http::GroundStop, Problem> { todo!() }
}

let app = router(Arc::new(Stub));