Skip to content

Commit eb10a36

Browse files
committed
Streaming endpoint and color for zones
1 parent b22a0d4 commit eb10a36

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

dataikuapi/dss/flow.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from .savedmodel import DSSSavedModel
55
from .recipe import DSSRecipe, DSSRecipeDefinitionAndPayload
66
from .future import DSSFuture
7+
from .streaming_endpoint import DSSStreamingEndpoint
78
import logging, json
89

910
class DSSProjectFlow(object):
@@ -153,6 +154,8 @@ def _to_smart_ref(self, obj):
153154
ot = "SAVED_MODEL"
154155
elif isinstance(obj, DSSRecipe):
155156
ot = "RECIPE"
157+
elif isinstance(obj, DSSStreamingEndpoint):
158+
ot = "STREAMING_ENDPOINT"
156159
else:
157160
raise ValueError("Cannot transform to DSS object ref: %s" % obj)
158161

@@ -210,6 +213,8 @@ def _to_native_obj(self, zone_item):
210213
return p.get_saved_model(zone_item["objectId"])
211214
elif zone_item["objectType"] == "RECIPE":
212215
return p.get_recipe(zone_item["objectId"])
216+
elif zone_item["objectType"] == "STREAMING_ENDPOINT":
217+
return p.get_streaming_endpoint(zone_item["objectId"])
213218
else:
214219
raise ValueError("Cannot transform to DSS object: %s" % zone_item)
215220

@@ -297,6 +302,14 @@ def name(self):
297302
def name(self, new_name):
298303
self._raw["name"] = new_name
299304

305+
@property
306+
def color(self):
307+
return self._raw["color"]
308+
309+
@color.setter
310+
def color(self, new_color):
311+
self._raw["color"] = new_color
312+
300313
def save(self):
301314
"""Saves the settings of the zone"""
302315
self._zone.client._perform_empty("PUT", "/projects/%s/flow/zones/%s" % (self._zone.flow.project.project_key, self._zone.id),

0 commit comments

Comments
 (0)