diff --git a/kernelci/api/latest.py b/kernelci/api/latest.py index c638b18219..ba7f99c5cf 100644 --- a/kernelci/api/latest.py +++ b/kernelci/api/latest.py @@ -140,6 +140,18 @@ def update(self, node: dict, noevent=False) -> dict: uri += '?noevent=true' return self._put(uri, node).json() + def bulkset(self, nodes: list, field: str, value: str): + """ + Set a field to a value for a list of nodes(ids) + """ + param = { + 'nodes': nodes, + 'field': field, + 'value': value + } + print(f"bulkset param: {param}") + return self._put(f'batch/nodeset', data=param) + def subscribe(self, channel: str, promisc: Optional[bool] = None) -> int: params = {'promisc': promisc} if promisc else None resp = self._post(f'subscribe/{channel}', params=params)