Skip to content

Commit

Permalink
feat(api/latest.py): Implement bulk set api call
Browse files Browse the repository at this point in the history
Reference PR: kernelci/kernelci-api#584

Signed-off-by: Denys Fedoryshchenko <[email protected]>
  • Loading branch information
nuclearcat committed Dec 4, 2024
1 parent 7144fa1 commit 675449b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kernelci/api/latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ 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
}
return self._put(f'nodes/set', 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)
Expand Down

0 comments on commit 675449b

Please sign in to comment.