diff --git a/Cargo.lock b/Cargo.lock index 291ac9d47f7..bfa6b653209 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -750,7 +750,7 @@ checksum = "4bb454f0228b18c7f4c3b0ebbee346ed9c52e7443b0999cd543ff3571205701d" [[package]] name = "dropshot" version = "0.6.1-dev" -source = "git+https://github.com/oxidecomputer/dropshot?branch=main#ff33033ad3d7fcf32caa352d76fc243bd20db176" +source = "git+https://github.com/oxidecomputer/dropshot?branch=main#e145e9bf23231edca18eb7005fff936998517fda" dependencies = [ "async-trait", "base64", @@ -785,7 +785,7 @@ dependencies = [ [[package]] name = "dropshot_endpoint" version = "0.6.1-dev" -source = "git+https://github.com/oxidecomputer/dropshot?branch=main#ff33033ad3d7fcf32caa352d76fc243bd20db176" +source = "git+https://github.com/oxidecomputer/dropshot?branch=main#e145e9bf23231edca18eb7005fff936998517fda" dependencies = [ "proc-macro2", "quote", diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index aa8637fe9e7..7cea9bb6c5c 100644 --- a/nexus/src/external_api/http_entrypoints.rs +++ b/nexus/src/external_api/http_entrypoints.rs @@ -22,6 +22,7 @@ use dropshot::HttpResponseAccepted; use dropshot::HttpResponseCreated; use dropshot::HttpResponseDeleted; use dropshot::HttpResponseOk; +use dropshot::HttpResponseUpdatedNoContent; use dropshot::Path; use dropshot::Query; use dropshot::RequestContext; @@ -1143,7 +1144,7 @@ async fn project_vpcs_put_vpc( rqctx: Arc>>, path_params: Path, updated_vpc: TypedBody, -) -> Result, HttpError> { +) -> Result { let apictx = rqctx.context(); let nexus = &apictx.nexus; let path = path_params.into_inner(); @@ -1156,7 +1157,7 @@ async fn project_vpcs_put_vpc( &updated_vpc.into_inner(), ) .await?; - Ok(HttpResponseOk(())) + Ok(HttpResponseUpdatedNoContent()) }; apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await } @@ -1328,7 +1329,7 @@ async fn vpc_subnets_put_subnet( rqctx: Arc>>, path_params: Path, subnet_params: TypedBody, -) -> Result, HttpError> { +) -> Result { let apictx = rqctx.context(); let nexus = &apictx.nexus; let path = path_params.into_inner(); @@ -1342,7 +1343,7 @@ async fn vpc_subnets_put_subnet( &subnet_params.into_inner(), ) .await?; - Ok(HttpResponseOk(())) + Ok(HttpResponseUpdatedNoContent()) }; apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await } @@ -1564,7 +1565,7 @@ async fn vpc_routers_put_router( rqctx: Arc>>, path_params: Path, router_params: TypedBody, -) -> Result, HttpError> { +) -> Result { let apictx = rqctx.context(); let nexus = &apictx.nexus; let path = path_params.into_inner(); @@ -1578,7 +1579,7 @@ async fn vpc_routers_put_router( &router_params.into_inner(), ) .await?; - Ok(HttpResponseOk(())) + Ok(HttpResponseUpdatedNoContent()) }; apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await } @@ -1734,7 +1735,7 @@ async fn routers_routes_put_route( rqctx: Arc>>, path_params: Path, router_params: TypedBody, -) -> Result, HttpError> { +) -> Result { let apictx = rqctx.context(); let nexus = &apictx.nexus; let path = path_params.into_inner(); @@ -1749,7 +1750,7 @@ async fn routers_routes_put_route( &router_params.into_inner(), ) .await?; - Ok(HttpResponseOk(())) + Ok(HttpResponseUpdatedNoContent()) }; apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await } diff --git a/nexus/tests/test_router_routes.rs b/nexus/tests/test_router_routes.rs index e7ae6e72df5..ec4859223ed 100644 --- a/nexus/tests/test_router_routes.rs +++ b/nexus/tests/test_router_routes.rs @@ -146,7 +146,7 @@ async fn test_router_routes() { "loopback".parse().unwrap(), ), }), - StatusCode::OK, + StatusCode::NO_CONTENT, ) .await .unwrap(); diff --git a/nexus/tests/test_vpc_routers.rs b/nexus/tests/test_vpc_routers.rs index 81c81f9f2ec..3538e4734c5 100644 --- a/nexus/tests/test_vpc_routers.rs +++ b/nexus/tests/test_vpc_routers.rs @@ -138,7 +138,7 @@ async fn test_vpc_routers() { Method::PUT, &router_url, Some(update_params), - StatusCode::OK, + StatusCode::NO_CONTENT, ) .await .unwrap(); diff --git a/nexus/tests/test_vpc_subnets.rs b/nexus/tests/test_vpc_subnets.rs index d93bf8b0e31..103c6f7b34c 100644 --- a/nexus/tests/test_vpc_subnets.rs +++ b/nexus/tests/test_vpc_subnets.rs @@ -181,7 +181,7 @@ async fn test_vpc_subnets() { Method::PUT, &subnet_url, Some(update_params), - StatusCode::OK, + StatusCode::NO_CONTENT, ) .await .unwrap(); diff --git a/nexus/tests/test_vpcs.rs b/nexus/tests/test_vpcs.rs index 2e4355edc96..176be42cca2 100644 --- a/nexus/tests/test_vpcs.rs +++ b/nexus/tests/test_vpcs.rs @@ -149,7 +149,12 @@ async fn vpc_put( params: params::VpcUpdate, ) { client - .make_request(Method::PUT, &vpc_url, Some(params), StatusCode::OK) + .make_request( + Method::PUT, + &vpc_url, + Some(params), + StatusCode::NO_CONTENT, + ) .await .unwrap(); } diff --git a/openapi/nexus.json b/openapi/nexus.json index d56bd3a7edf..fe25cc358df 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -1522,8 +1522,8 @@ "required": true }, "responses": { - "200": { - "description": "successful operation" + "204": { + "description": "resource updated" } } }, @@ -1939,8 +1939,8 @@ "required": true }, "responses": { - "200": { - "description": "successful operation" + "204": { + "description": "resource updated" } } }, @@ -2268,8 +2268,8 @@ "required": true }, "responses": { - "200": { - "description": "successful operation" + "204": { + "description": "resource updated" } } }, @@ -2570,8 +2570,8 @@ "required": true }, "responses": { - "200": { - "description": "successful operation" + "204": { + "description": "resource updated" } } },