From 9c101ace1da37167202f1eb2cb8227ac506d49e4 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Wed, 25 Oct 2023 15:25:24 -0500 Subject: [PATCH] pluralize /associations for restiness, prep for list endpoint --- nexus/src/external_api/http_entrypoints.rs | 4 ++-- nexus/test-utils/src/resource_helpers.rs | 2 +- nexus/tests/integration_tests/endpoints.rs | 2 +- nexus/tests/integration_tests/instances.rs | 2 +- nexus/tests/integration_tests/ip_pools.rs | 8 ++++---- nexus/tests/output/nexus_tags.txt | 4 ++-- openapi/nexus.json | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index 71f106e1bd..03ad0fbbdc 100644 --- a/nexus/src/external_api/http_entrypoints.rs +++ b/nexus/src/external_api/http_entrypoints.rs @@ -1325,7 +1325,7 @@ async fn ip_pool_update( /// Associate an IP Pool with a silo or project #[endpoint { method = POST, - path = "/v1/system/ip-pools/{pool}/association", + path = "/v1/system/ip-pools/{pool}/associations", tags = ["system/networking"], }] async fn ip_pool_association_create( @@ -1352,7 +1352,7 @@ async fn ip_pool_association_create( /// Remove an IP pool's association with a silo or project #[endpoint { method = DELETE, - path = "/v1/system/ip-pools/{pool}/association", + path = "/v1/system/ip-pools/{pool}/associations", tags = ["system/networking"], }] async fn ip_pool_association_delete( diff --git a/nexus/test-utils/src/resource_helpers.rs b/nexus/test-utils/src/resource_helpers.rs index fb001fcf11..b575e1b378 100644 --- a/nexus/test-utils/src/resource_helpers.rs +++ b/nexus/test-utils/src/resource_helpers.rs @@ -147,7 +147,7 @@ pub async fn create_ip_pool( // make pool available for use anywhere in fleet let _assoc: views::IpPoolResource = object_create( client, - &format!("/v1/system/ip-pools/{pool_name}/association"), + &format!("/v1/system/ip-pools/{pool_name}/associations"), ¶ms::IpPoolAssociationCreate::Fleet(params::IpPoolAssociateFleet { is_default: false, }), diff --git a/nexus/tests/integration_tests/endpoints.rs b/nexus/tests/integration_tests/endpoints.rs index 200f40fa5b..0ad87236d7 100644 --- a/nexus/tests/integration_tests/endpoints.rs +++ b/nexus/tests/integration_tests/endpoints.rs @@ -501,7 +501,7 @@ lazy_static! { description: Some(String::from("a new IP pool")), }, }; - pub static ref DEMO_IP_POOL_ASSOC_URL: String = format!("{}/association", *DEMO_IP_POOL_URL); + pub static ref DEMO_IP_POOL_ASSOC_URL: String = format!("{}/associations", *DEMO_IP_POOL_URL); pub static ref DEMO_IP_POOL_ASSOC_BODY: params::IpPoolAssociationCreate = params::IpPoolAssociationCreate::Silo(params::IpPoolAssociateSilo { silo: NameOrId::Id(DEFAULT_SILO.identity().id), diff --git a/nexus/tests/integration_tests/instances.rs b/nexus/tests/integration_tests/instances.rs index 7a46618a13..a6aee0b87e 100644 --- a/nexus/tests/integration_tests/instances.rs +++ b/nexus/tests/integration_tests/instances.rs @@ -3618,7 +3618,7 @@ async fn test_instance_ephemeral_ip_from_correct_pool( silo: NameOrId::Id(DEFAULT_SILO.id()), is_default: true, }); - let assoc_url = format!("/v1/system/ip-pools/{pool_name}/association"); + let assoc_url = format!("/v1/system/ip-pools/{pool_name}/associations"); let _ = NexusRequest::objects_post(client, &assoc_url, ¶ms) .authn_as(AuthnMode::PrivilegedUser) .execute() diff --git a/nexus/tests/integration_tests/ip_pools.rs b/nexus/tests/integration_tests/ip_pools.rs index 9e9932157a..62ce4d2dde 100644 --- a/nexus/tests/integration_tests/ip_pools.rs +++ b/nexus/tests/integration_tests/ip_pools.rs @@ -361,7 +361,7 @@ async fn test_ip_pool_with_silo(cptestctx: &ControlPlaneTestContext) { RequestBuilder::new( client, Method::POST, - "/v1/system/ip-pools/p1/association", + "/v1/system/ip-pools/p1/associations", ) .body(Some(¶ms)) .expect_status(Some(StatusCode::NOT_FOUND)), @@ -387,7 +387,7 @@ async fn test_ip_pool_with_silo(cptestctx: &ControlPlaneTestContext) { }); let _: IpPoolResource = object_create( client, - &format!("/v1/system/ip-pools/p1/association"), + &format!("/v1/system/ip-pools/p1/associations"), ¶ms, ) .await; @@ -412,7 +412,7 @@ async fn test_ip_pool_with_silo(cptestctx: &ControlPlaneTestContext) { }); let _: IpPoolResource = object_create( client, - &format!("/v1/system/ip-pools/p1/association"), + &format!("/v1/system/ip-pools/p1/associations"), ¶ms, ) .await; @@ -844,7 +844,7 @@ async fn test_ip_pool_list_usable_by_project( }); let _: IpPoolResource = object_create( client, - &format!("/v1/system/ip-pools/{mypool_name}/association"), + &format!("/v1/system/ip-pools/{mypool_name}/associations"), ¶ms, ) .await; diff --git a/nexus/tests/output/nexus_tags.txt b/nexus/tests/output/nexus_tags.txt index f3082cc05b..2039c33812 100644 --- a/nexus/tests/output/nexus_tags.txt +++ b/nexus/tests/output/nexus_tags.txt @@ -129,8 +129,8 @@ system_metric GET /v1/system/metrics/{metric_nam API operations found with tag "system/networking" OPERATION ID METHOD URL PATH -ip_pool_association_create POST /v1/system/ip-pools/{pool}/association -ip_pool_association_delete DELETE /v1/system/ip-pools/{pool}/association +ip_pool_association_create POST /v1/system/ip-pools/{pool}/associations +ip_pool_association_delete DELETE /v1/system/ip-pools/{pool}/associations ip_pool_create POST /v1/system/ip-pools ip_pool_delete DELETE /v1/system/ip-pools/{pool} ip_pool_list GET /v1/system/ip-pools diff --git a/openapi/nexus.json b/openapi/nexus.json index 56e7281b5f..dc0a406496 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -4577,7 +4577,7 @@ } } }, - "/v1/system/ip-pools/{pool}/association": { + "/v1/system/ip-pools/{pool}/associations": { "post": { "tags": [ "system/networking"