lightning-sdk 2025.10.31__py3-none-any.whl → 2025.11.13__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 (53) hide show
  1. lightning_sdk/__init__.py +6 -6
  2. lightning_sdk/__version__.py +3 -0
  3. lightning_sdk/agents.py +2 -1
  4. lightning_sdk/ai_hub.py +2 -1
  5. lightning_sdk/api/cloud_account_api.py +2 -2
  6. lightning_sdk/api/deployment_api.py +11 -1
  7. lightning_sdk/api/utils.py +58 -1
  8. lightning_sdk/cli/legacy/deploy/serve.py +16 -2
  9. lightning_sdk/cli/studio/__init__.py +2 -0
  10. lightning_sdk/cli/studio/cp.py +138 -0
  11. lightning_sdk/cli/utils/logging.py +2 -1
  12. lightning_sdk/cli/utils/studio_selection.py +3 -3
  13. lightning_sdk/deployment/__init__.py +2 -0
  14. lightning_sdk/deployment/deployment.py +33 -5
  15. lightning_sdk/helpers.py +1 -1
  16. lightning_sdk/job/base.py +2 -1
  17. lightning_sdk/job/job.py +7 -1
  18. lightning_sdk/lightning_cloud/openapi/__init__.py +5 -2
  19. lightning_sdk/lightning_cloud/openapi/api/__init__.py +1 -0
  20. lightning_sdk/lightning_cloud/openapi/api/incidents_service_api.py +1058 -0
  21. lightning_sdk/lightning_cloud/openapi/api/k8_s_cluster_service_api.py +415 -1508
  22. lightning_sdk/lightning_cloud/openapi/api/storage_service_api.py +105 -0
  23. lightning_sdk/lightning_cloud/openapi/models/__init__.py +4 -2
  24. lightning_sdk/lightning_cloud/openapi/models/{project_id_kubernetestemplates_body.py → cluster_id_kubernetestemplates_body.py} +23 -49
  25. lightning_sdk/lightning_cloud/openapi/models/incident_id_messages_body.py +3 -29
  26. lightning_sdk/lightning_cloud/openapi/models/kubernetestemplates_id_body.py +1 -27
  27. lightning_sdk/lightning_cloud/openapi/models/messages_message_id_body.py +3 -29
  28. lightning_sdk/lightning_cloud/openapi/models/storagetransfers_validate_body.py +149 -0
  29. lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_specialized_view.py +1 -1
  30. lightning_sdk/lightning_cloud/openapi/models/v1_cluster_metrics.py +287 -1
  31. lightning_sdk/lightning_cloud/openapi/models/{project_id_incidents_body.py → v1_create_incident_request.py} +61 -35
  32. lightning_sdk/lightning_cloud/openapi/models/v1_get_user_response.py +27 -1
  33. lightning_sdk/lightning_cloud/openapi/models/v1_kubernetes_template.py +1 -27
  34. lightning_sdk/lightning_cloud/openapi/models/v1_update_user_request.py +27 -1
  35. lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +27 -53
  36. lightning_sdk/lightning_cloud/openapi/models/v1_validate_storage_transfer_response.py +123 -0
  37. lightning_sdk/lit_container.py +9 -0
  38. lightning_sdk/machine.py +8 -0
  39. lightning_sdk/mmt/mmt.py +8 -4
  40. lightning_sdk/models.py +8 -0
  41. lightning_sdk/owner.py +2 -1
  42. lightning_sdk/pipeline/pipeline.py +3 -0
  43. lightning_sdk/plugin.py +2 -1
  44. lightning_sdk/serve.py +3 -1
  45. lightning_sdk/studio.py +10 -5
  46. lightning_sdk/teamspace.py +17 -1
  47. lightning_sdk/utils/logging.py +8 -1
  48. {lightning_sdk-2025.10.31.dist-info → lightning_sdk-2025.11.13.dist-info}/METADATA +1 -1
  49. {lightning_sdk-2025.10.31.dist-info → lightning_sdk-2025.11.13.dist-info}/RECORD +53 -48
  50. {lightning_sdk-2025.10.31.dist-info → lightning_sdk-2025.11.13.dist-info}/LICENSE +0 -0
  51. {lightning_sdk-2025.10.31.dist-info → lightning_sdk-2025.11.13.dist-info}/WHEEL +0 -0
  52. {lightning_sdk-2025.10.31.dist-info → lightning_sdk-2025.11.13.dist-info}/entry_points.txt +0 -0
  53. {lightning_sdk-2025.10.31.dist-info → lightning_sdk-2025.11.13.dist-info}/top_level.txt +0 -0
@@ -47,6 +47,7 @@ class V1GetUserResponse(object):
47
47
  'auto_replenish_amount': 'float',
48
48
  'auto_replenish_threshold': 'float',
49
49
  'country': 'str',
50
+ 'disable_shell_persistence': 'bool',
50
51
  'email': 'str',
51
52
  'experimentation_id': 'str',
52
53
  'features': 'V1UserFeatures',
@@ -91,6 +92,7 @@ class V1GetUserResponse(object):
91
92
  'auto_replenish_amount': 'autoReplenishAmount',
92
93
  'auto_replenish_threshold': 'autoReplenishThreshold',
93
94
  'country': 'country',
95
+ 'disable_shell_persistence': 'disableShellPersistence',
94
96
  'email': 'email',
95
97
  'experimentation_id': 'experimentationId',
96
98
  'features': 'features',
@@ -128,7 +130,7 @@ class V1GetUserResponse(object):
128
130
  'website': 'website'
129
131
  }
