omni_orchestrator/schemas/v1/api/
mod.rs

1//-----------------------------------------------------------------------------
2// OmniOrchestrator V1 API route registration module
3//-----------------------------------------------------------------------------
4// Authors: Tristan Poland, Maxine DeAndreade, Caznix
5//
6// This module contains the route registration for the V1 API of OmniOrchestrator.
7// It includes all the necessary routes for various functionalities such as
8// apps, alerts, notifications, instances, users, permissions, metadata,
9// audit logs, builds, regions, providers, workers, metrics, storage,
10// cost, deployments, and logging.
11//
12// Each module corresponds to a specific functionality and contains the
13// implementation of the routes related to that functionality.
14// The `routes` function aggregates all the routes from the individual
15// modules and returns them as a vector of Rocket routes.
16// The routes are defined using the Rocket framework, which is a web
17// framework for Rust.
18//
19// The modules are organized in a way that allows for easy navigation
20// and understanding of the different functionalities provided by
21// OmniOrchestrator. Each module is responsible for a specific area of
22// functionality, and the routes defined within that module are related
23// to that functionality.
24//
25// The `routes` function is the entry point for registering all the
26// routes in the V1 API. It uses the `routes!` macro from Rocket to
27// define the routes and their corresponding handlers. The routes
28// are then returned as a vector, which can be used to register the
29// routes with the Rocket application.
30//-----------------------------------------------------------------------------
31
32use rocket::routes;
33
34pub mod alerts;
35pub mod apps;
36pub mod audit_log;
37pub mod builds;
38pub mod control;
39pub mod cost;
40pub mod deploy;
41pub mod helpers;
42pub mod instances;
43pub mod metadata;
44pub mod metrics;
45pub mod notifications;
46pub mod permissions;
47// pub mod platforms;
48pub mod deployments;
49pub mod index;
50pub mod logging;
51pub mod providers;
52pub mod regions;
53pub mod storage;
54pub mod users;
55pub mod workers;
56pub mod platforms;
57
58pub fn routes() -> Vec<rocket::Route> {
59    routes![
60        // apps
61        apps::release,
62        apps::get_app,
63        apps::stop_app,
64        apps::list_apps,
65        apps::start_app,
66        apps::scale_app,
67        apps::count_apps,
68        apps::create_app,
69        apps::update_app,
70        apps::delete_app,
71        apps::get_app_stats,
72        apps::list_instances,
73        apps::get_app_with_instances,
74
75        // alerts
76        alerts::list_alerts,
77        alerts::get_alert,
78        alerts::create_alert,
79        alerts::update_alert_status,
80        alerts::acknowledge_alert,
81        alerts::resolve_alert,
82        alerts::escalate_alert,
83        alerts::get_app_alerts,
84        alerts::get_org_active_alerts,
85        alerts::get_org_alert_stats,
86        alerts::get_alerts_needing_escalation,
87        alerts::auto_resolve_old_alerts,
88        alerts::search_alerts,
89        alerts::bulk_update_alert_status,
90
91        // Notifications
92        notifications::list_user_notifications,
93        notifications::count_unread_user_notifications,
94        notifications::get_user_notification_by_id,
95        notifications::create_user_notification,
96        notifications::mark_user_notification_as_read,
97        notifications::mark_all_user_notifications_as_read,
98        notifications::delete_user_notification,
99        notifications::delete_read_user_notifications,
100        notifications::list_role_notifications,
101        notifications::create_role_notification,
102        notifications::acknowledge_notification,
103        notifications::get_all_user_notifications_with_count,
104
105        // Instances
106        instances::list_instances_by_region,
107        instances::count_instances,
108        instances::get_instance,
109        // deploy
110        deploy::deploy_permissions,
111
112        // Users
113        users::handle_register,
114        users::handle_login,
115        users::update_profile,
116        users::get_current_user,
117        users::change_password,
118        users::logout,
119        users::get_user_profile,
120        users::list_user_sessions,
121        users::invalidate_user_session,
122        users::list_users,
123
124        // permissions
125        permissions::list_permission,
126        permissions::get_permission_by_id,
127        permissions::create_permission,
128        permissions::delete_permission,
129        // update_permission,
130
131        // Metadata
132        metadata::get_meta_value,
133        metadata::set_meta_value,
134
135        // Audit log
136        audit_log::create_audit_log,
137        audit_log::list_audit_logs,
138        audit_log::list_audit_logs_for_app,
139
140        //Builds
141        builds::list_builds,
142        builds::list_builds_for_app,
143        builds::get_build,
144
145        // Regions
146        regions::list_regions,
147        regions::list_provider_regions,
148        //        regions::get_region,
149        //        regions::delete_region,
150        //        regions::create_region,
151        //        regions::update_region,
152
153        // Providers
154        providers::list_providers,
155        providers::get_provider_instances,
156        providers::get_provider_audit_logs_paginated,
157
158        // TODO: @tristanpoland Migration broke these
159        //init_platform,
160        //check_platform_status,
161        //bootstrap_host,
162        //configure_network,
163        //setup_monitoring,
164        //setup_backups,
165        // Workers
166        workers::list_workers,
167        workers::get_worker_by_id,
168        // Metrics
169        metrics::get_metrics,
170        metrics::get_metrics_by_app_id,
171
172        // Storage
173        storage::list_storage_classes,
174        storage::get_storage_class,
175        storage::list_storage_volumes,
176        storage::get_volumes_by_storage_class,
177        storage::list_qos_policies,
178        storage::list_volumes_by_write_concern,
179        storage::list_volumes_by_persistence_level,
180        storage::get_volumes_for_region_route,
181        storage::get_storage_volumes_for_provider,
182
183        // Cost
184        // Resource Type routes
185        cost::list_resource_types,
186        cost::count_resource_types,
187        cost::get_resource_type,
188        cost::create_resource_type,
189        cost::update_resource_type,
190        cost::delete_resource_type,
191        // Cost Metric routes
192        cost::list_cost_metrics,
193        cost::get_cost_metric,
194        cost::create_cost_metric,
195        cost::delete_cost_metric,
196        cost::analyze_costs_by_dimension,
197        cost::analyze_cost_over_time,
198        // Cost Budget routes
199        cost::list_cost_budgets,
200        cost::get_cost_budget,
201        cost::create_cost_budget,
202        cost::update_cost_budget,
203        cost::delete_cost_budget,
204        // Cost Projection routes
205        cost::list_cost_projections,
206        cost::get_cost_projection,
207        cost::create_cost_projection,
208        cost::delete_cost_projection,
209        // Resource Pricing routes
210        cost::list_resource_pricing,
211        cost::get_resource_pricing,
212        cost::create_resource_pricing,
213        cost::update_resource_pricing,
214        cost::delete_resource_pricing,
215        // Cost Allocation Tag routes
216        cost::get_cost_allocation_tags,
217        cost::create_cost_allocation_tag,
218        cost::delete_cost_allocation_tag,
219
220        // CLI
221        // control::backup::get_backup,
222        // control::backup::list_backups,
223        // control::backup::create_backup,
224        // control::backup::list_backups_by_app_id,
225
226        deployments::list_deployments,
227        deployments::count_deployments,
228        deployments::get_deployment,
229        deployments::list_app_deployments,
230        deployments::create_deployment,
231        deployments::update_deployment_status,
232        deployments::delete_deployment,
233
234        // Logging
235        logging::list_logs,
236        logging::list_platform_logs,
237        logging::list_org_logs,
238        logging::list_app_logs,
239        logging::list_instance_logs,
240        logging::insert_logs,
241
242        platforms::list_platforms,
243        platforms::add_platform,
244        platforms::remove_platform,
245    ]
246}