Skip to content

Commit bdc75da

Browse files
committed
renaming of kubikle
1 parent ec67e18 commit bdc75da

File tree

4 files changed

+84
-84
lines changed

4 files changed

+84
-84
lines changed

dataikuapi/dss/admin.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,15 +1274,15 @@ def total_active_with_trigger_scenarios_count(self):
12741274
return self.data["scenarios"]["activeWithTriggers"]
12751275

12761276

1277-
class DSSKubikleTemplateListItem(object):
1278-
"""An item in a list of kubikle templates. Do not instantiate this class, use :meth:`dataikuapi.DSSClient.list_kubikle_templates`"""
1277+
class DSSCodeStudioTemplateListItem(object):
1278+
"""An item in a list of code studio templates. Do not instantiate this class, use :meth:`dataikuapi.DSSClient.list_code_studio_templates`"""
12791279
def __init__(self, client, data):
12801280
self.client = client
12811281
self._data = data
12821282

1283-
def to_kubikle_template(self):
1284-
"""Gets the :class:`DSSKubikleTemplate` corresponding to this kubikle template """
1285-
return DSSKubikleTemplate(self.client, self._data["id"])
1283+
def to_code_studio_template(self):
1284+
"""Gets the :class:`DSSCodeStudioTemplate` corresponding to this code studio template """
1285+
return DSSCodeStudioTemplate(self.client, self._data["id"])
12861286

12871287
@property
12881288
def name(self):
@@ -1310,12 +1310,12 @@ def last_built(self):
13101310
else:
13111311
return None
13121312

1313-
class DSSKubikleTemplate(object):
1313+
class DSSCodeStudioTemplate(object):
13141314
"""
1315-
A handle to interact with a kubikle template on the DSS instance
1315+
A handle to interact with a code studio template on the DSS instance
13161316
"""
13171317
def __init__(self, client, template_id):
1318-
"""Do not call that directly, use :meth:`dataikuapi.DSSClient.get_kubikle_template`"""
1318+
"""Do not call that directly, use :meth:`dataikuapi.DSSClient.get_code_studio_template`"""
13191319
self.client = client
13201320
self.template_id = template_id
13211321

@@ -1327,18 +1327,18 @@ def get_settings(self):
13271327
"""
13281328
Get the template's settings.
13291329
1330-
:returns: a :class:`DSSKubikleTemplateSettings` object to interact with kubikle template settings
1331-
:rtype: :class:`DSSKubikleTemplateSettings`
1330+
:returns: a :class:`DSSCodeStudioTemplateSettings` object to interact with code studio template settings
1331+
:rtype: :class:`DSSCodeStudioTemplateSettings`
13321332
"""
1333-
settings = self.client._perform_json("GET", "/admin/kubikles/%s" % (self.template_id))
1334-
return DSSKubikleTemplateSettings(self.client, self.template_id, settings)
1333+
settings = self.client._perform_json("GET", "/admin/code-studios/%s" % (self.template_id))
1334+
return DSSCodeStudioTemplateSettings(self.client, self.template_id, settings)
13351335

1336-
class DSSKubikleTemplateSettings(object):
1336+
class DSSCodeStudioTemplateSettings(object):
13371337
"""
1338-
The settings of a kubikle template
1338+
The settings of a code studio template
13391339
"""
13401340
def __init__(self, client, template_id, settings):
1341-
"""Do not call directly, use :meth:`DSSKubikleTemplate.get_settings`"""
1341+
"""Do not call directly, use :meth:`DSSCodeStudioTemplate.get_settings`"""
13421342
self.client = client
13431343
self.template_id = template_id
13441344
self.settings = settings
Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
import json
33
from datetime import datetime
44

5-
class DSSKubikleObjectListItem(object):
6-
"""An item in a list of kubikles. Do not instantiate this class, use :meth:`dataikuapi.dss.project.DSSProject.list_kubikle_objects`"""
5+
class DSSCodeStudioObjectListItem(object):
6+
"""An item in a list of code studios. Do not instantiate this class, use :meth:`dataikuapi.dss.project.DSSProject.list_code_studio_objects`"""
77
def __init__(self, client, project_key, data):
88
self.client = client
99
self.project_key = project_key
1010
self._data = data
1111

12-
def to_kubikle_object(self):
13-
"""Gets the :class:`DSSKubikleTemplate` corresponding to this kubikle object """
14-
return DSSKubikleObject(self.client, self.project_key, self._data["id"])
12+
def to_code_studio_object(self):
13+
"""Gets the :class:`DSSCodeStudioObject` corresponding to this code studio object """
14+
return DSSCodeStudioObject(self.client, self.project_key, self._data["id"])
1515