130
132
 
131
- def __init__(self, agree_to_terms_and_conditions: 'bool' =None, allow_credits_auto_replenish: 'bool' =None, api_key: 'str' =None, auto_replenish_amount: 'float' =None, auto_replenish_threshold: 'float' =None, country: 'str' =None, email: 'str' =None, experimentation_id: 'str' =None, features: 'V1UserFeatures' =None, first_name: 'str' =None, general_audience_mode: 'bool' =None, id: 'str' =None, internal_blog_admin: 'bool' =None, internal_docs_admin: 'bool' =None, invite_code: 'str' =None, is_internal: 'bool' =None, last_name: 'str' =None, linux_username: 'str' =None, non_developer_mode: 'bool' =None, opted_in_marketing_emails: 'bool' =None, organization: 'str' =None, organizations: 'list[V1Organization]' =None, phone_number: 'str' =None, picture_url: 'str' =None, preferred_color_scheme: 'str' =None, preferred_ide: 'str' =None, preferred_shell: 'str' =None, preferred_vscode_marketplace: 'str' =None, role: 'str' =None, saw_create_first_project_dialog: 'bool' =None, saw_forums_login_merge_dialog: 'bool' =None, saw_free_credits_notification: 'bool' =None, sb: 'bool' =None, status: 'Externalv1UserStatus' =None, storage_bytes: 'str' =None, storage_overuse_deletion_at: 'datetime' =None, test_user: 'bool' =None, user_metadata: 'str' =None, username: 'str' =None, waitlisted: 'bool' =None, website: 'str' =None): # noqa: E501
133
+ def __init__(self, agree_to_terms_and_conditions: 'bool' =None, allow_credits_auto_replenish: 'bool' =None, api_key: 'str' =None, auto_replenish_amount: 'float' =None, auto_replenish_threshold: 'float' =None, country: 'str' =None, disable_shell_persistence: 'bool' =None, email: 'str' =None, experimentation_id: 'str' =None, features: 'V1UserFeatures' =None, first_name: 'str' =None, general_audience_mode: 'bool' =None, id: 'str' =None, internal_blog_admin: 'bool' =None, internal_docs_admin: 'bool' =None, invite_code: 'str' =None, is_internal: 'bool' =None, last_name: 'str' =None, linux_username: 'str' =None, non_developer_mode: 'bool' =None, opted_in_marketing_emails: 'bool' =None, organization: 'str' =None, organizations: 'list[V1Organization]' =None, phone_number: 'str' =None, picture_url: 'str' =None, preferred_color_scheme: 'str' =None, preferred_ide: 'str' =None, preferred_shell: 'str' =None, preferred_vscode_marketplace: 'str' =None, role: 'str' =None, saw_create_first_project_dialog: 'bool' =None, saw_forums_login_merge_dialog: 'bool' =None, saw_free_credits_notification: 'bool' =None, sb: 'bool' =None, status: 'Externalv1UserStatus' =None, storage_bytes: 'str' =None, storage_overuse_deletion_at: 'datetime' =None, test_user: 'bool' =None, user_metadata: 'str' =None, username: 'str' =None, waitlisted: 'bool' =None, website: 'str' =None): # noqa: E501
132
134
  """V1GetUserResponse - a model defined in Swagger""" # noqa: E501
133
135
  self._agree_to_terms_and_conditions = None
134
136
  self._allow_credits_auto_replenish = None
@@ -136,6 +138,7 @@ class V1GetUserResponse(object):
136
138
  self._auto_replenish_amount = None
137
139
  self._auto_replenish_threshold = None
138
140
  self._country = None
141
+ self._disable_shell_persistence = None
139
142
  self._email = None
140
143
  self._experimentation_id = None
141
144
  self._features = None
@@ -184,6 +187,8 @@ class V1GetUserResponse(object):
184
187
  self.auto_replenish_threshold = auto_replenish_threshold
185
188
  if country is not None:
186
189
  self.country = country
190
+ if disable_shell_persistence is not None:
191
+ self.disable_shell_persistence = disable_shell_persistence
187
192
  if email is not None:
188
193
  self.email = email
189
194
  if experimentation_id is not None:
@@ -381,6 +386,27 @@ class V1GetUserResponse(object):
381
386
 
382
387
  self._country = country
383
388
 
389
+ @property
390
+ def disable_shell_persistence(self) -> 'bool':
391
+ """Gets the disable_shell_persistence of this V1GetUserResponse. # noqa: E501
392
+
393
+
394
+ :return: The disable_shell_persistence of this V1GetUserResponse. # noqa: E501
395
+ :rtype: bool
396
+ """
397
+ return self._disable_shell_persistence
398
+
399
+ @disable_shell_persistence.setter
400
+ def disable_shell_persistence(self, disable_shell_persistence: 'bool'):
401
+ """Sets the disable_shell_persistence of this V1GetUserResponse.
402
+
403
+
404
+ :param disable_shell_persistence: The disable_shell_persistence of this V1GetUserResponse. # noqa: E501
405
+ :type: bool
406
+ """
407
+
408
+ self._disable_shell_persistence = disable_shell_persistence
409
+
384
410
  @property
385
411
  def email(self) -> 'str':
