lightning-sdk 0.1.32__py3-none-any.whl → 0.1.34__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. lightning_sdk/__init__.py +1 -1
  2. lightning_sdk/ai_hub.py +90 -5
  3. lightning_sdk/api/ai_hub_api.py +53 -4
  4. lightning_sdk/api/studio_api.py +15 -8
  5. lightning_sdk/api/utils.py +8 -1
  6. lightning_sdk/cli/ai_hub.py +38 -0
  7. lightning_sdk/cli/entrypoint.py +2 -0
  8. lightning_sdk/lightning_cloud/openapi/__init__.py +1 -0
  9. lightning_sdk/lightning_cloud/openapi/models/__init__.py +1 -0
  10. lightning_sdk/lightning_cloud/openapi/models/create_deployment_request_defines_a_spec_for_the_job_that_allows_for_autoscaling_jobs.py +27 -1
  11. lightning_sdk/lightning_cloud/openapi/models/deployments_id_body.py +27 -1
  12. lightning_sdk/lightning_cloud/openapi/models/v1_checkbox.py +175 -0
  13. lightning_sdk/lightning_cloud/openapi/models/v1_deployment.py +27 -1
  14. lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template_parameter.py +27 -1
  15. lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template_parameter_type.py +1 -0
  16. lightning_sdk/lightning_cloud/openapi/models/v1_job_spec.py +1 -27
  17. lightning_sdk/lightning_cloud/openapi/models/v1_lightningwork_status.py +1 -27
  18. lightning_sdk/lightning_cloud/openapi/models/v1_metric_value.py +27 -1
  19. lightning_sdk/lightning_cloud/openapi/models/v1_usage_details.py +55 -3
  20. lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +53 -1
  21. lightning_sdk/studio.py +6 -5
  22. {lightning_sdk-0.1.32.dist-info → lightning_sdk-0.1.34.dist-info}/METADATA +1 -1
  23. {lightning_sdk-0.1.32.dist-info → lightning_sdk-0.1.34.dist-info}/RECORD +27 -25
  24. {lightning_sdk-0.1.32.dist-info → lightning_sdk-0.1.34.dist-info}/LICENSE +0 -0
  25. {lightning_sdk-0.1.32.dist-info → lightning_sdk-0.1.34.dist-info}/WHEEL +0 -0
  26. {lightning_sdk-0.1.32.dist-info → lightning_sdk-0.1.34.dist-info}/entry_points.txt +0 -0
  27. {lightning_sdk-0.1.32.dist-info → lightning_sdk-0.1.34.dist-info}/top_level.txt +0 -0
@@ -48,6 +48,7 @@ class V1Deployment(object):
48
48
  'id': 'str',
49
49
  'is_published': 'bool',
50
50
  'name': 'str',
51
+ 'parameter_spec': 'V1ParameterizationSpec',
51
52
  'project_id': 'str',
52
53
  'release_id': 'str',
53
54
  'replicas': 'int',
@@ -66,6 +67,7 @@ class V1Deployment(object):
66
67
  'id': 'id',
67
68
  'is_published': 'isPublished',
68
69
  'name': 'name',
70
+ 'parameter_spec': 'parameterSpec',
69
71
  'project_id': 'projectId',
70
72
  'release_id': 'releaseId',
71
73
  'replicas': 'replicas',
@@ -76,7 +78,7 @@ class V1Deployment(object):
76
78
  'user_id': 'userId'
77
79
  }
78
80
 
79
- def __init__(self, autoscaling: 'V1AutoscalingSpec' =None, created_at: 'datetime' =None, desired_state: 'V1DeploymentState' =None, endpoint: 'V1Endpoint' =None, id: 'str' =None, is_published: 'bool' =None, name: 'str' =None, project_id: 'str' =None, release_id: 'str' =None, replicas: 'int' =None, spec: 'V1JobSpec' =None, status: 'V1DeploymentStatus' =None, strategy: 'V1DeploymentStrategy' =None, updated_at: 'datetime' =None, user_id: 'str' =None): # noqa: E501
81
+ def __init__(self, autoscaling: 'V1AutoscalingSpec' =None, created_at: 'datetime' =None, desired_state: 'V1DeploymentState' =None, endpoint: 'V1Endpoint' =None, id: 'str' =None, is_published: 'bool' =None, name: 'str' =None, parameter_spec: 'V1ParameterizationSpec' =None, project_id: 'str' =None, release_id: 'str' =None, replicas: 'int' =None, spec: 'V1JobSpec' =None, status: 'V1DeploymentStatus' =None, strategy: 'V1DeploymentStrategy' =None, updated_at: 'datetime' =None, user_id: 'str' =None): # noqa: E501
80
82
  """V1Deployment - a model defined in Swagger""" # noqa: E501
81
83
  self._autoscaling = None
82
84
  self._created_at = None
@@ -85,6 +87,7 @@ class V1Deployment(object):
85
87
  self._id = None
86
88
  self._is_published = None
87
89
  self._name = None
90
+ self._parameter_spec = None
88
91
  self._project_id = None
89
92
  self._release_id = None
90
93
  self._replicas = None
@@ -108,6 +111,8 @@ class V1Deployment(object):
108
111
  self.is_published = is_published
