Skip to content

Commit 67c25df

Browse files
authored
sled-agent: remove never-used endpoints for writing boot disks (PR 4/4) (#8541)
We added these long before reconfigurator existed but never used them. Now that writing boot disk images is the responsibility of reconfigurator (and the config-reconciler, as of #8540), this is just a cleanup PR to remove dead code.
1 parent 3b3931b commit 67c25df

File tree

8 files changed

+2
-2122
lines changed

8 files changed

+2
-2122
lines changed

openapi/sled-agent.json

Lines changed: 0 additions & 281 deletions
Original file line numberDiff line numberDiff line change
@@ -185,131 +185,6 @@
185185
}
186186
}
187187
},
188-
"/boot-disk/{boot_disk}/os/write": {
189-
"post": {
190-
"summary": "Write a new host OS image to the specified boot disk",
191-
"operationId": "host_os_write_start",
192-
"parameters": [
193-
{
194-
"in": "path",
195-
"name": "boot_disk",
196-
"required": true,
197-
"schema": {
198-
"$ref": "#/components/schemas/M2Slot"
199-
}
200-
},
201-
{
202-
"in": "query",
203-
"name": "sha3_256_digest",
204-
"required": true,
205-
"schema": {
206-
"type": "string",
207-
"format": "hex string (32 bytes)"
208-
}
209-
},
210-
{
211-
"in": "query",
212-
"name": "update_id",
213-
"required": true,
214-
"schema": {
215-
"type": "string",
216-
"format": "uuid"
217-
}
218-
}
219-
],
220-
"requestBody": {
221-
"content": {
222-
"application/octet-stream": {
223-
"schema": {
224-
"type": "string",
225-
"format": "binary"
226-
}
227-
}
228-
},
229-
"required": true
230-
},
231-
"responses": {
232-
"204": {
233-
"description": "resource updated"
234-
},
235-
"4XX": {
236-
"$ref": "#/components/responses/Error"
237-
},
238-
"5XX": {
239-
"$ref": "#/components/responses/Error"
240-
}
241-
}
242-
}
243-
},
244-
"/boot-disk/{boot_disk}/os/write/status": {
245-
"get": {
246-
"operationId": "host_os_write_status_get",
247-
"parameters": [
248-
{
249-
"in": "path",
250-
"name": "boot_disk",
251-
"required": true,
252-
"schema": {
253-
"$ref": "#/components/schemas/M2Slot"
254-
}
255-
}
256-
],
257-
"responses": {
258-
"200": {
259-
"description": "successful operation",
260-
"content": {
261-
"application/json": {
262-
"schema": {
263-
"$ref": "#/components/schemas/BootDiskOsWriteStatus"
264-
}
265-
}
266-
}
267-
},
268-
"4XX": {
269-
"$ref": "#/components/responses/Error"
270-
},
271-
"5XX": {
272-
"$ref": "#/components/responses/Error"
273-
}
274-
}
275-
}
276-
},
277-
"/boot-disk/{boot_disk}/os/write/status/{update_id}": {
278-
"delete": {
279-
"summary": "Clear the status of a completed write of a new host OS",
280-
"operationId": "host_os_write_status_delete",
281-
"parameters": [
282-
{
283-
"in": "path",
284-
"name": "boot_disk",
285-
"required": true,
286-
"schema": {
287-
"$ref": "#/components/schemas/M2Slot"
288-
}
289-
},
290-
{
291-
"in": "path",
292-
"name": "update_id",
293-
"required": true,
294-
"schema": {
295-
"type": "string",
296-
"format": "uuid"
297-
}
298-
}
299-
],
300-
"responses": {
301-
"204": {
302-
"description": "resource updated"
303-
},
304-
"4XX": {
305-
"$ref": "#/components/responses/Error"
306-
},
307-
"5XX": {
308-
"$ref": "#/components/responses/Error"
309-
}
310-
}
311-
}
312-
},
313188
"/bootstore/status": {
314189
"get": {
315190
"summary": "Get the internal state of the local bootstore node",
@@ -2698,162 +2573,6 @@
26982573
],
26992574
"additionalProperties": false
27002575
},
2701-
"BootDiskOsWriteProgress": {
2702-
"description": "Current progress of an OS image being written to disk.",
2703-
"oneOf": [
2704-
{
2705-
"description": "The image is still being uploaded.",
2706-
"type": "object",
2707-
"properties": {
2708-
"bytes_received": {
2709-
"type": "integer",
2710-
"format": "uint",
2711-
"minimum": 0
2712-
},
2713-
"state": {
2714-
"type": "string",
2715-
"enum": [
2716-
"receiving_uploaded_image"
2717-
]
2718-
}
2719-
},
2720-
"required": [
2721-
"bytes_received",
2722-
"state"
2723-
]
2724-
},
2725-
{
2726-
"description": "The image is being written to disk.",
2727-
"type": "object",
2728-
"properties": {
2729-
"bytes_written": {
2730-
"type": "integer",
2731-
"format": "uint",
2732-
"minimum": 0
2733-
},
2734-
"state": {
2735-
"type": "string",
2736-
"enum": [
2737-
"writing_image_to_disk"
2738-
]
2739-
}
2740-
},
2741-
"required": [
2742-
"bytes_written",
2743-
"state"
2744-
]
2745-
},
2746-
{
2747-
"description": "The image is being read back from disk for validation.",
2748-
"type": "object",
2749-
"properties": {
2750-
"bytes_read": {
2751-
"type": "integer",
2752-
"format": "uint",
2753-
"minimum": 0
2754-
},
2755-
"state": {
2756-
"type": "string",
2757-
"enum": [
2758-
"validating_written_image"
2759-
]
2760-
}
2761-
},
2762-
"required": [
2763-
"bytes_read",
2764-
"state"
2765-
]
2766-
}
2767-
]
2768-
},
2769-
"BootDiskOsWriteStatus": {
2770-
"description": "Status of an update to a boot disk OS.",
2771-
"oneOf": [
2772-
{
2773-
"description": "No update has been started for this disk, or any previously-started update has completed and had its status cleared.",
2774-
"type": "object",
2775-
"properties": {
2776-
"status": {
2777-
"type": "string",
2778-
"enum": [
2779-
"no_update_started"
2780-
]
2781-
}
2782-
},
2783-
"required": [
2784-
"status"
2785-
]
2786-
},
2787-
{
2788-
"description": "An update is currently running.",
2789-
"type": "object",
2790-
"properties": {
2791-
"progress": {
2792-
"$ref": "#/components/schemas/BootDiskOsWriteProgress"
2793-
},
2794-
"status": {
2795-
"type": "string",
2796-
"enum": [
2797-
"in_progress"
2798-
]
2799-
},
2800-
"update_id": {
2801-
"type": "string",
2802-
"format": "uuid"
2803-
}
2804-
},
2805-
"required": [
2806-
"progress",
2807-
"status",
2808-
"update_id"
2809-
]
2810-
},
2811-
{
2812-
"description": "The most recent update completed successfully.",
2813-
"type": "object",
2814-
"properties": {
2815-
"status": {
2816-
"type": "string",
2817-
"enum": [
2818-
"complete"
2819-
]
2820-
},
2821-
"update_id": {
2822-
"type": "string",
2823-
"format": "uuid"
2824-
}
2825-
},
2826-
"required": [
2827-
"status",
2828-
"update_id"
2829-
]
2830-
},
2831-
{
2832-
"description": "The most recent update failed.",
2833-
"type": "object",
2834-
"properties": {
2835-
"message": {
2836-
"type": "string"
2837-
},
2838-
"status": {
2839-
"type": "string",
2840-
"enum": [
2841-
"failed"
2842-
]
2843-
},
2844-
"update_id": {
2845-
"type": "string",
2846-
"format": "uuid"
2847-
}
2848-
},
2849-
"required": [
2850-
"message",
2851-
"status",
2852-
"update_id"
2853-
]
2854-
}
2855-
]
2856-
},
28572576
"BootImageHeader": {
28582577
"type": "object",
28592578
"properties": {

sled-agent/api/src/lib.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ use omicron_uuid_kinds::{
3333
use schemars::JsonSchema;
3434
use serde::{Deserialize, Serialize};
3535
use sled_agent_types::{
36-
boot_disk::{
37-
BootDiskOsWriteStatus, BootDiskPathParams, BootDiskUpdatePathParams,
38-
BootDiskWriteStartQueryParams,
39-
},
4036
bootstore::BootstoreStatus,
4137
disk::DiskEnsureBody,
4238
early_networking::EarlyNetworkConfig,
@@ -494,38 +490,6 @@ pub trait SledAgentApi {
494490
body: TypedBody<AddSledRequest>,
495491
) -> Result<HttpResponseUpdatedNoContent, HttpError>;
496492

497-
/// Write a new host OS image to the specified boot disk
498-
#[endpoint {
499-
method = POST,
500-
path = "/boot-disk/{boot_disk}/os/write",
501-
request_body_max_bytes = HOST_OS_IMAGE_MAX_BYTES,
502-
}]
503-
async fn host_os_write_start(
504-
rqctx: RequestContext<Self::Context>,
505-
path_params: Path<BootDiskPathParams>,
506-
query_params: Query<BootDiskWriteStartQueryParams>,
507-
body: StreamingBody,
508-
) -> Result<HttpResponseUpdatedNoContent, HttpError>;
509-
510-
#[endpoint {
511-
method = GET,
512-
path = "/boot-disk/{boot_disk}/os/write/status",
513-
}]
514-
async fn host_os_write_status_get(
515-
rqctx: RequestContext<Self::Context>,
516-
path_params: Path<BootDiskPathParams>,
517-
) -> Result<HttpResponseOk<BootDiskOsWriteStatus>, HttpError>;
518-
519-
/// Clear the status of a completed write of a new host OS
520-
#[endpoint {
521-
method = DELETE,
522-
path = "/boot-disk/{boot_disk}/os/write/status/{update_id}",
523-
}]
524-
async fn host_os_write_status_delete(
525-
rqctx: RequestContext<Self::Context>,
526-
path_params: Path<BootDiskUpdatePathParams>,
527-
) -> Result<HttpResponseUpdatedNoContent, HttpError>;
528-
529493
/// Fetch basic information about this sled
530494
#[endpoint {
531495
method = GET,

sled-agent/config-reconciler/src/internal_disks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ impl InternalDisks {
324324
})
325325
}
326326

327-
pub fn boot_image_raw_devfs_path(
327+
pub(crate) fn boot_image_raw_devfs_path(
328328
&self,
329329
slot: M2Slot,
330330
) -> Option<Result<Utf8PathBuf, Arc<PooledDiskError>>> {

0 commit comments

Comments
 (0)