386
412
  """Gets the email of this V1GetUserResponse. # noqa: E501
@@ -46,7 +46,6 @@ class V1KubernetesTemplate(object):
46
46
  'description': 'str',
47
47
  'id': 'str',
48
48
  'name': 'str',
49
- 'project_id': 'str',
50
49
  'properties': 'list[V1KubernetesTemplateProperty]',
51
50
  'spec': 'str',
52
51
  'updated_at': 'datetime',
@@ -60,7 +59,6 @@ class V1KubernetesTemplate(object):
60
59
  'description': 'description',
61
60
  'id': 'id',
62
61
  'name': 'name',
63
- 'project_id': 'projectId',
64
62
  'properties': 'properties',
65
63
  'spec': 'spec',
66
64
  'updated_at': 'updatedAt',
@@ -68,14 +66,13 @@ class V1KubernetesTemplate(object):
68
66
  'version': 'version'
69
67
  }
70
68
 
71
- def __init__(self, cluster_id: 'str' =None, created_at: 'datetime' =None, description: 'str' =None, id: 'str' =None, name: 'str' =None, project_id: 'str' =None, properties: 'list[V1KubernetesTemplateProperty]' =None, spec: 'str' =None, updated_at: 'datetime' =None, user_id: 'str' =None, version: 'str' =None): # noqa: E501
69
+ def __init__(self, cluster_id: 'str' =None, created_at: 'datetime' =None, description: 'str' =None, id: 'str' =None, name: 'str' =None, properties: 'list[V1KubernetesTemplateProperty]' =None, spec: 'str' =None, updated_at: 'datetime' =None, user_id: 'str' =None, version: 'str' =None): # noqa: E501
72
70
  """V1KubernetesTemplate - a model defined in Swagger""" # noqa: E501
73
71
  self._cluster_id = None
74
72
  self._created_at = None
75
73
  self._description = None
76
74
  self._id = None
77
75
  self._name = None
78
- self._project_id = None
79
76
  self._properties = None
80
77
  self._spec = None
81
78
  self._updated_at = None
@@ -92,8 +89,6 @@ class V1KubernetesTemplate(object):
92
89
  self.id = id
93
90
  if name is not None:
94
91
  self.name = name
95
- if project_id is not None:
96
- self.project_id = project_id
97
92
  if properties is not None:
98
93
  self.properties = properties
99
94
  if spec is not None:
@@ -210,27 +205,6 @@ class V1KubernetesTemplate(object):
210
205
 
211
206
  self._name = name
212
207
 
213
- @property
214
- def project_id(self) -> 'str':
215
- """Gets the project_id of this V1KubernetesTemplate. # noqa: E501
216
-
217
-
218
- :return: The project_id of this V1KubernetesTemplate. # noqa: E501
219
- :rtype: str
220
- """
221
- return self._project_id
222
-
223
- @project_id.setter
224
- def project_id(self, project_id: 'str'):
225
- """Sets the project_id of this V1KubernetesTemplate.
226
-
227
-
228
- :param project_id: The project_id of this V1KubernetesTemplate. # noqa: E501
229
- :type: str
230
- """
231
-
232
- self._project_id = project_id
233
-
234
208
  @property
235
209
  def properties(self) -> 'list[V1KubernetesTemplateProperty]':
236
210
  """Gets the properties of this V1KubernetesTemplate. # noqa: E501
@@ -48,6 +48,7 @@ class V1UpdateUserRequest(object):
48
48
  'complete_sign_up': 'bool',
49
49
  'completed_project_onboarding': 'bool',
50
50
  'country': 'str',
51
+ 'disable_shell_persistence': 'bool',
51
52
  'email': 'str',
52
53
  'experimentation_id': 'str',
53
54
  'first_name': 'str',
@@ -78,6 +79,7 @@ class V1UpdateUserRequest(object):
78
79
  'complete_sign_up': 'completeSignUp',
79
80
  'completed_project_onboarding': 'completedProjectOnboarding',
80
81
  'country': 'country',
82
+ 'disable_shell_persistence': 'disableShellPersistence',
81
83
  'email': 'email',
82
84
  'experimentation_id': 'experimentationId',
83
85
  'first_name': 'firstName',
@@ -100,7 +102,7 @@ class V1UpdateUserRequest(object):
100
102
  'website': 'website'
101
103
  }
102
104
 
103
- def __init__(self, agree_to_terms_and_conditions: 'bool' =None, allow_credits_auto_replenish: 'bool' =None, auto_replenish_amount: 'float' =None, auto_replenish_threshold: 'float' =None, complete_sign_up: 'bool' =None, completed_project_onboarding: 'bool' =None, country: 'str' =None, email: 'str' =None, experimentation_id: 'str' =None, first_name: 'str' =None, general_audience_mode: 'bool' =None, last_name: 'str' =None, linux_username: 'str' =None, non_developer_mode: 'bool' =None, opted_in_marketing_emails: 'bool' =None, organization: 'str' =None, preferred_color_scheme: 'str' =None, preferred_ide: 'str' =None, preferred_shell: 'str' =None, preferred_vscode_marketplace: 'str' =None, role: 'str' =None, saw_create_first_project_dialog: 'bool' =None, saw_forums_login_merge_dialog: 'bool' =None, saw_free_credits_notification: 'bool' =None, user_metadata: 'str' =None, username: 'str' =None, website: 'str' =None): # noqa: E501
105
+ def __init__(self, agree_to_terms_and_conditions: 'bool' =None, allow_credits_auto_replenish: 'bool' =None, auto_replenish_amount: 'float' =None, auto_replenish_threshold: 'float' =None, complete_sign_up: 'bool' =None, completed_project_onboarding: 'bool' =None, country: 'str' =None, disable_shell_persistence: 'bool' =None, email: 'str' =None, experimentation_id: 'str' =None, first_name: 'str' =None, general_audience_mode: 'bool' =None, last_name: 'str' =None, linux_username: 'str' =None, non_developer_mode: 'bool' =None, opted_in_marketing_emails: 'bool' =None, organization: 'str' =None, preferred_color_scheme: 'str' =None, preferred_ide: 'str' =None, preferred_shell: 'str' =None, preferred_vscode_marketplace: 'str' =None, role: 'str' =None, saw_create_first_project_dialog: 'bool' =None, saw_forums_login_merge_dialog: 'bool' =None, saw_free_credits_notification: 'bool' =None, user_metadata: 'str' =None, username: 'str' =None, website: 'str' =None): # noqa: E501
104
106
  """V1UpdateUserRequest - a model defined in Swagger""" # noqa: E501
