Skip to content

Commit

Permalink
update sled-agent openapi spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallagher committed Dec 6, 2023
1 parent 8b85684 commit af2a645
Showing 1 changed file with 254 additions and 0 deletions.
254 changes: 254 additions & 0 deletions openapi/sled-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,96 @@
"version": "0.0.1"
},
"paths": {
"/boot-disk/{boot_disk}/os/write": {
"post": {
"summary": "Write a new host OS image to the specified boot disk",
"operationId": "host_os_write_start",
"parameters": [
{
"in": "path",
"name": "boot_disk",
"required": true,
"schema": {
"$ref": "#/components/schemas/M2Slot"
}
},
{
"in": "query",
"name": "sha3_256_digest",
"required": true,
"schema": {
"type": "string",
"format": "hex string (32 bytes)"
}
},
{
"in": "query",
"name": "update_id",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
},
"required": true
},
"responses": {
"204": {
"description": "resource updated"
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/boot-disk/{boot_disk}/os/write/status": {
"get": {
"summary": "Get the status of writing a new host OS",
"operationId": "host_os_write_status",
"parameters": [
{
"in": "path",
"name": "boot_disk",
"required": true,
"schema": {
"$ref": "#/components/schemas/M2Slot"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BootDiskOsWriteStatus"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/cockroachdb": {
"post": {
"summary": "Initializes a CockroachDB cluster",
Expand Down Expand Up @@ -2135,6 +2225,162 @@
"range"
]
},
"BootDiskOsWriteProgress": {
"description": "Current progress of an OS image being written to disk.",
"oneOf": [
{
"description": "The image is still being uploaded.",
"type": "object",
"properties": {
"bytes_received": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"state": {
"type": "string",
"enum": [
"receiving_uploaded_image"
]
}
},
"required": [
"bytes_received",
"state"
]
},
{
"description": "The image is being written to disk.",
"type": "object",
"properties": {
"bytes_written": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"state": {
"type": "string",
"enum": [
"writing_image_to_disk"
]
}
},
"required": [
"bytes_written",
"state"
]
},
{
"description": "The image is being read back from disk for validation.",
"type": "object",
"properties": {
"bytes_read": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"state": {
"type": "string",
"enum": [
"validating_written_image"
]
}
},
"required": [
"bytes_read",
"state"
]
}
]
},
"BootDiskOsWriteStatus": {
"description": "Status of an update to a boot disk OS.",
"oneOf": [
{
"description": "No update has been started for this disk since this server started.",
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"no_update_started"
]
}
},
"required": [
"status"
]
},
{
"description": "An update is currently running.",
"type": "object",
"properties": {
"progress": {
"$ref": "#/components/schemas/BootDiskOsWriteProgress"
},
"status": {
"type": "string",
"enum": [
"in_progress"
]
},
"update_id": {
"type": "string",
"format": "uuid"
}
},
"required": [
"progress",
"status",
"update_id"
]
},
{
"description": "The most recent update completed successfully.",
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"complete"
]
},
"update_id": {
"type": "string",
"format": "uuid"
}
},
"required": [
"status",
"update_id"
]
},
{
"description": "The most recent update failed.",
"type": "object",
"properties": {
"message": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"failed"
]
},
"update_id": {
"type": "string",
"format": "uuid"
}
},
"required": [
"message",
"status",
"update_id"
]
}
]
},
"BundleUtilization": {
"description": "The portion of a debug dataset used for zone bundles.",
"type": "object",
Expand Down Expand Up @@ -6480,6 +6726,14 @@
"description": "Zpool names are of the format ox{i,p}_<UUID>. They are either Internal or External, and should be unique",
"type": "string",
"pattern": "^ox[ip]_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
},
"M2Slot": {
"description": "An M.2 slot that was written.",
"type": "string",
"enum": [
"A",
"B"
]
}
},
"responses": {
Expand Down

0 comments on commit af2a645

Please sign in to comment.