api: Add schema for bios API (versioning)

Change-Id: Idceab8c80b24064b6a05e4b409a8d30b0ca25a95
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane
2025-06-09 16:20:35 +01:00
parent 352d1c83d4
commit 52786d4fae
2 changed files with 6 additions and 0 deletions

View File

@@ -17,7 +17,9 @@ from pecan import rest
from ironic import api
from ironic.api.controllers.v1 import utils as api_utils
from ironic.api.controllers.v1 import versions
from ironic.api import method
from ironic.api import validation
from ironic.common import args
from ironic.common import exception
from ironic.common import metrics_utils
@@ -65,6 +67,7 @@ class NodeBiosController(rest.RestController):
@METRICS.timer('NodeBiosController.get_all')
@method.expose()
@validation.api_version(min_version=versions.MINOR_40_BIOS_INTERFACE)
@args.validate(fields=args.string_list, detail=args.boolean)
def get_all(self, detail=None, fields=None):
"""List node bios settings."""
@@ -85,6 +88,7 @@ class NodeBiosController(rest.RestController):
@METRICS.timer('NodeBiosController.get_one')
@method.expose()
@validation.api_version(min_version=versions.MINOR_40_BIOS_INTERFACE)
@args.validate(setting_name=args.name)
def get_one(self, setting_name):
"""Retrieve information about the given bios setting.

View File

@@ -2386,6 +2386,8 @@ class NodesController(rest.RestController):
pecan.abort(http_client.BAD_REQUEST, e.args[0])
if not remainder:
return
# TODO(stephenfin): Remove all of these once we have version decorators
# on them all
if ((remainder[0] == 'portgroups'
and not api_utils.allow_portgroups_subcontrollers())
or (remainder[0] == 'vifs'