105
107
  self._agree_to_terms_and_conditions = None
106
108
  self._allow_credits_auto_replenish = None
@@ -109,6 +111,7 @@ class V1UpdateUserRequest(object):
109
111
  self._complete_sign_up = None
110
112
  self._completed_project_onboarding = None
111
113
  self._country = None
114
+ self._disable_shell_persistence = None
112
115
  self._email = None
113
116
  self._experimentation_id = None
114
117
  self._first_name = None
@@ -144,6 +147,8 @@ class V1UpdateUserRequest(object):
144
147
  self.completed_project_onboarding = completed_project_onboarding
145
148
  if country is not None:
146
149
  self.country = country
150
+ if disable_shell_persistence is not None:
151
+ self.disable_shell_persistence = disable_shell_persistence
147
152
  if email is not None:
148
153
  self.email = email
149
154
  if experimentation_id is not None:
@@ -332,6 +337,27 @@ class V1UpdateUserRequest(object):
332
337
 
333
338
  self._country = country
334
339
 
340
+ @property
341
+ def disable_shell_persistence(self) -> 'bool':
342
+ """Gets the disable_shell_persistence of this V1UpdateUserRequest. # noqa: E501
343
+
344
+
345
+ :return: The disable_shell_persistence of this V1UpdateUserRequest. # noqa: E501
346
+ :rtype: bool
347
+ """
348
+ return self._disable_shell_persistence
349
+
350
+ @disable_shell_persistence.setter
351
+ def disable_shell_persistence(self, disable_shell_persistence: 'bool'):
352
+ """Sets the disable_shell_persistence of this V1UpdateUserRequest.
353
+
354
+
355
+ :param disable_shell_persistence: The disable_shell_persistence of this V1UpdateUserRequest. # noqa: E501
356
+ :type: bool
357
+ """
358
+
359
+ self._disable_shell_persistence = disable_shell_persistence
360
+
335
361
  @property
336
362
  def email(self) -> 'str':
