5
5
use super :: ServerContext ;
6
6
use crate :: db;
7
7
8
+ use crate :: params;
9
+ use crate :: views;
8
10
use dropshot:: endpoint;
9
11
use dropshot:: ApiDescription ;
10
12
use dropshot:: HttpError ;
@@ -38,9 +40,6 @@ use omicron_common::api::external::Instance;
38
40
use omicron_common:: api:: external:: InstanceCreateParams ;
39
41
use omicron_common:: api:: external:: Name ;
40
42
use omicron_common:: api:: external:: PaginationOrder ;
41
- use omicron_common:: api:: external:: Project ;
42
- use omicron_common:: api:: external:: ProjectCreateParams ;
43
- use omicron_common:: api:: external:: ProjectUpdateParams ;
44
43
use omicron_common:: api:: external:: Rack ;
45
44
use omicron_common:: api:: external:: Saga ;
46
45
use omicron_common:: api:: external:: Sled ;
@@ -156,7 +155,7 @@ pub fn external_api() -> NexusApiDescription {
156
155
async fn projects_get (
157
156
rqctx : Arc < RequestContext < Arc < ServerContext > > > ,
158
157
query_params : Query < PaginatedByNameOrId > ,
159
- ) -> Result < HttpResponseOk < ResultsPage < Project > > , HttpError > {
158
+ ) -> Result < HttpResponseOk < ResultsPage < views :: Project > > , HttpError > {
160
159
let apictx = rqctx. context ( ) ;
161
160
let nexus = & apictx. nexus ;
162
161
let query = query_params. into_inner ( ) ;
@@ -176,7 +175,7 @@ async fn projects_get(
176
175
} ;
177
176
178
177
let view_list =
179
- to_list :: < db:: model:: Project , Project > ( project_stream) . await ;
178
+ to_list :: < db:: model:: Project , views :: Project > ( project_stream) . await ;
180
179
Ok ( HttpResponseOk ( ScanByNameOrId :: results_page ( & query, view_list) ?) )
181
180
}
182
181
@@ -189,8 +188,8 @@ async fn projects_get(
189
188
} ]
190
189
async fn projects_post (
191
190
rqctx : Arc < RequestContext < Arc < ServerContext > > > ,
192
- new_project : TypedBody < ProjectCreateParams > ,
193
- ) -> Result < HttpResponseCreated < Project > , HttpError > {
191
+ new_project : TypedBody < params :: ProjectCreate > ,
192
+ ) -> Result < HttpResponseCreated < views :: Project > , HttpError > {
194
193
let apictx = rqctx. context ( ) ;
195
194
let nexus = & apictx. nexus ;
196
195
let project = nexus. project_create ( & new_project. into_inner ( ) ) . await ?;
@@ -216,7 +215,7 @@ struct ProjectPathParam {
216
215
async fn projects_get_project (
217
216
rqctx : Arc < RequestContext < Arc < ServerContext > > > ,
218
217
path_params : Path < ProjectPathParam > ,
219
- ) -> Result < HttpResponseOk < Project > , HttpError > {
218
+ ) -> Result < HttpResponseOk < views :: Project > , HttpError > {
220
219
let apictx = rqctx. context ( ) ;
221
220
let nexus = & apictx. nexus ;
222
221
let path = path_params. into_inner ( ) ;
@@ -260,8 +259,8 @@ async fn projects_delete_project(
260
259
async fn projects_put_project (
261
260
rqctx : Arc < RequestContext < Arc < ServerContext > > > ,
262
261
path_params : Path < ProjectPathParam > ,
263
- updated_project : TypedBody < ProjectUpdateParams > ,
264
- ) -> Result < HttpResponseOk < Project > , HttpError > {
262
+ updated_project : TypedBody < params :: ProjectUpdate > ,
263
+ ) -> Result < HttpResponseOk < views :: Project > , HttpError > {
265
264
let apictx = rqctx. context ( ) ;
266
265
let nexus = & apictx. nexus ;
267
266
let path = path_params. into_inner ( ) ;
0 commit comments