lightning-sdk 0.1.46__py3-none-any.whl → 0.1.48__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.
- lightning_sdk/__init__.py +1 -1
- lightning_sdk/api/job_api.py +37 -6
- lightning_sdk/api/lit_container_api.py +19 -0
- lightning_sdk/api/mmt_api.py +18 -1
- lightning_sdk/api/teamspace_api.py +19 -1
- lightning_sdk/api/utils.py +1 -1
- lightning_sdk/cli/delete.py +58 -0
- lightning_sdk/cli/entrypoint.py +8 -0
- lightning_sdk/cli/inspect.py +31 -0
- lightning_sdk/cli/job_and_mmt_action.py +37 -0
- lightning_sdk/cli/jobs_menu.py +57 -0
- lightning_sdk/cli/list.py +54 -0
- lightning_sdk/cli/mmts_menu.py +57 -0
- lightning_sdk/cli/run.py +12 -0
- lightning_sdk/cli/stop.py +37 -0
- lightning_sdk/cli/teamspace_menu.py +94 -0
- lightning_sdk/job/base.py +70 -2
- lightning_sdk/job/job.py +59 -9
- lightning_sdk/job/v1.py +28 -0
- lightning_sdk/job/v2.py +40 -4
- lightning_sdk/job/work.py +10 -1
- lightning_sdk/lightning_cloud/openapi/__init__.py +3 -0
- lightning_sdk/lightning_cloud/openapi/api/lit_registry_service_api.py +202 -0
- lightning_sdk/lightning_cloud/openapi/api/models_store_api.py +250 -8
- lightning_sdk/lightning_cloud/openapi/models/__init__.py +3 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_aws_direct_v1.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_delete_lit_repository_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_api.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_state.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_google_cloud_direct_v1.py +29 -27
- lightning_sdk/lightning_cloud/openapi/models/v1_job.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_model.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_resource_visibility.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +27 -53
- lightning_sdk/lightning_cloud/openapi/models/v1_vultr_direct_v1.py +55 -3
- lightning_sdk/lightning_cloud/openapi/models/version_default_body.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/versions_version_body.py +123 -0
- lightning_sdk/lightning_cloud/utils/data_connection.py +1 -1
- lightning_sdk/lit_container.py +57 -0
- lightning_sdk/machine.py +4 -0
- lightning_sdk/mmt/base.py +39 -1
- lightning_sdk/mmt/mmt.py +59 -14
- lightning_sdk/mmt/v1.py +30 -2
- lightning_sdk/mmt/v2.py +31 -2
- lightning_sdk/status.py +11 -7
- lightning_sdk/teamspace.py +51 -1
- {lightning_sdk-0.1.46.dist-info → lightning_sdk-0.1.48.dist-info}/METADATA +1 -1
- {lightning_sdk-0.1.46.dist-info → lightning_sdk-0.1.48.dist-info}/RECORD +52 -39
- {lightning_sdk-0.1.46.dist-info → lightning_sdk-0.1.48.dist-info}/LICENSE +0 -0
- {lightning_sdk-0.1.46.dist-info → lightning_sdk-0.1.48.dist-info}/WHEEL +0 -0
- {lightning_sdk-0.1.46.dist-info → lightning_sdk-0.1.48.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-0.1.46.dist-info → lightning_sdk-0.1.48.dist-info}/top_level.txt +0 -0
|
@@ -52,7 +52,6 @@ class V1UserFeatures(object):
|
|
|
52
52
|
'cap_drop': 'list[str]',
|
|
53
53
|
'capacity_reservation_byoc': 'bool',
|
|
54
54
|
'capacity_reservation_dry_run': 'bool',
|
|
55
|
-
'cluster_proxy': 'bool',
|
|
56
55
|
'code_tab': 'bool',
|
|
57
56
|
'collab_screen_sharing': 'bool',
|
|
58
57
|
'cost_attribution_settings': 'bool',
|
|
@@ -66,7 +65,6 @@ class V1UserFeatures(object):
|
|
|
66
65
|
'deployment_version_visibility': 'bool',
|
|
67
66
|
'docs_agent': 'bool',
|
|
68
67
|
'drive_v2': 'bool',
|
|
69
|
-
'dynamic_workload_scheduling': 'bool',
|
|
70
68
|
'enable_crypto_crackdown': 'bool',
|
|
71
69
|
'enable_efs': 'bool',
|
|
72
70
|
'enable_storage_limits': 'bool',
|
|
@@ -88,6 +86,7 @@ class V1UserFeatures(object):
|
|
|
88
86
|
'multiple_deployment_versions': 'bool',
|
|
89
87
|
'multiple_studio_versions': 'bool',
|
|
90
88
|
'org_level_member_permissions': 'bool',
|
|
89
|
+
'pipelines': 'bool',
|
|
91
90
|
'plugin_biz_chat': 'bool',
|
|
92
91
|
'plugin_distributed': 'bool',
|
|
93
92
|
'plugin_fiftyone': 'bool',
|
|
@@ -136,7 +135,6 @@ class V1UserFeatures(object):
|
|
|
136
135
|
'cap_drop': 'capDrop',
|
|
137
136
|
'capacity_reservation_byoc': 'capacityReservationByoc',
|
|
138
137
|
'capacity_reservation_dry_run': 'capacityReservationDryRun',
|
|
139
|
-
'cluster_proxy': 'clusterProxy',
|
|
140
138
|
'code_tab': 'codeTab',
|
|
141
139
|
'collab_screen_sharing': 'collabScreenSharing',
|
|
142
140
|
'cost_attribution_settings': 'costAttributionSettings',
|
|
@@ -150,7 +148,6 @@ class V1UserFeatures(object):
|
|
|
150
148
|
'deployment_version_visibility': 'deploymentVersionVisibility',
|
|
151
149
|
'docs_agent': 'docsAgent',
|
|
152
150
|
'drive_v2': 'driveV2',
|
|
153
|
-
'dynamic_workload_scheduling': 'dynamicWorkloadScheduling',
|
|
154
151
|
'enable_crypto_crackdown': 'enableCryptoCrackdown',
|
|
155
152
|
'enable_efs': 'enableEfs',
|
|
156
153
|
'enable_storage_limits': 'enableStorageLimits',
|
|
@@ -172,6 +169,7 @@ class V1UserFeatures(object):
|
|
|
172
169
|
'multiple_deployment_versions': 'multipleDeploymentVersions',
|
|
173
170
|
'multiple_studio_versions': 'multipleStudioVersions',
|
|
174
171
|
'org_level_member_permissions': 'orgLevelMemberPermissions',
|
|
172
|
+
'pipelines': 'pipelines',
|
|
175
173
|
'plugin_biz_chat': 'pluginBizChat',
|
|
176
174
|
'plugin_distributed': 'pluginDistributed',
|
|
177
175
|
'plugin_fiftyone': 'pluginFiftyone',
|
|
@@ -208,7 +206,7 @@ class V1UserFeatures(object):
|
|
|
208
206
|
'writable_data_connections': 'writableDataConnections'
|
|
209
207
|
}
|
|
210
208
|
|
|
211
|
-
def __init__(self, advanced_deployment_autoscaling: 'bool' =None, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, ai_hub_monetization: 'bool' =None, auto_fast_load: 'bool' =None, auto_join_orgs: 'bool' =None, b2c_experience: 'bool' =None, cap_add: 'list[str]' =None, cap_drop: 'list[str]' =None, capacity_reservation_byoc: 'bool' =None, capacity_reservation_dry_run: 'bool' =None,
|
|
209
|
+
def __init__(self, advanced_deployment_autoscaling: 'bool' =None, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, ai_hub_monetization: 'bool' =None, auto_fast_load: 'bool' =None, auto_join_orgs: 'bool' =None, b2c_experience: 'bool' =None, cap_add: 'list[str]' =None, cap_drop: 'list[str]' =None, capacity_reservation_byoc: 'bool' =None, capacity_reservation_dry_run: 'bool' =None, code_tab: 'bool' =None, collab_screen_sharing: 'bool' =None, cost_attribution_settings: '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, deployment_version_visibility: '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, instant_capacity_reservation: 'bool' =None, jobs_init: 'bool' =None, jobs_v2: 'bool' =None, landing_studios: 'bool' =None, lightning_registry: 'bool' =None, lit_logger: 'bool' =None, lit_logger_storage_v2: 'bool' =None, mmt_fault_tolerance: 'bool' =None, mmt_strategy_selector: 'bool' =None, mmt_v2: 'bool' =None, model_store: 'bool' =None, multiple_deployment_versions: 'bool' =None, multiple_studio_versions: 'bool' =None, org_level_member_permissions: 'bool' =None, pipelines: '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, show_dev_admin: 'bool' =None, slurm: 'bool' =None, slurm_machine_selector: 'bool' =None, snapshotter_service: 'bool' =None, snowflake_connection: 'bool' =None, spot_v2: 'bool' =None, studio_config: 'bool' =None, studio_on_stop: 'bool' =None, studio_version_visibility: 'bool' =None, teamspace_storage_tab: 'bool' =None, trainium2: 'bool' =None, use_rclone_mounts_only: 'bool' =None, writable_data_connections: 'bool' =None): # noqa: E501
|
|
212
210
|
"""V1UserFeatures - a model defined in Swagger""" # noqa: E501
|
|
213
211
|
self._advanced_deployment_autoscaling = None
|
|
214
212
|
self._affiliate_links = None
|
|
@@ -221,7 +219,6 @@ class V1UserFeatures(object):
|
|
|
221
219
|
self._cap_drop = None
|
|
222
220
|
self._capacity_reservation_byoc = None
|
|
223
221
|
self._capacity_reservation_dry_run = None
|
|
224
|
-
self._cluster_proxy = None
|
|
225
222
|
self._code_tab = None
|
|
226
223
|
self._collab_screen_sharing = None
|
|
227
224
|
self._cost_attribution_settings = None
|
|
@@ -235,7 +232,6 @@ class V1UserFeatures(object):
|
|
|
235
232
|
self._deployment_version_visibility = None
|
|
236
233
|
self._docs_agent = None
|
|
237
234
|
self._drive_v2 = None
|
|
238
|
-
self._dynamic_workload_scheduling = None
|
|
239
235
|
self._enable_crypto_crackdown = None
|
|
240
236
|
self._enable_efs = None
|
|
241
237
|
self._enable_storage_limits = None
|
|
@@ -257,6 +253,7 @@ class V1UserFeatures(object):
|
|
|
257
253
|
self._multiple_deployment_versions = None
|
|
258
254
|
self._multiple_studio_versions = None
|
|
259
255
|
self._org_level_member_permissions = None
|
|
256
|
+
self._pipelines = None
|
|
260
257
|
self._plugin_biz_chat = None
|
|
261
258
|
self._plugin_distributed = None
|
|
262
259
|
self._plugin_fiftyone = None
|
|
@@ -314,8 +311,6 @@ class V1UserFeatures(object):
|
|
|
314
311
|
self.capacity_reservation_byoc = capacity_reservation_byoc
|
|
315
312
|
if capacity_reservation_dry_run is not None:
|
|
316
313
|
self.capacity_reservation_dry_run = capacity_reservation_dry_run
|
|
317
|
-
if cluster_proxy is not None:
|
|
318
|
-
self.cluster_proxy = cluster_proxy
|
|
319
314
|
if code_tab is not None:
|
|
320
315
|
self.code_tab = code_tab
|
|
321
316
|
if collab_screen_sharing is not None:
|
|
@@ -342,8 +337,6 @@ class V1UserFeatures(object):
|
|
|
342
337
|
self.docs_agent = docs_agent
|
|
343
338
|
if drive_v2 is not None:
|
|
344
339
|
self.drive_v2 = drive_v2
|
|
345
|
-
if dynamic_workload_scheduling is not None:
|
|
346
|
-
self.dynamic_workload_scheduling = dynamic_workload_scheduling
|
|
347
340
|
if enable_crypto_crackdown is not None:
|
|
348
341
|
self.enable_crypto_crackdown = enable_crypto_crackdown
|
|
349
342
|
if enable_efs is not None:
|
|
@@ -386,6 +379,8 @@ class V1UserFeatures(object):
|
|
|
386
379
|
self.multiple_studio_versions = multiple_studio_versions
|
|
387
380
|
if org_level_member_permissions is not None:
|
|
388
381
|
self.org_level_member_permissions = org_level_member_permissions
|
|
382
|
+
if pipelines is not None:
|
|
383
|
+
self.pipelines = pipelines
|
|
389
384
|
if plugin_biz_chat is not None:
|
|
390
385
|
self.plugin_biz_chat = plugin_biz_chat
|
|
391
386
|
if plugin_distributed is not None:
|
|
@@ -686,27 +681,6 @@ class V1UserFeatures(object):
|
|
|
686
681
|
|
|
687
682
|
self._capacity_reservation_dry_run = capacity_reservation_dry_run
|
|
688
683
|
|
|
689
|
-
@property
|
|
690
|
-
def cluster_proxy(self) -> 'bool':
|
|
691
|
-
"""Gets the cluster_proxy of this V1UserFeatures. # noqa: E501
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
:return: The cluster_proxy of this V1UserFeatures. # noqa: E501
|
|
695
|
-
:rtype: bool
|
|
696
|
-
"""
|
|
697
|
-
return self._cluster_proxy
|
|
698
|
-
|
|
699
|
-
@cluster_proxy.setter
|
|
700
|
-
def cluster_proxy(self, cluster_proxy: 'bool'):
|
|
701
|
-
"""Sets the cluster_proxy of this V1UserFeatures.
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
:param cluster_proxy: The cluster_proxy of this V1UserFeatures. # noqa: E501
|
|
705
|
-
:type: bool
|
|
706
|
-
"""
|
|
707
|
-
|
|
708
|
-
self._cluster_proxy = cluster_proxy
|
|
709
|
-
|
|
710
684
|
@property
|
|
711
685
|
def code_tab(self) -> 'bool':
|
|
712
686
|
"""Gets the code_tab of this V1UserFeatures. # noqa: E501
|
|
@@ -980,27 +954,6 @@ class V1UserFeatures(object):
|
|
|
980
954
|
|
|
981
955
|
self._drive_v2 = drive_v2
|
|
982
956
|
|
|
983
|
-
@property
|
|
984
|
-
def dynamic_workload_scheduling(self) -> 'bool':
|
|
985
|
-
"""Gets the dynamic_workload_scheduling of this V1UserFeatures. # noqa: E501
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
:return: The dynamic_workload_scheduling of this V1UserFeatures. # noqa: E501
|
|
989
|
-
:rtype: bool
|
|
990
|
-
"""
|
|
991
|
-
return self._dynamic_workload_scheduling
|
|
992
|
-
|
|
993
|
-
@dynamic_workload_scheduling.setter
|
|
994
|
-
def dynamic_workload_scheduling(self, dynamic_workload_scheduling: 'bool'):
|
|
995
|
-
"""Sets the dynamic_workload_scheduling of this V1UserFeatures.
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
:param dynamic_workload_scheduling: The dynamic_workload_scheduling of this V1UserFeatures. # noqa: E501
|
|
999
|
-
:type: bool
|
|
1000
|
-
"""
|
|
1001
|
-
|
|
1002
|
-
self._dynamic_workload_scheduling = dynamic_workload_scheduling
|
|
1003
|
-
|
|
1004
957
|
@property
|
|
1005
958
|
def enable_crypto_crackdown(self) -> 'bool':
|
|
1006
959
|
"""Gets the enable_crypto_crackdown of this V1UserFeatures. # noqa: E501
|
|
@@ -1442,6 +1395,27 @@ class V1UserFeatures(object):
|
|
|
1442
1395
|
|
|
1443
1396
|
self._org_level_member_permissions = org_level_member_permissions
|
|
1444
1397
|
|
|
1398
|
+
@property
|
|
1399
|
+
def pipelines(self) -> 'bool':
|
|
1400
|
+
"""Gets the pipelines of this V1UserFeatures. # noqa: E501
|
|
1401
|
+
|
|
1402
|
+
|
|
1403
|
+
:return: The pipelines of this V1UserFeatures. # noqa: E501
|
|
1404
|
+
:rtype: bool
|
|
1405
|
+
"""
|
|
1406
|
+
return self._pipelines
|
|
1407
|
+
|
|
1408
|
+
@pipelines.setter
|
|
1409
|
+
def pipelines(self, pipelines: 'bool'):
|
|
1410
|
+
"""Sets the pipelines of this V1UserFeatures.
|
|
1411
|
+
|
|
1412
|
+
|
|
1413
|
+
:param pipelines: The pipelines of this V1UserFeatures. # noqa: E501
|
|
1414
|
+
:type: bool
|
|
1415
|
+
"""
|
|
1416
|
+
|
|
1417
|
+
self._pipelines = pipelines
|
|
1418
|
+
|
|
1445
1419
|
@property
|
|
1446
1420
|
def plugin_biz_chat(self) -> 'bool':
|
|
1447
1421
|
"""Gets the plugin_biz_chat of this V1UserFeatures. # noqa: E501
|
|
@@ -41,19 +41,29 @@ class V1VultrDirectV1(object):
|
|
|
41
41
|
and the value is json key in definition.
|
|
42
42
|
"""
|
|
43
43
|
swagger_types = {
|
|
44
|
-
'credentials_secret_id': 'str'
|
|
44
|
+
'credentials_secret_id': 'str',
|
|
45
|
+
'primary_region': 'str',
|
|
46
|
+
'regions': 'list[str]'
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
attribute_map = {
|
|
48
|
-
'credentials_secret_id': 'credentialsSecretId'
|
|
50
|
+
'credentials_secret_id': 'credentialsSecretId',
|
|
51
|
+
'primary_region': 'primaryRegion',
|
|
52
|
+
'regions': 'regions'
|
|
49
53
|
}
|
|
50
54
|
|
|
51
|
-
def __init__(self, credentials_secret_id: 'str' =None): # noqa: E501
|
|
55
|
+
def __init__(self, credentials_secret_id: 'str' =None, primary_region: 'str' =None, regions: 'list[str]' =None): # noqa: E501
|
|
52
56
|
"""V1VultrDirectV1 - a model defined in Swagger""" # noqa: E501
|
|
53
57
|
self._credentials_secret_id = None
|
|
58
|
+
self._primary_region = None
|
|
59
|
+
self._regions = None
|
|
54
60
|
self.discriminator = None
|
|
55
61
|
if credentials_secret_id is not None:
|
|
56
62
|
self.credentials_secret_id = credentials_secret_id
|
|
63
|
+
if primary_region is not None:
|
|
64
|
+
self.primary_region = primary_region
|
|
65
|
+
if regions is not None:
|
|
66
|
+
self.regions = regions
|
|
57
67
|
|
|
58
68
|
@property
|
|
59
69
|
def credentials_secret_id(self) -> 'str':
|
|
@@ -78,6 +88,48 @@ class V1VultrDirectV1(object):
|
|
|
78
88
|
|
|
79
89
|
self._credentials_secret_id = credentials_secret_id
|
|
80
90
|
|
|
91
|
+
@property
|
|
92
|
+
def primary_region(self) -> 'str':
|
|
93
|
+
"""Gets the primary_region of this V1VultrDirectV1. # noqa: E501
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
:return: The primary_region of this V1VultrDirectV1. # noqa: E501
|
|
97
|
+
:rtype: str
|
|
98
|
+
"""
|
|
99
|
+
return self._primary_region
|
|
100
|
+
|
|
101
|
+
@primary_region.setter
|
|
102
|
+
def primary_region(self, primary_region: 'str'):
|
|
103
|
+
"""Sets the primary_region of this V1VultrDirectV1.
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
:param primary_region: The primary_region of this V1VultrDirectV1. # noqa: E501
|
|
107
|
+
:type: str
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
self._primary_region = primary_region
|
|
111
|
+
|
|
112
|
+
@property
|
|
113
|
+
def regions(self) -> 'list[str]':
|
|
114
|
+
"""Gets the regions of this V1VultrDirectV1. # noqa: E501
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
:return: The regions of this V1VultrDirectV1. # noqa: E501
|
|
118
|
+
:rtype: list[str]
|
|
119
|
+
"""
|
|
120
|
+
return self._regions
|
|
121
|
+
|
|
122
|
+
@regions.setter
|
|
123
|
+
def regions(self, regions: 'list[str]'):
|
|
124
|
+
"""Sets the regions of this V1VultrDirectV1.
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
:param regions: The regions of this V1VultrDirectV1. # noqa: E501
|
|
128
|
+
:type: list[str]
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
self._regions = regions
|
|
132
|
+
|
|
81
133
|
def to_dict(self) -> dict:
|
|
82
134
|
"""Returns the model properties as a dict"""
|
|
83
135
|
result = {}
|
|
@@ -0,0 +1,149 @@
|
|
|
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 VersionDefaultBody(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
|
+
'index': 'int',
|
|
45
|
+
'model_name': 'str'
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
attribute_map = {
|
|
49
|
+
'index': 'index',
|
|
50
|
+
'model_name': 'modelName'
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
def __init__(self, index: 'int' =None, model_name: 'str' =None): # noqa: E501
|
|
54
|
+
"""VersionDefaultBody - a model defined in Swagger""" # noqa: E501
|
|
55
|
+
self._index = None
|
|
56
|
+
self._model_name = None
|
|
57
|
+
self.discriminator = None
|
|
58
|
+
if index is not None:
|
|
59
|
+
self.index = index
|
|
60
|
+
if model_name is not None:
|
|
61
|
+
self.model_name = model_name
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def index(self) -> 'int':
|
|
65
|
+
"""Gets the index of this VersionDefaultBody. # noqa: E501
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
:return: The index of this VersionDefaultBody. # noqa: E501
|
|
69
|
+
:rtype: int
|
|
70
|
+
"""
|
|
71
|
+
return self._index
|
|
72
|
+
|
|
73
|
+
@index.setter
|
|
74
|
+
def index(self, index: 'int'):
|
|
75
|
+
"""Sets the index of this VersionDefaultBody.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
:param index: The index of this VersionDefaultBody. # noqa: E501
|
|
79
|
+
:type: int
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
self._index = index
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def model_name(self) -> 'str':
|
|
86
|
+
"""Gets the model_name of this VersionDefaultBody. # noqa: E501
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
:return: The model_name of this VersionDefaultBody. # noqa: E501
|
|
90
|
+
:rtype: str
|
|
91
|
+
"""
|
|
92
|
+
return self._model_name
|
|
93
|
+
|
|
94
|
+
@model_name.setter
|
|
95
|
+
def model_name(self, model_name: 'str'):
|
|
96
|
+
"""Sets the model_name of this VersionDefaultBody.
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
:param model_name: The model_name of this VersionDefaultBody. # noqa: E501
|
|
100
|
+
:type: str
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
self._model_name = model_name
|
|
104
|
+
|
|
105
|
+
def to_dict(self) -> dict:
|
|
106
|
+
"""Returns the model properties as a dict"""
|
|
107
|
+
result = {}
|
|
108
|
+
|
|
109
|
+
for attr, _ in six.iteritems(self.swagger_types):
|
|
110
|
+
value = getattr(self, attr)
|
|
111
|
+
if isinstance(value, list):
|
|
112
|
+
result[attr] = list(map(
|
|
113
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
114
|
+
value
|
|
115
|
+
))
|
|
116
|
+
elif hasattr(value, "to_dict"):
|
|
117
|
+
result[attr] = value.to_dict()
|
|
118
|
+
elif isinstance(value, dict):
|
|
119
|
+
result[attr] = dict(map(
|
|
120
|
+
lambda item: (item[0], item[1].to_dict())
|
|
121
|
+
if hasattr(item[1], "to_dict") else item,
|
|
122
|
+
value.items()
|
|
123
|
+
))
|
|
124
|
+
else:
|
|
125
|
+
result[attr] = value
|
|
126
|
+
if issubclass(VersionDefaultBody, dict):
|
|
127
|
+
for key, value in self.items():
|
|
128
|
+
result[key] = value
|
|
129
|
+
|
|
130
|
+
return result
|
|
131
|
+
|
|
132
|
+
def to_str(self) -> str:
|
|
133
|
+
"""Returns the string representation of the model"""
|
|
134
|
+
return pprint.pformat(self.to_dict())
|
|
135
|
+
|
|
136
|
+
def __repr__(self) -> str:
|
|
137
|
+
"""For `print` and `pprint`"""
|
|
138
|
+
return self.to_str()
|
|
139
|
+
|
|
140
|
+
def __eq__(self, other: 'VersionDefaultBody') -> bool:
|
|
141
|
+
"""Returns true if both objects are equal"""
|
|
142
|
+
if not isinstance(other, VersionDefaultBody):
|
|
143
|
+
return False
|
|
144
|
+
|
|
145
|
+
return self.__dict__ == other.__dict__
|
|
146
|
+
|
|
147
|
+
def __ne__(self, other: 'VersionDefaultBody') -> bool:
|
|
148
|
+
"""Returns true if both objects are not equal"""
|
|
149
|
+
return not self == other
|
|
@@ -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 VersionsVersionBody(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
|
+
'name': 'str'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
attribute_map = {
|
|
48
|
+
'name': 'name'
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
def __init__(self, name: 'str' =None): # noqa: E501
|
|
52
|
+
"""VersionsVersionBody - a model defined in Swagger""" # noqa: E501
|
|
53
|
+
self._name = None
|
|
54
|
+
self.discriminator = None
|
|
55
|
+
if name is not None:
|
|
56
|
+
self.name = name
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def name(self) -> 'str':
|
|
60
|
+
"""Gets the name of this VersionsVersionBody. # noqa: E501
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
:return: The name of this VersionsVersionBody. # noqa: E501
|
|
64
|
+
:rtype: str
|
|
65
|
+
"""
|
|
66
|
+
return self._name
|
|
67
|
+
|
|
68
|
+
@name.setter
|
|
69
|
+
def name(self, name: 'str'):
|
|
70
|
+
"""Sets the name of this VersionsVersionBody.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
:param name: The name of this VersionsVersionBody. # noqa: E501
|
|
74
|
+
:type: str
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
self._name = name
|
|
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(VersionsVersionBody, 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: 'VersionsVersionBody') -> bool:
|
|
115
|
+
"""Returns true if both objects are equal"""
|
|
116
|
+
if not isinstance(other, VersionsVersionBody):
|
|
117
|
+
return False
|
|
118
|
+
|
|
119
|
+
return self.__dict__ == other.__dict__
|
|
120
|
+
|
|
121
|
+
def __ne__(self, other: 'VersionsVersionBody') -> bool:
|
|
122
|
+
"""Returns true if both objects are not equal"""
|
|
123
|
+
return not self == other
|
|
@@ -181,4 +181,4 @@ def delete_data_connection(name: str):
|
|
|
181
181
|
# It may exhaust the attempts before the connection is actually unmounted from the studio.
|
|
182
182
|
# for now it's best to actually stop the studio and all other things where the connection
|
|
183
183
|
# is mounted before trying to delete it
|
|
184
|
-
raise e from None
|
|
184
|
+
raise e from None
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from typing import Dict, List, Optional
|
|
2
|
+
|
|
3
|
+
from lightning_sdk.api.lit_container_api import LitContainerApi
|
|
4
|
+
from lightning_sdk.utils.resolve import _resolve_teamspace
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class LitContainer:
|
|
8
|
+
def __init__(self) -> None:
|
|
9
|
+
self._api = LitContainerApi()
|
|
10
|
+
|
|
11
|
+
def list_containers(
|
|
12
|
+
self, teamspace: str, org: Optional[str] = None, user: Optional[str] = None
|
|
13
|
+
) -> List[Dict[str, str]]:
|
|
14
|
+
"""List available docker repositories.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
teamspace: The teamspace to list containers from.
|
|
18
|
+
org: The organization to list containers from.
|
|
19
|
+
user: The user to list the containers from.
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
A list of dictionaries containing repository details.
|
|
23
|
+
"""
|
|
24
|
+
try:
|
|
25
|
+
teamspace = _resolve_teamspace(teamspace=teamspace, org=org, user=user)
|
|
26
|
+
except Exception as e:
|
|
27
|
+
raise ValueError(f"Could not resolve teamspace: {e}") from e
|
|
28
|
+
project_id = teamspace.id
|
|
29
|
+
repositories = self._api.list_containers(project_id)
|
|
30
|
+
table = []
|
|
31
|
+
for repo in repositories:
|
|
32
|
+
table.append(
|
|
33
|
+
{
|
|
34
|
+
"REPOSITORY": repo.name,
|
|
35
|
+
"IMAGE ID": repo.id,
|
|
36
|
+
"CREATED": repo.creation_time.strftime("%Y-%m-%d %H:%M:%S"),
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
return table
|
|
40
|
+
|
|
41
|
+
def delete_container(
|
|
42
|
+
self, container: str, teamspace: str, org: Optional[str] = None, user: Optional[str] = None
|
|
43
|
+
) -> None:
|
|
44
|
+
"""Delete a docker container.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
container: Name of the container to delete.
|
|
48
|
+
teamspace: The teamspace which contains the container.
|
|
49
|
+
org: The organization which contains the container.
|
|
50
|
+
user: The user which contains the container.
|
|
51
|
+
"""
|
|
52
|
+
try:
|
|
53
|
+
teamspace = _resolve_teamspace(teamspace=teamspace, org=org, user=user)
|
|
54
|
+
except Exception as e:
|
|
55
|
+
raise ValueError("Could not resolve teamspace") from e
|
|
56
|
+
project_id = teamspace.id
|
|
57
|
+
return self._api.delete_container(project_id, container)
|