1616
@property
1717
def name(self):
@@ -33,77 +33,77 @@ def template_description(self):
3333
return self._data.get('desc', {}).get('shortDesc', '')
3434

3535

36-
class DSSKubikleObject(object):
36+
class DSSCodeStudioObject(object):
3737
"""
38-
A handle to manage a kubikle object of a project
38+
A handle to manage a code studio object of a project
3939
"""
40-
def __init__(self, client, project_key, kubikle_object_id):
41-
"""Do not call directly, use :meth:`dataikuapi.dss.project.DSSProject.get_kubikle_object`"""
40+
def __init__(self, client, project_key, code_studio_object_id):
41+
"""Do not call directly, use :meth:`dataikuapi.dss.project.DSSProject.get_code_studio_object`"""
4242
self.client = client
4343
self.project_key = project_key
44-
self.kubikle_object_id = kubikle_object_id
44+
self.code_studio_object_id = code_studio_object_id
4545

4646
def delete(self):
4747
"""
48-
Delete the kubikle
48+
Delete the code studio
4949
"""
50-
self.client._perform_empty("DELETE", "/projects/%s/kubikles/%s" % (self.project_key, self.kubikle_object_id))
50+
self.client._perform_empty("DELETE", "/projects/%s/code-studios/%s" % (self.project_key, self.code_studio_object_id))
5151

5252
def get_settings(self):
5353
"""
54-
Get the kubikle object's settings
54+
Get the code studio object's settings
5555
56-
:returns: a handle to manage the kubikle settings
57-
:rtype: :class:`dataikuapi.dss.kubikle.DSSKubikleObjectSettings`
56+
:returns: a handle to manage the code studio settings
57+
:rtype: :class:`dataikuapi.dss.codestudio.DSSCodeStudioObjectSettings`
5858
"""
59-
settings = self.client._perform_json("GET", "/projects/%s/kubikles/%s" % (self.project_key, self.kubikle_object_id))
60-
return DSSKubikleObjectSettings(self.client, self.project_key, self.kubikle_object_id, settings)
59+
settings = self.client._perform_json("GET", "/projects/%s/code-studios/%s" % (self.project_key, self.code_studio_object_id))
60+
return DSSCodeStudioObjectSettings(self.client, self.project_key, self.code_studio_object_id, settings)
6161

6262
def get_status(self):
6363
"""
64-
Get the kubikle object's state
64+
Get the code studio object's state
6565
66-
:returns: a handle to inspect the kubikle state
67-
:rtype: :class:`dataikuapi.dss.kubikle.DSSKubikleObjectStatus`
66+
:returns: a handle to inspect the code studio state
67+
:rtype: :class:`dataikuapi.dss.codestudio.DSSCodeStudioObjectStatus`
6868
"""
69-
status = self.client._perform_json("GET", "/projects/%s/kubikles/%s/status" % (self.project_key, self.kubikle_object_id))
70-
return DSSKubikleObjectStatus(self.client, self.project_key, self.kubikle_object_id, status)
69+
status = self.client._perform_json("GET", "/projects/%s/code-studios/%s/status" % (self.project_key, self.code_studio_object_id))
70+
return DSSCodeStudioObjectStatus(self.client, self.project_key, self.code_studio_object_id, status)
7171

7272
def stop(self):
7373
"""
74-
Stop a running kubikle
74+
Stop a running code studio
7575
7676
:returns: a future to wait on the stop, or None if already stopped
7777
:rtype: :class:`dataikuapi.dss.future.DSSFuture`
7878
"""
79-
ret = self.client._perform_json("POST", "/projects/%s/kubikles/%s/stop" % (self.project_key, self.kubikle_object_id))
79+
ret = self.client._perform_json("POST", "/projects/%s/code-studios/%s/stop" % (self.project_key, self.code_studio_object_id))
8080
if 'jobId' in ret:
8181
return self.client.get_future(ret["jobId"])
8282
else:
8383
return None
8484

8585
def restart(self):
8686
"""
87-
Restart a kubikle
87+
Restart a code studio
8888
8989
:returns: a future to wait on the start
9090
:rtype: :class:`dataikuapi.dss.future.DSSFuture`
9191
"""
92-
ret = self.client._perform_json("POST", "/projects/%s/kubikles/%s/restart" % (self.project_key, self.kubikle_object_id))
92+
ret = self.client._perform_json("POST", "/projects/%s/code-studios/%s/restart" % (self.project_key, self.code_studio_object_id))
9393
if 'jobId' in ret:
9494
return self.client.get_future(ret["jobId"])
9595
else:
9696
return None
9797

