2
2
// License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
4
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
+
5
22
use crate :: apis:: { ApiBoundary , ManagedApiConfig , Versions } ;
6
23
7
24
/// All APIs managed by openapi-manager.
@@ -10,162 +27,172 @@ pub fn all_apis() -> Vec<ManagedApiConfig> {
10
27
vec ! [
11
28
ManagedApiConfig {
12
29
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 ) ) ,
14
31
description: "Per-sled API for setup and teardown" ,
15
32
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,
18
34
ident: "bootstrap-agent" ,
19
35
extra_validation: None ,
20
36
} ,
21
37
ManagedApiConfig {
22
38
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 ) ) ,
24
40
description: "API for interacting with the Oxide \
25
41
control plane's ClickHouse cluster keepers",
26
42
boundary: ApiBoundary :: Internal ,
27
43
api_description:
28
- clickhouse_admin_api :: clickhouse_admin_keeper_api_mod:: stub_api_description,
44
+ clickhouse_admin_keeper_api_mod:: stub_api_description,
29
45
ident: "clickhouse-admin-keeper" ,
30
46
extra_validation: None ,
31
47
} ,
32
48
ManagedApiConfig {
33
49
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 ) ) ,
35
51
description: "API for interacting with the Oxide \
36
52
control plane's ClickHouse cluster replica servers",
37
53
boundary: ApiBoundary :: Internal ,
38
54
api_description:
39
- clickhouse_admin_api :: clickhouse_admin_server_api_mod:: stub_api_description,
55
+ clickhouse_admin_server_api_mod:: stub_api_description,
40
56
ident: "clickhouse-admin-server" ,
41
57
extra_validation: None ,
42
58
} ,
43
59
ManagedApiConfig {
44
60
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 ) ) ,
46
62
description: "API for interacting with the Oxide \
47
63
control plane's single-node ClickHouse database",
48
64
boundary: ApiBoundary :: Internal ,
49
65
api_description:
50
- clickhouse_admin_api :: clickhouse_admin_single_api_mod:: stub_api_description,
66
+ clickhouse_admin_single_api_mod:: stub_api_description,
51
67
ident: "clickhouse-admin-single" ,
52
68
extra_validation: None ,
53
69
} ,
54
70
ManagedApiConfig {
55
71
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 ) ) ,
57
73
description: "API for interacting with the Oxide \
58
74
control plane's CockroachDB cluster",
59
75
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,
62
77
ident: "cockroach-admin" ,
63
78
extra_validation: None ,
64
79
} ,
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
- } ,
76
80
ManagedApiConfig {
77
81
title: "Internal DNS" ,
78
82
versions: Versions :: new_versioned(
79
- dns_server_api:: supported_versions( )
83
+ dns_server_api:: supported_versions( ) ,
80
84
) ,
81
85
description: "API for the internal DNS server" ,
82
86
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,
85
88
ident: "dns-server" ,
86
89
extra_validation: None ,
87
90
} ,
88
91
ManagedApiConfig {
89
92
title: "Ereport Reporter API" ,
90
- versions: Versions :: new_versioned(
91
- ereport_api:: supported_versions( )
92
- ) ,
93
+ versions: Versions :: new_versioned( ereport_api:: supported_versions( ) ) ,
93
94
description: "API for ereport producers" ,
94
95
boundary: ApiBoundary :: Internal ,
95
- api_description:
96
- ereport_api:: ereport_api_mod:: stub_api_description,
96
+ api_description: ereport_api_mod:: stub_api_description,
97
97
ident: "ereport" ,
98
98
extra_validation: None ,
99
99
} ,
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
+ } ,
100
110
ManagedApiConfig {
101
111
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 ) ) ,
103
113
description: "API for installinator to fetch artifacts \
104
114
and report progress",
105
115
boundary: ApiBoundary :: Internal ,
106
- api_description:
107
- installinator_api:: installinator_api_mod:: stub_api_description,
116
+ api_description: installinator_api_mod:: stub_api_description,
108
117
ident: "installinator" ,
109
118
extra_validation: None ,
110
119
} ,
111
120
ManagedApiConfig {
112
121
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
+ ) ) ,
114
125
description: "API for interacting with the Oxide control plane" ,
115
126
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,
118
128
ident: "nexus" ,
119
129
extra_validation: Some ( nexus_external_api:: validate_api) ,
120
130
} ,
121
131
ManagedApiConfig {
122
132
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 ) ) ,
124
134
description: "Nexus internal API" ,
125
135
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,
128
137
ident: "nexus-internal" ,
129
138
extra_validation: None ,
130
139
} ,
131
140
ManagedApiConfig {
132
141
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 ) ) ,
134
143
description: "API for interacting with oximeter" ,
135
144
boundary: ApiBoundary :: Internal ,
136
- api_description:
137
- oximeter_api:: oximeter_api_mod:: stub_api_description,
145
+ api_description: oximeter_api_mod:: stub_api_description,
138
146
ident: "oximeter" ,
139
147
extra_validation: None ,
140
148
} ,
141
149
ManagedApiConfig {
142
150
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 ) ) ,
144
152
description: "API for fetching update artifacts" ,
145
153
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,
147
155
ident: "repo-depot" ,
148
156
extra_validation: None ,
149
157
} ,
150
158
ManagedApiConfig {
151
159
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 ) ) ,
153
161
description: "API for interacting with individual sleds" ,
154
162
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,
157
164
ident: "sled-agent" ,
158
165
extra_validation: None ,
159
166
} ,
160
167
ManagedApiConfig {
161
168
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 ) ) ,
163
170
description: "API for use by the technician port TUI: wicket" ,
164
171
boundary: ApiBoundary :: Internal ,
165
- api_description: wicketd_api :: wicketd_api_mod:: stub_api_description,
172
+ api_description: wicketd_api_mod:: stub_api_description,
166
173
ident: "wicketd" ,
167
174
extra_validation: None ,
168
175
} ,
169
- // Add your APIs here! Please keep this list sorted by filename.
170
176
]
171
177
}
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