109
112
  if name is not None:
110
113
  self.name = name
114
+ if parameter_spec is not None:
115
+ self.parameter_spec = parameter_spec
111
116
  if project_id is not None:
112
117
  self.project_id = project_id
113
118
  if release_id is not None:
@@ -272,6 +277,27 @@ class V1Deployment(object):
272
277
 
273
278
  self._name = name
274
279
 
280
+ @property
281
+ def parameter_spec(self) -> 'V1ParameterizationSpec':
282
+ """Gets the parameter_spec of this V1Deployment. # noqa: E501
283
+
284
+
285
+ :return: The parameter_spec of this V1Deployment. # noqa: E501
286
+ :rtype: V1ParameterizationSpec
287
+ """
288
+ return self._parameter_spec
289
+
290
+ @parameter_spec.setter
291
+ def parameter_spec(self, parameter_spec: 'V1ParameterizationSpec'):
292
+ """Sets the parameter_spec of this V1Deployment.
293
+
294
+
295
+ :param parameter_spec: The parameter_spec of this V1Deployment. # noqa: E501
296
+ :type: V1ParameterizationSpec
297
+ """
298
+
299
+ self._parameter_spec = parameter_spec
300
+
275
301
  @property
276
302
  def project_id(self) -> 'str':
277
303
  """Gets the project_id of this V1Deployment. # noqa: E501
@@ -41,6 +41,7 @@ class V1DeploymentTemplateParameter(object):
41
41
  and the value is json key in definition.
42
42
  """
43
43
  swagger_types = {
44
+ 'checkbox': 'V1Checkbox',
44
45
  'data_path': 'V1DataPath',
45
46
  'display_name': 'str',
46
47
  'input': 'V1Input',
@@ -55,6 +56,7 @@ class V1DeploymentTemplateParameter(object):
55
56
  }
56
57
 
57
58
  attribute_map = {
59
+ 'checkbox': 'checkbox',
58
60
  'data_path': 'dataPath',
59
61
  'display_name': 'displayName',
60
62
  'input': 'input',
@@ -68,8 +70,9 @@ class V1DeploymentTemplateParameter(object):
68
70
  'type': 'type'
69
71
  }
70
72
 
71
- def __init__(self, data_path: 'V1DataPath' =None, display_name: 'str' =None, input: 'V1Input' =None, long_description: 'str' =None, name: 'str' =None, placements: 'list[V1DeploymentTemplateParameterPlacement]' =None, readonly: 'bool' =None, required: 'bool' =None, select: 'V1Select' =None, short_description: 'str' =None, type: 'V1DeploymentTemplateParameterType' =None): # noqa: E501
73
+ def __init__(self, checkbox: 'V1Checkbox' =None, data_path: 'V1DataPath' =None, display_name: 'str' =None, input: 'V1Input' =None, long_description: 'str' =None, name: 'str' =None, placements: 'list[V1DeploymentTemplateParameterPlacement]' =None, readonly: 'bool' =None, required: 'bool' =None, select: 'V1Select' =None, short_description: 'str' =None, type: 'V1DeploymentTemplateParameterType' =None): # noqa: E501
72
74
  """V1DeploymentTemplateParameter - a model defined in Swagger""" # noqa: E501
75
+ self._checkbox = None
73
76
  self._data_path = None
74
77
  self._display_name = None
75
78
  self._input = None
@@ -82,6 +85,8 @@ class V1DeploymentTemplateParameter(object):
82
85
  self._short_description = None
83
86
  self._type = None
84
87
  self.discriminator = None
88
+ if checkbox is not None:
89
+ self.checkbox = checkbox
85
90
  if data_path is not None:
86
91
  self.data_path = data_path
87
92
  if display_name is not None:
@@ -105,6 +110,27 @@ class V1DeploymentTemplateParameter(object):
105
110
  if type is not None:
106
111
  self.type = type
107
112
 
113
+ @property
114
+ def checkbox(self) -> 'V1Checkbox':
115
+ """Gets the checkbox of this V1DeploymentTemplateParameter. # noqa: E501
116
+
117
+
118
+ :return: The checkbox of this V1DeploymentTemplateParameter. # noqa: E501
119
+ :rtype: V1Checkbox
120
+ """
121
+ return self._checkbox
122
+
123
+ @checkbox.setter
124
+ def checkbox(self, checkbox: 'V1Checkbox'):
125
+ """Sets the checkbox of this V1DeploymentTemplateParameter.
126
+
127
+
128
+ :param checkbox: The checkbox of this V1DeploymentTemplateParameter. # noqa: E501
129
+ :type: V1Checkbox
130
+ """
131
+
132
+ self._checkbox = checkbox
133
+
108
134
  @property
109
135
  def data_path(self) -> 'V1DataPath':
110
136
  """Gets the data_path of this V1DeploymentTemplateParameter. # noqa: E501
@@ -40,6 +40,7 @@ class V1DeploymentTemplateParameterType(object):
40
40
  SELECT = "DEPLOYMENT_TEMPLATE_SELECT"
41
41
  INPUT = "DEPLOYMENT_TEMPLATE_INPUT"
42
42
  DATA_PATH = "DEPLOYMENT_TEMPLATE_DATA_PATH"
43
+ CHECKBOX = "DEPLOYMENT_TEMPLATE_CHECKBOX"
43
44
  """
