From 038f8ea2a57818694b407e91f23b188e7b44cb01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Dec 2021 16:44:59 +0000 Subject: [PATCH 1/4] Bump dropshot from `ff33033` to `e145e9b` Bumps [dropshot](https://github.com/oxidecomputer/dropshot) from `ff33033` to `e145e9b`. - [Release notes](https://github.com/oxidecomputer/dropshot/releases) - [Commits](https://github.com/oxidecomputer/dropshot/compare/ff33033ad3d7fcf32caa352d76fc243bd20db176...e145e9bf23231edca18eb7005fff936998517fda) --- updated-dependencies: - dependency-name: dropshot dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a6d168a85ad..ae792a00433 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -741,7 +741,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", @@ -776,7 +776,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", From 486abb59499dac913c6e9aac2a17d4128974b2d4 Mon Sep 17 00:00:00 2001 From: "Adam H. Leventhal" Date: Thu, 2 Dec 2021 11:31:43 -0800 Subject: [PATCH 2/4] clean up some endpoints that should return HttpResponseUpdatedNoContent --- nexus/src/external_api/http_entrypoints.rs | 17 +++++++++-------- openapi/nexus.json | 16 ++++++++-------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index 97b82d31ef4..24c9bfe224a 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; @@ -1140,7 +1141,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(); @@ -1153,7 +1154,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 } @@ -1325,7 +1326,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(); @@ -1339,7 +1340,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 } @@ -1561,7 +1562,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(); @@ -1575,7 +1576,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 } @@ -1731,7 +1732,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(); @@ -1746,7 +1747,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/openapi/nexus.json b/openapi/nexus.json index f139df5cc0c..65f759ca6ab 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" } } }, From 8f3aa4f04c2b3c9c764852260df663fc16482b2c Mon Sep 17 00:00:00 2001 From: "Adam H. Leventhal" Date: Thu, 2 Dec 2021 12:34:52 -0800 Subject: [PATCH 3/4] fix tests (the status codes changed) --- nexus/tests/test_router_routes.rs | 2 +- nexus/tests/test_vpc_routers.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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(); From 3c149d3477208174763ffb7e0a63e1f90893ddad Mon Sep 17 00:00:00 2001 From: David Crespo Date: Thu, 2 Dec 2021 15:52:06 -0600 Subject: [PATCH 4/4] fix the other two tests --- nexus/tests/test_vpc_subnets.rs | 2 +- nexus/tests/test_vpcs.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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(); }