Skip to content

Commit

Permalink
new rivets and fix up docs (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorVin authored Dec 5, 2023
1 parent e144854 commit 37a2c56
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 59 deletions.
103 changes: 88 additions & 15 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,32 @@ const docTemplate = `{
}
}
},
"/servers/{uuid}/conditionStatus": {
"get": {
"description": "Returns condition of a server",
"/servers/{uuid}/firmwareInstall": {
"post": {
"description": "Installs firmware on a device and validates with a subsequent inventory\nSample firmwareInstall payload, response: https://github.com/metal-toolbox/conditionorc/blob/main/sample/firmwareInstall.md",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Condition Status",
"operationId": "conditionStatus",
"summary": "Firmware Install",
"parameters": [
{
"type": "string",
"description": "Server ID",
"name": "uuid",
"in": "path",
"required": true
},
{
"description": "firmware install options",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/condition.FirmwareInstallTaskParameters"
}
}
],
"responses": {
Expand All @@ -133,16 +141,17 @@ const docTemplate = `{
}
}
},
"/servers/{uuid}/firmwareInstall": {
"post": {
"description": "Installs firmware on a device and validates with a subsequent inventory\nSample firmwareInstall payload, response: https://github.com/metal-toolbox/conditionorc/blob/main/sample/firmwareInstall.md",
"/servers/{uuid}/status": {
"get": {
"description": "Returns condition of a server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Firmware Install",
"summary": "Condition Status",
"operationId": "conditionStatus",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -210,10 +219,6 @@ const docTemplate = `{
"type": "integer"
}
},
"resourceVersion": {
"description": "ResourceVersion has to be set to the value received by the\nclient updating it, this it to make sure condition updates\noccur in the expected order.",
"type": "integer"
},
"state": {
"description": "State is one of State",
"allOf": [
Expand Down Expand Up @@ -256,16 +261,84 @@ const docTemplate = `{
}
}
},
"condition.Firmware": {
"type": "object",
"properties": {
"URL": {
"type": "string"
},
"checksum": {
"type": "string"
},
"component": {
"type": "string"
},
"filename": {
"type": "string"
},
"id": {
"type": "string"
},
"models": {
"type": "array",
"items": {
"type": "string"
}
},
"vendor": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"condition.FirmwareInstallTaskParameters": {
"type": "object",
"properties": {
"asset_id": {
"description": "Inventory identifier for the asset to install firmware on.",
"type": "string"
},
"dry_run": {
"description": "When defined, flasher will not perform any disruptive actions on the asset,\nit will download the firmware to be installed and determine if the firmware is applicable for the device.\n\nNo firmware installs will be attempted and if the device is powered off, it will not be powered on.",
"type": "boolean"
},
"firmware_set_id": {
"description": "FirmwareSetID specifies the firmware set to be applied.",
"type": "string"
},
"firmwares": {
"description": "Firmwares is the list of firmwares to be installed.",
"type": "array",
"items": {
"$ref": "#/definitions/condition.Firmware"
}
},
"force_install": {
"description": "Force install given firmware regardless of current firmware version.",
"type": "boolean"
},
"require_host_powered_off": {
"description": "When true, flasher will expect the host to be powered off before proceeding,\nif the host is not already powered off - the install task will be failed.",
"type": "boolean"
},
"reset_bmc_before_install": {
"description": "Reset device BMC before firmware install",
"type": "boolean"
}
}
},
"condition.Kind": {
"type": "string",
"enum": [
"virtualMediaMount",
"inventory",
"virtualMediaMount",
"firmwareInstall"
],
"x-enum-varnames": [
"VirtualMediaMount",
"Inventory",
"VirtualMediaMount",
"FirmwareInstall"
]
},
Expand Down
103 changes: 88 additions & 15 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,24 +95,32 @@
}
}
},
"/servers/{uuid}/conditionStatus": {
"get": {
"description": "Returns condition of a server",
"/servers/{uuid}/firmwareInstall": {
"post": {
"description": "Installs firmware on a device and validates with a subsequent inventory\nSample firmwareInstall payload, response: https://github.com/metal-toolbox/conditionorc/blob/main/sample/firmwareInstall.md",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Condition Status",
"operationId": "conditionStatus",
"summary": "Firmware Install",
"parameters": [
{
"type": "string",
"description": "Server ID",
"name": "uuid",
"in": "path",
"required": true
},
{
"description": "firmware install options",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/condition.FirmwareInstallTaskParameters"
}
}
],
"responses": {
Expand All @@ -125,16 +133,17 @@
}
}
},
"/servers/{uuid}/firmwareInstall": {
"post": {
"description": "Installs firmware on a device and validates with a subsequent inventory\nSample firmwareInstall payload, response: https://github.com/metal-toolbox/conditionorc/blob/main/sample/firmwareInstall.md",
"/servers/{uuid}/status": {
"get": {
"description": "Returns condition of a server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"summary": "Firmware Install",
"summary": "Condition Status",
"operationId": "conditionStatus",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -202,10 +211,6 @@
"type": "integer"
}
},
"resourceVersion": {
"description": "ResourceVersion has to be set to the value received by the\nclient updating it, this it to make sure condition updates\noccur in the expected order.",
"type": "integer"
},
"state": {
"description": "State is one of State",
"allOf": [
Expand Down Expand Up @@ -248,16 +253,84 @@
}
}
},
"condition.Firmware": {
"type": "object",
"properties": {
"URL": {
"type": "string"
},
"checksum": {
"type": "string"
},
"component": {
"type": "string"
},
"filename": {
"type": "string"
},
"id": {
"type": "string"
},
"models": {
"type": "array",
"items": {
"type": "string"
}
},
"vendor": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"condition.FirmwareInstallTaskParameters": {
"type": "object",
"properties": {
"asset_id": {
"description": "Inventory identifier for the asset to install firmware on.",
"type": "string"
},
"dry_run": {
"description": "When defined, flasher will not perform any disruptive actions on the asset,\nit will download the firmware to be installed and determine if the firmware is applicable for the device.\n\nNo firmware installs will be attempted and if the device is powered off, it will not be powered on.",
"type": "boolean"
},
"firmware_set_id": {
"description": "FirmwareSetID specifies the firmware set to be applied.",
"type": "string"
},
"firmwares": {
"description": "Firmwares is the list of firmwares to be installed.",
"type": "array",
"items": {
"$ref": "#/definitions/condition.Firmware"
}
},
"force_install": {
"description": "Force install given firmware regardless of current firmware version.",
"type": "boolean"
},
"require_host_powered_off": {
"description": "When true, flasher will expect the host to be powered off before proceeding,\nif the host is not already powered off - the install task will be failed.",
"type": "boolean"
},
"reset_bmc_before_install": {
"description": "Reset device BMC before firmware install",
"type": "boolean"
}
}
},
"condition.Kind": {
"type": "string",
"enum": [
"virtualMediaMount",
"inventory",
"virtualMediaMount",
"firmwareInstall"
],
"x-enum-varnames": [
"VirtualMediaMount",
"Inventory",
"VirtualMediaMount",
"FirmwareInstall"
]
},
Expand Down
Loading

0 comments on commit 37a2c56

Please sign in to comment.