{ "openapi": "3.0.1", "info": { "title": "Grendel API", "description": "Bare Metal Provisioning system for HPC Linux clusters. Find out more about Grendel at [https://github.com/ubccr/grendel](https://github.com/ubccr/grendel)", "contact": { "email": "aebruno2@buffalo.edu" }, "license": { "name": "GPLv3", "url": "https://www.gnu.org/licenses/gpl-3.0.en.html" }, "version": "1.0.0" }, "externalDocs": { "description": "https://grendel.readthedocs.io/en/latest/", "url": "https://grendel.readthedocs.io/en/latest/" }, "servers": [ { "url": "http://localhost/v1" } ], "tags": [ { "name": "host", "description": "Host API Service", "externalDocs": { "description": "Operations for grendel hosts", "url": "https://grendel.readthedocs.io/en/latest/" } }, { "name": "image", "description": "Boot Image API Service", "externalDocs": { "description": "Operations for grendel boot images", "url": "https://grendel.readthedocs.io/en/latest/" } } ], "paths": { "/host/list": { "get": { "tags": [ "host" ], "summary": "List all hosts", "description": "Returns all host stored in Grendel", "operationId": "hostList", "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Host" } } } } }, "500": { "description": "Failed to fetch hosts from database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/host/find/{nodeSet}": { "get": { "tags": [ "host" ], "summary": "Find hosts by name or nodeset", "description": "Returns a list of hosts in the given nodeset", "operationId": "hostFind", "parameters": [ { "name": "nodeSet", "in": "path", "description": "nodeset syntax. Example: cpn-d13-[01-100]", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Host" } } } } }, "400": { "description": "Invalid nodeset supplied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to fetch hosts from database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": [ "host" ], "summary": "Delete hosts by name or nodeset", "description": "Delete hosts in the given nodeset", "operationId": "hostDelete", "parameters": [ { "name": "nodeSet", "in": "path", "description": "nodeset syntax. Example: cpn-d13-[01-100]", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful operation", "content": { } }, "400": { "description": "Invalid nodeset supplied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to delete hosts from database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/host/tags/{tags}": { "get": { "tags": [ "host" ], "summary": "Find hosts by tags", "description": "Returns a list of hosts with the given tags", "operationId": "hostTags", "parameters": [ { "name": "tags", "in": "path", "description": "comman separated list of tags. Example: ib,noib,k16", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Host" } } } } }, "400": { "description": "Invalid tags supplied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to fetch hosts by tag from database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/host/provision/{nodeSet}": { "put": { "tags": [ "host" ], "summary": "Set hosts to provision by name or nodeset", "description": "Sets hosts to provision in the given nodeset", "operationId": "hostProvision", "parameters": [ { "name": "nodeSet", "in": "path", "description": "nodeset syntax. Example: cpn-d13-[01-100]", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful operation", "content": { } }, "400": { "description": "Invalid nodeset supplied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to fetch hosts from database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/host/unprovision/{nodeSet}": { "put": { "tags": [ "host" ], "summary": "Set hosts to unprovision by name or nodeset", "description": "Sets hosts to unprovision in the given nodeset", "operationId": "hostUnprovision", "parameters": [ { "name": "nodeSet", "in": "path", "description": "nodeset syntax. Example: cpn-d13-[01-100]", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful operation", "content": { } }, "400": { "description": "Invalid nodeset supplied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to fetch hosts from database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/host/tag/{nodeSet}": { "put": { "tags": [ "host" ], "summary": "Tag hosts by name or nodeset", "description": "Tag hosts in the given nodeset", "operationId": "hostTag", "parameters": [ { "name": "nodeSet", "in": "path", "description": "nodeset syntax. Example: cpn-d13-[01-100]", "required": true, "schema": { "type": "string" } }, { "name": "tags", "in": "query", "description": "list of tags. Example: ib,noib,k16", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful operation", "content": { } }, "400": { "description": "Invalid nodeset supplied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to fetch hosts from database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/host/untag/{nodeSet}": { "put": { "tags": [ "host" ], "summary": "Untag hosts name or nodeset", "description": "Untag hosts the given nodeset", "operationId": "hostUntag", "parameters": [ { "name": "nodeSet", "in": "path", "description": "nodeset syntax. Example: cpn-d13-[01-100]", "required": true, "schema": { "type": "string" } }, { "name": "tags", "in": "query", "description": "list of tags. Example: ib,noib,k16", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful operation", "content": { } }, "400": { "description": "Invalid nodeset supplied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to fetch hosts from database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/host": { "post": { "tags": [ "host" ], "summary": "Add or update hosts in Grendel", "operationId": "storeHosts", "requestBody": { "description": "Add/Update one or more hosts to Grendel", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Host" } } } }, "required": true }, "responses": { "201": { "description": "successfully stored hosts", "content": { } }, "400": { "description": "Invalid host input supplied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to store hosts in database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-codegen-request-body-name": "body" } }, "/bootimage/list": { "get": { "tags": [ "image" ], "summary": "List all images", "description": "Returns all images stored in Grendel", "operationId": "imageList", "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/BootImage" } } } } }, "500": { "description": "Failed to fetch images from database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/bootimage/find/{name}": { "get": { "tags": [ "image" ], "summary": "Find image by name", "description": "Returns image with the given name", "operationId": "imageFind", "parameters": [ { "name": "name", "in": "path", "description": "Name of image", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/BootImage" } } } } }, "400": { "description": "Invalid name supplied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to fetch image from database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": [ "image" ], "summary": "Delete boot images by name", "description": "Delete boot images with the given name", "operationId": "imageDelete", "parameters": [ { "name": "name", "in": "path", "description": "Name of boot image to delete", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "successful operation", "content": { } }, "400": { "description": "Invalid name supplied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to delete boot images from database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/bootimage": { "post": { "tags": [ "image" ], "summary": "Add or update images in Grendel", "operationId": "storeImages", "requestBody": { "description": "Add/Update one or more images to Grendel", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/BootImage" } } } }, "required": true }, "responses": { "201": { "description": "successfully stored images", "content": { } }, "400": { "description": "Invalid boot image input supplied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to store images in database", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } }, "x-codegen-request-body-name": "body" } } }, "components": { "schemas": { "Host": { "required": [ "name" ], "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "provision": { "type": "boolean" }, "firmware": { "type": "string" }, "boot_image": { "type": "string" }, "interfaces": { "type": "array", "items": { "$ref": "#/components/schemas/NetInterface" } } } }, "NetInterface": { "type": "object", "properties": { "mac": { "type": "string" }, "name": { "type": "string" }, "ip": { "type": "string" }, "fqdn": { "type": "string" }, "bmc": { "type": "boolean" } } }, "BootImage": { "required": [ "name" ], "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "kernel": { "type": "string" }, "initrd": { "type": "array", "items": { "type": "string" } }, "liveimg": { "type": "string" }, "cmdline": { "type": "string" }, "verify": { "type": "boolean" } } }, "ErrorResponse": { "type": "object", "properties": { "message": { "type": "string" } } } }, "securitySchemes": { "api_key": { "type": "apiKey", "name": "api_key", "in": "header" } } } }