Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions kernelci/api/latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
def add(self, node: dict) -> dict:
return self._post('node', node).json()

def update(self, node: dict, noevent=False) -> dict:

Check warning on line 132 in kernelci/api/latest.py

View workflow job for this annotation

GitHub Actions / Lint

Number of parameters was 2 in 'Node.update' and is now 3 in overridden 'Node.update' method
if node['result'] != 'incomplete':
data = node.get('data', {})
if data.get('error_code') == 'node_timeout':
Expand All @@ -140,6 +140,17 @@
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'batch/nodeset', data=param)

Check warning on line 152 in kernelci/api/latest.py

View workflow job for this annotation

GitHub Actions / Lint

Using an f-string that does not have any interpolated variables

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
Loading