337
363
  """Gets the email of this V1UpdateUserRequest. # noqa: E501
@@ -63,7 +63,6 @@ class V1UserFeatures(object):
63
63
  'enterprise_compute_admin': 'bool',
64
64
  'f234': 'bool',
65
65
  'f236': 'bool',
66
- 'f239': 'bool',
67
66
  'f240': 'bool',
68
67
  'f241': 'bool',
69
68
  'f243': 'bool',
@@ -73,7 +72,6 @@ class V1UserFeatures(object):
73
72
  'f252': 'bool',
74
73
  'f253': 'bool',
75
74
  'f254': 'bool',
76
- 'f255': 'bool',
77
75
  'f258': 'bool',
78
76
  'f259': 'bool',
79
77
  'f261': 'bool',
@@ -86,6 +84,7 @@ class V1UserFeatures(object):
86
84
  'f271': 'bool',
87
85
  'f272': 'bool',
88
86
  'f273': 'bool',
87
+ 'f274': 'bool',
89
88
  'fair_share': 'bool',
90
89
  'featured_studios_admin': 'bool',
91
90
  'job_artifacts_v2': 'bool',
@@ -150,7 +149,6 @@ class V1UserFeatures(object):
150
149
  'enterprise_compute_admin': 'enterpriseComputeAdmin',
151
150
  'f234': 'f234',
152
151
  'f236': 'f236',
153
- 'f239': 'f239',
154
152
  'f240': 'f240',
155
153
  'f241': 'f241',
156
154
  'f243': 'f243',
@@ -160,7 +158,6 @@ class V1UserFeatures(object):
160
158
  'f252': 'f252',
161
159
  'f253': 'f253',
162
160
  'f254': 'f254',
163
- 'f255': 'f255',
164
161
  'f258': 'f258',
165
162
  'f259': 'f259',
166
163
  'f261': 'f261',
@@ -173,6 +170,7 @@ class V1UserFeatures(object):
173
170
  'f271': 'f271',
174
171
  'f272': 'f272',
175
172
  'f273': 'f273',
173
+ 'f274': 'f274',
176
174
  'fair_share': 'fairShare',
177
175
  'featured_studios_admin': 'featuredStudiosAdmin',
178
176
  'job_artifacts_v2': 'jobArtifactsV2',
@@ -214,7 +212,7 @@ class V1UserFeatures(object):
214
212
  'writable_s3_connections': 'writableS3Connections'
215
213
  }
216
214
 
217
- def __init__(self, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, ai_hub_monetization: 'bool' =None, auto_fast_load: 'bool' =None, b2c_experience: 'bool' =None, byo_machine_type: 'bool' =None, cap_add: 'list[str]' =None, cap_drop: 'list[str]' =None, capacity_reservation_byoc: 'bool' =None, capacity_reservation_dry_run: 'bool' =None, chat_models: 'bool' =None, cloudspace_schedules: 'bool' =None, code_tab: 'bool' =None, collab_screen_sharing: 'bool' =None, control_center_monitoring: 'bool' =None, cost_attribution_settings: 'bool' =None, datasets: 'bool' =None, default_one_cluster: 'bool' =None, drive_v2: 'bool' =None, enterprise_compute_admin: 'bool' =None, f234: 'bool' =None, f236: 'bool' =None, f239: 'bool' =None, f240: 'bool' =None, f241: 'bool' =None, f243: 'bool' =None, f245: 'bool' =None, f247: 'bool' =None, f250: 'bool' =None, f252: 'bool' =None, f253: 'bool' =None, f254: 'bool' =None, f255: 'bool' =None, f258: 'bool' =None, f259: 'bool' =None, f261: 'bool' =None, f262: 'bool' =None, f265: 'bool' =None, f266: 'bool' =None, f268: 'bool' =None, f269: 'bool' =None, f270: 'bool' =None, f271: 'bool' =None, f272: 'bool' =None, f273: 'bool' =None, fair_share: 'bool' =None, featured_studios_admin: 'bool' =None, job_artifacts_v2: 'bool' =None, kubernetes_cluster_ui: 'bool' =None, kubernetes_clusters: 'bool' =None, landing_studios: 'bool' =None, lit_logger: 'bool' =None, marketplace: 'bool' =None, mmt_fault_tolerance: 'bool' =None, mmt_strategy_selector: 'bool' =None, multiple_studio_versions: 'bool' =None, nerf_fs_nonpaying: 'bool' =None, org_level_member_permissions: 'bool' =None, org_usage_limits: 'bool' =None, persistent_disk: 'bool' =None, plugin_distributed: 'bool' =None, plugin_inference: 'bool' =None, plugin_label_studio: 'bool' =None, plugin_langflow: 'bool' =None, plugin_python_profiler: 'bool' =None, plugin_sweeps: 'bool' =None, pricing_updates: 'bool' =None, product_generator: 'bool' =None, product_license: 'bool' =None, project_selector: 'bool' =None, publish_pipelines: 'bool' =None, reserved_machines_tab: 'bool' =None, restartable_jobs: 'bool' =None, runnable_public_studio_page: 'bool' =None, security_docs: 'bool' =None, show_dev_admin: 'bool' =None, slurm: 'bool' =None, specialised_studios: 'bool' =None, storage_overuse_deletion: 'bool' =None, studio_config: 'bool' =None, studio_version_visibility: 'bool' =None, vultr: 'bool' =None, weka: 'bool' =None, writable_s3_connections: 'bool' =None): # noqa: E501
215
+ def __init__(self, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, ai_hub_monetization: 'bool' =None, auto_fast_load: 'bool' =None, b2c_experience: 'bool' =None, byo_machine_type: 'bool' =None, cap_add: 'list[str]' =None, cap_drop: 'list[str]' =None, capacity_reservation_byoc: 'bool' =None, capacity_reservation_dry_run: 'bool' =None, chat_models: 'bool' =None, cloudspace_schedules: 'bool' =None, code_tab: 'bool' =None, collab_screen_sharing: 'bool' =None, control_center_monitoring: 'bool' =None, cost_attribution_settings: 'bool' =None, datasets: 'bool' =None, default_one_cluster: 'bool' =None, drive_v2: 'bool' =None, enterprise_compute_admin: 'bool' =None, f234: 'bool' =None, f236: 'bool' =None, f240: 'bool' =None, f241: 'bool' =None, f243: 'bool' =None, f245: 'bool' =None, f247: 'bool' =None, f250: 'bool' =None, f252: 'bool' =None, f253: 'bool' =None, f254: 'bool' =None, f258: 'bool' =None, f259: 'bool' =None, f261: 'bool' =None, f262: 'bool' =None, f265: 'bool' =None, f266: 'bool' =None, f268: 'bool' =None, f269: 'bool' =None, f270: 'bool' =None, f271: 'bool' =None, f272: 'bool' =None, f273: 'bool' =None, f274: 'bool' =None, fair_share: 'bool' =None, featured_studios_admin: 'bool' =None, job_artifacts_v2: 'bool' =None, kubernetes_cluster_ui: 'bool' =None, kubernetes_clusters: 'bool' =None, landing_studios: 'bool' =None, lit_logger: 'bool' =None, marketplace: 'bool' =None, mmt_fault_tolerance: 'bool' =None, mmt_strategy_selector: 'bool' =None, multiple_studio_versions: 'bool' =None, nerf_fs_nonpaying: 'bool' =None, org_level_member_permissions: 'bool' =None, org_usage_limits: 'bool' =None, persistent_disk: 'bool' =None, plugin_distributed: 'bool' =None, plugin_inference: 'bool' =None, plugin_label_studio: 'bool' =None, plugin_langflow: 'bool' =None, plugin_python_profiler: 'bool' =None, plugin_sweeps: 'bool' =None, pricing_updates: 'bool' =None, product_generator: 'bool' =None, product_license: 'bool' =None, project_selector: 'bool' =None, publish_pipelines: 'bool' =None, reserved_machines_tab: 'bool' =None, restartable_jobs: 'bool' =None, runnable_public_studio_page: 'bool' =None, security_docs: 'bool' =None, show_dev_admin: 'bool' =None, slurm: 'bool' =None, specialised_studios: 'bool' =None, storage_overuse_deletion: 'bool' =None, studio_config: 'bool' =None, studio_version_visibility: 'bool' =None, vultr: 'bool' =None, weka: 'bool' =None, writable_s3_connections: 'bool' =None): # noqa: E501
218
216
  """V1UserFeatures - a model defined in Swagger""" # noqa: E501
219
217
  self._affiliate_links = None
220
218
  self._agents_v2 = None
@@ -238,7 +236,6 @@ class V1UserFeatures(object):
238
236
  self._enterprise_compute_admin = None
239
237
  self._f234 = None
240
238
  self._f236 = None
241
- self._f239 = None
242
239
  self._f240 = None
243
240
  self._f241 = None
244
241
  self._f243 = None
@@ -248,7 +245,6 @@ class V1UserFeatures(object):
248
245
  self._f252 = None
249
246
  self._f253 = None
250
247
  self._f254 = None
251
- self._f255 = None
252
248
  self._f258 = None
253
249
  self._f259 = None
254
250
  self._f261 = None
@@ -261,6 +257,7 @@ class V1UserFeatures(object):
261
257
  self._f271 = None
262
258
  self._f272 = None
263
259
  self._f273 = None
260
+ self._f274 = None
264
261
  self._fair_share = None
265
262
  self._featured_studios_admin = None
266
263
  self._job_artifacts_v2 = None
@@ -345,8 +342,6 @@ class V1UserFeatures(object):
345
342
  self.f234 = f234
346
343
  if f236 is not None:
347
344
  self.f236 = f236
348
- if f239 is not None:
349
- self.f239 = f239
350
345
  if f240 is not None:
351
346
  self.f240 = f240
352
347
  if f241 is not None:
@@ -365,8 +360,6 @@ class V1UserFeatures(object):
365
360
  self.f253 = f253
366
361
  if f254 is not None:
367
362
  self.f254 = f254
368
- if f255 is not None:
369
- self.f255 = f255
370
363
  if f258 is not None:
371
364
  self.f258 = f258
372
365
  if f259 is not None:
@@ -391,6 +384,8 @@ class V1UserFeatures(object):
391
384
  self.f272 = f272
392
385
  if f273 is not None:
393
386
  self.f273 = f273
387
+ if f274 is not None:
388
+ self.f274 = f274
394
389
  if fair_share is not None:
395
390
  self.fair_share = fair_share
396
391
  if featured_studios_admin is not None:
@@ -932,27 +927,6 @@ class V1UserFeatures(object):
932
927
 
933
928
  self._f236 = f236
934
929
 
935
- @property
936
- def f239(self) -> 'bool':
937
- """Gets the f239 of this V1UserFeatures. # noqa: E501
938
-
939
-
940
- :return: The f239 of this V1UserFeatures. # noqa: E501
941
- :rtype: bool
942
- """
943
- return self._f239
944
-
945
- @f239.setter
946
- def f239(self, f239: 'bool'):
947
- """Sets the f239 of this V1UserFeatures.
948
-
949
-
950
- :param f239: The f239 of this V1UserFeatures. # noqa: E501
951
- :type: bool
952
- """
953
-
954
- self._f239 = f239
955
-
956
930
  @property
957
931
  def f240(self) -> 'bool':
958
932
  """Gets the f240 of this V1UserFeatures. # noqa: E501
