Skip to content

Commit 769f844

Browse files
committed
[sc-68952] Add items to zone by batch
1 parent 566ba99 commit 769f844

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

dataikuapi/dss/flow.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,22 @@ def add_item(self, obj):
338338
self._raw = self.client._perform_json("POST", "/projects/%s/flow/zones/%s/items" % (self.flow.project.project_key, self.id),
339339
body=self.flow._to_smart_ref(obj))
340340

341+
def add_items(self, items):
342+
"""
343+
Adds items to this zone.
344+
345+
The items will automatically be moved from its existing zone. Additional items may be moved to this zone
346+
as a result of the operation (notably the recipe generating `obj`).
347+
348+
:param object items: A :class:`dataikuapi.dss.dataset.DSSDataset`, :class:`dataikuapi.dss.managedfolder.DSSManagedFolder`,
349+
or :class:`dataikuapi.dss.savedmodel.DSSSavedModel` to add to the zone
350+
"""
351+
smart_refs = []
352+
for item in items:
353+
smart_refs.append(self.flow._to_smart_ref(item))
354+
self._raw = self.client._perform_json("POST", "/projects/%s/flow/zones/%s/add-items" % (self.flow.project.project_key, self.id),
355+
body=smart_refs)
356+
341357
@property
342358
def items(self):
343359
"""

0 commit comments

Comments
 (0)