44
45
  Attributes:
45
46
  swagger_types (dict): The key is attribute name
@@ -44,7 +44,6 @@ class V1JobSpec(object):
44
44
  'cloudspace_id': 'str',
45
45
  'cluster_id': 'str',
46
46
  'command': 'str',
47
- 'created_symlinks': 'bool',
48
47
  'data_paths': 'list[V1DataPath]',
49
48
  'entrypoint': 'str',
50
49
  'env': 'list[V1EnvVar]',
@@ -69,7 +68,6 @@ class V1JobSpec(object):
69
68
  'cloudspace_id': 'cloudspaceId',
70
69
  'cluster_id': 'clusterId',
71
70
  'command': 'command',
72
- 'created_symlinks': 'createdSymlinks',
73
71
  'data_paths': 'dataPaths',
74
72
  'entrypoint': 'entrypoint',
75
73
  'env': 'env',
@@ -90,12 +88,11 @@ class V1JobSpec(object):
90
88
  'volumes': 'volumes'
91
89
  }
92
90
 
93
- def __init__(self, cloudspace_id: 'str' =None, cluster_id: 'str' =None, command: 'str' =None, created_symlinks: 'bool' =None, data_paths: 'list[V1DataPath]' =None, entrypoint: 'str' =None, env: 'list[V1EnvVar]' =None, image: 'str' =None, image_cluster_credentials: 'bool' =None, image_secret_ref: 'str' =None, include_credentials: 'bool' =None, instance_name: 'str' =None, instance_type: 'str' =None, modified_volume: 'bool' =None, readiness_probe: 'V1JobHealthCheckConfig' =None, resources: 'V1Resources' =None, restart_policy: 'str' =None, run_id: 'str' =None, skip_data_connections_setup: 'bool' =None, skip_filesystem_setup: 'bool' =None, spot: 'bool' =None, volumes: 'list[V1Volume]' =None): # noqa: E501
91
+ def __init__(self, cloudspace_id: 'str' =None, cluster_id: 'str' =None, command: 'str' =None, data_paths: 'list[V1DataPath]' =None, entrypoint: 'str' =None, env: 'list[V1EnvVar]' =None, image: 'str' =None, image_cluster_credentials: 'bool' =None, image_secret_ref: 'str' =None, include_credentials: 'bool' =None, instance_name: 'str' =None, instance_type: 'str' =None, modified_volume: 'bool' =None, readiness_probe: 'V1JobHealthCheckConfig' =None, resources: 'V1Resources' =None, restart_policy: 'str' =None, run_id: 'str' =None, skip_data_connections_setup: 'bool' =None, skip_filesystem_setup: 'bool' =None, spot: 'bool' =None, volumes: 'list[V1Volume]' =None): # noqa: E501
94
92
  """V1JobSpec - a model defined in Swagger""" # noqa: E501
95
93
  self._cloudspace_id = None
96
94
  self._cluster_id = None
97
95
  self._command = None
98
- self._created_symlinks = None
99
96
  self._data_paths = None
100
97
  self._entrypoint = None
101
98
  self._env = None
@@ -121,8 +118,6 @@ class V1JobSpec(object):
121
118
  self.cluster_id = cluster_id
122
119
  if command is not None:
123
120
  self.command = command
124
- if created_symlinks is not None:
125
- self.created_symlinks = created_symlinks
126
121
  if data_paths is not None:
127
122
  self.data_paths = data_paths
128
123
  if entrypoint is not None:
@@ -223,27 +218,6 @@ class V1JobSpec(object):
223
218
 
224
219
  self._command = command
225
220
 
226
- @property
227
- def created_symlinks(self) -> 'bool':
228
- """Gets the created_symlinks of this V1JobSpec. # noqa: E501
229
-
230
-
231
- :return: The created_symlinks of this V1JobSpec. # noqa: E501
232
- :rtype: bool
233
- """
234
- return self._created_symlinks
235
-
236
- @created_symlinks.setter
237
- def created_symlinks(self, created_symlinks: 'bool'):
238
- """Sets the created_symlinks of this V1JobSpec.
239
-
240
-
241
- :param created_symlinks: The created_symlinks of this V1JobSpec. # noqa: E501
242
- :type: bool
243
- """
244
-
245
- self._created_symlinks = created_symlinks
246
-
247
221
  @property
248
222
  def data_paths(self) -> 'list[V1DataPath]':
