Skip to content

Commit

Permalink
pluralize /associations for restiness, prep for list endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Oct 25, 2023
1 parent 80a4d22 commit 9c101ac
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions nexus/src/external_api/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion nexus/test-utils/src/resource_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
&params::IpPoolAssociationCreate::Fleet(params::IpPoolAssociateFleet {
is_default: false,
}),
Expand Down
2 changes: 1 addition & 1 deletion nexus/tests/integration_tests/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion nexus/tests/integration_tests/instances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, &params)
.authn_as(AuthnMode::PrivilegedUser)
.execute()
Expand Down
8 changes: 4 additions & 4 deletions nexus/tests/integration_tests/ip_pools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(&params))
.expect_status(Some(StatusCode::NOT_FOUND)),
Expand All @@ -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"),
&params,
)
.await;
Expand All @@ -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"),
&params,
)
.await;
Expand Down Expand Up @@ -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"),
&params,
)
.await;
Expand Down
4 changes: 2 additions & 2 deletions nexus/tests/output/nexus_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -4577,7 +4577,7 @@
}
}
},
"/v1/system/ip-pools/{pool}/association": {
"/v1/system/ip-pools/{pool}/associations": {
"post": {
"tags": [
"system/networking"
Expand Down

0 comments on commit 9c101ac

Please sign in to comment.