@@ -1142,27 +1116,6 @@ class V1UserFeatures(object):
1142
1116
 
1143
1117
  self._f254 = f254
1144
1118
 
1145
- @property
1146
- def f255(self) -> 'bool':
1147
- """Gets the f255 of this V1UserFeatures. # noqa: E501
1148
-
1149
-
1150
- :return: The f255 of this V1UserFeatures. # noqa: E501
1151
- :rtype: bool
1152
- """
1153
- return self._f255
1154
-
1155
- @f255.setter
1156
- def f255(self, f255: 'bool'):
1157
- """Sets the f255 of this V1UserFeatures.
1158
-
1159
-
1160
- :param f255: The f255 of this V1UserFeatures. # noqa: E501
1161
- :type: bool
1162
- """
1163
-
1164
- self._f255 = f255
1165
-
1166
1119
  @property
1167
1120
  def f258(self) -> 'bool':
1168
1121
  """Gets the f258 of this V1UserFeatures. # noqa: E501
@@ -1415,6 +1368,27 @@ class V1UserFeatures(object):
1415
1368
 
1416
1369
  self._f273 = f273
1417
1370
 
1371
+ @property
1372
+ def f274(self) -> 'bool':
1373
+ """Gets the f274 of this V1UserFeatures. # noqa: E501
1374
+
1375
+
1376
+ :return: The f274 of this V1UserFeatures. # noqa: E501
1377
+ :rtype: bool
1378
+ """
1379
+ return self._f274
1380
+
1381
+ @f274.setter
1382
+ def f274(self, f274: 'bool'):
1383
+ """Sets the f274 of this V1UserFeatures.
1384
+
1385
+
1386
+ :param f274: The f274 of this V1UserFeatures. # noqa: E501
1387
+ :type: bool
1388
+ """
1389
+
1390
+ self._f274 = f274
1391
+
1418
1392
  @property
1419
1393
  def fair_share(self) -> 'bool':
1420
1394
  """Gets the fair_share of this V1UserFeatures. # noqa: E501
