From 17c8162f49e3e4c00e406d1ed45c5323f9afe617 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Fri, 17 Feb 2023 14:19:47 -0600 Subject: [PATCH 1/2] add some missing deprecations --- nexus/src/external_api/http_entrypoints.rs | 12 ++++++++++++ openapi/nexus.json | 17 +++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index f1d14099b5f..f4c2308b539 100644 --- a/nexus/src/external_api/http_entrypoints.rs +++ b/nexus/src/external_api/http_entrypoints.rs @@ -2788,10 +2788,12 @@ async fn instance_list_v1( } /// List instances +/// Use `GET /v1/instances` instead #[endpoint { method = GET, path = "/organizations/{organization_name}/projects/{project_name}/instances", tags = ["instances"], + deprecated = true, }] async fn instance_list( rqctx: RequestContext>, @@ -2967,10 +2969,12 @@ async fn instance_view( } /// Fetch an instance by id +/// Use `GET /v1/instances/{instance}` instead #[endpoint { method = GET, path = "/by-id/instances/{id}", tags = ["instances"], + deprecated = true, }] async fn instance_view_by_id( rqctx: RequestContext>, @@ -4239,10 +4243,12 @@ async fn instance_network_interface_list_v1( apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await } /// List network interfaces +/// Use `GET /v1/network-interfaces` instead #[endpoint { method = GET, path = "/organizations/{organization_name}/projects/{project_name}/instances/{instance_name}/network-interfaces", tags = ["instances"], + deprecated = true, }] async fn instance_network_interface_list( rqctx: RequestContext>, @@ -4395,10 +4401,13 @@ async fn instance_network_interface_delete_v1( /// are any secondary interfaces. A new primary interface must be designated /// first. The primary interface can be deleted if there are no secondary /// interfaces. +/// +/// Use `DELETE /v1/network-interfaces/{interface}` instead #[endpoint { method = DELETE, path = "/organizations/{organization_name}/projects/{project_name}/instances/{instance_name}/network-interfaces/{interface_name}", tags = ["instances"], + deprecated = true, }] async fn instance_network_interface_delete( rqctx: RequestContext>, @@ -4486,10 +4495,13 @@ async fn instance_network_interface_view( } /// Fetch a network interface by id +/// +/// Use `GET /v1/network-interfaces/{interface}` instead #[endpoint { method = GET, path = "/by-id/network-interfaces/{id}", tags = ["instances"], + deprecated = true, }] async fn instance_network_interface_view_by_id( rqctx: RequestContext>, diff --git a/openapi/nexus.json b/openapi/nexus.json index 3b5cbe8bbc8..7765b1ca671 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -94,6 +94,7 @@ "instances" ], "summary": "Fetch an instance by id", + "description": "Use `GET /v1/instances/{instance}` instead", "operationId": "instance_view_by_id", "parameters": [ { @@ -123,7 +124,8 @@ "5XX": { "$ref": "#/components/responses/Error" } - } + }, + "deprecated": true } }, "/by-id/network-interfaces/{id}": { @@ -132,6 +134,7 @@ "instances" ], "summary": "Fetch a network interface by id", + "description": "Use `GET /v1/network-interfaces/{interface}` instead", "operationId": "instance_network_interface_view_by_id", "parameters": [ { @@ -161,7 +164,8 @@ "5XX": { "$ref": "#/components/responses/Error" } - } + }, + "deprecated": true } }, "/by-id/organizations/{id}": { @@ -1929,6 +1933,7 @@ "instances" ], "summary": "List instances", + "description": "Use `GET /v1/instances` instead", "operationId": "instance_list", "parameters": [ { @@ -1995,6 +2000,7 @@ "$ref": "#/components/responses/Error" } }, + "deprecated": true, "x-dropshot-pagination": true }, "post": { @@ -2492,6 +2498,7 @@ "instances" ], "summary": "List network interfaces", + "description": "Use `GET /v1/network-interfaces` instead", "operationId": "instance_network_interface_list", "parameters": [ { @@ -2564,6 +2571,7 @@ "$ref": "#/components/responses/Error" } }, + "deprecated": true, "x-dropshot-pagination": true }, "post": { @@ -2768,7 +2776,7 @@ "instances" ], "summary": "Delete a network interface", - "description": "Note that the primary interface for an instance cannot be deleted if there are any secondary interfaces. A new primary interface must be designated first. The primary interface can be deleted if there are no secondary interfaces.", + "description": "Note that the primary interface for an instance cannot be deleted if there are any secondary interfaces. A new primary interface must be designated first. The primary interface can be deleted if there are no secondary interfaces.\nUse `DELETE /v1/network-interfaces/{interface}` instead", "operationId": "instance_network_interface_delete", "parameters": [ { @@ -2814,7 +2822,8 @@ "5XX": { "$ref": "#/components/responses/Error" } - } + }, + "deprecated": true } }, "/organizations/{organization_name}/projects/{project_name}/instances/{instance_name}/reboot": { From 2d55e08d319b2819249e40233c6de8be716a5609 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Fri, 17 Feb 2023 14:38:57 -0600 Subject: [PATCH 2/2] missed one --- nexus/src/external_api/http_entrypoints.rs | 4 +++- openapi/nexus.json | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index f4c2308b539..fd58a326dfe 100644 --- a/nexus/src/external_api/http_entrypoints.rs +++ b/nexus/src/external_api/http_entrypoints.rs @@ -5894,10 +5894,12 @@ async fn vpc_router_view( } /// Get a router by id +/// Use `GET /v1/vpc-routers/{router}` instead #[endpoint { method = GET, path = "/by-id/vpc-routers/{id}", tags = ["vpcs"], + deprecated = true, }] async fn vpc_router_view_by_id( rqctx: RequestContext>, @@ -6118,7 +6120,7 @@ async fn vpc_router_update( apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await } -// List routes +/// List routes /// /// List the routes associated with a router in a particular VPC. #[endpoint { diff --git a/openapi/nexus.json b/openapi/nexus.json index 7765b1ca671..6f1452e6747 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -334,6 +334,7 @@ "vpcs" ], "summary": "Get a router by id", + "description": "Use `GET /v1/vpc-routers/{router}` instead", "operationId": "vpc_router_view_by_id", "parameters": [ { @@ -363,7 +364,8 @@ "5XX": { "$ref": "#/components/responses/Error" } - } + }, + "deprecated": true } }, "/by-id/vpc-subnets/{id}": { @@ -10995,7 +10997,8 @@ "tags": [ "vpcs" ], - "summary": "List the routes associated with a router in a particular VPC.", + "summary": "List routes", + "description": "List the routes associated with a router in a particular VPC.", "operationId": "vpc_router_route_list_v1", "parameters": [ {