249
223
  """Gets the data_paths of this V1JobSpec. # noqa: E501
@@ -52,7 +52,6 @@ class V1LightningworkStatus(object):
52
52
  'server_instance_id': 'str',
53
53
  'start_timestamp': 'datetime',
54
54
  'stop_timestamp': 'datetime',
55
- 'symlinks_created': 'bool',
56
55
  'total_cost': 'float',
57
56
  'total_size_bytes': 'str'
58
57
  }
@@ -69,12 +68,11 @@ class V1LightningworkStatus(object):
69
68
  'server_instance_id': 'serverInstanceId',
70
69
  'start_timestamp': 'startTimestamp',
71
70
  'stop_timestamp': 'stopTimestamp',
72
- 'symlinks_created': 'symlinksCreated',
73
71
  'total_cost': 'totalCost',
74
72
  'total_size_bytes': 'totalSizeBytes'
75
73
  }
76
74
 
77
- def __init__(self, ip_address: 'str' =None, last_state_status_transition_timestamp: 'datetime' =None, message: 'str' =None, modified_volume: 'bool' =None, number_of_files: 'str' =None, phase: 'V1LightningworkState' =None, reason: 'V1LightningworkStatusReason' =None, server_id: 'str' =None, server_instance_id: 'str' =None, start_timestamp: 'datetime' =None, stop_timestamp: 'datetime' =None, symlinks_created: 'bool' =None, total_cost: 'float' =None, total_size_bytes: 'str' =None): # noqa: E501
75
+ def __init__(self, ip_address: 'str' =None, last_state_status_transition_timestamp: 'datetime' =None, message: 'str' =None, modified_volume: 'bool' =None, number_of_files: 'str' =None, phase: 'V1LightningworkState' =None, reason: 'V1LightningworkStatusReason' =None, server_id: 'str' =None, server_instance_id: 'str' =None, start_timestamp: 'datetime' =None, stop_timestamp: 'datetime' =None, total_cost: 'float' =None, total_size_bytes: 'str' =None): # noqa: E501
78
76
  """V1LightningworkStatus - a model defined in Swagger""" # noqa: E501
79
77
  self._ip_address = None
80
78
  self._last_state_status_transition_timestamp = None
@@ -87,7 +85,6 @@ class V1LightningworkStatus(object):
87
85
  self._server_instance_id = None
88
86
  self._start_timestamp = None
89
87
  self._stop_timestamp = None
90
- self._symlinks_created = None
91
88
  self._total_cost = None
92
89
  self._total_size_bytes = None
93
90
  self.discriminator = None
@@ -113,8 +110,6 @@ class V1LightningworkStatus(object):
113
110
  self.start_timestamp = start_timestamp
114
111
  if stop_timestamp is not None:
115
112
  self.stop_timestamp = stop_timestamp
116
- if symlinks_created is not None:
117
- self.symlinks_created = symlinks_created
118
113
  if total_cost is not None:
119
114
  self.total_cost = total_cost
120
115
  if total_size_bytes is not None:
@@ -351,27 +346,6 @@ class V1LightningworkStatus(object):
351
346
 
352
347
  self._stop_timestamp = stop_timestamp
353
348
 
354
- @property
355
- def symlinks_created(self) -> 'bool':
356
- """Gets the symlinks_created of this V1LightningworkStatus. # noqa: E501
357
-
358
-
359
- :return: The symlinks_created of this V1LightningworkStatus. # noqa: E501
360
- :rtype: bool
361
- """
362
- return self._symlinks_created
363
-
364
- @symlinks_created.setter
365
- def symlinks_created(self, symlinks_created: 'bool'):
366
- """Sets the symlinks_created of this V1LightningworkStatus.
367
-
368
-
369
- :param symlinks_created: The symlinks_created of this V1LightningworkStatus. # noqa: E501
370
- :type: bool
371
- """
372
-
373
- self._symlinks_created = symlinks_created
374
-
375
349
  @property
376
350
  def total_cost(self) -> 'float':
377
351
  """Gets the total_cost of this V1LightningworkStatus. # noqa: E501
@@ -42,24 +42,29 @@ class V1MetricValue(object):
42
42
  """
43
43
  swagger_types = {
44
44
  'created_at': 'datetime',
45
+ 'internal_step': 'str',
45
46
  'step': 'str',
46
47
  'value': 'float'
47
48
  }
48
49
 
49
50
  attribute_map = {
50
51
  'created_at': 'createdAt',
52
+ 'internal_step': 'internalStep',
51
53
  'step': 'step',
52
54
  'value': 'value'
53
55
  }
54
56
 
55
- def __init__(self, created_at: 'datetime' =None, step: 'str' =None, value: 'float' =None): # noqa: E501
57
+ def __init__(self, created_at: 'datetime' =None, internal_step: 'str' =None, step: 'str' =None, value: 'float' =None): # noqa: E501
56
58
  """V1MetricValue - a model defined in Swagger""" # noqa: E501
57
59
  self._created_at = None
60
+ self._internal_step = None
58
61
  self._step = None
59
62
  self._value = None
60
63
  self.discriminator = None
61
64
  if created_at is not None:
62
65
  self.created_at = created_at
66
+ if internal_step is not None:
67
+ self.internal_step = internal_step
63
68
  if step is not None:
64
69
  self.step = step
65
70
  if value is not None:
@@ -86,6 +91,27 @@ class V1MetricValue(object):
86
91
 
87
92
  self._created_at = created_at
88
93
 
94
+ @property
95
+ def internal_step(self) -> 'str':
96
+ """Gets the internal_step of this V1MetricValue. # noqa: E501
97
+
98
+
99
+ :return: The internal_step of this V1MetricValue. # noqa: E501
100
+ :rtype: str
101
+ """
102
+ return self._internal_step
103
+
104
+ @internal_step.setter
105
+ def internal_step(self, internal_step: 'str'):
106
+ """Sets the internal_step of this V1MetricValue.
107
+
108
+
109
+ :param internal_step: The internal_step of this V1MetricValue. # noqa: E501
110
+ :type: str
111
+ """
112
+
113
+ self._internal_step = internal_step
114
+
89
115
  @property
90
116
  def step(self) -> 'str':
91
117
  """Gets the step of this V1MetricValue. # noqa: E501