@@ -0,0 +1,123 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ external/v1/auth_service.proto
5
+
6
+ No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7
+
8
+ OpenAPI spec version: version not set
9
+
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+
12
+ NOTE
13
+ ----
14
+ standard swagger-codegen-cli for this python client has been modified
15
+ by custom templates. The purpose of these templates is to include
16
+ typing information in the API and Model code. Please refer to the
17
+ main grid repository for more info
18
+ """
19
+
20
+ import pprint
21
+ import re # noqa: F401
22
+
23
+ from typing import TYPE_CHECKING
24
+
25
+ import six
26
+
27
+ if TYPE_CHECKING:
28
+ from datetime import datetime
29
+ from lightning_sdk.lightning_cloud.openapi.models import *
30
+
31
+ class V1ValidateStorageTransferResponse(object):
32
+ """NOTE: This class is auto generated by the swagger code generator program.
33
+
34
+ Do not edit the class manually.
35
+ """
36
+ """
37
+ Attributes:
38
+ swagger_types (dict): The key is attribute name
39
+ and the value is attribute type.
40
+ attribute_map (dict): The key is attribute name
41
+ and the value is json key in definition.
42
+ """
43
+ swagger_types = {
44
+ 'valid_perms': 'bool'
45
+ }
46
+
47
+ attribute_map = {
48
+ 'valid_perms': 'validPerms'
49
+ }
50
+
51
+ def __init__(self, valid_perms: 'bool' =None): # noqa: E501
52
+ """V1ValidateStorageTransferResponse - a model defined in Swagger""" # noqa: E501
53
+ self._valid_perms = None
54
+ self.discriminator = None
55
+ if valid_perms is not None:
56
+ self.valid_perms = valid_perms
57
+
58
+ @property
59
+ def valid_perms(self) -> 'bool':
60
+ """Gets the valid_perms of this V1ValidateStorageTransferResponse. # noqa: E501
61
+
62
+
63
+ :return: The valid_perms of this V1ValidateStorageTransferResponse. # noqa: E501
64
+ :rtype: bool
65
+ """
66
+ return self._valid_perms
67
+
68
+ @valid_perms.setter
69
+ def valid_perms(self, valid_perms: 'bool'):
70
+ """Sets the valid_perms of this V1ValidateStorageTransferResponse.
71
+
72
+
73
+ :param valid_perms: The valid_perms of this V1ValidateStorageTransferResponse. # noqa: E501
74
+ :type: bool
75
+ """
76
+
77
+ self._valid_perms = valid_perms
78
+
79
+ def to_dict(self) -> dict:
80
+ """Returns the model properties as a dict"""
81
+ result = {}
82
+
83
+ for attr, _ in six.iteritems(self.swagger_types):
84
+ value = getattr(self, attr)
85
+ if isinstance(value, list):
86
+ result[attr] = list(map(
87
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
88
+ value
89
+ ))
90
+ elif hasattr(value, "to_dict"):
91
+ result[attr] = value.to_dict()
92
+ elif isinstance(value, dict):
93
+ result[attr] = dict(map(
94
+ lambda item: (item[0], item[1].to_dict())
95
+ if hasattr(item[1], "to_dict") else item,
96
+ value.items()
97
+ ))
98
+ else:
99
+ result[attr] = value
100
+ if issubclass(V1ValidateStorageTransferResponse, dict):
101
+ for key, value in self.items():
102
+ result[key] = value
103
+
104
+ return result
105
+
106
+ def to_str(self) -> str:
107
+ """Returns the string representation of the model"""
108
+ return pprint.pformat(self.to_dict())
109
+
110
+ def __repr__(self) -> str:
111
+ """For `print` and `pprint`"""
112
+ return self.to_str()
113
+
114
+ def __eq__(self, other: 'V1ValidateStorageTransferResponse') -> bool:
115
+ """Returns true if both objects are equal"""
116
+ if not isinstance(other, V1ValidateStorageTransferResponse):
117
+ return False
118
+
119
+ return self.__dict__ == other.__dict__
120
+
121
+ def __ne__(self, other: 'V1ValidateStorageTransferResponse') -> bool:
122
+ """Returns true if both objects are not equal"""
123
+ return not self == other
@@ -4,6 +4,7 @@ from typing import Dict, List, Optional
4
4
  from rich.console import Console
5
5
 
6
6
  from lightning_sdk.api.lit_container_api import LitContainerApi
7
+ from lightning_sdk.api.utils import AccessibleResource, raise_access_error_if_not_allowed
7
8
  from lightning_sdk.utils.resolve import _resolve_teamspace
8
9
 
9
10
 
@@ -31,6 +32,8 @@ class LitContainer:
31
32
  except Exception:
32
33
  console.print(f"[bold red]Could not resolve teamspace: {teamspace}[/bold red]")
33
34
  return []
35
+
36
+ raise_access_error_if_not_allowed(AccessibleResource.Containers, teamspace.id)
34
37
  project_id = teamspace.id
35
38
  repositories = self._api.list_containers(project_id, cloud_account=cloud_account)
36
39
  table = []
@@ -68,6 +71,8 @@ class LitContainer:
68
71
  teamspace = _resolve_teamspace(teamspace=teamspace, org=org, user=user)
69
72
  except Exception as e:
70
73
  raise ValueError("Could not resolve teamspace") from e
74
+
75
+ raise_access_error_if_not_allowed(AccessibleResource.Containers, teamspace.id)
71
76
  project_id = teamspace.id
72
77
  return self._api.delete_container(project_id, container)
73
78
 
@@ -99,6 +104,8 @@ class LitContainer:
99
104
  except Exception as e:
100
105
  raise ValueError(f"Could not resolve teamspace: {e}") from e
101
106
 
107
+ raise_access_error_if_not_allowed(AccessibleResource.Containers, teamspace.id)
108
+
102
109
  resp = self._api.upload_container(
103
110
  container, teamspace, tag, cloud_account, platform=platform, return_final_dict=return_final_dict
104
111
  )
@@ -134,4 +141,6 @@ class LitContainer:
134
141
  except Exception as e:
135
142
  raise ValueError(f"Could not resolve teamspace: {e}") from e
136
143
 
144
+ raise_access_error_if_not_allowed(AccessibleResource.Containers, teamspace.id)
145
+
137
146
  return self._api.download_container(container, teamspace, tag, cloud_account)
lightning_sdk/machine.py CHANGED
@@ -16,6 +16,14 @@ class CloudProvider(Enum):
16
16
  """Converts the CloudProvider to a str."""
17
17
  return self.value
18
18
 
19
+ @classmethod
20
+ def from_str(cls, provider: str) -> "CloudProvider":
21
+ """Converts a string to a CloudProvider enum member."""
22
+ for cp in cls:
23
+ if cp.value.lower() == provider.lower():
24
+ return cp
25
+ raise ValueError(f"Unknown CloudProvider: {provider}")
26
+
19
27
 
20
28
  @dataclass(frozen=True)
21
29
  class Machine:
lightning_sdk/mmt/mmt.py CHANGED
@@ -1,10 +1,11 @@
1
1
  from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union
2
2
 
3
3
  from lightning_sdk.api.cloud_account_api import CloudAccountApi
4
+ from lightning_sdk.api.utils import AccessibleResource, raise_access_error_if_not_allowed
4
5
  from lightning_sdk.mmt.base import MMTMachine, _BaseMMT
5
6
  from lightning_sdk.mmt.v1 import _MMTV1
6
7
  from lightning_sdk.mmt.v2 import _MMTV2
7
- from lightning_sdk.utils.resolve import _setup_logger
8
+ from lightning_sdk.utils.resolve import _resolve_teamspace, _setup_logger
8
9
 
9
10
  if TYPE_CHECKING:
10
11
  from lightning_sdk.machine import CloudProvider, Machine
@@ -20,9 +21,9 @@ _logger = _setup_logger(__name__)
20
21
  class MMT(_BaseMMT):
21
22
  """Class to submit and manage multi-machine jobs on the Lightning AI Platform."""
22
23
 
23
- _force_v1: (
24
- bool
25
- ) = False # required for studio plugin still working correctly as v2 currently does not support the studio env
24
+ _force_v1: bool = (
25
+ False # required for studio plugin still working correctly as v2 currently does not support the studio env
26
+ )
26
27
 
27
28
  def __init__(
28
29
  self,
@@ -42,6 +43,9 @@ class MMT(_BaseMMT):
42
43
  user: the name of the user owning the :param`teamspace`
43
44
  in case it is owned directly by a user instead of an org.
44
45
  """
