22// License, v. 2.0. If a copy of the MPL was not distributed with this
33// file, You can obtain one at https://mozilla.org/MPL/2.0/.
44
5+ use bootstrap_agent_api:: bootstrap_agent_api_mod;
6+ use clickhouse_admin_api:: {
7+ clickhouse_admin_keeper_api_mod, clickhouse_admin_server_api_mod,
8+ clickhouse_admin_single_api_mod,
9+ } ;
10+ use cockroach_admin_api:: cockroach_admin_api_mod;
11+ use dns_server_api:: dns_server_api_mod;
12+ use ereport_api:: ereport_api_mod;
13+ use gateway_api:: gateway_api_mod;
14+ use installinator_api:: installinator_api_mod;
15+ use nexus_external_api:: nexus_external_api_mod;
16+ use nexus_internal_api:: nexus_internal_api_mod;
17+ use oximeter_api:: oximeter_api_mod;
18+ use repo_depot_api:: repo_depot_api_mod;
19+ use sled_agent_api:: sled_agent_api_mod;
20+ use wicketd_api:: wicketd_api_mod;
21+
522use crate :: apis:: { ApiBoundary , ManagedApiConfig , Versions } ;
623
724/// All APIs managed by openapi-manager.
@@ -10,162 +27,172 @@ pub fn all_apis() -> Vec<ManagedApiConfig> {
1027 vec ! [
1128 ManagedApiConfig {
1229 title: "Bootstrap Agent API" ,
13- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
30+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
1431 description: "Per-sled API for setup and teardown" ,
1532 boundary: ApiBoundary :: Internal ,
16- api_description:
17- bootstrap_agent_api:: bootstrap_agent_api_mod:: stub_api_description,
33+ api_description: bootstrap_agent_api_mod:: stub_api_description,
1834 ident: "bootstrap-agent" ,
1935 extra_validation: None ,
2036 } ,
2137 ManagedApiConfig {
2238 title: "ClickHouse Cluster Admin Keeper API" ,
23- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
39+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
2440 description: "API for interacting with the Oxide \
2541 control plane's ClickHouse cluster keepers",
2642 boundary: ApiBoundary :: Internal ,
2743 api_description:
28- clickhouse_admin_api :: clickhouse_admin_keeper_api_mod:: stub_api_description,
44+ clickhouse_admin_keeper_api_mod:: stub_api_description,
2945 ident: "clickhouse-admin-keeper" ,
3046 extra_validation: None ,
3147 } ,
3248 ManagedApiConfig {
3349 title: "ClickHouse Cluster Admin Server API" ,
34- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
50+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
3551 description: "API for interacting with the Oxide \
3652 control plane's ClickHouse cluster replica servers",
3753 boundary: ApiBoundary :: Internal ,
3854 api_description:
39- clickhouse_admin_api :: clickhouse_admin_server_api_mod:: stub_api_description,
55+ clickhouse_admin_server_api_mod:: stub_api_description,
4056 ident: "clickhouse-admin-server" ,
4157 extra_validation: None ,
4258 } ,
4359 ManagedApiConfig {
4460 title: "ClickHouse Single-Node Admin Server API" ,
45- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
61+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
4662 description: "API for interacting with the Oxide \
4763 control plane's single-node ClickHouse database",
4864 boundary: ApiBoundary :: Internal ,
4965 api_description:
50- clickhouse_admin_api :: clickhouse_admin_single_api_mod:: stub_api_description,
66+ clickhouse_admin_single_api_mod:: stub_api_description,
5167 ident: "clickhouse-admin-single" ,
5268 extra_validation: None ,
5369 } ,
5470 ManagedApiConfig {
5571 title: "CockroachDB Cluster Admin API" ,
56- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
72+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
5773 description: "API for interacting with the Oxide \
5874 control plane's CockroachDB cluster",
5975 boundary: ApiBoundary :: Internal ,
60- api_description:
61- cockroach_admin_api:: cockroach_admin_api_mod:: stub_api_description,
76+ api_description: cockroach_admin_api_mod:: stub_api_description,
6277 ident: "cockroach-admin" ,
6378 extra_validation: None ,
6479 } ,
65- ManagedApiConfig {
66- title: "Oxide Management Gateway Service API" ,
67- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
68- description: "API for interacting with the Oxide \
69- control plane's gateway service",
70- boundary: ApiBoundary :: Internal ,
71- api_description:
72- gateway_api:: gateway_api_mod:: stub_api_description,
73- ident: "gateway" ,
74- extra_validation: None ,
75- } ,
7680 ManagedApiConfig {
7781 title: "Internal DNS" ,
7882 versions: Versions :: new_versioned(
79- dns_server_api:: supported_versions( )
83+ dns_server_api:: supported_versions( ) ,
8084 ) ,
8185 description: "API for the internal DNS server" ,
8286 boundary: ApiBoundary :: Internal ,
83- api_description:
84- dns_server_api:: dns_server_api_mod:: stub_api_description,
87+ api_description: dns_server_api_mod:: stub_api_description,
8588 ident: "dns-server" ,
8689 extra_validation: None ,
8790 } ,
8891 ManagedApiConfig {
8992 title: "Ereport Reporter API" ,
90- versions: Versions :: new_versioned(
91- ereport_api:: supported_versions( )
92- ) ,
93+ versions: Versions :: new_versioned( ereport_api:: supported_versions( ) ) ,
9394 description: "API for ereport producers" ,
9495 boundary: ApiBoundary :: Internal ,
95- api_description:
96- ereport_api:: ereport_api_mod:: stub_api_description,
96+ api_description: ereport_api_mod:: stub_api_description,
9797 ident: "ereport" ,
9898 extra_validation: None ,
9999 } ,
100+ ManagedApiConfig {
101+ title: "Oxide Management Gateway Service API" ,
102+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
103+ description: "API for interacting with the Oxide \
104+ control plane's gateway service",
105+ boundary: ApiBoundary :: Internal ,
106+ api_description: gateway_api_mod:: stub_api_description,
107+ ident: "gateway" ,
108+ extra_validation: None ,
109+ } ,
100110 ManagedApiConfig {
101111 title: "Installinator API" ,
102- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
112+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
103113 description: "API for installinator to fetch artifacts \
104114 and report progress",
105115 boundary: ApiBoundary :: Internal ,
106- api_description:
107- installinator_api:: installinator_api_mod:: stub_api_description,
116+ api_description: installinator_api_mod:: stub_api_description,
108117 ident: "installinator" ,
109118 extra_validation: None ,
110119 } ,
111120 ManagedApiConfig {
112121 title: "Oxide Region API" ,
113- versions: Versions :: new_lockstep( semver:: Version :: new( 20250409 , 0 , 0 ) ) ,
122+ versions: Versions :: new_lockstep( semver:: Version :: new(
123+ 20250604 , 0 , 0 ,
124+ ) ) ,
114125 description: "API for interacting with the Oxide control plane" ,
115126 boundary: ApiBoundary :: External ,
116- api_description:
117- nexus_external_api:: nexus_external_api_mod:: stub_api_description,
127+ api_description: nexus_external_api_mod:: stub_api_description,
118128 ident: "nexus" ,
119129 extra_validation: Some ( nexus_external_api:: validate_api) ,
120130 } ,
121131 ManagedApiConfig {
122132 title: "Nexus internal API" ,
123- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
133+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
124134 description: "Nexus internal API" ,
125135 boundary: ApiBoundary :: Internal ,
126- api_description:
127- nexus_internal_api:: nexus_internal_api_mod:: stub_api_description,
136+ api_description: nexus_internal_api_mod:: stub_api_description,
128137 ident: "nexus-internal" ,
129138 extra_validation: None ,
130139 } ,
131140 ManagedApiConfig {
132141 title: "Oxide Oximeter API" ,
133- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
142+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
134143 description: "API for interacting with oximeter" ,
135144 boundary: ApiBoundary :: Internal ,
136- api_description:
137- oximeter_api:: oximeter_api_mod:: stub_api_description,
145+ api_description: oximeter_api_mod:: stub_api_description,
138146 ident: "oximeter" ,
139147 extra_validation: None ,
140148 } ,
141149 ManagedApiConfig {
142150 title: "Oxide TUF Repo Depot API" ,
143- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
151+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
144152 description: "API for fetching update artifacts" ,
145153 boundary: ApiBoundary :: Internal ,
146- api_description: repo_depot_api :: repo_depot_api_mod:: stub_api_description,
154+ api_description: repo_depot_api_mod:: stub_api_description,
147155 ident: "repo-depot" ,
148156 extra_validation: None ,
149157 } ,
150158 ManagedApiConfig {
151159 title: "Oxide Sled Agent API" ,
152- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
160+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
153161 description: "API for interacting with individual sleds" ,
154162 boundary: ApiBoundary :: Internal ,
155- api_description:
156- sled_agent_api:: sled_agent_api_mod:: stub_api_description,
163+ api_description: sled_agent_api_mod:: stub_api_description,
157164 ident: "sled-agent" ,
158165 extra_validation: None ,
159166 } ,
160167 ManagedApiConfig {
161168 title: "Oxide Technician Port Control Service" ,
162- versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
169+ versions: Versions :: new_lockstep( semver:: Version :: new( 0 , 0 , 1 ) ) ,
163170 description: "API for use by the technician port TUI: wicket" ,
164171 boundary: ApiBoundary :: Internal ,
165- api_description: wicketd_api :: wicketd_api_mod:: stub_api_description,
172+ api_description: wicketd_api_mod:: stub_api_description,
166173 ident: "wicketd" ,
167174 extra_validation: None ,
168175 } ,
169- // Add your APIs here! Please keep this list sorted by filename.
170176 ]
171177}
178+
179+ #[ cfg( test) ]
180+ mod tests {
181+ use super :: all_apis;
182+
183+ #[ test]
184+ fn all_apis_is_sorted ( ) {
185+ let unordered = all_apis ( )
186+ . windows ( 2 )
187+ . filter_map ( |window| {
188+ ( window[ 0 ] . ident > window[ 1 ] . ident ) . then_some ( format ! (
189+ "{} is incorrectly listed before {}" ,
190+ window[ 0 ] . ident, window[ 1 ] . ident
191+ ) )
192+ } )
193+ . collect :: < Vec < _ > > ( ) ;
194+ if !unordered. is_empty ( ) {
195+ panic ! ( "all_apis() is not sorted by filename: {unordered:?}" )
196+ }
197+ }
198+ }
0 commit comments