From e839eee9eb7e61006af7ce68da54b25b222d3951 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Mon, 24 Jun 2024 14:25:14 -0500 Subject: [PATCH] just go with current_silo_. oh well --- nexus/src/external_api/http_entrypoints.rs | 13 +++++++++---- nexus/tests/output/nexus_tags.txt | 4 ++-- openapi/nexus.json | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index 350836441e..f27234f916 100644 --- a/nexus/src/external_api/http_entrypoints.rs +++ b/nexus/src/external_api/http_entrypoints.rs @@ -116,8 +116,8 @@ pub(crate) fn external_api() -> NexusApiDescription { api.register(project_update)?; api.register(project_policy_view)?; api.register(project_policy_update)?; - api.register(project_ip_pool_list)?; - api.register(project_ip_pool_view)?; + api.register(current_silo_ip_pool_list)?; + api.register(current_silo_ip_pool_view)?; // Operator-Accessible IP Pools API api.register(ip_pool_list)?; @@ -1505,13 +1505,18 @@ async fn project_policy_update( // IP Pools +// current_silo prefix is needed to distinguish silo-scoped endpoints from +// fleet-scoped. In other cases we might choose to put the prefix on the fleet +// endpoints, but in this case the vast majority of IP pool-related endpoints +// are at fleet level, so we put the prefix on the silo-scoped endpoints. + /// List IP pools #[endpoint { method = GET, path = "/v1/ip-pools", tags = ["projects"], }] -async fn project_ip_pool_list( +async fn current_silo_ip_pool_list( rqctx: RequestContext, query_params: Query, ) -> Result>, HttpError> { @@ -1551,7 +1556,7 @@ async fn project_ip_pool_list( path = "/v1/ip-pools/{pool}", tags = ["projects"], }] -async fn project_ip_pool_view( +async fn current_silo_ip_pool_view( rqctx: RequestContext, path_params: Path, ) -> Result, HttpError> { diff --git a/nexus/tests/output/nexus_tags.txt b/nexus/tests/output/nexus_tags.txt index a32fe5c4b9..50b40db31a 100644 --- a/nexus/tests/output/nexus_tags.txt +++ b/nexus/tests/output/nexus_tags.txt @@ -83,10 +83,10 @@ system_policy_view GET /v1/system/policy API operations found with tag "projects" OPERATION ID METHOD URL PATH +current_silo_ip_pool_list GET /v1/ip-pools +current_silo_ip_pool_view GET /v1/ip-pools/{pool} project_create POST /v1/projects project_delete DELETE /v1/projects/{project} -project_ip_pool_list GET /v1/ip-pools -project_ip_pool_view GET /v1/ip-pools/{pool} project_list GET /v1/projects project_policy_update PUT /v1/projects/{project}/policy project_policy_view GET /v1/projects/{project}/policy diff --git a/openapi/nexus.json b/openapi/nexus.json index 01ec9aeb56..83daab7887 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -2682,7 +2682,7 @@ "projects" ], "summary": "List IP pools", - "operationId": "project_ip_pool_list", + "operationId": "current_silo_ip_pool_list", "parameters": [ { "in": "query", @@ -2741,7 +2741,7 @@ "projects" ], "summary": "Fetch IP pool", - "operationId": "project_ip_pool_view", + "operationId": "current_silo_ip_pool_view", "parameters": [ { "in": "path",