From b8888f44db287b4b492e511b3333251cd94b581c Mon Sep 17 00:00:00 2001 From: "Mitch Harding (the weird one)" Date: Tue, 30 May 2023 17:20:33 -0400 Subject: [PATCH] CASMCMS-8651: Remove ARS from CLI; Use updated BSS API spec with updated non-ARS link examples --- .github/CODEOWNERS | 1 - cray/modules/ars/__init__.py | 0 cray/modules/ars/cli.py | 31 - cray/modules/ars/swagger3.json | 1968 --------- cray/modules/artifacts/cli.py | 60 +- cray/modules/bss/swagger.yaml | 4 +- cray/modules/bss/swagger3.json | 6322 +++++++++++++-------------- cray/tests/test_modules/test_ars.py | 306 -- docs/source/groups/ars.rst | 5 - 9 files changed, 3172 insertions(+), 5525 deletions(-) delete mode 100644 cray/modules/ars/__init__.py delete mode 100644 cray/modules/ars/cli.py delete mode 100644 cray/modules/ars/swagger3.json delete mode 100644 cray/tests/test_modules/test_ars.py delete mode 100644 docs/source/groups/ars.rst diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0a9c507..05af659 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,3 @@ -/cray/modules/ars @Cray-HPE/cray-management-systems /cray/modules/artifacts @Cray-HPE/cray-management-systems /cray/modules/badger @Cray-HPE/hardware-management /cray/modules/bos @Cray-HPE/cms-core-bos diff --git a/cray/modules/ars/__init__.py b/cray/modules/ars/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/cray/modules/ars/cli.py b/cray/modules/ars/cli.py deleted file mode 100644 index fe936e1..0000000 --- a/cray/modules/ars/cli.py +++ /dev/null @@ -1,31 +0,0 @@ -# -# MIT License -# -# (C) Copyright 2020-2023 Hewlett Packard Enterprise Development LP -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. -# -""" ars """ -# pylint: disable=invalid-name -from cray.generator import generate - -cli = generate(__file__) - -# Since this API/CLI is deprecated, hide from the main help message -cli.hidden = True diff --git a/cray/modules/ars/swagger3.json b/cray/modules/ars/swagger3.json deleted file mode 100644 index 35ed3b7..0000000 --- a/cray/modules/ars/swagger3.json +++ /dev/null @@ -1,1968 +0,0 @@ -{ - "openapi": "3.0.2", - "info": { - "title": "Artifact Repository Service API", - "version": "1.0.6", - "description": "The Artifact Repository Service is a general purpose binary object management service that is used for creating, retrieving, updating and deleting binary blobs available to the System Management Services. \n\nThe types of binary objects that can be managed with this service include, but are not limited to, bootable images, docker images, OS packages, and firmware images. Along with the binary images, metadata about using the artifact, such as versioning and download location is also stored in the ARS.\n\nARS is used by System Administrators or Application Developers who want to create utilities on top of the API. \n# Resources\n## /artifacts \n Manage an ArtifactRecord. Allows you to create an ArtifactRecord. The ArtifactRecord \n stores the location of an artifact once it has been uploaded as well as the \n associated metadata, described in the ArtifactRecord request body. \n Required fields include the name of the artifact, the type of artifact \n (limited to `generic`, `kernel`, and `initrd`), and the version.\n\n## /uploads \nManage an UploadRequest. Allows you to create an upload request for an artifact and then upload the artifact to the ARS. You can also delete an upload request by upload_id.\n# Workflow \n\n\n This workflow describes how you can upload an artifact in ARS: \n\n* POST /artifacts - Create a new artifact record in the ARS. Note **artifact_id**. \n* POST /uploads - Create a new upload request and use artifact_id from previous step. \n Note **upload_id**. The value of upload_id is same as artifact_id. \n\n* PUT /uploads/{upload_id} - Upload an artifact to the upload request and use upload_id \n from previous step. \n \n* GET /uploads/{upload_id} - Retrieve information about the upload request by upload_id. \n This step is optional and may be used to confirm that the upload succeeded or to view \n the current state of the upload.\n\n* GET /artifacts/{artifact_id} - Retrieve the artifact record and get the download\n location (uri).\n\n\nThe default content type for the ARS API is \"application/json\". Unsuccessful API calls return a content type of \"application/problem+json\" as per RFC 7807." - }, - "servers": [ - { - "url": "https://api-gw-service-nmn.local/apis/ars", - "description": "The production ARS API server" - } - ], - "paths": { - "/downloads/{artifact_id}": { - "parameters": [ - { - "name": "artifact_id", - "description": "The unique id of the artifact record", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "get": { - "summary": "Download Artifact", - "x-openapi-router-controller": "cray.ars.api.controllers.downloads_controller", - "operationId": "download_artifact", - "tags": [ - "artifacts", - "cli_ignore" - ], - "description": "Download an artifact from the repository by artifact_id.", - "responses": { - "200": { - "description": "Download", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "404": { - "description": "Requested resource does not exist. Re-run request with valid ID.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "An internal error occurred and the request could not be handled.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - } - } - } - }, - "/healthz/live": { - "get": { - "summary": "Retrieve Artifact Repository Liveness Probe", - "x-openapi-router-controller": "cray.ars.api.controllers.healthz_controller", - "operationId": "liveness", - "tags": [ - "service", - "cli_hidden" - ], - "description": "Liveness probe for ARS. This is used by Kubernetes to determine if ARS is responsive.", - "responses": { - "200": { - "description": "ARS is responsive", - "content": { - "application/json": {} - } - }, - "500": { - "description": "ARS is not responsive", - "content": { - "application/json": {} - } - } - } - } - }, - "/healthz/ready": { - "get": { - "summary": "Retrieve Artifact Repository Readiness Probe", - "x-openapi-router-controller": "cray.ars.api.controllers.healthz_controller", - "operationId": "readiness", - "tags": [ - "service", - "cli_hidden" - ], - "description": "Readiness probe for ARS. This is used by Kubernetes to determine if ARS is ready to accept requests.", - "responses": { - "200": { - "description": "ARS is ready to accept requests", - "content": { - "application/json": {} - } - }, - "500": { - "description": "ARS is not able to accept requests", - "content": { - "application/json": {} - } - } - } - } - }, - "/artifacts": { - "get": { - "summary": "Retrieve ArtifactRecord Collection", - "x-openapi-router-controller": "cray.ars.api.controllers.artifacts_controller", - "operationId": "get_artifacts", - "tags": [ - "artifacts" - ], - "description": "Retrieve a list of artifact records.", - "responses": { - "200": { - "description": "A collection of artifacts", - "content": { - "application/json": { - "schema": { - "items": { - "description": "An ArtifactRecord contains metadata used to access, and manage artifacts in the artifact repository.", - "type": "object", - "required": [ - "atype", - "name", - "version" - ], - "properties": { - "atype": { - "description": "Type of artifact.\n* The kernel artifact is a bootable kernel image.\n* The initrd artifact is an initial root file system that is mounted. The initrd is bound to the kernel and loaded as part of the kernel boot procedure.\n* The generic artifact includes any type of artifact.", - "enum": [ - "kernel", - "initrd", - "generic" - ], - "example": "generic", - "type": "string" - }, - "name": { - "description": "Name of the artifact", - "example": "sample_file.bin", - "type": "string" - }, - "version": { - "description": "Version of the artifact", - "example": "0.0.1-x86_64", - "type": "string" - }, - "artifact_id": { - "description": "Unique id of the artifact", - "example": "46a2731e-a1d0-4f98-ba92-4f78c756bb12", - "format": "uuid", - "readOnly": true, - "type": "string" - }, - "created": { - "description": "Time the artifact record was created", - "example": "2018-07-28T03:26:01.234567+00:00", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "download_url": { - "description": "Download URL for the artifact. This field should not be by clients for downloading artifacts. Instead, use the value of the uri of this artifact along with the hostname of the server used to access ARS. This URL is subject to change and is not guaranteed to be accessible by all clients from all locations.", - "format": "url", - "readOnly": true, - "type": "string", - "x-nullable": true - }, - "uri": { - "description": "URI of downloadable artifact. Use this value along with the hostname of the server used to access ARS. Clients using this URI should follow redirects to download the artifact.", - "example": "/apis/ars/assets/artifacts/generic/sample_file.bin", - "format": "string", - "readOnly": true, - "type": "string", - "x-nullable": true - } - } - }, - "type": "array" - } - } - } - }, - "500": { - "description": "An internal error occurred and the request could not be handled.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - } - } - }, - "post": { - "summary": "Create ArtifactRecord", - "x-openapi-router-controller": "cray.ars.api.controllers.artifacts_controller", - "operationId": "create_artifact", - "tags": [ - "artifacts" - ], - "description": "Create a new artifact record in a repository. An artifact record stores metadata about a file artifact including its version and download location.\nRequest body contains minimum required fields in an ArtifactRecord. Successful completion returns completed ArtifactRecord, including a unique artifact_id, and the version and download location of the artifact. The artifact itself has not been uploaded yet. The artifact_id may be used in subsequent /uploads operations to actually request and perform an upload.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "description": "An ArtifactRecordCreate contains metadata used to create artifacts in the artifact repository.", - "properties": { - "atype": { - "description": "Type of artifact.\n* The kernel artifact is a bootable kernel image.\n* The initrd artifact is an initial root file system that is mounted. The initrd is bound to the kernel and loaded as part of the kernel boot procedure.\n* The generic artifact includes any type of artifact.", - "enum": [ - "kernel", - "initrd", - "generic" - ], - "example": "generic", - "type": "string" - }, - "name": { - "description": "Name of the artifact", - "example": "sample_file.bin", - "type": "string" - }, - "version": { - "description": "Version of the artifact", - "example": "0.0.1-x86_64", - "type": "string" - } - }, - "required": [ - "atype", - "name", - "version" - ] - } - } - }, - "description": "Artifact record to create", - "required": true - }, - "responses": { - "201": { - "description": "An Artifact Record", - "content": { - "application/json": { - "schema": { - "description": "An ArtifactRecord contains metadata used to access, and manage artifacts in the artifact repository.", - "type": "object", - "required": [ - "atype", - "name", - "version" - ], - "properties": { - "atype": { - "description": "Type of artifact.\n* The kernel artifact is a bootable kernel image.\n* The initrd artifact is an initial root file system that is mounted. The initrd is bound to the kernel and loaded as part of the kernel boot procedure.\n* The generic artifact includes any type of artifact.", - "enum": [ - "kernel", - "initrd", - "generic" - ], - "example": "generic", - "type": "string" - }, - "name": { - "description": "Name of the artifact", - "example": "sample_file.bin", - "type": "string" - }, - "version": { - "description": "Version of the artifact", - "example": "0.0.1-x86_64", - "type": "string" - }, - "artifact_id": { - "description": "Unique id of the artifact", - "example": "46a2731e-a1d0-4f98-ba92-4f78c756bb12", - "format": "uuid", - "readOnly": true, - "type": "string" - }, - "created": { - "description": "Time the artifact record was created", - "example": "2018-07-28T03:26:01.234567+00:00", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "download_url": { - "description": "Download URL for the artifact. This field should not be by clients for downloading artifacts. Instead, use the value of the uri of this artifact along with the hostname of the server used to access ARS. This URL is subject to change and is not guaranteed to be accessible by all clients from all locations.", - "format": "url", - "readOnly": true, - "type": "string", - "x-nullable": true - }, - "uri": { - "description": "URI of downloadable artifact. Use this value along with the hostname of the server used to access ARS. Clients using this URI should follow redirects to download the artifact.", - "example": "/apis/ars/assets/artifacts/generic/sample_file.bin", - "format": "string", - "readOnly": true, - "type": "string", - "x-nullable": true - } - } - } - } - } - }, - "400": { - "description": "Input data was understood, but failed validation. Re-run request with valid input values for the fields indicated in the response.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "An internal error occurred and the request could not be handled.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - } - } - } - }, - "/artifacts/{artifact_id}": { - "parameters": [ - { - "name": "artifact_id", - "description": "The unique id of the artifact record", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "get": { - "summary": "Retrieve ArtifactRecord", - "x-openapi-router-controller": "cray.ars.api.controllers.artifacts_controller", - "operationId": "get_artifact", - "tags": [ - "artifacts" - ], - "description": "Get an artifact from the repository by artifact_id.", - "responses": { - "200": { - "description": "An artifact record", - "content": { - "application/json": { - "schema": { - "description": "An ArtifactRecord contains metadata used to access, and manage artifacts in the artifact repository.", - "type": "object", - "required": [ - "atype", - "name", - "version" - ], - "properties": { - "atype": { - "description": "Type of artifact.\n* The kernel artifact is a bootable kernel image.\n* The initrd artifact is an initial root file system that is mounted. The initrd is bound to the kernel and loaded as part of the kernel boot procedure.\n* The generic artifact includes any type of artifact.", - "enum": [ - "kernel", - "initrd", - "generic" - ], - "example": "generic", - "type": "string" - }, - "name": { - "description": "Name of the artifact", - "example": "sample_file.bin", - "type": "string" - }, - "version": { - "description": "Version of the artifact", - "example": "0.0.1-x86_64", - "type": "string" - }, - "artifact_id": { - "description": "Unique id of the artifact", - "example": "46a2731e-a1d0-4f98-ba92-4f78c756bb12", - "format": "uuid", - "readOnly": true, - "type": "string" - }, - "created": { - "description": "Time the artifact record was created", - "example": "2018-07-28T03:26:01.234567+00:00", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "download_url": { - "description": "Download URL for the artifact. This field should not be by clients for downloading artifacts. Instead, use the value of the uri of this artifact along with the hostname of the server used to access ARS. This URL is subject to change and is not guaranteed to be accessible by all clients from all locations.", - "format": "url", - "readOnly": true, - "type": "string", - "x-nullable": true - }, - "uri": { - "description": "URI of downloadable artifact. Use this value along with the hostname of the server used to access ARS. Clients using this URI should follow redirects to download the artifact.", - "example": "/apis/ars/assets/artifacts/generic/sample_file.bin", - "format": "string", - "readOnly": true, - "type": "string", - "x-nullable": true - } - } - } - } - } - }, - "404": { - "description": "Requested resource does not exist. Re-run request with valid ID.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "An internal error occurred and the request could not be handled.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - } - } - }, - "delete": { - "summary": "Delete ArtifactRecord", - "x-openapi-router-controller": "cray.ars.api.controllers.artifacts_controller", - "operationId": "delete_artifact", - "tags": [ - "artifacts" - ], - "description": "Delete an artifact from the repository by artifact_id. Any upload requests associated with this artifact will also be deleted.", - "responses": { - "204": { - "description": "Artifact record deleted successfully" - }, - "404": { - "description": "Requested resource does not exist. Re-run request with valid ID.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "An internal error occurred and the request could not be handled.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - } - } - } - }, - "/uploads": { - "get": { - "summary": "Retrieve UploadRequest Collection", - "x-openapi-router-controller": "cray.ars.api.controllers.uploads_controller", - "operationId": "get_uploads", - "tags": [ - "uploads" - ], - "description": "Retrieve a list of upload requests.", - "responses": { - "200": { - "description": "A collection of upload requests", - "content": { - "application/json": { - "schema": { - "items": { - "description": "An upload request", - "type": "object", - "required": [ - "artifact_id" - ], - "properties": { - "artifact_id": { - "description": "ID of the artifact record that is associated with this upload request.", - "example": "46a2731e-a1d0-4f98-ba92-4f78c756bb12", - "format": "uuid", - "type": "string" - }, - "created": { - "description": "Time the upload request was created", - "example": "2018-07-28T03:26:01.234567+00:00", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "state": { - "description": "State of the upload request. It can be the following - * created The upload request is created. The file is not uploaded yet. This happens after you run POST /uploads. * upload-processing The artifact is currently being uploaded. * upload-complete The artifact is uploaded. * error There is an error during upload.", - "enum": [ - "created", - "upload-processing", - "upload-complete", - "error" - ], - "readOnly": true, - "type": "string" - }, - "upload_id": { - "description": "Unique id of the artifact", - "example": "082929ff-8f1b-4ecb-9f09-18460c4a29aa", - "format": "uuid", - "readOnly": true, - "type": "string" - }, - "url": { - "description": "Download URL of the uploaded file", - "example": "https://sms/apis/ars/assets/artifacts/generic/sample_file.bin", - "format": "url", - "readOnly": true, - "type": "string", - "x-nullable": true - } - } - }, - "type": "array" - } - } - } - }, - "500": { - "description": "An internal error occurred and the request could not be handled.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - } - } - }, - "post": { - "summary": "Create UploadRequest", - "x-openapi-router-controller": "cray.ars.api.controllers.uploads_controller", - "operationId": "create_upload", - "tags": [ - "uploads" - ], - "description": "Create a new upload request associated with an existing artifact_id. An artifact_id should be associated with a single upload_id; do not re-use an artifact_id with this operation.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "description": "An object to create upload request", - "type": "object", - "properties": { - "artifact_id": { - "description": "ID of the artifact record that is associated with this upload request.", - "example": "46a2731e-a1d0-4f98-ba92-4f78c756bb12", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "artifact_id" - ] - } - } - }, - "required": true, - "description": "Artifact record id to associate the upload with." - }, - "responses": { - "201": { - "description": "An Upload Request.", - "content": { - "application/json": { - "schema": { - "description": "An upload request", - "type": "object", - "required": [ - "artifact_id" - ], - "properties": { - "artifact_id": { - "description": "ID of the artifact record that is associated with this upload request.", - "example": "46a2731e-a1d0-4f98-ba92-4f78c756bb12", - "format": "uuid", - "type": "string" - }, - "created": { - "description": "Time the upload request was created", - "example": "2018-07-28T03:26:01.234567+00:00", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "state": { - "description": "State of the upload request. It can be the following - * created The upload request is created. The file is not uploaded yet. This happens after you run POST /uploads. * upload-processing The artifact is currently being uploaded. * upload-complete The artifact is uploaded. * error There is an error during upload.", - "enum": [ - "created", - "upload-processing", - "upload-complete", - "error" - ], - "readOnly": true, - "type": "string" - }, - "upload_id": { - "description": "Unique id of the artifact", - "example": "082929ff-8f1b-4ecb-9f09-18460c4a29aa", - "format": "uuid", - "readOnly": true, - "type": "string" - }, - "url": { - "description": "Download URL of the uploaded file", - "example": "https://sms/apis/ars/assets/artifacts/generic/sample_file.bin", - "format": "url", - "readOnly": true, - "type": "string", - "x-nullable": true - } - } - } - } - } - }, - "400": { - "description": "Input data was understood, but failed validation. Re-run request with valid input values for the fields indicated in the response.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "An internal error occurred and the request could not be handled.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - } - } - } - }, - "/uploads/{upload_id}": { - "parameters": [ - { - "name": "upload_id", - "description": "The unique id of the upload request", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "get": { - "summary": "Retrieve UploadRequest", - "x-openapi-router-controller": "cray.ars.api.controllers.uploads_controller", - "operationId": "get_upload", - "tags": [ - "uploads" - ], - "description": "Get information about an upload request by upload_id. May be used to confirm that the upload succeeded or view the current state of the upload.", - "responses": { - "200": { - "description": "An upload request", - "content": { - "application/json": { - "schema": { - "description": "An upload request", - "type": "object", - "required": [ - "artifact_id" - ], - "properties": { - "artifact_id": { - "description": "ID of the artifact record that is associated with this upload request.", - "example": "46a2731e-a1d0-4f98-ba92-4f78c756bb12", - "format": "uuid", - "type": "string" - }, - "created": { - "description": "Time the upload request was created", - "example": "2018-07-28T03:26:01.234567+00:00", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "state": { - "description": "State of the upload request. It can be the following - * created The upload request is created. The file is not uploaded yet. This happens after you run POST /uploads. * upload-processing The artifact is currently being uploaded. * upload-complete The artifact is uploaded. * error There is an error during upload.", - "enum": [ - "created", - "upload-processing", - "upload-complete", - "error" - ], - "readOnly": true, - "type": "string" - }, - "upload_id": { - "description": "Unique id of the artifact", - "example": "082929ff-8f1b-4ecb-9f09-18460c4a29aa", - "format": "uuid", - "readOnly": true, - "type": "string" - }, - "url": { - "description": "Download URL of the uploaded file", - "example": "https://sms/apis/ars/assets/artifacts/generic/sample_file.bin", - "format": "url", - "readOnly": true, - "type": "string", - "x-nullable": true - } - } - } - } - } - }, - "404": { - "description": "Requested resource does not exist. Re-run request with valid ID.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "An internal error occurred and the request could not be handled.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - } - } - }, - "put": { - "summary": "Update UploadRequest", - "x-openapi-router-controller": "cray.ars.api.controllers.uploads_controller", - "operationId": "put_upload", - "tags": [ - "uploads" - ], - "description": "Upload a file to an upload request. There are no restrictions on file type. You cannot replace an artifact after uploading it.", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "properties": { - "artifact": { - "description": "The file to upload.", - "type": "string", - "format": "binary" - } - }, - "required": [ - "artifact" - ] - } - } - } - }, - "responses": { - "204": { - "description": "Content successfully uploaded and associated with an artifact" - }, - "400": { - "description": "Upload request already completed. Create a new upload request for the artifact ID.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Requested resource does not exist. Re-run request with valid ID.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "Failed to upload the file or the associated artifact was not found. Either the file upload to server is not successful or the server is unable to create download location because the request was missing 'Host' header.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - } - } - }, - "delete": { - "summary": "DELETE UploadRequest (DEPRECATED)", - "x-openapi-router-controller": "cray.ars.api.controllers.uploads_controller", - "operationId": "delete_upload", - "tags": [ - "uploads" - ], - "description": "DEPRECATED. Delete an upload request and artifact by upload_id. This endpoint should not be used. To delete an artifact and its associated upload information, delete the artifact instead.", - "responses": { - "204": { - "description": "No-op." - }, - "404": { - "description": "Requested resource does not exist. Re-run request with valid ID.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "An internal error occurred and the request could not be handled.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "tags": [ - { - "name": "artifacts", - "description": "Interact with artifacts records" - }, - { - "name": "uploads", - "description": "Interact with upload requests" - } - ], - "components": { - "responses": { - "InvalidArtifact": { - "description": "Associated artifact does not exist. Determine the specific information that is missing or invalid and then re-run the request with valid information.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "InvalidInputData": { - "description": "Input data was understood, but failed validation. Re-run request with valid input values for the fields indicated in the response.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "NoInputProvided": { - "description": "No input provided. Determine the specific information that is missing or invalid and then re-run the request with valid information.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "NotFound": { - "description": "Requested resource does not exist. Re-run request with valid ID.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "UploadAlreadyCompleted": { - "description": "Upload request already completed. Create a new upload request for the artifact ID.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "UploadFailure": { - "description": "Failed to upload the file or the associated artifact was not found. Either the file upload to server is not successful or the server is unable to create download location because the request was missing 'Host' header.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - }, - "ServerError": { - "description": "An internal error occurred and the request could not be handled.", - "content": { - "application/problem+json": { - "schema": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - } - } - } - } - }, - "schemas": { - "ArtifactRecordCreate": { - "type": "object", - "description": "An ArtifactRecordCreate contains metadata used to create artifacts in the artifact repository.", - "properties": { - "atype": { - "description": "Type of artifact.\n* The kernel artifact is a bootable kernel image.\n* The initrd artifact is an initial root file system that is mounted. The initrd is bound to the kernel and loaded as part of the kernel boot procedure.\n* The generic artifact includes any type of artifact.", - "enum": [ - "kernel", - "initrd", - "generic" - ], - "example": "generic", - "type": "string" - }, - "name": { - "description": "Name of the artifact", - "example": "sample_file.bin", - "type": "string" - }, - "version": { - "description": "Version of the artifact", - "example": "0.0.1-x86_64", - "type": "string" - } - }, - "required": [ - "atype", - "name", - "version" - ] - }, - "ArtifactRecord": { - "description": "An ArtifactRecord contains metadata used to access, and manage artifacts in the artifact repository.", - "type": "object", - "required": [ - "atype", - "name", - "version" - ], - "properties": { - "atype": { - "description": "Type of artifact.\n* The kernel artifact is a bootable kernel image.\n* The initrd artifact is an initial root file system that is mounted. The initrd is bound to the kernel and loaded as part of the kernel boot procedure.\n* The generic artifact includes any type of artifact.", - "enum": [ - "kernel", - "initrd", - "generic" - ], - "example": "generic", - "type": "string" - }, - "name": { - "description": "Name of the artifact", - "example": "sample_file.bin", - "type": "string" - }, - "version": { - "description": "Version of the artifact", - "example": "0.0.1-x86_64", - "type": "string" - }, - "artifact_id": { - "description": "Unique id of the artifact", - "example": "46a2731e-a1d0-4f98-ba92-4f78c756bb12", - "format": "uuid", - "readOnly": true, - "type": "string" - }, - "created": { - "description": "Time the artifact record was created", - "example": "2018-07-28T03:26:01.234567+00:00", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "download_url": { - "description": "Download URL for the artifact. This field should not be by clients for downloading artifacts. Instead, use the value of the uri of this artifact along with the hostname of the server used to access ARS. This URL is subject to change and is not guaranteed to be accessible by all clients from all locations.", - "format": "url", - "readOnly": true, - "type": "string", - "x-nullable": true - }, - "uri": { - "description": "URI of downloadable artifact. Use this value along with the hostname of the server used to access ARS. Clients using this URI should follow redirects to download the artifact.", - "example": "/apis/ars/assets/artifacts/generic/sample_file.bin", - "format": "string", - "readOnly": true, - "type": "string", - "x-nullable": true - } - } - }, - "ProblemDetails": { - "description": "An error response for RFC 7807 problem details.", - "type": "object", - "properties": { - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem. Focus on helping correct the problem, rather than giving debugging information.", - "type": "string" - }, - "errors": { - "description": "An object denoting field-specific errors. Only present on error responses when field input is specified for the request.", - "type": "object" - }, - "instance": { - "description": "A relative URI reference that identifies the specific occurrence of the problem", - "format": "uri", - "type": "string" - }, - "status": { - "description": "HTTP status code", - "example": 400, - "type": "integer" - }, - "title": { - "description": "Short, human-readable summary of the problem, should not change by occurrence.", - "type": "string" - }, - "type": { - "default": "about:blank", - "description": "Relative URI reference to the type of problem which includes human readable documentation.", - "format": "uri", - "type": "string" - } - } - }, - "UploadRequestCreate": { - "description": "An object to create upload request", - "type": "object", - "properties": { - "artifact_id": { - "description": "ID of the artifact record that is associated with this upload request.", - "example": "46a2731e-a1d0-4f98-ba92-4f78c756bb12", - "format": "uuid", - "type": "string" - } - }, - "required": [ - "artifact_id" - ] - }, - "UploadRequest": { - "description": "An upload request", - "type": "object", - "required": [ - "artifact_id" - ], - "properties": { - "artifact_id": { - "description": "ID of the artifact record that is associated with this upload request.", - "example": "46a2731e-a1d0-4f98-ba92-4f78c756bb12", - "format": "uuid", - "type": "string" - }, - "created": { - "description": "Time the upload request was created", - "example": "2018-07-28T03:26:01.234567+00:00", - "format": "date-time", - "readOnly": true, - "type": "string" - }, - "state": { - "description": "State of the upload request. It can be the following - * created The upload request is created. The file is not uploaded yet. This happens after you run POST /uploads. * upload-processing The artifact is currently being uploaded. * upload-complete The artifact is uploaded. * error There is an error during upload.", - "enum": [ - "created", - "upload-processing", - "upload-complete", - "error" - ], - "readOnly": true, - "type": "string" - }, - "upload_id": { - "description": "Unique id of the artifact", - "example": "082929ff-8f1b-4ecb-9f09-18460c4a29aa", - "format": "uuid", - "readOnly": true, - "type": "string" - }, - "url": { - "description": "Download URL of the uploaded file", - "example": "https://sms/apis/ars/assets/artifacts/generic/sample_file.bin", - "format": "url", - "readOnly": true, - "type": "string", - "x-nullable": true - } - } - } - } - } -} diff --git a/cray/modules/artifacts/cli.py b/cray/modules/artifacts/cli.py index 9051317..3070350 100644 --- a/cray/modules/artifacts/cli.py +++ b/cray/modules/artifacts/cli.py @@ -21,7 +21,7 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # -""" Artifact - thin wrapper over S3 with ARS backwards compatibility """ +""" Artifact - thin wrapper over S3 """ # pylint: disable=invalid-name,redefined-outer-name,missing-docstring,unused-argument,broad-except import datetime import hashlib @@ -144,37 +144,16 @@ def describe_object(ctx, bucket, obj): @argument('bucket', metavar='BUCKET') @argument('obj', metavar='OBJECT') @argument('filename', metavar='FILEPATH') -@option( - '--expires', - metavar='EXPIRES', - help='Seconds until download url expiration.', - default=60 * 60 -) @pass_context def upload_object(ctx, bucket, obj, filename, expires): """ Create a new object in a bucket """ - # - # Remove this check along with the --expires parameter when ARS is fully deprecated - # - if expires > 3600: - raise click.ClickException( - f"Maximum download url timeout is 3600 seconds: {expires:d}" - ) - s3client = get_s3_client() md5sum = md5(filename) - if bucket == 'ars-app': - # Generate an ID, for compatibility of some services that validate that ARS - # artifacts are UUID, this must be a UUID and the S3 object must use it as - # the object name. Can be removed when ARS is fully deprecated. - obj_id = str(uuid.uuid4()) - else: - obj_id = obj + obj_id = obj - # Create the object and a download url, then upload the file with the ARS- - # compatible metadata + # Create the object and a download url, then upload the file try: s3client.put_object(Bucket=bucket, Key=obj_id, ACL='public-read') url = s3client.generate_presigned_url( @@ -198,35 +177,14 @@ def upload_object(ctx, bucket, obj, filename, expires): upload_args = (filename, bucket, obj_id) config = TransferConfig(use_threads=False) - if bucket == 'ars-app': - # ARS-compatible metadata, remove when ARS is fully deprecated - upload_kwargs = { - 'Config': config, - 'ExtraArgs': { - 'Metadata': { - 'artifact_id': obj_id, - 'atype': 'generic', - 'created': datetime.datetime.now().isoformat(), - 'download_url': url, - 'md5sum': md5sum, - 'name': obj, - 'state': 'upload-complete', - 'upload_id': obj_id, - 'uri': '/apis/ars/downloads/' + obj_id, - 'url': url, - 'version': '1', - } - } - } - else: - upload_kwargs = { - 'Config': config, - 'ExtraArgs': { - 'Metadata': { - 'md5sum': md5sum, - } + upload_kwargs = { + 'Config': config, + 'ExtraArgs': { + 'Metadata': { + 'md5sum': md5sum, } } + } s3client.upload_file(*upload_args, **upload_kwargs) diff --git a/cray/modules/bss/swagger.yaml b/cray/modules/bss/swagger.yaml index fa2e61b..c4d4ed9 100644 --- a/cray/modules/bss/swagger.yaml +++ b/cray/modules/bss/swagger.yaml @@ -828,11 +828,11 @@ definitions: kernel: type: string description: URL or file system path specifying kernel image. - example: "http://10.252.100.50/apis/ars/downloads/30b96241-12ff-4185-93ea-a1f7991372d3" + example: "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/kernel" initrd: type: string description: URL or file system path specifying initrd image. - example: "http://10.252.100.50/apis/ars/downloads/7e0bcf9f-10fc-46a9-b2f8-ba8814c1999c" + example: "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/initrd" cloud-init: $ref: '#/definitions/CloudInit' diff --git a/cray/modules/bss/swagger3.json b/cray/modules/bss/swagger3.json index 85ba38d..b69a242 100644 --- a/cray/modules/bss/swagger3.json +++ b/cray/modules/bss/swagger3.json @@ -1,3332 +1,3332 @@ { - "openapi": "3.0.0", - "info": { - "description": "Boot Script Service (BSS) manages the iPXE boot scripts that coordinate the boot process for nodes, and enables basic association of boot scripts with nodes. When nodes initially power on, boot, or reboot, they consult BSS for their target artifacts and boot parameters. The boot scripts are generated on demand from the information that is entered and delivered to the requester during an iPXE boot. The boot scripts supply a booting node with a pointer to the necessary images (kernel and initrd) that are stored in the artifact repository and a set of boot-time parameters.\nThe BSS API allows the caller to retrieve an iPXE boot script from the boot script server, and to set, update, delete, and retrieve boot script parameters for each host in a system. BSS works with all nodes that are known to HSM and do not have the hardware role as Management in HSM.\n## Resources\n### /boot/v1/bootscript\nRetrieve the iPXE boot script for a host. One of the three parameters is required - name, MAC, or NID.\n### /boot/v1/bootparameters\nSet, update, delete, and retrieve boot script parameters for specific hosts.\n### /boot/v1/hosts\nRetrieve the latest host information like state, NID, and ID from HSM.\n### /boot/v1/dumpstate\nDump internal state of boot script service for debugging purposes.\n## Workflows\n### Define Boot Parameters for all Nodes\n#### POST /boot/v1/bootparameters\nDefine boot parameters. Specify the host as Default. While BSS allows for fine grained control of individual nodes, the Default tag is typically more convenient, especially for a large system.\n\nAlong with the host, the kernel, initrd, and params should be defined. The kernel is required for BSS to generate a boot script, but initrd and params are typically needed for the node to boot successfully. The kernel and initrd fields contain a URL to the respective images. The params field is a string that will be passed to the kernel during the boot process.\n#### GET /boot/v1/bootscript\nVerify the boot script to ensure it's what you want\n### Update Boot Parameters\n#### GET /boot/v1/hosts\nRetrieve list of hosts known to HSM and select the host for which the boot parameters need to be changed.\n#### GET /boot/v1/bootparameters\nRetrieve the boot parameters for the specific host.\n#### PUT /boot/v1/bootparameters\nUpdate boot parameters for the host.\n#### GET /boot/v1/bootparameters\nVerify the boot parameters for the specific host.", - "version": "1.0.0", - "title": "Boot Script Service" - }, - "paths": { - "/meta-data": { - "get": { - "summary": "Retrieve cloud-init meta-data", - "tags": [ - "cli_ignore" - ], - "operationId": "meta_data_get", - "parameters": [ - { - "name": "key", - "in": "query", - "description": "Specific sub key(s) to query. Separated by periods.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "meta-data for node", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" + "openapi": "3.0.0", + "info": { + "description": "Boot Script Service (BSS) manages the iPXE boot scripts that coordinate the boot process for nodes, and enables basic association of boot scripts with nodes. When nodes initially power on, boot, or reboot, they consult BSS for their target artifacts and boot parameters. The boot scripts are generated on demand from the information that is entered and delivered to the requester during an iPXE boot. The boot scripts supply a booting node with a pointer to the necessary images (kernel and initrd) that are stored in the artifact repository and a set of boot-time parameters.\nThe BSS API allows the caller to retrieve an iPXE boot script from the boot script server, and to set, update, delete, and retrieve boot script parameters for each host in a system. BSS works with all nodes that are known to HSM and do not have the hardware role as Management in HSM.\n## Resources\n### /boot/v1/bootscript\nRetrieve the iPXE boot script for a host. One of the three parameters is required - name, MAC, or NID.\n### /boot/v1/bootparameters\nSet, update, delete, and retrieve boot script parameters for specific hosts.\n### /boot/v1/hosts\nRetrieve the latest host information like state, NID, and ID from HSM.\n### /boot/v1/dumpstate\nDump internal state of boot script service for debugging purposes.\n## Workflows\n### Define Boot Parameters for all Nodes\n#### POST /boot/v1/bootparameters\nDefine boot parameters. Specify the host as Default. While BSS allows for fine grained control of individual nodes, the Default tag is typically more convenient, especially for a large system.\n\nAlong with the host, the kernel, initrd, and params should be defined. The kernel is required for BSS to generate a boot script, but initrd and params are typically needed for the node to boot successfully. The kernel and initrd fields contain a URL to the respective images. The params field is a string that will be passed to the kernel during the boot process.\n#### GET /boot/v1/bootscript\nVerify the boot script to ensure it's what you want\n### Update Boot Parameters\n#### GET /boot/v1/hosts\nRetrieve list of hosts known to HSM and select the host for which the boot parameters need to be changed.\n#### GET /boot/v1/bootparameters\nRetrieve the boot parameters for the specific host.\n#### PUT /boot/v1/bootparameters\nUpdate boot parameters for the host.\n#### GET /boot/v1/bootparameters\nVerify the boot parameters for the specific host.", + "version": "1.0.0", + "title": "Boot Script Service" + }, + "paths": { + "/meta-data": { + "get": { + "summary": "Retrieve cloud-init meta-data", + "tags": [ + "cli_ignore" + ], + "operationId": "meta_data_get", + "parameters": [ + { + "name": "key", + "in": "query", + "description": "Specific sub key(s) to query. Separated by periods.", + "schema": { + "type": "string" + } } - } - } - } - } - }, - "404": { - "description": "Does Not Exist - Either the host, MAC or NID are unknown and there is no Default, or the existing entry does not specify a kernel image for boot.", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" + ], + "responses": { + "200": { + "description": "meta-data for node", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } }, - "status": { - "type": "integer" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "detail": { - "type": "string" + "404": { + "description": "Does Not Exist - Either the host, MAC or NID are unknown and there is no Default, or the existing entry does not specify a kernel image for boot.", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "instance": { - "type": "string" + "default": { + "description": "Unexpected error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } } - } } - } } - }, - "default": { - "description": "Unexpected error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" + }, + "/user-data": { + "get": { + "summary": "Retrieve cloud-init user-data", + "tags": [ + "cli_ignore" + ], + "operationId": "user_data_get", + "responses": { + "200": { + "description": "user-data for node", + "content": { + "text/yaml": { + "schema": { + "type": "object" + } + } + } }, - "status": { - "type": "integer" + "400": { + "description": "Bad Request", + "content": { + "text/yaml": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "detail": { - "type": "string" + "404": { + "description": "Does Not Exist - Either the host, MAC or NID are unknown and there is no Default, or the existing entry does not specify a kernel image for boot.", + "content": { + "text/yaml": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "instance": { - "type": "string" + "default": { + "description": "Unexpected error", + "content": { + "text/yaml": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } } - } } - } } - } - } - } - }, - "/user-data": { - "get": { - "summary": "Retrieve cloud-init user-data", - "tags": [ - "cli_ignore" - ], - "operationId": "user_data_get", - "responses": { - "200": { - "description": "user-data for node", - "content": { - "text/yaml": { - "schema": { - "type": "object" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "text/yaml": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" + }, + "/phone-home": { + "post": { + "summary": "Post cloud-init", + "tags": [ + "cli_ignore" + ], + "operationId": "phone_home_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Meta data for node", + "content": { + "application/json": { + "schema": { + "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", + "type": "object", + "properties": { + "hosts": { + "type": "array", + "description": "host names", + "items": { + "type": "string" + }, + "example": [ + "x0c0s2b0n0", + "x0c0s3b0n0" + ] + }, + "macs": { + "type": "array", + "description": "MAC addresses", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "nids": { + "type": "array", + "description": "Node ID", + "items": { + "type": "integer" + }, + "example": [ + 1, + 2, + 3, + 4 + ] + }, + "params": { + "type": "string", + "description": "Specific to the kernel that is being booted.", + "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" + }, + "kernel": { + "type": "string", + "description": "URL or file system path specifying kernel image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/kernel" + }, + "initrd": { + "type": "string", + "description": "URL or file system path specifying initrd image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/initrd" + }, + "cloud-init": { + "description": "Cloud-Init data for the hosts", + "type": "object", + "properties": { + "meta-data": { + "description": "Cloud-Init Instance Metadata for a host.", + "type": "object", + "additionalProperties": true + }, + "user-data": { + "description": "Cloud-Init User data for a host.", + "type": "object", + "additionalProperties": true + }, + "phone-home": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } + } + }, + "example": { + "user-data": { + "foo": "bar" + }, + "meta-data": { + "foo": "bar" + } + } + } + } + } + } + } }, - "status": { - "type": "integer" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "detail": { - "type": "string" + "404": { + "description": "Does Not Exist - Either the host, MAC or NID are unknown and there is no Default, or the existing entry does not specify a kernel image for boot.", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "instance": { - "type": "string" + "default": { + "description": "Unexpected error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } } - } } - } } - }, - "404": { - "description": "Does Not Exist - Either the host, MAC or NID are unknown and there is no Default, or the existing entry does not specify a kernel image for boot.", - "content": { - "text/yaml": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" + }, + "/boot/v1/bootscript": { + "get": { + "summary": "Retrieve iPXE boot script", + "tags": [ + "bootscript" + ], + "description": "Retrieve iPXE boot script for the host specified by the MAC parameter. Alternatively, for test/convenience purposes, use the name or the NID parameter to specify the host name or xname. Do not specify more than one parameter (MAC, name, or NID) in the request as results are undefined if they do not all refer to the same node.", + "operationId": "bootscript_get", + "parameters": [ + { + "name": "mac", + "in": "query", + "description": "MAC address of host requesting boot script", + "schema": { + "type": "string" + } }, - "title": { - "type": "string" + { + "name": "name", + "in": "query", + "description": "Name of host requesting boot script or xname", + "schema": { + "type": "string" + } }, - "status": { - "type": "integer" + { + "name": "nid", + "in": "query", + "description": "Node ID (NID) of host requesting boot script", + "schema": { + "type": "integer" + } }, - "detail": { - "type": "string" + { + "name": "retry", + "in": "query", + "description": "Number of times requesting script without a successful boot. This parameter is mostly used by the software itself to keep track of retries.", + "schema": { + "type": "integer" + } }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "content": { - "text/yaml": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" + { + "name": "arch", + "in": "query", + "description": "The architecture value from the iPXE variable ${buildarch}. This parameter is mostly used by the software itself.", + "schema": { + "type": "string" + } }, - "title": { - "type": "string" + { + "name": "ts", + "in": "query", + "description": "Timestamp for when the HSM state info needs to be up to date by. This is the Unix concept of time, the number of seconds since Jan 1, 1970 UTC. This parameter is mostly used by the software itself.", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Boot script for requested MAC address", + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "#!ipxe\nkernel --name kernel http://rgw-vip.nmn/boot-images/00000000-0000-0000-0000-000000000000/kernel initrd=initrd console=ttyS0,115200 bad_page=panic crashkernel=512M hugepagelist=2m-2g intel_iommu=off intel_pstate=disable iommu.passthrough=on numa_interleave_omit=headless oops=panic pageblock_order=14 rd.neednet=1 rd.retry=10 rd.shell systemd.unified_cgroup_hierarchy=1 ip=dhcp quiet spire_join_token=00000000-0000-0000-0000-000000000000 root=craycps-s3:s3://boot-images/00000000-0000-0000-0000-000000000000/rootfs:00000000000000000000000000000000-000:dvs:api-gw-service-nmn.local:300:hsn0,nmn0:0 nmd_data=url=s3://boot-images/00000000-0000-0000-0000-000000000000/rootfs bos_session_id=000000-0000-0000-0000-000000000000 xname=x3000c0s17b3n0 nid=3 bss_referral_token=00000000-0000-0000-0000-000000000000 ds=nocloud-net;s=http://10.92.100.81:8888/ || goto boot_retry\ninitrd --name initrd http://rgw-vip.nmn/boot-images/00000000-0000-0000-0000-000000000000/initrd || goto boot_retry\nboot || goto boot_retry\n:boot_retry\nsleep 30\nchain https://api-gw-service-nmn.local/apis/bss/boot/v1/bootscript?mac=b4:2e:99:df:eb:bf&retry=1\n" + } + } + } }, - "status": { - "type": "integer" + "400": { + "description": "Bad Request", + "content": { + "text/plain": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "detail": { - "type": "string" + "404": { + "description": "Does Not Exist - Either the host, MAC, or NID are unknown and there is no Default, or the existing entry does not specify a kernel image for boot.", + "content": { + "text/plain": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "instance": { - "type": "string" + "default": { + "description": "Unexpected error", + "content": { + "text/plain": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } } - } - } - } - } - } - } - } - }, - "/phone-home": { - "post": { - "summary": "Post cloud-init", - "tags": [ - "cli_ignore" - ], - "operationId": "phone_home_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", - "type": "object", - "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } } - } } - } }, - "responses": { - "200": { - "description": "Meta data for node", - "content": { - "application/json": { - "schema": { - "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", - "type": "object", - "properties": { - "hosts": { - "type": "array", - "description": "host names", - "items": { - "type": "string" - }, - "example": [ - "x0c0s2b0n0", - "x0c0s3b0n0" - ] - }, - "macs": { - "type": "array", - "description": "MAC addresses", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "nids": { - "type": "array", - "description": "Node ID", - "items": { - "type": "integer" - }, - "example": [ - 1, - 2, - 3, - 4 - ] - }, - "params": { - "type": "string", - "description": "Specific to the kernel that is being booted.", - "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" - }, - "kernel": { - "type": "string", - "description": "URL or file system path specifying kernel image.", - "example": "http://10.252.100.50/apis/ars/downloads/30b96241-12ff-4185-93ea-a1f7991372d3" + "/boot/v1/bootparameters": { + "get": { + "summary": "Retrieve boot parameters", + "tags": [ + "bootparameters" + ], + "description": "Retrieve the boot parameters for one or more hosts. If no parameters are provided, then all known parameters are returned. Filtering can be accomplished by either providing a body of the boot parameters or one of the three query parameters: host names, MAC addresses, and/or NIDs. The body of boot parameters can also provide a kernel or initrd path which will be returned along with any bootparameter settings as well. Alternatively, query parameters name=, mac=, and/or nid= can provide the filtering of individual items or comma-separated lists of items. The response is a list of boot parameter items. These items will include the individual kernel and initrd images, along with any related boot parameters. If filtering parameters are provided, each parameter will provide a result if one exists. Note that the kernel and initrd images are specified with a URL or path. A plain path will result in a TFTP download from this server. If a URL is provided, it can be from any available service which iPXE supports, and any location that the iPXE client has access to.", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Host name or tag name of boot parameters to return", + "schema": { + "type": "string" + } }, - "initrd": { - "type": "string", - "description": "URL or file system path specifying initrd image.", - "example": "http://10.252.100.50/apis/ars/downloads/7e0bcf9f-10fc-46a9-b2f8-ba8814c1999c" + { + "name": "mac", + "in": "query", + "description": "MAC Address of host of boot parameters to return", + "schema": { + "type": "string" + } }, - "cloud-init": { - "description": "Cloud-Init data for the hosts", - "type": "object", - "properties": { - "meta-data": { - "description": "Cloud-Init Instance Metadata for a host.", - "type": "object", - "additionalProperties": true - }, - "user-data": { - "description": "Cloud-Init User data for a host.", - "type": "object", - "additionalProperties": true - }, - "phone-home": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", - "type": "object", - "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } - } + { + "name": "nid", + "in": "query", + "description": "NID of host of boot parameters to return", + "schema": { + "type": "integer" } - }, - "example": { - "user-data": { - "foo": "bar" - }, - "meta-data": { - "foo": "bar" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", + "type": "object", + "properties": { + "hosts": { + "type": "array", + "description": "host names", + "items": { + "type": "string" + }, + "example": [ + "x0c0s2b0n0", + "x0c0s3b0n0" + ] + }, + "macs": { + "type": "array", + "description": "MAC addresses", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "nids": { + "type": "array", + "description": "Node ID", + "items": { + "type": "integer" + }, + "example": [ + 1, + 2, + 3, + 4 + ] + }, + "params": { + "type": "string", + "description": "Specific to the kernel that is being booted.", + "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" + }, + "kernel": { + "type": "string", + "description": "URL or file system path specifying kernel image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/kernel" + }, + "initrd": { + "type": "string", + "description": "URL or file system path specifying initrd image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/initrd" + }, + "cloud-init": { + "description": "Cloud-Init data for the hosts", + "type": "object", + "properties": { + "meta-data": { + "description": "Cloud-Init Instance Metadata for a host.", + "type": "object", + "additionalProperties": true + }, + "user-data": { + "description": "Cloud-Init User data for a host.", + "type": "object", + "additionalProperties": true + }, + "phone-home": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } + } + }, + "example": { + "user-data": { + "foo": "bar" + }, + "meta-data": { + "foo": "bar" + } + } + } + } + } } - } } - } - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" + }, + "responses": { + "200": { + "description": "List of currently known boot parameters", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", + "type": "object", + "properties": { + "hosts": { + "type": "array", + "description": "host names", + "items": { + "type": "string" + }, + "example": [ + "x0c0s2b0n0", + "x0c0s3b0n0" + ] + }, + "macs": { + "type": "array", + "description": "MAC addresses", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "nids": { + "type": "array", + "description": "Node ID", + "items": { + "type": "integer" + }, + "example": [ + 1, + 2, + 3, + 4 + ] + }, + "params": { + "type": "string", + "description": "Specific to the kernel that is being booted.", + "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" + }, + "kernel": { + "type": "string", + "description": "URL or file system path specifying kernel image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/kernel" + }, + "initrd": { + "type": "string", + "description": "URL or file system path specifying initrd image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/initrd" + }, + "cloud-init": { + "description": "Cloud-Init data for the hosts", + "type": "object", + "properties": { + "meta-data": { + "description": "Cloud-Init Instance Metadata for a host.", + "type": "object", + "additionalProperties": true + }, + "user-data": { + "description": "Cloud-Init User data for a host.", + "type": "object", + "additionalProperties": true + }, + "phone-home": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } + } + }, + "example": { + "user-data": { + "foo": "bar" + }, + "meta-data": { + "foo": "bar" + } + } + } + } + } + } + } + } }, - "title": { - "type": "string" + "400": { + "description": "Bad Request - BootParams value incorrect", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "status": { - "type": "integer" + "404": { + "description": "Does Not Exist - Cannot find host, MAC, or NID", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "detail": { - "type": "string" + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "instance": { - "type": "string" + "default": { + "description": "Unexpected error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } } - } } - } - } - }, - "404": { - "description": "Does Not Exist - Either the host, MAC or NID are unknown and there is no Default, or the existing entry does not specify a kernel image for boot.", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/boot/v1/bootscript": { - "get": { - "summary": "Retrieve iPXE boot script", - "tags": [ - "bootscript" - ], - "description": "Retrieve iPXE boot script for the host specified by the MAC parameter. Alternatively, for test/convenience purposes, use the name or the NID parameter to specify the host name or xname. Do not specify more than one parameter (MAC, name, or NID) in the request as results are undefined if they do not all refer to the same node.", - "operationId": "bootscript_get", - "parameters": [ - { - "name": "mac", - "in": "query", - "description": "MAC address of host requesting boot script", - "schema": { - "type": "string" - } - }, - { - "name": "name", - "in": "query", - "description": "Name of host requesting boot script or xname", - "schema": { - "type": "string" - } - }, - { - "name": "nid", - "in": "query", - "description": "Node ID (NID) of host requesting boot script", - "schema": { - "type": "integer" - } - }, - { - "name": "retry", - "in": "query", - "description": "Number of times requesting script without a successful boot. This parameter is mostly used by the software itself to keep track of retries.", - "schema": { - "type": "integer" - } - }, - { - "name": "arch", - "in": "query", - "description": "The architecture value from the iPXE variable ${buildarch}. This parameter is mostly used by the software itself.", - "schema": { - "type": "string" - } - }, - { - "name": "ts", - "in": "query", - "description": "Timestamp for when the HSM state info needs to be up to date by. This is the Unix concept of time, the number of seconds since Jan 1, 1970 UTC. This parameter is mostly used by the software itself.", - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Boot script for requested MAC address", - "content": { - "text/plain": { - "schema": { - "type": "string", - "example": "#!ipxe\nkernel --name kernel http://rgw-vip.nmn/boot-images/00000000-0000-0000-0000-000000000000/kernel initrd=initrd console=ttyS0,115200 bad_page=panic crashkernel=512M hugepagelist=2m-2g intel_iommu=off intel_pstate=disable iommu.passthrough=on numa_interleave_omit=headless oops=panic pageblock_order=14 rd.neednet=1 rd.retry=10 rd.shell systemd.unified_cgroup_hierarchy=1 ip=dhcp quiet spire_join_token=00000000-0000-0000-0000-000000000000 root=craycps-s3:s3://boot-images/00000000-0000-0000-0000-000000000000/rootfs:00000000000000000000000000000000-000:dvs:api-gw-service-nmn.local:300:hsn0,nmn0:0 nmd_data=url=s3://boot-images/00000000-0000-0000-0000-000000000000/rootfs bos_session_id=000000-0000-0000-0000-000000000000 xname=x3000c0s17b3n0 nid=3 bss_referral_token=00000000-0000-0000-0000-000000000000 ds=nocloud-net;s=http://10.92.100.81:8888/ || goto boot_retry\ninitrd --name initrd http://rgw-vip.nmn/boot-images/00000000-0000-0000-0000-000000000000/initrd || goto boot_retry\nboot || goto boot_retry\n:boot_retry\nsleep 30\nchain https://api-gw-service-nmn.local/apis/bss/boot/v1/bootscript?mac=b4:2e:99:df:eb:bf&retry=1\n" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "text/plain": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Does Not Exist - Either the host, MAC, or NID are unknown and there is no Default, or the existing entry does not specify a kernel image for boot.", - "content": { - "text/plain": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "content": { - "text/plain": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/boot/v1/bootparameters": { - "get": { - "summary": "Retrieve boot parameters", - "tags": [ - "bootparameters" - ], - "description": "Retrieve the boot parameters for one or more hosts. If no parameters are provided, then all known parameters are returned. Filtering can be accomplished by either providing a body of the boot parameters or one of the three query parameters: host names, MAC addresses, and/or NIDs. The body of boot parameters can also provide a kernel or initrd path which will be returned along with any bootparameter settings as well. Alternatively, query parameters name=, mac=, and/or nid= can provide the filtering of individual items or comma-separated lists of items. The response is a list of boot parameter items. These items will include the individual kernel and initrd images, along with any related boot parameters. If filtering parameters are provided, each parameter will provide a result if one exists. Note that the kernel and initrd images are specified with a URL or path. A plain path will result in a TFTP download from this server. If a URL is provided, it can be from any available service which iPXE supports, and any location that the iPXE client has access to.", - "parameters": [ - { - "name": "name", - "in": "query", - "description": "Host name or tag name of boot parameters to return", - "schema": { - "type": "string" - } - }, - { - "name": "mac", - "in": "query", - "description": "MAC Address of host of boot parameters to return", - "schema": { - "type": "string" - } - }, - { - "name": "nid", - "in": "query", - "description": "NID of host of boot parameters to return", - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", - "type": "object", - "properties": { - "hosts": { - "type": "array", - "description": "host names", - "items": { - "type": "string" - }, - "example": [ - "x0c0s2b0n0", - "x0c0s3b0n0" - ] - }, - "macs": { - "type": "array", - "description": "MAC addresses", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "nids": { - "type": "array", - "description": "Node ID", - "items": { - "type": "integer" - }, - "example": [ - 1, - 2, - 3, - 4 - ] - }, - "params": { - "type": "string", - "description": "Specific to the kernel that is being booted.", - "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" - }, - "kernel": { - "type": "string", - "description": "URL or file system path specifying kernel image.", - "example": "http://10.252.100.50/apis/ars/downloads/30b96241-12ff-4185-93ea-a1f7991372d3" - }, - "initrd": { - "type": "string", - "description": "URL or file system path specifying initrd image.", - "example": "http://10.252.100.50/apis/ars/downloads/7e0bcf9f-10fc-46a9-b2f8-ba8814c1999c" - }, - "cloud-init": { - "description": "Cloud-Init data for the hosts", - "type": "object", - "properties": { - "meta-data": { - "description": "Cloud-Init Instance Metadata for a host.", - "type": "object", - "additionalProperties": true - }, - "user-data": { - "description": "Cloud-Init User data for a host.", - "type": "object", - "additionalProperties": true - }, - "phone-home": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", - "type": "object", - "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } - } - } - }, - "example": { - "user-data": { - "foo": "bar" - }, - "meta-data": { - "foo": "bar" - } - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "List of currently known boot parameters", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", - "type": "object", - "properties": { - "hosts": { - "type": "array", - "description": "host names", - "items": { - "type": "string" - }, - "example": [ - "x0c0s2b0n0", - "x0c0s3b0n0" - ] - }, - "macs": { - "type": "array", - "description": "MAC addresses", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "nids": { - "type": "array", - "description": "Node ID", - "items": { - "type": "integer" - }, - "example": [ - 1, - 2, - 3, - 4 - ] - }, - "params": { - "type": "string", - "description": "Specific to the kernel that is being booted.", - "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" - }, - "kernel": { - "type": "string", - "description": "URL or file system path specifying kernel image.", - "example": "http://10.252.100.50/apis/ars/downloads/30b96241-12ff-4185-93ea-a1f7991372d3" - }, - "initrd": { - "type": "string", - "description": "URL or file system path specifying initrd image.", - "example": "http://10.252.100.50/apis/ars/downloads/7e0bcf9f-10fc-46a9-b2f8-ba8814c1999c" - }, - "cloud-init": { - "description": "Cloud-Init data for the hosts", - "type": "object", - "properties": { - "meta-data": { - "description": "Cloud-Init Instance Metadata for a host.", - "type": "object", - "additionalProperties": true - }, - "user-data": { - "description": "Cloud-Init User data for a host.", - "type": "object", - "additionalProperties": true - }, - "phone-home": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", - "type": "object", - "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } - } - } - }, - "example": { - "user-data": { - "foo": "bar" - }, - "meta-data": { - "foo": "bar" - } - } - } - } - } - } - } - } - }, - "400": { - "description": "Bad Request - BootParams value incorrect", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Does Not Exist - Cannot find host, MAC, or NID", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - } - } - }, - "post": { - "summary": "Create boot parameters", - "tags": [ - "bootparameters" - ], - "description": "Define boot parameters. Specify a list of one of the following parameters: hosts, MACs, or NIDs along with the boot parameters to associate with those hosts. You can either use specific hosts or specify a general tag for hosts. Specific hosts can be specified either by a hostname (xname), a NID, or a MAC address. It is recommended to use the xname. Otherwise, a tag can be used for the hosts parameter. A tag is \"Default\", or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlong with the hosts, there must be a kernel image reference in order for the boot script service to be able to generate a boot script. In most cases, there should also be an initrd image reference, unless the kernel being booted is standalone and does not require an initrd image. Finally, the params entry can be used to specify boot parameters for the specified hosts.\nNote that if there is no existing params entry for a host, a new entry for the host is created. If an entry already exists for the host, this request will fail.\n\nSpecial entries for HSM roles like 'Compute', 'Storage' and 'Application' can also be specified as hosts, and are managed similar to specific hosts. If an error occurs during the save/update, processing will stop after the first error. Subsequent hosts in the list will not be processed.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", - "type": "object", - "properties": { - "hosts": { - "type": "array", - "description": "host names", - "items": { - "type": "string" - }, - "example": [ - "x0c0s2b0n0", - "x0c0s3b0n0" - ] - }, - "macs": { - "type": "array", - "description": "MAC addresses", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "nids": { - "type": "array", - "description": "Node ID", - "items": { - "type": "integer" - }, - "example": [ - 1, - 2, - 3, - 4 - ] - }, - "params": { - "type": "string", - "description": "Specific to the kernel that is being booted.", - "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" - }, - "kernel": { - "type": "string", - "description": "URL or file system path specifying kernel image.", - "example": "http://10.252.100.50/apis/ars/downloads/30b96241-12ff-4185-93ea-a1f7991372d3" - }, - "initrd": { - "type": "string", - "description": "URL or file system path specifying initrd image.", - "example": "http://10.252.100.50/apis/ars/downloads/7e0bcf9f-10fc-46a9-b2f8-ba8814c1999c" - }, - "cloud-init": { - "description": "Cloud-Init data for the hosts", - "type": "object", - "properties": { - "meta-data": { - "description": "Cloud-Init Instance Metadata for a host.", - "type": "object", - "additionalProperties": true - }, - "user-data": { - "description": "Cloud-Init User data for a host.", - "type": "object", - "additionalProperties": true - }, - "phone-home": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", - "type": "object", - "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } - } - } - }, - "example": { - "user-data": { - "foo": "bar" - }, - "meta-data": { - "foo": "bar" - } - } - } - } - } - } - } - }, - "responses": { - "201": { - "description": "successfully created boot parameters", - "headers": { - "BSS-Referral-Token": { - "description": "The UUID that will be included in the boot script. A new UUID is generated on each POST and PUT request.", - "schema": { - "type": "string" - } - } - } - }, - "400": { - "description": "Bad Request - Invalid BootParams value", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - } - } - }, - "put": { - "summary": "Set boot parameters", - "tags": [ - "bootparameters" - ], - "description": "Set or update boot parameters for one or more hosts. Specify a list of one of the following parameters: hosts, MACs, or NIDs along with the boot parameters to associate with those hosts.\n\nYou can either use specific hosts or specify a general tag for hosts. Specific hosts can be specified either by a hostname (xname), a NID, or a MAC address. It is recommended to use the xname. Otherwise, a tag can be used for the hosts parameter. A tag is \"Default\", or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlong with the hosts, there must be a kernel image reference in order for the boot script service to be able to generate a boot script. In most cases, there should also be an initrd image reference, unless the kernel being booted is standalone and does not require an initrd image. Finally, the params entry can be used to specify boot parameters specific to the specified hosts. If there are no boot params stored for one or more hosts, then a new entry for that host will be created. For kernel, initrd and params values, an existing value will be replaced. The params value is a replacement of the existing values. If the params value does not specify one or more values, any existing values are removed. If an error occurs during the save/update, processing will stop after the first error. Subsequent hosts in the list will not be processed.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", - "type": "object", - "properties": { - "hosts": { - "type": "array", - "description": "host names", - "items": { - "type": "string" - }, - "example": [ - "x0c0s2b0n0", - "x0c0s3b0n0" - ] - }, - "macs": { - "type": "array", - "description": "MAC addresses", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "nids": { - "type": "array", - "description": "Node ID", - "items": { - "type": "integer" - }, - "example": [ - 1, - 2, - 3, - 4 - ] - }, - "params": { - "type": "string", - "description": "Specific to the kernel that is being booted.", - "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" - }, - "kernel": { - "type": "string", - "description": "URL or file system path specifying kernel image.", - "example": "http://10.252.100.50/apis/ars/downloads/30b96241-12ff-4185-93ea-a1f7991372d3" - }, - "initrd": { - "type": "string", - "description": "URL or file system path specifying initrd image.", - "example": "http://10.252.100.50/apis/ars/downloads/7e0bcf9f-10fc-46a9-b2f8-ba8814c1999c" - }, - "cloud-init": { - "description": "Cloud-Init data for the hosts", - "type": "object", - "properties": { - "meta-data": { - "description": "Cloud-Init Instance Metadata for a host.", - "type": "object", - "additionalProperties": true - }, - "user-data": { - "description": "Cloud-Init User data for a host.", - "type": "object", - "additionalProperties": true - }, - "phone-home": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", - "type": "object", - "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } - } - } - }, - "example": { - "user-data": { - "foo": "bar" - }, - "meta-data": { - "foo": "bar" - } - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "successfully update boot parameters", - "headers": { - "BSS-Referral-Token": { - "description": "The UUID that will be included in the boot script. A new UUID is generated on each POST and PUT request.", - "schema": { - "type": "string" - } - } - } - }, - "400": { - "description": "Bad Request - Invalid BootParams value", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Does Not Exist - Cannot find specified host, MAC, or NID", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "default": { - "description": "Unexpected error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - } - } - }, - "patch": { - "summary": "Update existing boot parameters", - "tags": [ - "bootparameters" - ], - "description": "Update an existing entry with new boot parameters while retaining existing settings for the kernel and initrd settings. The entry only needs to specify one or more hosts and the new boot parameters without the need to specify the kernel and initrd entries.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", - "type": "object", - "properties": { - "hosts": { - "type": "array", - "description": "host names", - "items": { - "type": "string" - }, - "example": [ - "x0c0s2b0n0", - "x0c0s3b0n0" - ] - }, - "macs": { - "type": "array", - "description": "MAC addresses", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "nids": { - "type": "array", - "description": "Node ID", - "items": { - "type": "integer" - }, - "example": [ - 1, - 2, - 3, - 4 - ] - }, - "params": { - "type": "string", - "description": "Specific to the kernel that is being booted.", - "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" - }, - "kernel": { - "type": "string", - "description": "URL or file system path specifying kernel image.", - "example": "http://10.252.100.50/apis/ars/downloads/30b96241-12ff-4185-93ea-a1f7991372d3" - }, - "initrd": { - "type": "string", - "description": "URL or file system path specifying initrd image.", - "example": "http://10.252.100.50/apis/ars/downloads/7e0bcf9f-10fc-46a9-b2f8-ba8814c1999c" - }, - "cloud-init": { - "description": "Cloud-Init data for the hosts", - "type": "object", - "properties": { - "meta-data": { - "description": "Cloud-Init Instance Metadata for a host.", - "type": "object", - "additionalProperties": true - }, - "user-data": { - "description": "Cloud-Init User data for a host.", - "type": "object", - "additionalProperties": true - }, - "phone-home": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", - "type": "object", - "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } + }, + "post": { + "summary": "Create boot parameters", + "tags": [ + "bootparameters" + ], + "description": "Define boot parameters. Specify a list of one of the following parameters: hosts, MACs, or NIDs along with the boot parameters to associate with those hosts. You can either use specific hosts or specify a general tag for hosts. Specific hosts can be specified either by a hostname (xname), a NID, or a MAC address. It is recommended to use the xname. Otherwise, a tag can be used for the hosts parameter. A tag is \"Default\", or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlong with the hosts, there must be a kernel image reference in order for the boot script service to be able to generate a boot script. In most cases, there should also be an initrd image reference, unless the kernel being booted is standalone and does not require an initrd image. Finally, the params entry can be used to specify boot parameters for the specified hosts.\nNote that if there is no existing params entry for a host, a new entry for the host is created. If an entry already exists for the host, this request will fail.\n\nSpecial entries for HSM roles like 'Compute', 'Storage' and 'Application' can also be specified as hosts, and are managed similar to specific hosts. If an error occurs during the save/update, processing will stop after the first error. Subsequent hosts in the list will not be processed.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", + "type": "object", + "properties": { + "hosts": { + "type": "array", + "description": "host names", + "items": { + "type": "string" + }, + "example": [ + "x0c0s2b0n0", + "x0c0s3b0n0" + ] + }, + "macs": { + "type": "array", + "description": "MAC addresses", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "nids": { + "type": "array", + "description": "Node ID", + "items": { + "type": "integer" + }, + "example": [ + 1, + 2, + 3, + 4 + ] + }, + "params": { + "type": "string", + "description": "Specific to the kernel that is being booted.", + "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" + }, + "kernel": { + "type": "string", + "description": "URL or file system path specifying kernel image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/kernel" + }, + "initrd": { + "type": "string", + "description": "URL or file system path specifying initrd image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/initrd" + }, + "cloud-init": { + "description": "Cloud-Init data for the hosts", + "type": "object", + "properties": { + "meta-data": { + "description": "Cloud-Init Instance Metadata for a host.", + "type": "object", + "additionalProperties": true + }, + "user-data": { + "description": "Cloud-Init User data for a host.", + "type": "object", + "additionalProperties": true + }, + "phone-home": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } + } + }, + "example": { + "user-data": { + "foo": "bar" + }, + "meta-data": { + "foo": "bar" + } + } + } + } + } } - } - }, - "example": { - "user-data": { - "foo": "bar" - }, - "meta-data": { - "foo": "bar" - } - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Successfully update boot parameters" - }, - "400": { - "description": "Bad Request - Invalid BootParams value.", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Does Not Exist - Cannot find entry for specified host, MAC, or NID", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" } - } - } - } - } - } - } - }, - "delete": { - "summary": "Delete existing boot parameters", - "tags": [ - "bootparameters" - ], - "description": "Remove an existing boot parameter settings for one or more hosts, as specified by hosts, MACs, or NIDs. If you specify a kernel or initrd image, the image entry is removed, and the references by any existing hosts are removed. Note that this can leave a host unbootable, and so will need to be updated with new image references before they will be bootable.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", - "type": "object", - "properties": { - "hosts": { - "type": "array", - "description": "host names", - "items": { - "type": "string" - }, - "example": [ - "x0c0s2b0n0", - "x0c0s3b0n0" - ] - }, - "macs": { - "type": "array", - "description": "MAC addresses", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "nids": { - "type": "array", - "description": "Node ID", - "items": { - "type": "integer" - }, - "example": [ - 1, - 2, - 3, - 4 - ] - }, - "params": { - "type": "string", - "description": "Specific to the kernel that is being booted.", - "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" - }, - "kernel": { - "type": "string", - "description": "URL or file system path specifying kernel image.", - "example": "http://10.252.100.50/apis/ars/downloads/30b96241-12ff-4185-93ea-a1f7991372d3" - }, - "initrd": { - "type": "string", - "description": "URL or file system path specifying initrd image.", - "example": "http://10.252.100.50/apis/ars/downloads/7e0bcf9f-10fc-46a9-b2f8-ba8814c1999c" - }, - "cloud-init": { - "description": "Cloud-Init data for the hosts", - "type": "object", - "properties": { - "meta-data": { - "description": "Cloud-Init Instance Metadata for a host.", - "type": "object", - "additionalProperties": true - }, - "user-data": { - "description": "Cloud-Init User data for a host.", - "type": "object", - "additionalProperties": true - }, - "phone-home": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", - "type": "object", - "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } + }, + "responses": { + "201": { + "description": "successfully created boot parameters", + "headers": { + "BSS-Referral-Token": { + "description": "The UUID that will be included in the boot script. A new UUID is generated on each POST and PUT request.", + "schema": { + "type": "string" + } + } } - } - }, - "example": { - "user-data": { - "foo": "bar" - }, - "meta-data": { - "foo": "bar" - } - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Successfully deleted the appropriate entry or entries" - }, - "400": { - "description": "Bad Request - Invalid BootParams value.", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" }, - "status": { - "type": "integer" + "400": { + "description": "Bad Request - Invalid BootParams value", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "detail": { - "type": "string" + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "instance": { - "type": "string" + "default": { + "description": "Unexpected error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } } - } } - } - } - }, - "404": { - "description": "Does Not Exist - Cannot find specified host, MAC, or NID", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" + }, + "put": { + "summary": "Set boot parameters", + "tags": [ + "bootparameters" + ], + "description": "Set or update boot parameters for one or more hosts. Specify a list of one of the following parameters: hosts, MACs, or NIDs along with the boot parameters to associate with those hosts.\n\nYou can either use specific hosts or specify a general tag for hosts. Specific hosts can be specified either by a hostname (xname), a NID, or a MAC address. It is recommended to use the xname. Otherwise, a tag can be used for the hosts parameter. A tag is \"Default\", or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlong with the hosts, there must be a kernel image reference in order for the boot script service to be able to generate a boot script. In most cases, there should also be an initrd image reference, unless the kernel being booted is standalone and does not require an initrd image. Finally, the params entry can be used to specify boot parameters specific to the specified hosts. If there are no boot params stored for one or more hosts, then a new entry for that host will be created. For kernel, initrd and params values, an existing value will be replaced. The params value is a replacement of the existing values. If the params value does not specify one or more values, any existing values are removed. If an error occurs during the save/update, processing will stop after the first error. Subsequent hosts in the list will not be processed.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", + "type": "object", + "properties": { + "hosts": { + "type": "array", + "description": "host names", + "items": { + "type": "string" + }, + "example": [ + "x0c0s2b0n0", + "x0c0s3b0n0" + ] + }, + "macs": { + "type": "array", + "description": "MAC addresses", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "nids": { + "type": "array", + "description": "Node ID", + "items": { + "type": "integer" + }, + "example": [ + 1, + 2, + 3, + 4 + ] + }, + "params": { + "type": "string", + "description": "Specific to the kernel that is being booted.", + "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" + }, + "kernel": { + "type": "string", + "description": "URL or file system path specifying kernel image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/kernel" + }, + "initrd": { + "type": "string", + "description": "URL or file system path specifying initrd image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/initrd" + }, + "cloud-init": { + "description": "Cloud-Init data for the hosts", + "type": "object", + "properties": { + "meta-data": { + "description": "Cloud-Init Instance Metadata for a host.", + "type": "object", + "additionalProperties": true + }, + "user-data": { + "description": "Cloud-Init User data for a host.", + "type": "object", + "additionalProperties": true + }, + "phone-home": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } + } + }, + "example": { + "user-data": { + "foo": "bar" + }, + "meta-data": { + "foo": "bar" + } + } + } + } + } + } } - } - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" + }, + "responses": { + "200": { + "description": "successfully update boot parameters", + "headers": { + "BSS-Referral-Token": { + "description": "The UUID that will be included in the boot script. A new UUID is generated on each POST and PUT request.", + "schema": { + "type": "string" + } + } + } }, - "title": { - "type": "string" + "400": { + "description": "Bad Request - Invalid BootParams value", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "status": { - "type": "integer" + "404": { + "description": "Does Not Exist - Cannot find specified host, MAC, or NID", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "detail": { - "type": "string" + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "instance": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/boot/v1/hosts": { - "get": { - "summary": "Retrieve hosts", - "tags": [ - "hosts" - ], - "description": "Retrieve list of known hosts obtained from HSM. This list can be filtered by specifying one or more of the query parameters name=, mac=, and/or nid=. If any of these parameters are specified, then only host information for those items are returned in the response. Multiple hosts can be specified for any of these parameters by specifying a comma-separated list of items, or by providing the query parameter itself more than once. If the same host is referenced more than once, its information will be returned multiple times. In particular, if a host is referenced by both its host name and NID and/or MAC address, this same host information will be returned once for each reference.", - "parameters": [ - { - "name": "name", - "in": "query", - "description": "Host name or tag name of boot parameters to return", - "schema": { - "type": "string" - } - }, - { - "name": "mac", - "in": "query", - "description": "MAC Address of host of boot parameters to return", - "schema": { - "type": "string" - } - }, - { - "name": "nid", - "in": "query", - "description": "NID of host of boot parameters to return", - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Return list of hosts and associated attributes known to BSS", - "content": { - "application/json": { - "schema": { - "description": "This data structure is used to return the component info for a /hosts get request", - "type": "array", - "items": { - "description": "This data structure is used to return host info for debug purposes", - "type": "object", - "properties": { - "ID": { - "type": "string", - "example": "x0c0s21b0n0" - }, - "Type": { - "type": "string", - "example": "Node" - }, - "State": { - "type": "string", - "example": "Ready" - }, - "Flag": { - "type": "string", - "example": "OK" - }, - "Enabled": { - "type": "boolean", - "example": true - }, - "Role": { - "type": "string", - "example": "Compute" - }, - "RubeRole": { - "type": "string", - "example": "Worker" - }, - "NID": { - "type": "integer", - "example": 2 - }, - "NetType": { - "type": "string", - "example": "Sling" - }, - "Arch": { - "type": "string", - "example": "X86" - }, - "Class": { - "type": "string" - }, - "ReservationDisabled": { - "type": "boolean", - "example": false - }, - "Locked": { - "type": "boolean", - "example": false - }, - "FQDN": { - "type": "string" - }, - "MAC": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "EndpointEnabled": { - "type": "boolean", - "example": true - } + "default": { + "description": "Unexpected error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } } - } } - } - } - } - } - }, - "post": { - "summary": "Retrieve hosts", - "tags": [ - "hosts" - ], - "description": "Retrieve the latest host information from HSM.", - "responses": { - "204": { - "description": "Successfully retrieved current state from HSM." - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" + }, + "patch": { + "summary": "Update existing boot parameters", + "tags": [ + "bootparameters" + ], + "description": "Update an existing entry with new boot parameters while retaining existing settings for the kernel and initrd settings. The entry only needs to specify one or more hosts and the new boot parameters without the need to specify the kernel and initrd entries.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", + "type": "object", + "properties": { + "hosts": { + "type": "array", + "description": "host names", + "items": { + "type": "string" + }, + "example": [ + "x0c0s2b0n0", + "x0c0s3b0n0" + ] + }, + "macs": { + "type": "array", + "description": "MAC addresses", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "nids": { + "type": "array", + "description": "Node ID", + "items": { + "type": "integer" + }, + "example": [ + 1, + 2, + 3, + 4 + ] + }, + "params": { + "type": "string", + "description": "Specific to the kernel that is being booted.", + "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" + }, + "kernel": { + "type": "string", + "description": "URL or file system path specifying kernel image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/kernel" + }, + "initrd": { + "type": "string", + "description": "URL or file system path specifying initrd image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/initrd" + }, + "cloud-init": { + "description": "Cloud-Init data for the hosts", + "type": "object", + "properties": { + "meta-data": { + "description": "Cloud-Init Instance Metadata for a host.", + "type": "object", + "additionalProperties": true + }, + "user-data": { + "description": "Cloud-Init User data for a host.", + "type": "object", + "additionalProperties": true + }, + "phone-home": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } + } + }, + "example": { + "user-data": { + "foo": "bar" + }, + "meta-data": { + "foo": "bar" + } + } + } + } + } + } } - } - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" + }, + "responses": { + "200": { + "description": "Successfully update boot parameters" + }, + "400": { + "description": "Bad Request - Invalid BootParams value.", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "instance": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/boot/v1/dumpstate": { - "get": { - "summary": "Retrieve dumpstate", - "tags": [ - "dumpstate" - ], - "description": "Dump internal state of boot script service for debugging purposes. Return known hosts and associated information, along with the known boot parameter info.", - "responses": { - "200": { - "description": "Return internal service state", - "content": { - "application/json": { - "schema": { - "description": "This data structure is used to return the full component and boot parameter info of the dumpstate request.", - "type": "object", - "properties": { - "components": { - "type": "array", - "items": { - "type": "object", - "properties": { - "schema": { - "description": "This data structure is used to return host info for debug purposes", - "type": "object", - "properties": { - "ID": { - "type": "string", - "example": "x0c0s21b0n0" - }, - "Type": { - "type": "string", - "example": "Node" - }, - "State": { - "type": "string", - "example": "Ready" - }, - "Flag": { - "type": "string", - "example": "OK" - }, - "Enabled": { - "type": "boolean", - "example": true - }, - "Role": { - "type": "string", - "example": "Compute" - }, - "RubeRole": { - "type": "string", - "example": "Worker" - }, - "NID": { - "type": "integer", - "example": 2 - }, - "NetType": { - "type": "string", - "example": "Sling" - }, - "Arch": { - "type": "string", - "example": "X86" - }, - "Class": { - "type": "string" - }, - "ReservationDisabled": { - "type": "boolean", - "example": false - }, - "Locked": { - "type": "boolean", - "example": false - }, - "FQDN": { - "type": "string" - }, - "MAC": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "EndpointEnabled": { - "type": "boolean", - "example": true - } - } - } - } - } + "404": { + "description": "Does Not Exist - Cannot find entry for specified host, MAC, or NID", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "params": { - "type": "array", - "items": { - "type": "object", - "properties": { - "schema": { - "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", - "type": "object", - "properties": { - "hosts": { - "type": "array", - "description": "host names", - "items": { - "type": "string" - }, - "example": [ - "x0c0s2b0n0", - "x0c0s3b0n0" - ] - }, - "macs": { - "type": "array", - "description": "MAC addresses", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "nids": { - "type": "array", - "description": "Node ID", - "items": { - "type": "integer" - }, - "example": [ - 1, - 2, - 3, - 4 - ] - }, - "params": { - "type": "string", - "description": "Specific to the kernel that is being booted.", - "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" - }, - "kernel": { - "type": "string", - "description": "URL or file system path specifying kernel image.", - "example": "http://10.252.100.50/apis/ars/downloads/30b96241-12ff-4185-93ea-a1f7991372d3" - }, - "initrd": { - "type": "string", - "description": "URL or file system path specifying initrd image.", - "example": "http://10.252.100.50/apis/ars/downloads/7e0bcf9f-10fc-46a9-b2f8-ba8814c1999c" - }, - "cloud-init": { - "description": "Cloud-Init data for the hosts", + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete existing boot parameters", + "tags": [ + "bootparameters" + ], + "description": "Remove an existing boot parameter settings for one or more hosts, as specified by hosts, MACs, or NIDs. If you specify a kernel or initrd image, the image entry is removed, and the references by any existing hosts are removed. Note that this can leave a host unbootable, and so will need to be updated with new image references before they will be bootable.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", "type": "object", "properties": { - "meta-data": { - "description": "Cloud-Init Instance Metadata for a host.", + "hosts": { + "type": "array", + "description": "host names", + "items": { + "type": "string" + }, + "example": [ + "x0c0s2b0n0", + "x0c0s3b0n0" + ] + }, + "macs": { + "type": "array", + "description": "MAC addresses", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "nids": { + "type": "array", + "description": "Node ID", + "items": { + "type": "integer" + }, + "example": [ + 1, + 2, + 3, + 4 + ] + }, + "params": { + "type": "string", + "description": "Specific to the kernel that is being booted.", + "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" + }, + "kernel": { + "type": "string", + "description": "URL or file system path specifying kernel image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/kernel" + }, + "initrd": { + "type": "string", + "description": "URL or file system path specifying initrd image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/initrd" + }, + "cloud-init": { + "description": "Cloud-Init data for the hosts", + "type": "object", + "properties": { + "meta-data": { + "description": "Cloud-Init Instance Metadata for a host.", + "type": "object", + "additionalProperties": true + }, + "user-data": { + "description": "Cloud-Init User data for a host.", + "type": "object", + "additionalProperties": true + }, + "phone-home": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } + } + }, + "example": { + "user-data": { + "foo": "bar" + }, + "meta-data": { + "foo": "bar" + } + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Successfully deleted the appropriate entry or entries" + }, + "400": { + "description": "Bad Request - Invalid BootParams value.", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", "type": "object", - "additionalProperties": true - }, - "user-data": { - "description": "Cloud-Init User data for a host.", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } + }, + "404": { + "description": "Does Not Exist - Cannot find specified host, MAC, or NID", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", "type": "object", - "additionalProperties": true - }, - "phone-home": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", "type": "object", "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } } - } - }, - "example": { - "user-data": { - "foo": "bar" - }, - "meta-data": { - "foo": "bar" - } } - } } - } } - } } - } } - } } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" + }, + "/boot/v1/hosts": { + "get": { + "summary": "Retrieve hosts", + "tags": [ + "hosts" + ], + "description": "Retrieve list of known hosts obtained from HSM. This list can be filtered by specifying one or more of the query parameters name=, mac=, and/or nid=. If any of these parameters are specified, then only host information for those items are returned in the response. Multiple hosts can be specified for any of these parameters by specifying a comma-separated list of items, or by providing the query parameter itself more than once. If the same host is referenced more than once, its information will be returned multiple times. In particular, if a host is referenced by both its host name and NID and/or MAC address, this same host information will be returned once for each reference.", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Host name or tag name of boot parameters to return", + "schema": { + "type": "string" + } }, - "status": { - "type": "integer" + { + "name": "mac", + "in": "query", + "description": "MAC Address of host of boot parameters to return", + "schema": { + "type": "string" + } }, - "detail": { - "type": "string" + { + "name": "nid", + "in": "query", + "description": "NID of host of boot parameters to return", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Return list of hosts and associated attributes known to BSS", + "content": { + "application/json": { + "schema": { + "description": "This data structure is used to return the component info for a /hosts get request", + "type": "array", + "items": { + "description": "This data structure is used to return host info for debug purposes", + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "x0c0s21b0n0" + }, + "Type": { + "type": "string", + "example": "Node" + }, + "State": { + "type": "string", + "example": "Ready" + }, + "Flag": { + "type": "string", + "example": "OK" + }, + "Enabled": { + "type": "boolean", + "example": true + }, + "Role": { + "type": "string", + "example": "Compute" + }, + "RubeRole": { + "type": "string", + "example": "Worker" + }, + "NID": { + "type": "integer", + "example": 2 + }, + "NetType": { + "type": "string", + "example": "Sling" + }, + "Arch": { + "type": "string", + "example": "X86" + }, + "Class": { + "type": "string" + }, + "ReservationDisabled": { + "type": "boolean", + "example": false + }, + "Locked": { + "type": "boolean", + "example": false + }, + "FQDN": { + "type": "string" + }, + "MAC": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "EndpointEnabled": { + "type": "boolean", + "example": true + } + } + } + } + } + } + } + } + }, + "post": { + "summary": "Retrieve hosts", + "tags": [ + "hosts" + ], + "description": "Retrieve the latest host information from HSM.", + "responses": { + "204": { + "description": "Successfully retrieved current state from HSM." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "instance": { - "type": "string" + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } } - } } - } } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" + }, + "/boot/v1/dumpstate": { + "get": { + "summary": "Retrieve dumpstate", + "tags": [ + "dumpstate" + ], + "description": "Dump internal state of boot script service for debugging purposes. Return known hosts and associated information, along with the known boot parameter info.", + "responses": { + "200": { + "description": "Return internal service state", + "content": { + "application/json": { + "schema": { + "description": "This data structure is used to return the full component and boot parameter info of the dumpstate request.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "type": "object", + "properties": { + "schema": { + "description": "This data structure is used to return host info for debug purposes", + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "x0c0s21b0n0" + }, + "Type": { + "type": "string", + "example": "Node" + }, + "State": { + "type": "string", + "example": "Ready" + }, + "Flag": { + "type": "string", + "example": "OK" + }, + "Enabled": { + "type": "boolean", + "example": true + }, + "Role": { + "type": "string", + "example": "Compute" + }, + "RubeRole": { + "type": "string", + "example": "Worker" + }, + "NID": { + "type": "integer", + "example": 2 + }, + "NetType": { + "type": "string", + "example": "Sling" + }, + "Arch": { + "type": "string", + "example": "X86" + }, + "Class": { + "type": "string" + }, + "ReservationDisabled": { + "type": "boolean", + "example": false + }, + "Locked": { + "type": "boolean", + "example": false + }, + "FQDN": { + "type": "string" + }, + "MAC": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "EndpointEnabled": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "params": { + "type": "array", + "items": { + "type": "object", + "properties": { + "schema": { + "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", + "type": "object", + "properties": { + "hosts": { + "type": "array", + "description": "host names", + "items": { + "type": "string" + }, + "example": [ + "x0c0s2b0n0", + "x0c0s3b0n0" + ] + }, + "macs": { + "type": "array", + "description": "MAC addresses", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "nids": { + "type": "array", + "description": "Node ID", + "items": { + "type": "integer" + }, + "example": [ + 1, + 2, + 3, + 4 + ] + }, + "params": { + "type": "string", + "description": "Specific to the kernel that is being booted.", + "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" + }, + "kernel": { + "type": "string", + "description": "URL or file system path specifying kernel image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/kernel" + }, + "initrd": { + "type": "string", + "description": "URL or file system path specifying initrd image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/initrd" + }, + "cloud-init": { + "description": "Cloud-Init data for the hosts", + "type": "object", + "properties": { + "meta-data": { + "description": "Cloud-Init Instance Metadata for a host.", + "type": "object", + "additionalProperties": true + }, + "user-data": { + "description": "Cloud-Init User data for a host.", + "type": "object", + "additionalProperties": true + }, + "phone-home": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } + } + }, + "example": { + "user-data": { + "foo": "bar" + }, + "meta-data": { + "foo": "bar" + } + } + } + } + } + } + } + } + } + } + } + } }, - "detail": { - "type": "string" + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } }, - "instance": { - "type": "string" + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } } - } } - } - } - } - } - } - }, - "/boot/v1/endpoint-history": { - "get": { - "summary": "Retrieve access information for xname and endpoint", - "tags": [ - "endpoint-history" - ], - "description": "Retrieve access information for xname and endpoint. Every time a node requests special types of endpoint (its boot script or cloud-init data) that is recorded in the database. This is useful for determining a number of things most notably as a way to monitor boot progress.", - "parameters": [ - { - "name": "name", - "in": "query", - "description": "Xname of the node.", - "schema": { - "type": "string" } - }, - { - "name": "endpoint", - "in": "query", - "description": "The endpoint to get the last access information for.", - "schema": { - "type": "string", - "enum": [ - "bootscript", - "user-data" - ] - } - } - ], - "responses": { - "200": { - "description": "Endpoint access information", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "description": "This data structure is used to return the endpoint access information for a given resource.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Xname of the node", - "example": "x3000c0s1b0n0" - }, - "endpoint": { - "type": "string", - "enum": [ - "bootscript", - "user-data" - ] - }, - "last_epoch": { - "type": "integer", - "description": "Unix epoch time of last request. An epoch of 0 indicates a request has not taken place.", - "example": 1635284155 - } + }, + "/boot/v1/endpoint-history": { + "get": { + "summary": "Retrieve access information for xname and endpoint", + "tags": [ + "endpoint-history" + ], + "description": "Retrieve access information for xname and endpoint. Every time a node requests special types of endpoint (its boot script or cloud-init data) that is recorded in the database. This is useful for determining a number of things most notably as a way to monitor boot progress.", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Xname of the node.", + "schema": { + "type": "string" + } + }, + { + "name": "endpoint", + "in": "query", + "description": "The endpoint to get the last access information for.", + "schema": { + "type": "string", + "enum": [ + "bootscript", + "user-data" + ] + } } - } - } - } - } - } - } - } - }, - "/boot/v1/service/status": { - "get": { - "summary": "Retrieve the current status of BSS", - "tags": [ - "service-status", - "cli_ignore" - ], - "description": "Retrieve the current status of the BSS service itself.\n\nThis endpoint can be used as a liveness probe for the BSS to determine if it is alive or dead.\n", - "responses": { - "200": { - "description": "The BSS REST API is alive and accessible.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "bss-status": { - "type": "string", - "enum": [ - "running" - ], - "description": "Current status of BSS." + ], + "responses": { + "200": { + "description": "Endpoint access information", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "description": "This data structure is used to return the endpoint access information for a given resource.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Xname of the node", + "example": "x3000c0s1b0n0" + }, + "endpoint": { + "type": "string", + "enum": [ + "bootscript", + "user-data" + ] + }, + "last_epoch": { + "type": "integer", + "description": "Unix epoch time of last request. An epoch of 0 indicates a request has not taken place.", + "example": 1635284155 + } + } + } + } + } + } } - } } - } } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" + }, + "/boot/v1/service/status": { + "get": { + "summary": "Retrieve the current status of BSS", + "tags": [ + "service-status", + "cli_ignore" + ], + "description": "Retrieve the current status of the BSS service itself.\n\nThis endpoint can be used as a liveness probe for the BSS to determine if it is alive or dead.\n", + "responses": { + "200": { + "description": "The BSS REST API is alive and accessible.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bss-status": { + "type": "string", + "enum": [ + "running" + ], + "description": "Current status of BSS." + } + } + } + } + } }, - "instance": { - "type": "string" + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + } + } + } } - } } - } } - } - } - } - }, - "/boot/v1/service/etcd": { - "get": { - "summary": "Retrieve the current connection status to ETCD", - "tags": [ - "service-status", - "cli_ignore" - ], - "description": "Retrieve the current connection status to the BSS ETCD database.\n\nThe connection to ETCD will be tested by writing a value to ETCD, and then reading it\nback from the database. If the value is successfully writen to ETCD and read back as the \nsame value, then the connection to ETCD is considered to be connected. Otherwise, there\nis a connection error.\n", - "responses": { - "200": { - "description": "The ETCD database connection is healthy.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "bss-status-etcd": { - "type": "string", - "enum": [ - "connected" - ], - "description": "Current connection status to ETCD." + }, + "/boot/v1/service/etcd": { + "get": { + "summary": "Retrieve the current connection status to ETCD", + "tags": [ + "service-status", + "cli_ignore" + ], + "description": "Retrieve the current connection status to the BSS ETCD database.\n\nThe connection to ETCD will be tested by writing a value to ETCD, and then reading it\nback from the database. If the value is successfully writen to ETCD and read back as the \nsame value, then the connection to ETCD is considered to be connected. Otherwise, there\nis a connection error.\n", + "responses": { + "200": { + "description": "The ETCD database connection is healthy.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bss-status-etcd": { + "type": "string", + "enum": [ + "connected" + ], + "description": "Current connection status to ETCD." + } + } + } + } + } + }, + "500": { + "description": "The ETCD database connection is unhealthy.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bss-status-etcd": { + "type": "string", + "enum": [ + "error" + ], + "description": "Current connection status to ETCD." + } + } + } + } + } } - } } - } } - }, - "500": { - "description": "The ETCD database connection is unhealthy.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "bss-status-etcd": { - "type": "string", - "enum": [ - "error" - ], - "description": "Current connection status to ETCD." + }, + "/boot/v1/service/hsm": { + "get": { + "summary": "Retrieve the current connection status to HSM", + "tags": [ + "service-status", + "cli_ignore" + ], + "description": "Retrieve the current connection status to the Hardware State Manager (HSM).\n\nThe connection to HSM will be tested by querying a HSM endpoint to verify HSM\nis alive.\n", + "responses": { + "200": { + "description": "The HSM connection is healthy.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bss-status-hsm": { + "type": "string", + "enum": [ + "connected" + ], + "description": "Current connection status to HSM." + } + } + } + } + } + }, + "500": { + "description": "The HSM connection is unhealthy.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bss-status-hsm": { + "type": "string", + "enum": [ + "error" + ], + "description": "Current connection status to HSM." + } + } + } + } + } } - } } - } } - } - } - } - }, - "/boot/v1/service/hsm": { - "get": { - "summary": "Retrieve the current connection status to HSM", - "tags": [ - "service-status", - "cli_ignore" - ], - "description": "Retrieve the current connection status to the Hardware State Manager (HSM).\n\nThe connection to HSM will be tested by querying a HSM endpoint to verify HSM\nis alive.\n", - "responses": { - "200": { - "description": "The HSM connection is healthy.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "bss-status-hsm": { - "type": "string", - "enum": [ - "connected" - ], - "description": "Current connection status to HSM." + }, + "/boot/v1/service/version": { + "get": { + "summary": "Retrieve the service version", + "tags": [ + "service-status", + "cli_ignore" + ], + "description": "Retrieve the current service version.\n", + "responses": { + "200": { + "description": "The current running service version.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bss-version": { + "type": "string", + "example": "1.21.0" + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error. Unable to determine current running service version.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bss-version": { + "type": "string", + "enum": [ + "error" + ] + } + } + } + } + } } - } } - } } - }, - "500": { - "description": "The HSM connection is unhealthy.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "bss-status-hsm": { - "type": "string", - "enum": [ - "error" - ], - "description": "Current connection status to HSM." + }, + "/boot/v1/service/status/all": { + "get": { + "summary": "Retrieve the overall service health", + "tags": [ + "service-status", + "cli_ignore" + ], + "description": "Retrieve the overall health of the service, and determine if the service is healthy to serve\nrequests as a readiness probe.\n\nThis will retrieve the current BSS version and status, along with the connection status to HSM and ETCD.\n", + "responses": { + "200": { + "description": "All service checks reported a healthy status.\n", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bss-status": { + "type": "string", + "enum": [ + "running" + ] + }, + "bss-status-etcd": { + "type": "string", + "enum": [ + "connected" + ], + "description": "Current connection status to ETCD." + }, + "bss-status-hsm": { + "type": "string", + "enum": [ + "connected" + ], + "description": "Current connection status to HSM." + }, + "bss-version": { + "type": "string", + "example": "1.21.0" + } + } + } + } + } + }, + "500": { + "description": "One or more service checks reported an unhealthy status.\n", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bss-status": { + "type": "string", + "enum": [ + "running" + ] + }, + "bss-status-etcd": { + "type": "string", + "enum": [ + "connected", + "error" + ], + "description": "Current connection status to ETCD.", + "example": "error" + }, + "bss-status-hsm": { + "type": "string", + "enum": [ + "connected", + "error" + ], + "description": "Current connection status to HSM.", + "example": "error" + }, + "bss-version": { + "type": "string", + "example": "1.21.0" + } + } + } + } + } } - } } - } } - } } - } }, - "/boot/v1/service/version": { - "get": { - "summary": "Retrieve the service version", - "tags": [ - "service-status", - "cli_ignore" - ], - "description": "Retrieve the current service version.\n", - "responses": { - "200": { - "description": "The current running service version.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "bss-version": { - "type": "string", - "example": "1.21.0" - } - } - } - } - } - }, - "500": { - "description": "Internal Server Error. Unable to determine current running service version.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "bss-version": { - "type": "string", - "enum": [ - "error" - ] + "servers": [ + { + "url": "http://bootscriptserver:27778/apis/bss" + } + ], + "components": { + "schemas": { + "BootParams": { + "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", + "type": "object", + "properties": { + "hosts": { + "type": "array", + "description": "host names", + "items": { + "type": "string" + }, + "example": [ + "x0c0s2b0n0", + "x0c0s3b0n0" + ] + }, + "macs": { + "type": "array", + "description": "MAC addresses", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "nids": { + "type": "array", + "description": "Node ID", + "items": { + "type": "integer" + }, + "example": [ + 1, + 2, + 3, + 4 + ] + }, + "params": { + "type": "string", + "description": "Specific to the kernel that is being booted.", + "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" + }, + "kernel": { + "type": "string", + "description": "URL or file system path specifying kernel image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/kernel" + }, + "initrd": { + "type": "string", + "description": "URL or file system path specifying initrd image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/initrd" + }, + "cloud-init": { + "description": "Cloud-Init data for the hosts", + "type": "object", + "properties": { + "meta-data": { + "description": "Cloud-Init Instance Metadata for a host.", + "type": "object", + "additionalProperties": true + }, + "user-data": { + "description": "Cloud-Init User data for a host.", + "type": "object", + "additionalProperties": true + }, + "phone-home": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } + } + }, + "example": { + "user-data": { + "foo": "bar" + }, + "meta-data": { + "foo": "bar" + } + } } - } } - } - } - } - } - } - }, - "/boot/v1/service/status/all": { - "get": { - "summary": "Retrieve the overall service health", - "tags": [ - "service-status", - "cli_ignore" - ], - "description": "Retrieve the overall health of the service, and determine if the service is healthy to serve\nrequests as a readiness probe.\n\nThis will retrieve the current BSS version and status, along with the connection status to HSM and ETCD.\n", - "responses": { - "200": { - "description": "All service checks reported a healthy status.\n", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "bss-status": { - "type": "string", - "enum": [ - "running" - ] - }, - "bss-status-etcd": { - "type": "string", - "enum": [ - "connected" - ], - "description": "Current connection status to ETCD." - }, - "bss-status-hsm": { - "type": "string", - "enum": [ - "connected" - ], - "description": "Current connection status to HSM." - }, - "bss-version": { - "type": "string", - "example": "1.21.0" + }, + "CloudInit": { + "description": "Cloud-Init data for the hosts", + "type": "object", + "properties": { + "meta-data": { + "description": "Cloud-Init Instance Metadata for a host.", + "type": "object", + "additionalProperties": true + }, + "user-data": { + "description": "Cloud-Init User data for a host.", + "type": "object", + "additionalProperties": true + }, + "phone-home": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } } - } - } - } - } - }, - "500": { - "description": "One or more service checks reported an unhealthy status.\n", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "bss-status": { - "type": "string", - "enum": [ - "running" - ] - }, - "bss-status-etcd": { - "type": "string", - "enum": [ - "connected", - "error" - ], - "description": "Current connection status to ETCD.", - "example": "error" - }, - "bss-status-hsm": { - "type": "string", - "enum": [ - "connected", - "error" - ], - "description": "Current connection status to HSM.", - "example": "error" - }, - "bss-version": { - "type": "string", - "example": "1.21.0" + }, + "example": { + "user-data": { + "foo": "bar" + }, + "meta-data": { + "foo": "bar" } - } } - } - } - } - } - } - } - }, - "servers": [ - { - "url": "http://bootscriptserver:27778/apis/bss" - } - ], - "components": { - "schemas": { - "BootParams": { - "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", - "type": "object", - "properties": { - "hosts": { - "type": "array", - "description": "host names", - "items": { - "type": "string" - }, - "example": [ - "x0c0s2b0n0", - "x0c0s3b0n0" - ] - }, - "macs": { - "type": "array", - "description": "MAC addresses", - "items": { - "type": "string" }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "nids": { - "type": "array", - "description": "Node ID", - "items": { - "type": "integer" - }, - "example": [ - 1, - 2, - 3, - 4 - ] - }, - "params": { - "type": "string", - "description": "Specific to the kernel that is being booted.", - "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" - }, - "kernel": { - "type": "string", - "description": "URL or file system path specifying kernel image.", - "example": "http://10.252.100.50/apis/ars/downloads/30b96241-12ff-4185-93ea-a1f7991372d3" - }, - "initrd": { - "type": "string", - "description": "URL or file system path specifying initrd image.", - "example": "http://10.252.100.50/apis/ars/downloads/7e0bcf9f-10fc-46a9-b2f8-ba8814c1999c" - }, - "cloud-init": { - "description": "Cloud-Init data for the hosts", - "type": "object", - "properties": { - "meta-data": { + "CloudInitMetadata": { "description": "Cloud-Init Instance Metadata for a host.", "type": "object", "additionalProperties": true - }, - "user-data": { + }, + "CloudInitUserData": { "description": "Cloud-Init User data for a host.", "type": "object", "additionalProperties": true - }, - "phone-home": { + }, + "CloudInitPhoneHome": { "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", "type": "object", "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } } - } - }, - "example": { - "user-data": { - "foo": "bar" - }, - "meta-data": { - "foo": "bar" - } - } - } - } - }, - "CloudInit": { - "description": "Cloud-Init data for the hosts", - "type": "object", - "properties": { - "meta-data": { - "description": "Cloud-Init Instance Metadata for a host.", - "type": "object", - "additionalProperties": true - }, - "user-data": { - "description": "Cloud-Init User data for a host.", - "type": "object", - "additionalProperties": true - }, - "phone-home": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", - "type": "object", - "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } - } - } - }, - "example": { - "user-data": { - "foo": "bar" - }, - "meta-data": { - "foo": "bar" - } - } - }, - "CloudInitMetadata": { - "description": "Cloud-Init Instance Metadata for a host.", - "type": "object", - "additionalProperties": true - }, - "CloudInitUserData": { - "description": "Cloud-Init User data for a host.", - "type": "object", - "additionalProperties": true - }, - "CloudInitPhoneHome": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", - "type": "object", - "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" - }, - "fqdn": { - "type": "string" - } - } - }, - "Component": { - "description": "This data structure is used to return host info for debug purposes", - "type": "object", - "properties": { - "ID": { - "type": "string", - "example": "x0c0s21b0n0" - }, - "Type": { - "type": "string", - "example": "Node" - }, - "State": { - "type": "string", - "example": "Ready" - }, - "Flag": { - "type": "string", - "example": "OK" - }, - "Enabled": { - "type": "boolean", - "example": true - }, - "Role": { - "type": "string", - "example": "Compute" - }, - "RubeRole": { - "type": "string", - "example": "Worker" - }, - "NID": { - "type": "integer", - "example": 2 - }, - "NetType": { - "type": "string", - "example": "Sling" - }, - "Arch": { - "type": "string", - "example": "X86" - }, - "Class": { - "type": "string" - }, - "ReservationDisabled": { - "type": "boolean", - "example": false - }, - "Locked": { - "type": "boolean", - "example": false - }, - "FQDN": { - "type": "string" - }, - "MAC": { - "type": "array", - "items": { - "type": "string" }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "EndpointEnabled": { - "type": "boolean", - "example": true - } - } - }, - "StateInfo": { - "description": "This data structure is used to return the full component and boot parameter info of the dumpstate request.", - "type": "object", - "properties": { - "components": { - "type": "array", - "items": { - "type": "object", - "properties": { - "schema": { - "description": "This data structure is used to return host info for debug purposes", - "type": "object", - "properties": { + "Component": { + "description": "This data structure is used to return host info for debug purposes", + "type": "object", + "properties": { "ID": { - "type": "string", - "example": "x0c0s21b0n0" + "type": "string", + "example": "x0c0s21b0n0" }, "Type": { - "type": "string", - "example": "Node" + "type": "string", + "example": "Node" }, "State": { - "type": "string", - "example": "Ready" + "type": "string", + "example": "Ready" }, "Flag": { - "type": "string", - "example": "OK" + "type": "string", + "example": "OK" }, "Enabled": { - "type": "boolean", - "example": true + "type": "boolean", + "example": true }, "Role": { - "type": "string", - "example": "Compute" + "type": "string", + "example": "Compute" }, "RubeRole": { - "type": "string", - "example": "Worker" + "type": "string", + "example": "Worker" }, "NID": { - "type": "integer", - "example": 2 + "type": "integer", + "example": 2 }, "NetType": { - "type": "string", - "example": "Sling" + "type": "string", + "example": "Sling" }, "Arch": { - "type": "string", - "example": "X86" + "type": "string", + "example": "X86" }, "Class": { - "type": "string" + "type": "string" }, "ReservationDisabled": { - "type": "boolean", - "example": false + "type": "boolean", + "example": false }, "Locked": { - "type": "boolean", - "example": false + "type": "boolean", + "example": false }, "FQDN": { - "type": "string" + "type": "string" }, "MAC": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] }, "EndpointEnabled": { - "type": "boolean", - "example": true + "type": "boolean", + "example": true } - } } - } - } - }, - "params": { - "type": "array", - "items": { - "type": "object", - "properties": { - "schema": { - "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", - "type": "object", - "properties": { - "hosts": { - "type": "array", - "description": "host names", - "items": { - "type": "string" - }, - "example": [ - "x0c0s2b0n0", - "x0c0s3b0n0" - ] - }, - "macs": { - "type": "array", - "description": "MAC addresses", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] - }, - "nids": { - "type": "array", - "description": "Node ID", - "items": { - "type": "integer" - }, - "example": [ - 1, - 2, - 3, - 4 - ] + }, + "StateInfo": { + "description": "This data structure is used to return the full component and boot parameter info of the dumpstate request.", + "type": "object", + "properties": { + "components": { + "type": "array", + "items": { + "type": "object", + "properties": { + "schema": { + "description": "This data structure is used to return host info for debug purposes", + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "x0c0s21b0n0" + }, + "Type": { + "type": "string", + "example": "Node" + }, + "State": { + "type": "string", + "example": "Ready" + }, + "Flag": { + "type": "string", + "example": "OK" + }, + "Enabled": { + "type": "boolean", + "example": true + }, + "Role": { + "type": "string", + "example": "Compute" + }, + "RubeRole": { + "type": "string", + "example": "Worker" + }, + "NID": { + "type": "integer", + "example": 2 + }, + "NetType": { + "type": "string", + "example": "Sling" + }, + "Arch": { + "type": "string", + "example": "X86" + }, + "Class": { + "type": "string" + }, + "ReservationDisabled": { + "type": "boolean", + "example": false + }, + "Locked": { + "type": "boolean", + "example": false + }, + "FQDN": { + "type": "string" + }, + "MAC": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "EndpointEnabled": { + "type": "boolean", + "example": true + } + } + } + } + } }, "params": { - "type": "string", - "description": "Specific to the kernel that is being booted.", - "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" - }, - "kernel": { - "type": "string", - "description": "URL or file system path specifying kernel image.", - "example": "http://10.252.100.50/apis/ars/downloads/30b96241-12ff-4185-93ea-a1f7991372d3" - }, - "initrd": { - "type": "string", - "description": "URL or file system path specifying initrd image.", - "example": "http://10.252.100.50/apis/ars/downloads/7e0bcf9f-10fc-46a9-b2f8-ba8814c1999c" - }, - "cloud-init": { - "description": "Cloud-Init data for the hosts", - "type": "object", - "properties": { - "meta-data": { - "description": "Cloud-Init Instance Metadata for a host.", - "type": "object", - "additionalProperties": true + "type": "array", + "items": { + "type": "object", + "properties": { + "schema": { + "description": "When used as a request body, the caller sets boot parameters and specifies hosts, along with the kernel image path/URL and initrd path/URL. To specify hosts, use one of the three parameters - hosts, MACs, or NIDs. If MAC addresses are used, they are mapped to host names based on information retrieved from the hardware state manager. Likewise, if NIDs are used, they are mapped to host names with the same hardware state manager info. While the expected usage is to specify hosts based on their host names, the \"macs\" and \"nids\" alternatives may be more convenient in some contexts.\nYou can also specify a general tag for hosts. A tag is 'Default', or one of the roles that a node may be defined as in the hardware state manager (HSM). Some of the HSM roles like 'Compute', 'Storage', 'System', and 'Application' can be specified as hosts and are managed similar to specific hosts. While BSS allows for fine grained control of individual nodes, the tags are typically more convenient, especially for a large system.\n\nAlternatively, if you specify a kernel or initrd image and params, but no host, MAC, or NID, the boot script service will associate the specified params with the specified kernel or initrd image. When used as a response body, identifies the hosts available for booting using either hosts, MACs, or NIDs, depending on which parameter was used in the request.", + "type": "object", + "properties": { + "hosts": { + "type": "array", + "description": "host names", + "items": { + "type": "string" + }, + "example": [ + "x0c0s2b0n0", + "x0c0s3b0n0" + ] + }, + "macs": { + "type": "array", + "description": "MAC addresses", + "items": { + "type": "string" + }, + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] + }, + "nids": { + "type": "array", + "description": "Node ID", + "items": { + "type": "integer" + }, + "example": [ + 1, + 2, + 3, + 4 + ] + }, + "params": { + "type": "string", + "description": "Specific to the kernel that is being booted.", + "example": "console=tty0 console=ttyS0,115200n8 initrd=initrd-4.12.14-15.5_8.1.96-cray_shasta_c root=crayfs nfsserver=10.2.0.1nfspath=/var/opt/cray/boot_images imagename=/SLES selinux=0 rd.shell rd.net.timeout.carrier=40 rd.retry=40 ip=dhcp rd.neednet=1 crashkernel=256M htburl=https://api-gw-service-nmn.local/apis/hbtd/hmi/v1/heartbeat bad_page=panic hugepagelist=2m-2g intel_iommu=off iommu=pt numa_interleave_omit=headless numa_zonelist_order=node oops=panic pageblock_order=14 pcie_ports=native printk.synchronous=y quiet turbo_boost_limit=999" + }, + "kernel": { + "type": "string", + "description": "URL or file system path specifying kernel image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/kernel" + }, + "initrd": { + "type": "string", + "description": "URL or file system path specifying initrd image.", + "example": "s3://boot-images/1dbb777c-2527-449b-bd6d-fb4d1cb79e88/initrd" + }, + "cloud-init": { + "description": "Cloud-Init data for the hosts", + "type": "object", + "properties": { + "meta-data": { + "description": "Cloud-Init Instance Metadata for a host.", + "type": "object", + "additionalProperties": true + }, + "user-data": { + "description": "Cloud-Init User data for a host.", + "type": "object", + "additionalProperties": true + }, + "phone-home": { + "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", + "type": "object", + "properties": { + "pub_key_dsa": { + "type": "string" + }, + "pub_key_rsa": { + "type": "string" + }, + "pub_key_ecdsa": { + "type": "string" + }, + "pub_key_ed25519": { + "type": "string" + }, + "instance_id": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "fqdn": { + "type": "string" + } + } + } + }, + "example": { + "user-data": { + "foo": "bar" + }, + "meta-data": { + "foo": "bar" + } + } + } + } + } + } + } + } + } + }, + "HostInfo": { + "description": "This data structure is used to return the component info for a /hosts get request", + "type": "array", + "items": { + "description": "This data structure is used to return host info for debug purposes", + "type": "object", + "properties": { + "ID": { + "type": "string", + "example": "x0c0s21b0n0" }, - "user-data": { - "description": "Cloud-Init User data for a host.", - "type": "object", - "additionalProperties": true + "Type": { + "type": "string", + "example": "Node" }, - "phone-home": { - "description": "Data sent from the Phone Home Cloud-Init module after a host's boot is complete.", - "type": "object", - "properties": { - "pub_key_dsa": { - "type": "string" - }, - "pub_key_rsa": { - "type": "string" - }, - "pub_key_ecdsa": { - "type": "string" - }, - "pub_key_ed25519": { - "type": "string" - }, - "instance_id": { - "type": "string" - }, - "hostname": { - "type": "string" + "State": { + "type": "string", + "example": "Ready" + }, + "Flag": { + "type": "string", + "example": "OK" + }, + "Enabled": { + "type": "boolean", + "example": true + }, + "Role": { + "type": "string", + "example": "Compute" + }, + "RubeRole": { + "type": "string", + "example": "Worker" + }, + "NID": { + "type": "integer", + "example": 2 + }, + "NetType": { + "type": "string", + "example": "Sling" + }, + "Arch": { + "type": "string", + "example": "X86" + }, + "Class": { + "type": "string" + }, + "ReservationDisabled": { + "type": "boolean", + "example": false + }, + "Locked": { + "type": "boolean", + "example": false + }, + "FQDN": { + "type": "string" + }, + "MAC": { + "type": "array", + "items": { + "type": "string" }, - "fqdn": { - "type": "string" - } - } - } - }, - "example": { - "user-data": { - "foo": "bar" + "example": [ + "00:40:a6:82:f6:c5", + "a4:bf:01:3e:c0:a2", + "00:40:a6:82:f7:0c" + ] }, - "meta-data": { - "foo": "bar" + "EndpointEnabled": { + "type": "boolean", + "example": true } - } } - } } - } - } - } - } - }, - "HostInfo": { - "description": "This data structure is used to return the component info for a /hosts get request", - "type": "array", - "items": { - "description": "This data structure is used to return host info for debug purposes", - "type": "object", - "properties": { - "ID": { - "type": "string", - "example": "x0c0s21b0n0" }, - "Type": { - "type": "string", - "example": "Node" - }, - "State": { - "type": "string", - "example": "Ready" - }, - "Flag": { - "type": "string", - "example": "OK" - }, - "Enabled": { - "type": "boolean", - "example": true - }, - "Role": { - "type": "string", - "example": "Compute" - }, - "RubeRole": { - "type": "string", - "example": "Worker" - }, - "NID": { - "type": "integer", - "example": 2 - }, - "NetType": { - "type": "string", - "example": "Sling" - }, - "Arch": { - "type": "string", - "example": "X86" - }, - "Class": { - "type": "string" - }, - "ReservationDisabled": { - "type": "boolean", - "example": false - }, - "Locked": { - "type": "boolean", - "example": false - }, - "FQDN": { - "type": "string" - }, - "MAC": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "00:40:a6:82:f6:c5", - "a4:bf:01:3e:c0:a2", - "00:40:a6:82:f7:0c" - ] + "EndpointAccess": { + "description": "This data structure is used to return the endpoint access information for a given resource.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Xname of the node", + "example": "x3000c0s1b0n0" + }, + "endpoint": { + "type": "string", + "enum": [ + "bootscript", + "user-data" + ] + }, + "last_epoch": { + "type": "integer", + "description": "Unix epoch time of last request. An epoch of 0 indicates a request has not taken place.", + "example": 1635284155 + } + } }, - "EndpointEnabled": { - "type": "boolean", - "example": true + "Error": { + "description": "Return an RFC7808 error response.", + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "detail": { + "type": "string" + }, + "instance": { + "type": "string" + } + } } - } - } - }, - "EndpointAccess": { - "description": "This data structure is used to return the endpoint access information for a given resource.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Xname of the node", - "example": "x3000c0s1b0n0" - }, - "endpoint": { - "type": "string", - "enum": [ - "bootscript", - "user-data" - ] - }, - "last_epoch": { - "type": "integer", - "description": "Unix epoch time of last request. An epoch of 0 indicates a request has not taken place.", - "example": 1635284155 - } - } - }, - "Error": { - "description": "Return an RFC7808 error response.", - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "detail": { - "type": "string" - }, - "instance": { - "type": "string" - } } - } } - } -} +} \ No newline at end of file diff --git a/cray/tests/test_modules/test_ars.py b/cray/tests/test_modules/test_ars.py deleted file mode 100644 index b6c1c8a..0000000 --- a/cray/tests/test_modules/test_ars.py +++ /dev/null @@ -1,306 +0,0 @@ -# -# MIT License -# -# (C) Copyright 2020-2023 Hewlett Packard Enterprise Development LP -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. -# -""" -Tests for Artifact Repository Service (ARS) CLI subcommand (`cray ars`) -and options. -""" -# pylint: disable=unused-argument -# pylint: disable=invalid-name -import json - - -def test_cray_ars_base(cli_runner, rest_mock): - """ Test cray ars base command """ - runner, cli, _ = cli_runner - result = runner.invoke(cli, ['ars']) - assert result.exit_code == 0 - - outputs = [ - "Artifact Repository Service API", - "Options:", - "--help Show this message and exit.", - "Groups:", - "artifacts", - "uploads" - ] - - for txt in outputs: - assert txt in result.output - - -# TEST Artifacts Command - -def test_cray_ars_artifacts(cli_runner, rest_mock): - """ Test cray ars artifacts command """ - runner, cli, _ = cli_runner - result = runner.invoke(cli, ['ars', 'artifacts']) - assert result.exit_code == 0 - - outputs = [ - "ars artifacts [OPTIONS] COMMAND [ARGS]...", - "create", - "delete", - "describe", - "list" - ] - - for txt in outputs: - assert txt in result.output - - -def test_cray_ars_artifacts_create(cli_runner, rest_mock): - """ Test cray ars create ... """ - runner, cli, config = cli_runner - version = "0.1" - atype = 'generic' - name = 'test-name' - result = runner.invoke( - cli, ['ars', 'artifacts', 'create', '--version', version, '--atype', - atype, '--name', name] - ) - assert result.exit_code == 0 - data = json.loads(result.output) - assert data['method'] == 'POST' - assert data['url'] == f'{config["default"]["hostname"]}/apis/ars/artifacts' - assert data['body'] == { - 'version': version, - 'atype': atype, - 'name': name - } - - -def test_cray_ars_artifacts_delete(cli_runner, rest_mock): - """ Test cray ars artifacts delete ... """ - runner, cli, config = cli_runner - name = 'test-artifact' - result = runner.invoke(cli, ['ars', 'artifacts', 'delete', name]) - assert result.exit_code == 0 - data = json.loads(result.output) - assert data['method'] == 'DELETE' - assert data['url'] == f'{config["default"]["hostname"]}' \ - f'/apis/ars/artifacts/{name}' - - -def test_cray_ars_artifacts_list(cli_runner, rest_mock): - """ Test cray ars artifacts list ... """ - runner, cli, config = cli_runner - result = runner.invoke(cli, ['ars', 'artifacts', 'list']) - assert result.exit_code == 0 - data = json.loads(result.output) - assert data['method'] == 'GET' - assert data['url'] == f'{config["default"]["hostname"]}/apis/ars/artifacts' - - -def test_cray_ars_artifacts_describe(cli_runner, rest_mock): - """ Test cray ars artifacts describe ... """ - runner, cli, config = cli_runner - artifact_id = 'foo' - result = runner.invoke(cli, ['ars', 'artifacts', 'describe', artifact_id]) - assert result.exit_code == 0 - data = json.loads(result.output) - assert data['method'] == 'GET' - assert data['url'] == f'{config["default"]["hostname"]}' \ - f'/apis/ars/artifacts/{artifact_id}' - - -def test_cray_ars_artifacts_create_missing_required_name( - cli_runner, - rest_mock -): - """ - Test cray ars artifacts create ... - when a required parameter 'name' is missing - """ - runner, cli, _ = cli_runner - result = runner.invoke( - cli, ['ars', 'artifacts', 'create', - '--version', '0.1', - '--atype', 'generic'] - ) - assert result.exit_code == 2 - assert '--name' in result.output - - -def test_cray_ars_artifacts_create_missing_required_atype( - cli_runner, - rest_mock -): - """ Test cray ars artifacts create ... when a required parameter 'atype' is missing """ - runner, cli, _ = cli_runner - result = runner.invoke( - cli, ['ars', 'artifacts', 'create', - '--version', '0.1', - '--name', 'foo'] - ) - assert result.exit_code == 2 - assert '--atype' in result.output - - -def test_cray_ars_artifacts_create_missing_required_version( - cli_runner, - rest_mock -): - """ Test cray ars artifacts create ... when a required parameter 'version' is missing """ - runner, cli, _ = cli_runner - result = runner.invoke( - cli, ['ars', 'artifacts', 'create', - '--atype', 'generic', - '--name', 'foo'] - ) - assert result.exit_code == 2 - assert '--version' in result.output - - -def test_cray_ars_artifacts_create_invalid_atype(cli_runner, rest_mock): - """ Test cray ars artifacts create ... with an invalid atype value """ - runner, cli, _ = cli_runner - result = runner.invoke( - cli, ['ars', 'artifacts', 'create', - '--version', '0.1', - '--name', 'foo', - '--atype', 'invalid-type'] - ) - assert result.exit_code == 2 - assert 'Invalid value for' in result.output - assert "--atype" in result.output - - -# TEST Uploads Command - -def test_cray_ars_uploads(cli_runner, rest_mock): - """ Test cray ars artifacts uploads command """ - runner, cli, _ = cli_runner - result = runner.invoke(cli, ['ars', 'uploads']) - assert result.exit_code == 0 - - outputs = [ - "ars uploads [OPTIONS] COMMAND [ARGS]...", - "create", - "delete", - "describe", - "list", - "update" - ] - - for txt in outputs: - assert txt in result.output - - -def test_cray_ars_uploads_create(cli_runner, rest_mock): - """ Test cray ars uploads create ... """ - runner, cli, config = cli_runner - artifact_id = 'foo' - result = runner.invoke( - cli, - ['ars', 'uploads', 'create', '--artifact-id', artifact_id] - ) - assert result.exit_code == 0 - data = json.loads(result.output) - assert data['method'] == 'POST' - assert data['url'] == f"{config['default']['hostname']}/apis/ars/uploads" - assert data['body'] == { - 'artifact_id': artifact_id - } - - -def test_cray_ars_uploads_delete(cli_runner, rest_mock): - """ Test cray ars uploads delete ... """ - runner, cli, config = cli_runner - upload_id = 'test-upload-id' - result = runner.invoke(cli, ['ars', 'uploads', 'delete', upload_id]) - assert result.exit_code == 0 - data = json.loads(result.output) - assert data['method'] == 'DELETE' - assert data['url'] == f'{config["default"]["hostname"]}/apis/ars/uploads/{upload_id}' - - -def test_cray_ars_uploads_list(cli_runner, rest_mock): - """ Test cray ars uploads list ... """ - runner, cli, config = cli_runner - result = runner.invoke(cli, ['ars', 'uploads', 'list']) - assert result.exit_code == 0 - data = json.loads(result.output) - assert data['method'] == 'GET' - assert data['url'] == f'{config["default"]["hostname"]}/apis/ars/uploads' - - -def test_cray_ars_uploads_describe(cli_runner, rest_mock): - """ Test cray ars uploads describe ... """ - runner, cli, config = cli_runner - upload_id = 'foo' - result = runner.invoke(cli, ['ars', 'uploads', 'describe', upload_id]) - assert result.exit_code == 0 - data = json.loads(result.output) - assert data['method'] == 'GET' - assert data['url'] == f'{config["default"]["hostname"]}/apis/ars/uploads/{upload_id}' - - -# def test_cray_ars_uploads_update(cli_runner, rest_mock): -# """ Test cray ars uploads describe ... """ -# runner, cli, config = cli_runner -# upload_id = 'foo' -# with tempfile.NamedTemporaryFile() as fp: -# file_name = fp.name -# result = runner.invoke(cli, ['ars', 'uploads', 'update', '--artifact', file_name, -# upload_id]) -# assert result.exit_code == 0 -# data = json.loads(result.output) -# assert data['method'] == 'PUT' -# assert data['url'] == f'{config['default']['hostname']}/apis/ars/uploads/{upload_id}' -# # The body comes back as a unicode string version of the multipart/form-data -# # format. It does not come back as a nice dictionary. -# # Thus, the following does not work. -# #assert data['body'] == { -# # 'artifact': os.path.basename(file_name) -# #} -# # Instead, I parsed the data using regular expressions. -# name_regex = re.compile(r'name=\"(.*)\";') -# filename_regex = re.compile(r'filename=\"(.*)\"') -# returned_name = name_regex.search(data['body']).group(1) -# returned_file_name = filename_regex.search(data['body']).group(1) -# assert returned_name == 'artifact' -# assert returned_file_name == os.path.basename(file_name) - - -def test_cray_ars_uploads_update_missing_required_artifact_path( - cli_runner, - rest_mock -): - """ Test cray ars uploads describe ... """ - runner, cli, _ = cli_runner - upload_id = 'foo' - result = runner.invoke(cli, ['ars', 'uploads', 'update', upload_id]) - assert result.exit_code == 2 - assert '--artifact' in result.output - - -def test_cray_ars_uploads_create_missing_required_artifact_id( - cli_runner, - rest_mock -): - """ Test cray ars uploads create ... when a required parameter 'name' is missing """ - runner, cli, _ = cli_runner - result = runner.invoke(cli, ['ars', 'uploads', 'create']) - assert result.exit_code == 2 - assert '--artifact-id' in result.output diff --git a/docs/source/groups/ars.rst b/docs/source/groups/ars.rst deleted file mode 100644 index 4e56a7f..0000000 --- a/docs/source/groups/ars.rst +++ /dev/null @@ -1,5 +0,0 @@ - -.. click:: cray.modules.ars.cli:cli - :prog: cray ars - :show-nested: - \ No newline at end of file