@@ -49,11 +49,13 @@ class V1UsageDetails(object):
49
49
  'hourly_price': 'float',
50
50
  'instance_count': 'str',
51
51
  'instance_type': 'str',
52
+ 'read_bytes': 'str',
52
53
  'resource_name': 'str',
53
54
  'saved_cost': 'float',
54
55
  'spot': 'bool',
55
56
  'started_at': 'datetime',
56
- 'user_id': 'str'
57
+ 'user_id': 'str',
58
+ 'written_bytes': 'str'
57
59
  }
58
60
 
59
61
  attribute_map = {
@@ -65,14 +67,16 @@ class V1UsageDetails(object):
65
67
  'hourly_price': 'hourlyPrice',
66
68
  'instance_count': 'instanceCount',
67
69
  'instance_type': 'instanceType',
70
+ 'read_bytes': 'readBytes',
68
71
  'resource_name': 'resourceName',
69
72
  'saved_cost': 'savedCost',
70
73
  'spot': 'spot',
71
74
  'started_at': 'startedAt',
72
- 'user_id': 'userId'
75
+ 'user_id': 'userId',
76
+ 'written_bytes': 'writtenBytes'
73
77
  }
74
78
 
75
- def __init__(self, billed_bytes: 'str' =None, billed_time_seconds: 'str' =None, cost: 'float' =None, ended_at: 'datetime' =None, free: 'bool' =None, hourly_price: 'float' =None, instance_count: 'str' =None, instance_type: 'str' =None, resource_name: 'str' =None, saved_cost: 'float' =None, spot: 'bool' =None, started_at: 'datetime' =None, user_id: 'str' =None): # noqa: E501
79
+ def __init__(self, billed_bytes: 'str' =None, billed_time_seconds: 'str' =None, cost: 'float' =None, ended_at: 'datetime' =None, free: 'bool' =None, hourly_price: 'float' =None, instance_count: 'str' =None, instance_type: 'str' =None, read_bytes: 'str' =None, resource_name: 'str' =None, saved_cost: 'float' =None, spot: 'bool' =None, started_at: 'datetime' =None, user_id: 'str' =None, written_bytes: 'str' =None): # noqa: E501
76
80
  """V1UsageDetails - a model defined in Swagger""" # noqa: E501
77
81
  self._billed_bytes = None
78
82
  self._billed_time_seconds = None
@@ -82,11 +86,13 @@ class V1UsageDetails(object):
82
86
  self._hourly_price = None
83
87
  self._instance_count = None
84
88
  self._instance_type = None
89
+ self._read_bytes = None
85
90
  self._resource_name = None
86
91
  self._saved_cost = None
87
92
  self._spot = None
88
93
  self._started_at = None
89
94
  self._user_id = None
95
+ self._written_bytes = None
90
96
  self.discriminator = None
91
97
  if billed_bytes is not None:
92
98
  self.billed_bytes = billed_bytes
@@ -104,6 +110,8 @@ class V1UsageDetails(object):
104
110
  self.instance_count = instance_count
105
111
  if instance_type is not None:
106
112
  self.instance_type = instance_type
113
+ if read_bytes is not None:
114
+ self.read_bytes = read_bytes
107
115
  if resource_name is not None:
108
116
  self.resource_name = resource_name
109
117
  if saved_cost is not None:
@@ -114,6 +122,8 @@ class V1UsageDetails(object):
114
122
  self.started_at = started_at
115
123
  if user_id is not None:
116
124
  self.user_id = user_id
125
+ if written_bytes is not None:
126
+ self.written_bytes = written_bytes
117
127
 
118
128
  @property
119
129
  def billed_bytes(self) -> 'str':
@@ -283,6 +293,27 @@ class V1UsageDetails(object):
283
293
 
284
294
  self._instance_type = instance_type
285
295
 
296
+ @property
297
+ def read_bytes(self) -> 'str':
298
+ """Gets the read_bytes of this V1UsageDetails. # noqa: E501
299
+
300
+
301
+ :return: The read_bytes of this V1UsageDetails. # noqa: E501
302
+ :rtype: str
303
+ """
304
+ return self._read_bytes
305
+
306
+ @read_bytes.setter
307
+ def read_bytes(self, read_bytes: 'str'):
308
+ """Sets the read_bytes of this V1UsageDetails.
309
+
310
+
311
+ :param read_bytes: The read_bytes of this V1UsageDetails. # noqa: E501
312
+ :type: str
313
+ """
314
+
315
+ self._read_bytes = read_bytes
316
+
286
317
  @property
287
318
  def resource_name(self) -> 'str':
