Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename project_ip_pools_list and _view #5919

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion nexus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extern crate slog;
/// to stdout.
pub fn run_openapi_external() -> Result<(), String> {
external_api()
.openapi("Oxide Region API", "20240502.0")
.openapi("Oxide Region API", "20240626.0")
.description("API for interacting with the Oxide control plane")
.contact_url("https://oxide.computer")
.contact_email("[email protected]")
Expand Down
2 changes: 1 addition & 1 deletion nexus/tests/integration_tests/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fn test_nexus_openapi() {
.expect("stdout was not valid OpenAPI");
assert_eq!(spec.openapi, "3.0.3");
assert_eq!(spec.info.title, "Oxide Region API");
assert_eq!(spec.info.version, "20240502.0");
assert_eq!(spec.info.version, "20240626.0");

// Spot check a couple of items.
assert!(!spec.paths.paths.is_empty());
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
6 changes: 3 additions & 3 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://oxide.computer",
"email": "[email protected]"
},
"version": "20240502.0"
"version": "20240626.0"
},
"paths": {
"/device/auth": {
Expand Down 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
Loading