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

Group system IP pools endpoints under their own tag #6492

Merged
merged 1 commit into from
Aug 30, 2024
Merged
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
4 changes: 2 additions & 2 deletions end-to-end-tests/src/bin/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use oxide_client::types::{
NameOrId, SiloQuotasUpdate,
};
use oxide_client::{
ClientDisksExt, ClientHiddenExt, ClientProjectsExt,
ClientSystemNetworkingExt, ClientSystemSilosExt,
ClientDisksExt, ClientHiddenExt, ClientProjectsExt, ClientSystemIpPoolsExt,
ClientSystemSilosExt,
};
use serde::{de::DeserializeOwned, Deserialize};
use std::time::Duration;
Expand Down
2 changes: 1 addition & 1 deletion end-to-end-tests/src/bin/commtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use oxide_client::{
UsernamePasswordCredentials,
},
ClientHiddenExt, ClientLoginExt, ClientProjectsExt,
ClientSystemHardwareExt, ClientSystemNetworkingExt, ClientSystemStatusExt,
ClientSystemHardwareExt, ClientSystemIpPoolsExt, ClientSystemStatusExt,
ClientVpcsExt,
};
use std::{
Expand Down
13 changes: 8 additions & 5 deletions nexus/external-api/output/nexus_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,7 @@ sled_view GET /v1/system/hardware/sleds/{sle
switch_list GET /v1/system/hardware/switches
switch_view GET /v1/system/hardware/switches/{switch_id}

API operations found with tag "system/metrics"
OPERATION ID METHOD URL PATH
system_metric GET /v1/system/metrics/{metric_name}

API operations found with tag "system/networking"
API operations found with tag "system/ip-pools"
OPERATION ID METHOD URL PATH
ip_pool_create POST /v1/system/ip-pools
ip_pool_delete DELETE /v1/system/ip-pools/{pool}
Expand All @@ -169,6 +165,13 @@ ip_pool_silo_update PUT /v1/system/ip-pools/{pool}/sil
ip_pool_update PUT /v1/system/ip-pools/{pool}
ip_pool_utilization_view GET /v1/system/ip-pools/{pool}/utilization
ip_pool_view GET /v1/system/ip-pools/{pool}

API operations found with tag "system/metrics"
OPERATION ID METHOD URL PATH
system_metric GET /v1/system/metrics/{metric_name}

API operations found with tag "system/networking"
OPERATION ID METHOD URL PATH
networking_address_lot_block_list GET /v1/system/networking/address-lot/{address_lot}/blocks
networking_address_lot_create POST /v1/system/networking/address-lot
networking_address_lot_delete DELETE /v1/system/networking/address-lot/{address_lot}
Expand Down
40 changes: 23 additions & 17 deletions nexus/external-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ pub const API_VERSION: &str = "20240821.0";
url = "http://docs.oxide.computer/api/system-metrics"
}
},
"system/ip-pools" = {
description = "IP pools are collections of external IPs that can be assigned to silos. When a pool is linked to a silo, users in that silo can allocate IPs from the pool for their instances.",
external_docs = {
url = "http://docs.oxide.computer/api/system-ip-pools"
}
},
"system/networking" = {
description = "This provides rack-level network configuration.",
external_docs = {
Expand Down Expand Up @@ -630,7 +636,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = GET,
path = "/v1/system/ip-pools",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_list(
rqctx: RequestContext<Self::Context>,
Expand All @@ -641,7 +647,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = POST,
path = "/v1/system/ip-pools",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_create(
rqctx: RequestContext<Self::Context>,
Expand All @@ -652,7 +658,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = GET,
path = "/v1/system/ip-pools/{pool}",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_view(
rqctx: RequestContext<Self::Context>,
Expand All @@ -663,7 +669,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = DELETE,
path = "/v1/system/ip-pools/{pool}",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_delete(
rqctx: RequestContext<Self::Context>,
Expand All @@ -674,7 +680,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = PUT,
path = "/v1/system/ip-pools/{pool}",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_update(
rqctx: RequestContext<Self::Context>,
Expand All @@ -686,7 +692,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = GET,
path = "/v1/system/ip-pools/{pool}/utilization",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_utilization_view(
rqctx: RequestContext<Self::Context>,
Expand All @@ -697,7 +703,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = GET,
path = "/v1/system/ip-pools/{pool}/silos",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_silo_list(
rqctx: RequestContext<Self::Context>,
Expand All @@ -723,7 +729,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = POST,
path = "/v1/system/ip-pools/{pool}/silos",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_silo_link(
rqctx: RequestContext<Self::Context>,
Expand All @@ -737,7 +743,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = DELETE,
path = "/v1/system/ip-pools/{pool}/silos/{silo}",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_silo_unlink(
rqctx: RequestContext<Self::Context>,
Expand All @@ -754,7 +760,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = PUT,
path = "/v1/system/ip-pools/{pool}/silos/{silo}",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_silo_update(
rqctx: RequestContext<Self::Context>,
Expand All @@ -766,7 +772,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = GET,
path = "/v1/system/ip-pools-service",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_service_view(
rqctx: RequestContext<Self::Context>,
Expand All @@ -778,7 +784,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = GET,
path = "/v1/system/ip-pools/{pool}/ranges",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_range_list(
rqctx: RequestContext<Self::Context>,
Expand All @@ -792,7 +798,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = POST,
path = "/v1/system/ip-pools/{pool}/ranges/add",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_range_add(
rqctx: RequestContext<Self::Context>,
Expand All @@ -804,7 +810,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = POST,
path = "/v1/system/ip-pools/{pool}/ranges/remove",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_range_remove(
rqctx: RequestContext<Self::Context>,
Expand All @@ -818,7 +824,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = GET,
path = "/v1/system/ip-pools-service/ranges",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_service_range_list(
rqctx: RequestContext<Self::Context>,
Expand All @@ -831,7 +837,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = POST,
path = "/v1/system/ip-pools-service/ranges/add",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_service_range_add(
rqctx: RequestContext<Self::Context>,
Expand All @@ -842,7 +848,7 @@ pub trait NexusExternalApi {
#[endpoint {
method = POST,
path = "/v1/system/ip-pools-service/ranges/remove",
tags = ["system/networking"],
tags = ["system/ip-pools"],
}]
async fn ip_pool_service_range_remove(
rqctx: RequestContext<Self::Context>,
Expand Down
41 changes: 24 additions & 17 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -5210,7 +5210,7 @@
"/v1/system/ip-pools": {
"get": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "List IP pools",
"operationId": "ip_pool_list",
Expand Down Expand Up @@ -5267,7 +5267,7 @@
},
"post": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Create IP pool",
"operationId": "ip_pool_create",
Expand Down Expand Up @@ -5304,7 +5304,7 @@
"/v1/system/ip-pools/{pool}": {
"get": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Fetch IP pool",
"operationId": "ip_pool_view",
Expand Down Expand Up @@ -5340,7 +5340,7 @@
},
"put": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Update IP pool",
"operationId": "ip_pool_update",
Expand Down Expand Up @@ -5386,7 +5386,7 @@
},
"delete": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Delete IP pool",
"operationId": "ip_pool_delete",
Expand Down Expand Up @@ -5417,7 +5417,7 @@
"/v1/system/ip-pools/{pool}/ranges": {
"get": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "List ranges for IP pool",
"description": "Ranges are ordered by their first address.",
Expand Down Expand Up @@ -5479,7 +5479,7 @@
"/v1/system/ip-pools/{pool}/ranges/add": {
"post": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Add range to IP pool",
"description": "IPv6 ranges are not allowed yet.",
Expand Down Expand Up @@ -5528,7 +5528,7 @@
"/v1/system/ip-pools/{pool}/ranges/remove": {
"post": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Remove range from IP pool",
"operationId": "ip_pool_range_remove",
Expand Down Expand Up @@ -5569,7 +5569,7 @@
"/v1/system/ip-pools/{pool}/silos": {
"get": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "List IP pool's linked silos",
"operationId": "ip_pool_silo_list",
Expand Down Expand Up @@ -5635,7 +5635,7 @@
},
"post": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Link IP pool to silo",
"description": "Users in linked silos can allocate external IPs from this pool for their instances. A silo can have at most one default pool. IPs are allocated from the default pool when users ask for one without specifying a pool.",
Expand Down Expand Up @@ -5684,7 +5684,7 @@
"/v1/system/ip-pools/{pool}/silos/{silo}": {
"put": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Make IP pool default for silo",
"description": "When a user asks for an IP (e.g., at instance create time) without specifying a pool, the IP comes from the default pool if a default is configured. When a pool is made the default for a silo, any existing default will remain linked to the silo, but will no longer be the default.",
Expand Down Expand Up @@ -5738,7 +5738,7 @@
},
"delete": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Unlink IP pool from silo",
"description": "Will fail if there are any outstanding IPs allocated in the silo.",
Expand Down Expand Up @@ -5777,7 +5777,7 @@
"/v1/system/ip-pools/{pool}/utilization": {
"get": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Fetch IP pool utilization",
"operationId": "ip_pool_utilization_view",
Expand Down Expand Up @@ -5815,7 +5815,7 @@
"/v1/system/ip-pools-service": {
"get": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Fetch Oxide service IP pool",
"operationId": "ip_pool_service_view",
Expand All @@ -5842,7 +5842,7 @@
"/v1/system/ip-pools-service/ranges": {
"get": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "List IP ranges for the Oxide service pool",
"description": "Ranges are ordered by their first address.",
Expand Down Expand Up @@ -5895,7 +5895,7 @@
"/v1/system/ip-pools-service/ranges/add": {
"post": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Add IP range to Oxide service pool",
"description": "IPv6 ranges are not allowed yet.",
Expand Down Expand Up @@ -5933,7 +5933,7 @@
"/v1/system/ip-pools-service/ranges/remove": {
"post": {
"tags": [
"system/networking"
"system/ip-pools"
],
"summary": "Remove IP range from Oxide service pool",
"operationId": "ip_pool_service_range_remove",
Expand Down Expand Up @@ -21464,6 +21464,13 @@
"url": "http://docs.oxide.computer/api/system-hardware"
}
},
{
"name": "system/ip-pools",
"description": "IP pools are collections of external IPs that can be assigned to silos. When a pool is linked to a silo, users in that silo can allocate IPs from the pool for their instances.",
"externalDocs": {
"url": "http://docs.oxide.computer/api/system-ip-pools"
}
},
{
"name": "system/metrics",
"description": "Metrics provide insight into the operation of the Oxide deployment. These include telemetry on hardware and software components that can be used to understand the current state as well as to diagnose issues.",
Expand Down
Loading