288
319
  """Gets the resource_name of this V1UsageDetails. # noqa: E501
@@ -388,6 +419,27 @@ class V1UsageDetails(object):
388
419
 
389
420
  self._user_id = user_id
390
421
 
422
+ @property
423
+ def written_bytes(self) -> 'str':
424
+ """Gets the written_bytes of this V1UsageDetails. # noqa: E501
425
+
426
+
427
+ :return: The written_bytes of this V1UsageDetails. # noqa: E501
428
+ :rtype: str
429
+ """
430
+ return self._written_bytes
431
+
432
+ @written_bytes.setter
433
+ def written_bytes(self, written_bytes: 'str'):
434
+ """Sets the written_bytes of this V1UsageDetails.
435
+
436
+
437
+ :param written_bytes: The written_bytes of this V1UsageDetails. # noqa: E501
438
+ :type: str
439
+ """
440
+
441
+ self._written_bytes = written_bytes
442
+
391
443
  def to_dict(self) -> dict:
392
444
  """Returns the model properties as a dict"""
393
445
  result = {}
@@ -60,6 +60,7 @@ class V1UserFeatures(object):
60
60
  'custom_app_domain': 'bool',
61
61
  'custom_instance_types': 'bool',
62
62
  'default_one_cluster': 'bool',
63
+ 'deployment_customize_api': 'bool',
63
64
  'deployment_data_path': 'bool',
64
65
  'deployment_gallery': 'bool',
65
66
  'deployment_persistent_disk': 'bool',
@@ -81,6 +82,7 @@ class V1UserFeatures(object):
81
82
  'mmt_strategy_selector': 'bool',
82
83
  'model_store': 'bool',
83
84
  'multiple_deployment_versions': 'bool',
85
+ 'multiple_studio_versions': 'bool',
84
86
  'org_level_member_permissions': 'bool',
85
87
  'plugin_biz_chat': 'bool',
86
88
  'plugin_distributed': 'bool',
@@ -136,6 +138,7 @@ class V1UserFeatures(object):
136
138
  'custom_app_domain': 'customAppDomain',
137
139
  'custom_instance_types': 'customInstanceTypes',
138
140
  'default_one_cluster': 'defaultOneCluster',
141
+ 'deployment_customize_api': 'deploymentCustomizeApi',
139
142
  'deployment_data_path': 'deploymentDataPath',
140
143
  'deployment_gallery': 'deploymentGallery',
141
144
  'deployment_persistent_disk': 'deploymentPersistentDisk',
@@ -157,6 +160,7 @@ class V1UserFeatures(object):
157
160
  'mmt_strategy_selector': 'mmtStrategySelector',
158
161
  'model_store': 'modelStore',
159
162
  'multiple_deployment_versions': 'multipleDeploymentVersions',
163
+ 'multiple_studio_versions': 'multipleStudioVersions',
160
164
  'org_level_member_permissions': 'orgLevelMemberPermissions',
161
165
  'plugin_biz_chat': 'pluginBizChat',
162
166
  'plugin_distributed': 'pluginDistributed',
@@ -192,7 +196,7 @@ class V1UserFeatures(object):
192
196
  'writable_data_connections': 'writableDataConnections'
193
197
  }
194
198
 
195
- def __init__(self, advanced_deployment_autoscaling: 'bool' =None, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, auto_fast_load: 'bool' =None, auto_join_orgs: 'bool' =None, aws_trainium: 'bool' =None, b2c_experience: 'bool' =None, cap_add: 'list[str]' =None, cap_drop: 'list[str]' =None, capacity_reservation: 'bool' =None, capacity_reservation_dry_run: 'bool' =None, cluster_proxy: 'bool' =None, code_tab: 'bool' =None, collab_screen_sharing: 'bool' =None, cost_attribution_settings: 'bool' =None, crypto_monitoring: 'bool' =None, custom_app_domain: 'bool' =None, custom_instance_types: 'bool' =None, default_one_cluster: 'bool' =None, deployment_data_path: 'bool' =None, deployment_gallery: 'bool' =None, deployment_persistent_disk: 'bool' =None, docs_agent: 'bool' =None, drive_v2: 'bool' =None, enable_crypto_crackdown: 'bool' =None, enable_efs: 'bool' =None, enable_storage_limits: 'bool' =None, featured_studios_admin: 'bool' =None, filesystem_optimisation: 'bool' =None, gcp: 'bool' =None, inference_job_deployment_plugin: 'bool' =None, jobs_init: 'bool' =None, jobs_v2: 'bool' =None, landing_studios: 'bool' =None, lit_logger: 'bool' =None, lit_logger_storage_v2: 'bool' =None, mmt_fault_tolerance: 'bool' =None, mmt_strategy_selector: 'bool' =None, model_store: 'bool' =None, multiple_deployment_versions: 'bool' =None, org_level_member_permissions: 'bool' =None, plugin_biz_chat: 'bool' =None, plugin_distributed: 'bool' =None, plugin_fiftyone: 'bool' =None, plugin_inference: 'bool' =None, plugin_label_studio: 'bool' =None, plugin_langflow: 'bool' =None, plugin_lightning_apps: 'bool' =None, plugin_lightning_apps_distributed: 'bool' =None, plugin_mage_ai: 'bool' =None, plugin_milvus: 'bool' =None, plugin_python_profiler: 'bool' =None, plugin_react: 'bool' =None, plugin_service: 'bool' =None, plugin_sweeps: 'bool' =None, plugin_weviate: 'bool' =None, pricing_updates: 'bool' =None, product_generator: 'bool' =None, project_selector: 'bool' =None, restart_ide_on_hang: 'bool' =None, restartable_jobs: 'bool' =None, runnable_public_studio_page: 'bool' =None, s3_folders: 'bool' =None, show_dev_admin: 'bool' =None, slurm: 'bool' =None, slurm_machine_selector: 'bool' =None, snowflake_connection: 'bool' =None, spot_v2: 'bool' =None, studio_config: 'bool' =None, studio_on_stop: 'bool' =None, teamspace_storage_tab: 'bool' =None, use_rclone_mounts_only: 'bool' =None, writable_data_connections: 'bool' =None): # noqa: E501
199
+ def __init__(self, advanced_deployment_autoscaling: 'bool' =None, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, auto_fast_load: 'bool' =None, auto_join_orgs: 'bool' =None, aws_trainium: 'bool' =None, b2c_experience: 'bool' =None, cap_add: 'list[str]' =None, cap_drop: 'list[str]' =None, capacity_reservation: 'bool' =None, capacity_reservation_dry_run: 'bool' =None, cluster_proxy: 'bool' =None, code_tab: 'bool' =None, collab_screen_sharing: 'bool' =None, cost_attribution_settings: 'bool' =None, crypto_monitoring: 'bool' =None, custom_app_domain: 'bool' =None, custom_instance_types: 'bool' =None, default_one_cluster: 'bool' =None, deployment_customize_api: 'bool' =None, deployment_data_path: 'bool' =None, deployment_gallery: 'bool' =None, deployment_persistent_disk: 'bool' =None, docs_agent: 'bool' =None, drive_v2: 'bool' =None, enable_crypto_crackdown: 'bool' =None, enable_efs: 'bool' =None, enable_storage_limits: 'bool' =None, featured_studios_admin: 'bool' =None, filesystem_optimisation: 'bool' =None, gcp: 'bool' =None, inference_job_deployment_plugin: 'bool' =None, jobs_init: 'bool' =None, jobs_v2: 'bool' =None, landing_studios: 'bool' =None, lit_logger: 'bool' =None, lit_logger_storage_v2: 'bool' =None, mmt_fault_tolerance: 'bool' =None, mmt_strategy_selector: 'bool' =None, model_store: 'bool' =None, multiple_deployment_versions: 'bool' =None, multiple_studio_versions: 'bool' =None, org_level_member_permissions: 'bool' =None, plugin_biz_chat: 'bool' =None, plugin_distributed: 'bool' =None, plugin_fiftyone: 'bool' =None, plugin_inference: 'bool' =None, plugin_label_studio: 'bool' =None, plugin_langflow: 'bool' =None, plugin_lightning_apps: 'bool' =None, plugin_lightning_apps_distributed: 'bool' =None, plugin_mage_ai: 'bool' =None, plugin_milvus: 'bool' =None, plugin_python_profiler: 'bool' =None, plugin_react: 'bool' =None, plugin_service: 'bool' =None, plugin_sweeps: 'bool' =None, plugin_weviate: 'bool' =None, pricing_updates: 'bool' =None, product_generator: 'bool' =None, project_selector: 'bool' =None, restart_ide_on_hang: 'bool' =None, restartable_jobs: 'bool' =None, runnable_public_studio_page: 'bool' =None, s3_folders: 'bool' =None, show_dev_admin: 'bool' =None, slurm: 'bool' =None, slurm_machine_selector: 'bool' =None, snowflake_connection: 'bool' =None, spot_v2: 'bool' =None, studio_config: 'bool' =None, studio_on_stop: 'bool' =None, teamspace_storage_tab: 'bool' =None, use_rclone_mounts_only: 'bool' =None, writable_data_connections: 'bool' =None): # noqa: E501
196
200
  """V1UserFeatures - a model defined in Swagger""" # noqa: E501
197
201
  self._advanced_deployment_autoscaling = None
198
202
  self._affiliate_links = None
@@ -213,6 +217,7 @@ class V1UserFeatures(object):
213
217
  self._custom_app_domain = None
214
218
  self._custom_instance_types = None
215
219
  self._default_one_cluster = None
220
+ self._deployment_customize_api = None
216
221
  self._deployment_data_path = None
217
222
  self._deployment_gallery = None
218
223
  self._deployment_persistent_disk = None
@@ -234,6 +239,7 @@ class V1UserFeatures(object):
234
239
  self._mmt_strategy_selector = None
235
240
  self._model_store = None
236
241
  self._multiple_deployment_versions = None
242
+ self._multiple_studio_versions = None
237
243
  self._org_level_member_permissions = None
238
244
  self._plugin_biz_chat = None
239
245
  self._plugin_distributed = None
@@ -306,6 +312,8 @@ class V1UserFeatures(object):
306
312
  self.custom_instance_types = custom_instance_types
307
313
  if default_one_cluster is not None:
308
314
  self.default_one_cluster = default_one_cluster
315
+ if deployment_customize_api is not None:
316
+ self.deployment_customize_api = deployment_customize_api
309
317
  if deployment_data_path is not None:
310
318
  self.deployment_data_path = deployment_data_path
311
319
  if deployment_gallery is not None:
@@ -348,6 +356,8 @@ class V1UserFeatures(object):
348
356
  self.model_store = model_store
349
357
  if multiple_deployment_versions is not None:
350
358
  self.multiple_deployment_versions = multiple_deployment_versions
359
+ if multiple_studio_versions is not None:
360
+ self.multiple_studio_versions = multiple_studio_versions
351
361
  if org_level_member_permissions is not None:
352
362
  self.org_level_member_permissions = org_level_member_permissions
353
363
  if plugin_biz_chat is not None:
@@ -814,6 +824,27 @@ class V1UserFeatures(object):
814
824
 
815
825
  self._default_one_cluster = default_one_cluster
816
826
 
827
+ @property
828
+ def deployment_customize_api(self) -> 'bool':
829
+ """Gets the deployment_customize_api of this V1UserFeatures. # noqa: E501
830
+
831
+
832
+ :return: The deployment_customize_api of this V1UserFeatures. # noqa: E501
833
+ :rtype: bool
834
+ """
835
+ return self._deployment_customize_api
836
+
837
+ @deployment_customize_api.setter
838
+ def deployment_customize_api(self, deployment_customize_api: 'bool'):
839
+ """Sets the deployment_customize_api of this V1UserFeatures.
840
+
841
+
842
+ :param deployment_customize_api: The deployment_customize_api of this V1UserFeatures. # noqa: E501
843
+ :type: bool
844
+ """
845
+
846
+ self._deployment_customize_api = deployment_customize_api
847
+
817
848
  @property
818
849
  def deployment_data_path(self) -> 'bool':
819
850
  """Gets the deployment_data_path of this V1UserFeatures. # noqa: E501