46
+ teamspace = _resolve_teamspace(teamspace=teamspace, org=org, user=user)
47
+ raise_access_error_if_not_allowed(AccessibleResource.Jobs, teamspace_id=teamspace.id)
48
+
45
49
  from lightning_sdk.lightning_cloud.openapi.rest import ApiException
46
50
 
47
51
  if not self._force_v1:
lightning_sdk/models.py CHANGED
@@ -4,6 +4,7 @@ from pathlib import Path
4
4
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
5
5
 
6
6
  from lightning_sdk.api import OrgApi, TeamspaceApi, UserApi
7
+ from lightning_sdk.api.utils import AccessibleResource, raise_access_error_if_not_allowed
7
8
  from lightning_sdk.lightning_cloud.openapi import V1ModelVersionArchive
8
9
  from lightning_sdk.lightning_cloud.openapi.models import V1Membership, V1OwnerType
9
10
  from lightning_sdk.lightning_cloud.openapi.rest import ApiException
@@ -121,6 +122,10 @@ def download_model(
121
122
  """
122
123
  name = _extend_model_name_with_teamspace(name)
123
124
  teamspace_owner_name, teamspace_name, model_name, version = _parse_org_teamspace_model_version(name)
125
+
126
+ teamspace = _get_teamspace(name=teamspace_name, organization=teamspace_owner_name)
127
+ raise_access_error_if_not_allowed(AccessibleResource.Models, teamspace.id)
128
+
124
129
  api = TeamspaceApi()
125
130
 
126
131
  try:
@@ -162,6 +167,7 @@ def upload_model(
162
167
  name = _extend_model_name_with_teamspace(name)
163
168
  org_name, teamspace_name, model_name, version = _parse_org_teamspace_model_version(name)
164
169
  teamspace = _get_teamspace(name=teamspace_name, organization=org_name)
170
+ raise_access_error_if_not_allowed(AccessibleResource.Models, teamspace.id)
165
171
  return teamspace.upload_model(
166
172
  path=path,
167
173
  name=model_name,
@@ -185,6 +191,7 @@ def delete_model(
185
191
  name = _extend_model_name_with_teamspace(name)
186
192
  org_name, teamspace_name, model_name, version = _parse_org_teamspace_model_version(name)
187
193
  teamspace = _get_teamspace(name=teamspace_name, organization=org_name)
194
+ raise_access_error_if_not_allowed(AccessibleResource.Models, teamspace.id)
188
195
  teamspace.delete_model(name=f"{model_name}:{version}" if version else model_name)
189
196
 
190
197
 
@@ -200,4 +207,5 @@ def list_model_versions(
200
207
  name = _extend_model_name_with_teamspace(name)
201
208
  org_name, teamspace_name, model_name, _ = _parse_org_teamspace_model_version(name)
202
209
  teamspace = _get_teamspace(name=teamspace_name, organization=org_name)
210
+ raise_access_error_if_not_allowed(AccessibleResource.Models, teamspace.id)
203
211
  return teamspace.list_model_versions(name=model_name)