98-
class DSSKubikleObjectSettings(object):
98+
class DSSCodeStudioObjectSettings(object):
9999
"""
100-
Settings for the kubikle object
100+
Settings for the code studio object
101101
"""
102-
def __init__(self, client, project_key, kubikle_object_id, settings):
103-
"""Do not call directly, use :meth:`dataikuapi.dss.kubikle.DSSKubikleObject.get_settings`"""
102+
def __init__(self, client, project_key, code_studio_object_id, settings):
103+
"""Do not call directly, use :meth:`dataikuapi.dss.codestudio.DSSCodeStudioObject.get_settings`"""
104104
self.client = client
105105
self.project_key = project_key
106-
self.kubikle_object_id = kubikle_object_id
106+
self.code_studio_object_id = code_studio_object_id
107107
self.settings = settings
108108

109109
def get_raw(self):
@@ -112,15 +112,15 @@ def get_raw(self):
112112
"""
113113
return self.settings
114114

115-
class DSSKubikleObjectStatus(object):
115+
class DSSCodeStudioObjectStatus(object):
116116
"""
117-
Status of a kubikle object
117+
Status of a code studio object
118118
"""
119-
def __init__(self, client, project_key, kubikle_object_id, status):
120-
"""Do not call directly, use :meth:`dataikuapi.dss.kubikle.DSSKubikleObject.get_state`"""
119+
def __init__(self, client, project_key, code_studio_object_id, status):
120+
"""Do not call directly, use :meth:`dataikuapi.dss.codestudio.DSSCodeStudioObject.get_state`"""
121121
self.client = client
122122
self.project_key = project_key
123-
self.kubikle_object_id = kubikle_object_id
123+
self.code_studio_object_id = code_studio_object_id
124124
self.status = status
125125

126126
def get_raw(self):

dataikuapi/dss/project.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from .analysis import DSSAnalysis
2626
from .flow import DSSProjectFlow
2727
from .app import DSSAppManifest
28-
from .kubikle import DSSKubikleObject, DSSKubikleObjectListItem
28+
from .codestudio import DSSCodeStudioObject, DSSCodeStudioObjectListItem
2929

3030
class DSSProject(object):
3131
"""
@@ -1632,55 +1632,55 @@ def get_mlflow_extension(self):
16321632

16331633

16341634
########################################################
1635-
# Kubikles
1635+
# Code studios
16361636
########################################################
1637-
def list_kubikle_objects(self, as_type="listitems"):
1637+
def list_code_studio_objects(self, as_type="listitems"):
16381638
"""
1639-
List the kubikle objects in this project
1639+
List the code studio objects in this project
16401640
16411641
Returns:
1642-
the list of the kubikle objects, each one as a JSON object
1642+
the list of the code studio objects, each one as a JSON object
16431643
"""
16441644
items = self.client._perform_json(
1645-
"GET", "/projects/%s/kubikles/" % self.project_key)
1645+
"GET", "/projects/%s/code-studios/" % self.project_key)
16461646
if as_type == "listitems" or as_type == "listitem":
1647-
return [DSSKubikleObjectListItem(self.client, self.project_key, item) for item in items]
1647+
return [DSSCodeStudioObjectListItem(self.client, self.project_key, item) for item in items]
16481648
elif as_type == "objects" or as_type == "object":
1649-
return [DSSKubikleObject(self.client, self.project_key, item["id"]) for item in items]
1649+
return [DSSCodeStudioObject(self.client, self.project_key, item["id"]) for item in items]
16501650
else:
16511651
raise ValueError("Unknown as_type")
16521652

1653-
def get_kubikle_object(self, kubikle_object_id):
1653+
def get_code_studio_object(self, code_studio_object_id):
16541654
"""
1655-
Get a handle to interact with a specific kubikle object
1655+
Get a handle to interact with a specific code studio object
16561656
16571657
Args:
1658-
kubikle_object_id: the identifier of the desired kubikle object
1658+
code_studio_object_id: the identifier of the desired code studio object
16591659
16601660
Returns:
1661-
A :class:`dataikuapi.dss.kubikle.DSSKubikleObject` kubikle object handle
1661+
A :class:`dataikuapi.dss.codestudio.DSSCodeStudioObject` code studio object handle
16621662
"""
1663-
return DSSKubikleObject(self.client, self.project_key, kubikle_object_id)
1663+
return DSSCodeStudioObject(self.client, self.project_key, code_studio_object_id)
16641664

