|
4 | 4 | from .savedmodel import DSSSavedModel |
5 | 5 | from .recipe import DSSRecipe, DSSRecipeDefinitionAndPayload |
6 | 6 | from .future import DSSFuture |
| 7 | +from .streaming_endpoint import DSSStreamingEndpoint |
7 | 8 | import logging, json |
8 | 9 |
|
9 | 10 | class DSSProjectFlow(object): |
@@ -153,6 +154,8 @@ def _to_smart_ref(self, obj): |
153 | 154 | ot = "SAVED_MODEL" |
154 | 155 | elif isinstance(obj, DSSRecipe): |
155 | 156 | ot = "RECIPE" |
| 157 | + elif isinstance(obj, DSSStreamingEndpoint): |
| 158 | + ot = "STREAMING_ENDPOINT" |
156 | 159 | else: |
157 | 160 | raise ValueError("Cannot transform to DSS object ref: %s" % obj) |
158 | 161 |
|
@@ -210,6 +213,8 @@ def _to_native_obj(self, zone_item): |
210 | 213 | return p.get_saved_model(zone_item["objectId"]) |
211 | 214 | elif zone_item["objectType"] == "RECIPE": |
212 | 215 | return p.get_recipe(zone_item["objectId"]) |
| 216 | + elif zone_item["objectType"] == "STREAMING_ENDPOINT": |
| 217 | + return p.get_streaming_endpoint(zone_item["objectId"]) |
213 | 218 | else: |
214 | 219 | raise ValueError("Cannot transform to DSS object: %s" % zone_item) |
215 | 220 |
|
@@ -297,6 +302,14 @@ def name(self): |
297 | 302 | def name(self, new_name): |
298 | 303 | self._raw["name"] = new_name |
299 | 304 |
|
| 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 | + |
300 | 313 | def save(self): |
301 | 314 | """Saves the settings of the zone""" |
302 | 315 | self._zone.client._perform_empty("PUT", "/projects/%s/flow/zones/%s" % (self._zone.flow.project.project_key, self._zone.id), |
|
0 commit comments