|
3 | 3 | from .discussion import DSSObjectDiscussions |
4 | 4 | import json, logging, warnings |
5 | 5 | from .utils import DSSTaggableObjectListItem, DSSTaggableObjectSettings |
| 6 | +try: |
| 7 | + basestring |
| 8 | +except NameError: |
| 9 | + basestring = str |
6 | 10 |
|
7 | 11 | class DSSRecipeListItem(DSSTaggableObjectListItem): |
8 | 12 | """An item in a list of recipes. Do not instantiate this class, use :meth:`dataikuapi.dss.project.DSSProject.list_recipes`""" |
@@ -34,6 +38,11 @@ def __init__(self, client, project_key, recipe_name): |
34 | 38 | self.project_key = project_key |
35 | 39 | self.recipe_name = recipe_name |
36 | 40 |
|
| 41 | + @property |
| 42 | + def id(self): |
| 43 | + """The id of the recipe""" |
| 44 | + return self.recipe_name |
| 45 | + |
37 | 46 | @property |
38 | 47 | def name(self): |
39 | 48 | """The name of the recipe""" |
@@ -225,6 +234,16 @@ def get_continuous_activity(self): |
225 | 234 | from .continuousactivity import DSSContinuousActivity |
226 | 235 | return DSSContinuousActivity(self.client, self.project_key, self.recipe_name) |
227 | 236 |
|
| 237 | + def move_to_zone(self, zone): |
| 238 | + """ |
| 239 | + Moves this object to a flow zone |
| 240 | +
|
| 241 | + :param object zone: a :class:`dataikuapi.dss.flow.DSSFlowZone` where to move the object |
| 242 | + """ |
| 243 | + if isinstance(zone, basestring): |
| 244 | + zone = self.client.get_project(self.project_key).get_flow().get_zone(zone) |
| 245 | + zone.add_item(self) |
| 246 | + |
228 | 247 | class DSSRecipeStatus(object): |
229 | 248 | """Status of a recipce. |
230 | 249 | Do not create that directly, use :meth:`DSSRecipe.get_status`""" |
|
0 commit comments