1665-
def create_kubikle_object(self, name, template_id):
1665+
def create_code_studio_object(self, name, template_id):
16661666
"""
1667-
Create a new kubikle object in the project, and return a handle to interact with it
1667+
Create a new code studio object in the project, and return a handle to interact with it
16681668
16691669
Args:
1670-
name: the name of the kubikle object
1671-
template_id: the identifier of a kubikle template
1670+
name: the name of the code studio object
1671+
template_id: the identifier of a code studio template
16721672
16731673
Returns:
1674-
A :class:`dataikuapi.dss.kubikle.DSSKubikleObject` kubikle object handle
1674+
A :class:`dataikuapi.dss.codestudio.DSSCodeStudioObject` code studio object handle
16751675
"""
16761676
obj = {
16771677
"name" : name,
16781678
"projectKey" : self.project_key,
16791679
"templateId" : template_id
16801680
}
1681-
res = self.client._perform_json("POST", "/projects/%s/kubikles/" % self.project_key, body = obj)
1682-
kubikle_object_id = res['id']
1683-
return DSSKubikleObject(self.client, self.project_key, kubikle_object_id)
1681+
res = self.client._perform_json("POST", "/projects/%s/code-studios/" % self.project_key, body = obj)
1682+
code_studio_object_id = res['codeStudio']['id']
1683+
return DSSCodeStudioObject(self.client, self.project_key, code_studio_object_id)
16841684

16851685

16861686

dataikuapi/dssclient.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from .dss.project import DSSProject
1212
from .dss.app import DSSApp
1313
from .dss.plugin import DSSPlugin
14-
from .dss.admin import DSSUser, DSSOwnUser, DSSGroup, DSSConnection, DSSGeneralSettings, DSSCodeEnv, DSSGlobalApiKey, DSSCluster, DSSKubikleTemplate, DSSKubikleTemplateListItem, DSSGlobalUsageSummary, DSSInstanceVariables
14+
from .dss.admin import DSSUser, DSSOwnUser, DSSGroup, DSSConnection, DSSGeneralSettings, DSSCodeEnv, DSSGlobalApiKey, DSSCluster, DSSCodeStudioTemplate, DSSCodeStudioTemplateListItem, DSSGlobalUsageSummary, DSSInstanceVariables
1515
from .dss.meaning import DSSMeaning
1616
from .dss.sqlquery import DSSSQLQuery
1717
from .dss.discussion import DSSObjectDiscussions
@@ -595,35 +595,35 @@ def create_cluster(self, cluster_name, cluster_type='manual', params=None):
595595

596596

597597
########################################################
598-
# Kubikle templates
598+
# Code studio templates
599599
########################################################
600600

601-
def list_kubikle_templates(self, as_type='listitems'):
601+
def list_code_studio_templates(self, as_type='listitems'):
602602
"""
603-
List all kubikle templates on the DSS instance
603+
List all code studio templates on the DSS instance
604604
605605
Returns:
606606
List of templates (name, type)
607607
"""
608-
items = self._perform_json("GET", "/admin/kubikles/")
608+
items = self._perform_json("GET", "/admin/code-studios/")
609609
if as_type == "listitems" or as_type == "listitem":
610-
return [DSSKubikleTemplateListItem(self, item) for item in items]
610+
return [DSSCodeStudioTemplateListItem(self, item) for item in items]
611611
elif as_type == "objects" or as_type == "object":
612-
return [DSSKubikleTemplate(self, item["id"]) for item in items]
612+
return [DSSCodeStudioTemplate(self, item["id"]) for item in items]
613613
else:
614614
raise ValueError("Unknown as_type")
615615

616-
def get_kubikle_template(self, template_id):
616+
def get_code_studio_template(self, template_id):
617617
"""
618-
Get a handle to interact with a specific kubikle template
618+
Get a handle to interact with a specific code studio template
619619
620620
Args:
621-
template_id: the template id of the desired kubikle template
621+
template_id: the template id of the desired code studio template
622622
623623
Returns:
624-
A :class:`dataikuapi.dss.admin.DSSKubikleTemplate` kubikle template handle
624+
A :class:`dataikuapi.dss.admin.DSSCodeStudioTemplate` code studio template handle
625625
"""
626-
return DSSKubikleTemplate(self, template_id)
626+
return DSSCodeStudioTemplate(self, template_id)
627627

628628

629629
########################################################

0 commit comments

Comments
 (0)