@@ -1255,6 +1286,27 @@ class V1UserFeatures(object):
1255
1286
 
1256
1287
  self._multiple_deployment_versions = multiple_deployment_versions
1257
1288
 
1289
+ @property
1290
+ def multiple_studio_versions(self) -> 'bool':
1291
+ """Gets the multiple_studio_versions of this V1UserFeatures. # noqa: E501
1292
+
1293
+
1294
+ :return: The multiple_studio_versions of this V1UserFeatures. # noqa: E501
1295
+ :rtype: bool
1296
+ """
1297
+ return self._multiple_studio_versions
1298
+
1299
+ @multiple_studio_versions.setter
1300
+ def multiple_studio_versions(self, multiple_studio_versions: 'bool'):
1301
+ """Sets the multiple_studio_versions of this V1UserFeatures.
1302
+
1303
+
1304
+ :param multiple_studio_versions: The multiple_studio_versions of this V1UserFeatures. # noqa: E501
1305
+ :type: bool
1306
+ """
1307
+
1308
+ self._multiple_studio_versions = multiple_studio_versions
1309
+
1258
1310
  @property
1259
1311
  def org_level_member_permissions(self) -> 'bool':
1260
1312
  """Gets the org_level_member_permissions of this V1UserFeatures. # noqa: E501
lightning_sdk/studio.py CHANGED
@@ -3,6 +3,7 @@ import warnings
3
3
  from typing import TYPE_CHECKING, Any, Mapping, Optional, Tuple, Union
4
4
 
5
5
  from lightning_sdk.api.studio_api import StudioApi
6
+ from lightning_sdk.api.utils import _machine_to_compute_name
6
7
  from lightning_sdk.constants import _LIGHTNING_DEBUG
7
8
  from lightning_sdk.machine import Machine
8
9
  from lightning_sdk.organization import Organization
@@ -145,14 +146,14 @@ class Studio:
145
146
  """Returns the cluster the Studio is running on."""
146
147
  return self._studio.cluster_id
147
148
 
148
- def start(self, machine: Machine = Machine.CPU, interruptible: bool = False) -> None:
149
+ def start(self, machine: Union[Machine, str] = Machine.CPU, interruptible: bool = False) -> None:
149
150
  """Starts a Studio on the specified machine type (default: CPU-4)."""
150
151
  status = self.status
151
152
  if status == Status.Running:
152
- curr_machine = self.machine
153
- if curr_machine != machine:
153
+ curr_machine = _machine_to_compute_name(self.machine) if self.machine is not None else None
154
+ if curr_machine != _machine_to_compute_name(machine):
154
155
  raise RuntimeError(
155
- f"Requested to start studio on {machine}, but studio is already running on {curr_machine}."
156
+ f"Requested to start studio on {machine}, but studio is already running on {self.machine}."
156
157
  " Consider switching instead!"
157
158
  )
158
159
  _logger.info(f"Studio {self.name} is already running")
@@ -180,7 +181,7 @@ class Studio:
180
181
  kwargs = self._studio_api.duplicate_studio(self._studio.id, self._teamspace.id, self._teamspace.id)
181
182
  return Studio(**kwargs)
182
183
 
183
- def switch_machine(self, machine: Machine, interruptible: bool = False) -> None:
184
+ def switch_machine(self, machine: Union[Machine, str], interruptible: bool = False) -> None:
184
185
  """Switches machine to the provided machine type/.
185
186
 
186
187
  Args:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lightning_sdk
3
- Version: 0.1.32
3
+ Version: 0.1.34
4
4
  Summary: SDK to develop using Lightning AI Studios
5
5
  Author-email: Lightning-AI <justus@lightning.ai>
6
6
  License: MIT License