Skip to content

Commit

Permalink
just go with current_silo_. oh well
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Jun 24, 2024
1 parent fa9a4c1 commit e839eee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
13 changes: 9 additions & 4 deletions nexus/src/external_api/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down Expand Up @@ -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<ApiContext>,
query_params: Query<PaginatedByNameOrId>,
) -> Result<HttpResponseOk<ResultsPage<views::SiloIpPool>>, HttpError> {
Expand Down Expand Up @@ -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<ApiContext>,
path_params: Path<params::IpPoolPath>,
) -> Result<HttpResponseOk<views::SiloIpPool>, HttpError> {
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 @@ -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
Expand Down
4 changes: 2 additions & 2 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,7 @@
"projects"
],
"summary": "List IP pools",
"operationId": "project_ip_pool_list",
"operationId": "current_silo_ip_pool_list",
"parameters": [
{
"in": "query",
Expand Down Expand Up @@ -2741,7 +2741,7 @@
"projects"
],
"summary": "Fetch IP pool",
"operationId": "project_ip_pool_view",
"operationId": "current_silo_ip_pool_view",
"parameters": [
{
"in": "path",
Expand Down

0 comments on commit e839eee

Please sign in to comment.