lightning-sdk 0.2.24rc0__py3-none-any.whl → 2025.7.9__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/cluster_api.py +15 -0
- lightning_sdk/api/llm_api.py +18 -2
- lightning_sdk/api/pipeline_api.py +15 -7
- lightning_sdk/api/studio_api.py +0 -17
- lightning_sdk/lightning_cloud/openapi/__init__.py +6 -0
- lightning_sdk/lightning_cloud/openapi/api/__init__.py +1 -0
- lightning_sdk/lightning_cloud/openapi/api/cluster_service_api.py +9 -1
- lightning_sdk/lightning_cloud/openapi/api/lit_logger_service_api.py +13 -1
- lightning_sdk/lightning_cloud/openapi/api/volume_service_api.py +258 -0
- lightning_sdk/lightning_cloud/openapi/models/__init__.py +5 -0
- lightning_sdk/lightning_cloud/openapi/models/assistant_id_conversations_body.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/externalv1_user_status.py +1 -27
- lightning_sdk/lightning_cloud/openapi/models/project_id_schedules_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/schedules_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_billing_tier.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_capacity_reservation.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_conversation_response_chunk.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_data_connection_tier.py +103 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_filestore_data_connection.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_get_user_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_get_volume_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_kubernetes_direct_v1.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_login_request.py +1 -27
- lightning_sdk/lightning_cloud/openapi/models/v1_magic_link_login_request.py +3 -29
- lightning_sdk/lightning_cloud/openapi/models/v1_rule_resource.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_schedule.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_schedule_action_type.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_schedule_resource_type.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_user_request.py +1 -27
- lightning_sdk/lightning_cloud/openapi/models/v1_update_volume_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +183 -53
- lightning_sdk/lightning_cloud/openapi/models/volumes_id_body.py +123 -0
- lightning_sdk/llm/llm.py +6 -1
- lightning_sdk/machine.py +1 -4
- lightning_sdk/pipeline/pipeline.py +1 -15
- {lightning_sdk-0.2.24rc0.dist-info → lightning_sdk-2025.7.9.dist-info}/METADATA +1 -1
- {lightning_sdk-0.2.24rc0.dist-info → lightning_sdk-2025.7.9.dist-info}/RECORD +42 -36
- {lightning_sdk-0.2.24rc0.dist-info → lightning_sdk-2025.7.9.dist-info}/LICENSE +0 -0
- {lightning_sdk-0.2.24rc0.dist-info → lightning_sdk-2025.7.9.dist-info}/WHEEL +0 -0
- {lightning_sdk-0.2.24rc0.dist-info → lightning_sdk-2025.7.9.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-0.2.24rc0.dist-info → lightning_sdk-2025.7.9.dist-info}/top_level.txt +0 -0
lightning_sdk/__init__.py
CHANGED
lightning_sdk/api/cluster_api.py
CHANGED
|
@@ -4,6 +4,7 @@ from lightning_sdk.lightning_cloud.openapi import (
|
|
|
4
4
|
Externalv1Cluster,
|
|
5
5
|
V1CloudProvider,
|
|
6
6
|
V1ClusterType,
|
|
7
|
+
V1ExternalCluster,
|
|
7
8
|
V1ListClusterAcceleratorsResponse,
|
|
8
9
|
)
|
|
9
10
|
from lightning_sdk.lightning_cloud.rest_client import LightningClient
|
|
@@ -28,6 +29,20 @@ class ClusterApi:
|
|
|
28
29
|
raise ValueError(f"Cluster {cluster_id} does not exist")
|
|
29
30
|
return res
|
|
30
31
|
|
|
32
|
+
def list_clusters(self, project_id: str) -> List[V1ExternalCluster]:
|
|
33
|
+
"""Lists the clusters for a given project.
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
project_id: The project to list clusters for
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
A list of clusters
|
|
40
|
+
"""
|
|
41
|
+
res = self._client.cluster_service_list_project_clusters(
|
|
42
|
+
project_id=project_id,
|
|
43
|
+
)
|
|
44
|
+
return res.clusters
|
|
45
|
+
|
|
31
46
|
def list_cluster_accelerators(self, cluster_id: str, org_id: str) -> V1ListClusterAcceleratorsResponse:
|
|
32
47
|
"""Lists the accelerators for a given cluster.
|
|
33
48
|
|
lightning_sdk/api/llm_api.py
CHANGED
|
@@ -69,7 +69,7 @@ class LLMApi:
|
|
|
69
69
|
self,
|
|
70
70
|
prompt: str,
|
|
71
71
|
system_prompt: Optional[str],
|
|
72
|
-
max_completion_tokens: int,
|
|
72
|
+
max_completion_tokens: Optional[int],
|
|
73
73
|
assistant_id: str,
|
|
74
74
|
images: Optional[List[str]] = None,
|
|
75
75
|
conversation_id: Optional[str] = None,
|
|
@@ -77,8 +77,13 @@ class LLMApi:
|
|
|
77
77
|
name: Optional[str] = None,
|
|
78
78
|
metadata: Optional[Dict[str, str]] = None,
|
|
79
79
|
stream: bool = False,
|
|
80
|
+
**kwargs: Any,
|
|
80
81
|
) -> Union[V1ConversationResponseChunk, Generator[V1ConversationResponseChunk, None, None]]:
|
|
81
82
|
is_internal_conversation = os.getenv("LIGHTNING_INTERNAL_CONVERSATION", "false").lower() == "true"
|
|
83
|
+
ephemeral = os.getenv("LIGHTNING_EPHEMERAL", "false").lower() == "true"
|
|
84
|
+
if ephemeral:
|
|
85
|
+
conversation_id = None
|
|
86
|
+
name = None
|
|
82
87
|
body = {
|
|
83
88
|
"message": {
|
|
84
89
|
"author": {"role": "user"},
|
|
@@ -94,6 +99,9 @@ class LLMApi:
|
|
|
94
99
|
"metadata": metadata or {},
|
|
95
100
|
"internal_conversation": is_internal_conversation,
|
|
96
101
|
"system_prompt": system_prompt,
|
|
102
|
+
"ephemeral": ephemeral,
|
|
103
|
+
"parent_conversation_id": kwargs.get("parent_conversation_id", ""),
|
|
104
|
+
"parent_message_id": kwargs.get("parent_message_id", ""),
|
|
97
105
|
}
|
|
98
106
|
if images:
|
|
99
107
|
for image in images:
|
|
@@ -117,7 +125,7 @@ class LLMApi:
|
|
|
117
125
|
self,
|
|
118
126
|
prompt: str,
|
|
119
127
|
system_prompt: Optional[str],
|
|
120
|
-
max_completion_tokens: int,
|
|
128
|
+
max_completion_tokens: Optional[int],
|
|
121
129
|
assistant_id: str,
|
|
122
130
|
images: Optional[List[str]] = None,
|
|
123
131
|
conversation_id: Optional[str] = None,
|
|
@@ -125,8 +133,13 @@ class LLMApi:
|
|
|
125
133
|
name: Optional[str] = None,
|
|
126
134
|
metadata: Optional[Dict[str, str]] = None,
|
|
127
135
|
stream: bool = False,
|
|
136
|
+
**kwargs: Any,
|
|
128
137
|
) -> Union[V1ConversationResponseChunk, AsyncGenerator[V1ConversationResponseChunk, None]]:
|
|
129
138
|
is_internal_conversation = os.getenv("LIGHTNING_INTERNAL_CONVERSATION", "false").lower() == "true"
|
|
139
|
+
ephemeral = os.getenv("LIGHTNING_EPHEMERAL", "false").lower() == "true"
|
|
140
|
+
if ephemeral:
|
|
141
|
+
conversation_id = None
|
|
142
|
+
name = None
|
|
130
143
|
body = {
|
|
131
144
|
"message": {
|
|
132
145
|
"author": {"role": "user"},
|
|
@@ -142,6 +155,9 @@ class LLMApi:
|
|
|
142
155
|
"metadata": metadata or {},
|
|
143
156
|
"internal_conversation": is_internal_conversation,
|
|
144
157
|
"system_prompt": system_prompt,
|
|
158
|
+
"ephemeral": ephemeral,
|
|
159
|
+
"parent_conversation_id": kwargs.get("parent_conversation_id", ""),
|
|
160
|
+
"parent_message_id": kwargs.get("parent_message_id", ""),
|
|
145
161
|
}
|
|
146
162
|
if images:
|
|
147
163
|
for image in images:
|
|
@@ -55,7 +55,7 @@ class PipelineApi:
|
|
|
55
55
|
body = ProjectIdPipelinesBody(
|
|
56
56
|
name=name,
|
|
57
57
|
steps=steps,
|
|
58
|
-
shared_filesystem=self.
|
|
58
|
+
shared_filesystem=self._prepare_shared_filesystem(shared_filesystem, steps, teamspace),
|
|
59
59
|
parent_pipeline_id=parent_pipeline_id or "",
|
|
60
60
|
)
|
|
61
61
|
|
|
@@ -89,7 +89,7 @@ class PipelineApi:
|
|
|
89
89
|
def delete(self, project_id: str, pipeline_id: str) -> V1DeletePipelineResponse:
|
|
90
90
|
return self._client.pipelines_service_delete_pipeline(project_id, pipeline_id)
|
|
91
91
|
|
|
92
|
-
def
|
|
92
|
+
def _prepare_shared_filesystem(
|
|
93
93
|
self, shared_filesystem: Union[bool, V1SharedFilesystem], steps: List["V1PipelineStep"], teamspace: Teamspace
|
|
94
94
|
) -> V1SharedFilesystem:
|
|
95
95
|
if not shared_filesystem:
|
|
@@ -97,14 +97,22 @@ class PipelineApi:
|
|
|
97
97
|
|
|
98
98
|
from lightning_sdk.pipeline.utils import _get_cloud_account
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
clusters = self._cluster_api.list_clusters(project_id=teamspace.id)
|
|
101
|
+
|
|
102
|
+
selected_cluster = None
|
|
103
|
+
selected_cluster_id = _get_cloud_account(steps)
|
|
104
|
+
for cluster in clusters:
|
|
105
|
+
if cluster.id == selected_cluster_id:
|
|
106
|
+
selected_cluster = cluster
|
|
107
|
+
break
|
|
108
|
+
|
|
109
|
+
if selected_cluster is None:
|
|
110
|
+
raise ValueError(f"Cloud Account {selected_cluster_id} not found")
|
|
103
111
|
|
|
104
|
-
if
|
|
112
|
+
if selected_cluster.spec.aws_v1:
|
|
105
113
|
return V1SharedFilesystem(enabled=True, s3_folder=True)
|
|
106
114
|
|
|
107
|
-
if
|
|
115
|
+
if selected_cluster.spec.google_cloud_v1:
|
|
108
116
|
return V1SharedFilesystem(enabled=True, gcs_folder=True)
|
|
109
117
|
|
|
110
118
|
raise NotImplementedError("This cluster isn't support yet")
|
lightning_sdk/api/studio_api.py
CHANGED
|
@@ -2,7 +2,6 @@ import json
|
|
|
2
2
|
import os
|
|
3
3
|
import tempfile
|
|
4
4
|
import time
|
|
5
|
-
import warnings
|
|
6
5
|
import zipfile
|
|
7
6
|
from threading import Event, Thread
|
|
8
7
|
from typing import Any, Dict, Generator, Mapping, Optional, Tuple, Union
|
|
@@ -172,14 +171,6 @@ class StudioApi:
|
|
|
172
171
|
self, studio_id: str, teamspace_id: str, machine: Union[Machine, str], interruptible: False
|
|
173
172
|
) -> None:
|
|
174
173
|
"""Start an existing Studio."""
|
|
175
|
-
if _machine_to_compute_name(machine) == _machine_to_compute_name(Machine.CPU_SMALL):
|
|
176
|
-
warnings.warn(
|
|
177
|
-
f"{Machine.CPU_SMALL} is not a valid machine for starting a Studio. "
|
|
178
|
-
"It is reserved for running jobs only. "
|
|
179
|
-
"The Studio will be started with a CPU machine instead."
|
|
180
|
-
)
|
|
181
|
-
machine = Machine.CPU
|
|
182
|
-
|
|
183
174
|
self._client.cloud_space_service_start_cloud_space_instance(
|
|
184
175
|
IdStartBody(
|
|
185
176
|
compute_config=V1UserRequestedComputeConfig(name=_machine_to_compute_name(machine), spot=interruptible)
|
|
@@ -229,14 +220,6 @@ class StudioApi:
|
|
|
229
220
|
self, studio_id: str, teamspace_id: str, machine: Union[Machine, str], interruptible: bool
|
|
230
221
|
) -> None:
|
|
231
222
|
"""Switches given Studio to a new machine type."""
|
|
232
|
-
if _machine_to_compute_name(machine) == _machine_to_compute_name(Machine.CPU_SMALL):
|
|
233
|
-
warnings.warn(
|
|
234
|
-
f"{Machine.CPU_SMALL} is not a valid machine for switching a Studio. "
|
|
235
|
-
"It is reserved for running jobs only. "
|
|
236
|
-
"The Studio will be switched to a CPU machine instead."
|
|
237
|
-
)
|
|
238
|
-
machine = Machine.CPU
|
|
239
|
-
|
|
240
223
|
compute_name = _machine_to_compute_name(machine)
|
|
241
224
|
# TODO: UI sends disk size here, maybe we need to also?
|
|
242
225
|
body = IdCodeconfigBody(compute_config=V1UserRequestedComputeConfig(name=compute_name, spot=interruptible))
|
|
@@ -63,6 +63,7 @@ from lightning_sdk.lightning_cloud.openapi.api.snowflake_service_api import Snow
|
|
|
63
63
|
from lightning_sdk.lightning_cloud.openapi.api.storage_service_api import StorageServiceApi
|
|
64
64
|
from lightning_sdk.lightning_cloud.openapi.api.studio_jobs_service_api import StudioJobsServiceApi
|
|
65
65
|
from lightning_sdk.lightning_cloud.openapi.api.user_service_api import UserServiceApi
|
|
66
|
+
from lightning_sdk.lightning_cloud.openapi.api.volume_service_api import VolumeServiceApi
|
|
66
67
|
# import ApiClient
|
|
67
68
|
from lightning_sdk.lightning_cloud.openapi.api_client import ApiClient
|
|
68
69
|
from lightning_sdk.lightning_cloud.openapi.configuration import Configuration
|
|
@@ -394,6 +395,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_data_connection import V1Da
|
|
|
394
395
|
from lightning_sdk.lightning_cloud.openapi.models.v1_data_connection_artifact import V1DataConnectionArtifact
|
|
395
396
|
from lightning_sdk.lightning_cloud.openapi.models.v1_data_connection_mount import V1DataConnectionMount
|
|
396
397
|
from lightning_sdk.lightning_cloud.openapi.models.v1_data_connection_state import V1DataConnectionState
|
|
398
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_data_connection_tier import V1DataConnectionTier
|
|
397
399
|
from lightning_sdk.lightning_cloud.openapi.models.v1_data_path import V1DataPath
|
|
398
400
|
from lightning_sdk.lightning_cloud.openapi.models.v1_dataset import V1Dataset
|
|
399
401
|
from lightning_sdk.lightning_cloud.openapi.models.v1_dataset_type import V1DatasetType
|
|
@@ -575,6 +577,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_balance_response i
|
|
|
575
577
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_notification_preferences_response import V1GetUserNotificationPreferencesResponse
|
|
576
578
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_response import V1GetUserResponse
|
|
577
579
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_storage_breakdown_response import V1GetUserStorageBreakdownResponse
|
|
580
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_get_volume_response import V1GetVolumeResponse
|
|
578
581
|
from lightning_sdk.lightning_cloud.openapi.models.v1_git_credentials import V1GitCredentials
|
|
579
582
|
from lightning_sdk.lightning_cloud.openapi.models.v1_google_cloud_direct_v1 import V1GoogleCloudDirectV1
|
|
580
583
|
from lightning_sdk.lightning_cloud.openapi.models.v1_google_cloud_direct_v1_status import V1GoogleCloudDirectV1Status
|
|
@@ -869,6 +872,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_slurm_job import V1SLURMJob
|
|
|
869
872
|
from lightning_sdk.lightning_cloud.openapi.models.v1_ssh_key_pair import V1SSHKeyPair
|
|
870
873
|
from lightning_sdk.lightning_cloud.openapi.models.v1_ssh_public_key import V1SSHPublicKey
|
|
871
874
|
from lightning_sdk.lightning_cloud.openapi.models.v1_schedule import V1Schedule
|
|
875
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_schedule_action_type import V1ScheduleActionType
|
|
872
876
|
from lightning_sdk.lightning_cloud.openapi.models.v1_schedule_resource_type import V1ScheduleResourceType
|
|
873
877
|
from lightning_sdk.lightning_cloud.openapi.models.v1_search_job_logs_response import V1SearchJobLogsResponse
|
|
874
878
|
from lightning_sdk.lightning_cloud.openapi.models.v1_search_user import V1SearchUser
|
|
@@ -947,6 +951,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_update_user_credits_auto_re
|
|
|
947
951
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_user_request import V1UpdateUserRequest
|
|
948
952
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_user_viewed_new_features_request import V1UpdateUserViewedNewFeaturesRequest
|
|
949
953
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_user_viewed_new_features_response import V1UpdateUserViewedNewFeaturesResponse
|
|
954
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_update_volume_response import V1UpdateVolumeResponse
|
|
950
955
|
from lightning_sdk.lightning_cloud.openapi.models.v1_upload_agent_job_artifact_response import V1UploadAgentJobArtifactResponse
|
|
951
956
|
from lightning_sdk.lightning_cloud.openapi.models.v1_upload_agent_job_output_response import V1UploadAgentJobOutputResponse
|
|
952
957
|
from lightning_sdk.lightning_cloud.openapi.models.v1_upload_lightningapp_instance_artifact_response import V1UploadLightningappInstanceArtifactResponse
|
|
@@ -991,6 +996,7 @@ from lightning_sdk.lightning_cloud.openapi.models.version_uploads_body1 import V
|
|
|
991
996
|
from lightning_sdk.lightning_cloud.openapi.models.versions_id_body import VersionsIdBody
|
|
992
997
|
from lightning_sdk.lightning_cloud.openapi.models.versions_version_body import VersionsVersionBody
|
|
993
998
|
from lightning_sdk.lightning_cloud.openapi.models.versions_version_body1 import VersionsVersionBody1
|
|
999
|
+
from lightning_sdk.lightning_cloud.openapi.models.volumes_id_body import VolumesIdBody
|
|
994
1000
|
from lightning_sdk.lightning_cloud.openapi.models.works_id_body import WorksIdBody
|
|
995
1001
|
from lightning_sdk.lightning_cloud.openapi.models.v1_image_spec import V1ImageSpec as Gridv1ImageSpec
|
|
996
1002
|
from lightning_sdk.lightning_cloud.openapi.models.clusters_id_body import ClustersIdBody as Body
|
|
@@ -44,3 +44,4 @@ from lightning_sdk.lightning_cloud.openapi.api.snowflake_service_api import Snow
|
|
|
44
44
|
from lightning_sdk.lightning_cloud.openapi.api.storage_service_api import StorageServiceApi
|
|
45
45
|
from lightning_sdk.lightning_cloud.openapi.api.studio_jobs_service_api import StudioJobsServiceApi
|
|
46
46
|
from lightning_sdk.lightning_cloud.openapi.api.user_service_api import UserServiceApi
|
|
47
|
+
from lightning_sdk.lightning_cloud.openapi.api.volume_service_api import VolumeServiceApi
|
|
@@ -2428,6 +2428,8 @@ class ClusterServiceApi(object):
|
|
|
2428
2428
|
:param datetime start_time:
|
|
2429
2429
|
:param datetime end_time:
|
|
2430
2430
|
:param bool available_only:
|
|
2431
|
+
:param bool from_aggregate:
|
|
2432
|
+
:param str apparent_provider:
|
|
2431
2433
|
:return: V1ListClusterCapacityReservationsResponse
|
|
2432
2434
|
If the method is called asynchronously,
|
|
2433
2435
|
returns the request thread.
|
|
@@ -2453,12 +2455,14 @@ class ClusterServiceApi(object):
|
|
|
2453
2455
|
:param datetime start_time:
|
|
2454
2456
|
:param datetime end_time:
|
|
2455
2457
|
:param bool available_only:
|
|
2458
|
+
:param bool from_aggregate:
|
|
2459
|
+
:param str apparent_provider:
|
|
2456
2460
|
:return: V1ListClusterCapacityReservationsResponse
|
|
2457
2461
|
If the method is called asynchronously,
|
|
2458
2462
|
returns the request thread.
|
|
2459
2463
|
"""
|
|
2460
2464
|
|
|
2461
|
-
all_params = ['project_id', 'cluster_id', 'start_time', 'end_time', 'available_only'] # noqa: E501
|
|
2465
|
+
all_params = ['project_id', 'cluster_id', 'start_time', 'end_time', 'available_only', 'from_aggregate', 'apparent_provider'] # noqa: E501
|
|
2462
2466
|
all_params.append('async_req')
|
|
2463
2467
|
all_params.append('_return_http_data_only')
|
|
2464
2468
|
all_params.append('_preload_content')
|
|
@@ -2497,6 +2501,10 @@ class ClusterServiceApi(object):
|
|
|
2497
2501
|
query_params.append(('endTime', params['end_time'])) # noqa: E501
|
|
2498
2502
|
if 'available_only' in params:
|
|
2499
2503
|
query_params.append(('availableOnly', params['available_only'])) # noqa: E501
|
|
2504
|
+
if 'from_aggregate' in params:
|
|
2505
|
+
query_params.append(('fromAggregate', params['from_aggregate'])) # noqa: E501
|
|
2506
|
+
if 'apparent_provider' in params:
|
|
2507
|
+
query_params.append(('apparentProvider', params['apparent_provider'])) # noqa: E501
|
|
2500
2508
|
|
|
2501
2509
|
header_params = {}
|
|
2502
2510
|
|
|
@@ -1329,6 +1329,9 @@ class LitLoggerServiceApi(object):
|
|
|
1329
1329
|
:param str user_id:
|
|
1330
1330
|
:param str cloud_space_id:
|
|
1331
1331
|
:param str app_id:
|
|
1332
|
+
:param int limit:
|
|
1333
|
+
:param int offset:
|
|
1334
|
+
:param str order_by:
|
|
1332
1335
|
:return: V1ListMetricsStreamsResponse
|
|
1333
1336
|
If the method is called asynchronously,
|
|
1334
1337
|
returns the request thread.
|
|
@@ -1353,12 +1356,15 @@ class LitLoggerServiceApi(object):
|
|
|
1353
1356
|
:param str user_id:
|
|
1354
1357
|
:param str cloud_space_id:
|
|
1355
1358
|
:param str app_id:
|
|
1359
|
+
:param int limit:
|
|
1360
|
+
:param int offset:
|
|
1361
|
+
:param str order_by:
|
|
1356
1362
|
:return: V1ListMetricsStreamsResponse
|
|
1357
1363
|
If the method is called asynchronously,
|
|
1358
1364
|
returns the request thread.
|
|
1359
1365
|
"""
|
|
1360
1366
|
|
|
1361
|
-
all_params = ['project_id', 'user_id', 'cloud_space_id', 'app_id'] # noqa: E501
|
|
1367
|
+
all_params = ['project_id', 'user_id', 'cloud_space_id', 'app_id', 'limit', 'offset', 'order_by'] # noqa: E501
|
|
1362
1368
|
all_params.append('async_req')
|
|
1363
1369
|
all_params.append('_return_http_data_only')
|
|
1364
1370
|
all_params.append('_preload_content')
|
|
@@ -1391,6 +1397,12 @@ class LitLoggerServiceApi(object):
|
|
|
1391
1397
|
query_params.append(('cloudSpaceId', params['cloud_space_id'])) # noqa: E501
|
|
1392
1398
|
if 'app_id' in params:
|
|
1393
1399
|
query_params.append(('appId', params['app_id'])) # noqa: E501
|
|
1400
|
+
if 'limit' in params:
|
|
1401
|
+
query_params.append(('limit', params['limit'])) # noqa: E501
|
|
1402
|
+
if 'offset' in params:
|
|
1403
|
+
query_params.append(('offset', params['offset'])) # noqa: E501
|
|
1404
|
+
if 'order_by' in params:
|
|
1405
|
+
query_params.append(('orderBy', params['order_by'])) # noqa: E501
|
|
1394
1406
|
|
|
1395
1407
|
header_params = {}
|
|
1396
1408
|
|
|
@@ -0,0 +1,258 @@
|
|
|
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
|
+
from __future__ import absolute_import
|
|
21
|
+
|
|
22
|
+
import re # noqa: F401
|
|
23
|
+
from typing import TYPE_CHECKING, Any
|
|
24
|
+
|
|
25
|
+
# python 2 and python 3 compatibility library
|
|
26
|
+
import six
|
|
27
|
+
|
|
28
|
+
from lightning_sdk.lightning_cloud.openapi.api_client import ApiClient
|
|
29
|
+
|
|
30
|
+
if TYPE_CHECKING:
|
|
31
|
+
from datetime import datetime
|
|
32
|
+
from lightning_sdk.lightning_cloud.openapi.models import *
|
|
33
|
+
|
|
34
|
+
class VolumeServiceApi(object):
|
|
35
|
+
"""NOTE: This class is auto generated by the swagger code generator program.
|
|
36
|
+
|
|
37
|
+
Do not edit the class manually.
|
|
38
|
+
Ref: https://github.com/swagger-api/swagger-codegen
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
def __init__(self, api_client=None):
|
|
42
|
+
if api_client is None:
|
|
43
|
+
api_client = ApiClient()
|
|
44
|
+
self.api_client = api_client
|
|
45
|
+
|
|
46
|
+
def volume_service_get_volume(self, project_id: 'str', id: 'str', **kwargs) -> 'V1GetVolumeResponse': # noqa: E501
|
|
47
|
+
"""volume_service_get_volume # noqa: E501
|
|
48
|
+
|
|
49
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
50
|
+
asynchronous HTTP request, please pass async_req=True
|
|
51
|
+
>>> thread = api.volume_service_get_volume(project_id, id, async_req=True)
|
|
52
|
+
>>> result = thread.get()
|
|
53
|
+
|
|
54
|
+
:param async_req bool
|
|
55
|
+
:param str project_id: (required)
|
|
56
|
+
:param str id: (required)
|
|
57
|
+
:return: V1GetVolumeResponse
|
|
58
|
+
If the method is called asynchronously,
|
|
59
|
+
returns the request thread.
|
|
60
|
+
"""
|
|
61
|
+
kwargs['_return_http_data_only'] = True
|
|
62
|
+
if kwargs.get('async_req'):
|
|
63
|
+
return self.volume_service_get_volume_with_http_info(project_id, id, **kwargs) # noqa: E501
|
|
64
|
+
else:
|
|
65
|
+
(data) = self.volume_service_get_volume_with_http_info(project_id, id, **kwargs) # noqa: E501
|
|
66
|
+
return data
|
|
67
|
+
|
|
68
|
+
def volume_service_get_volume_with_http_info(self, project_id: 'str', id: 'str', **kwargs) -> 'V1GetVolumeResponse': # noqa: E501
|
|
69
|
+
"""volume_service_get_volume # noqa: E501
|
|
70
|
+
|
|
71
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
72
|
+
asynchronous HTTP request, please pass async_req=True
|
|
73
|
+
>>> thread = api.volume_service_get_volume_with_http_info(project_id, id, async_req=True)
|
|
74
|
+
>>> result = thread.get()
|
|
75
|
+
|
|
76
|
+
:param async_req bool
|
|
77
|
+
:param str project_id: (required)
|
|
78
|
+
:param str id: (required)
|
|
79
|
+
:return: V1GetVolumeResponse
|
|
80
|
+
If the method is called asynchronously,
|
|
81
|
+
returns the request thread.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
all_params = ['project_id', 'id'] # noqa: E501
|
|
85
|
+
all_params.append('async_req')
|
|
86
|
+
all_params.append('_return_http_data_only')
|
|
87
|
+
all_params.append('_preload_content')
|
|
88
|
+
all_params.append('_request_timeout')
|
|
89
|
+
|
|
90
|
+
params = locals()
|
|
91
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
92
|
+
if key not in all_params:
|
|
93
|
+
raise TypeError(
|
|
94
|
+
"Got an unexpected keyword argument '%s'"
|
|
95
|
+
" to method volume_service_get_volume" % key
|
|
96
|
+
)
|
|
97
|
+
params[key] = val
|
|
98
|
+
del params['kwargs']
|
|
99
|
+
# verify the required parameter 'project_id' is set
|
|
100
|
+
if ('project_id' not in params or
|
|
101
|
+
params['project_id'] is None):
|
|
102
|
+
raise ValueError("Missing the required parameter `project_id` when calling `volume_service_get_volume`") # noqa: E501
|
|
103
|
+
# verify the required parameter 'id' is set
|
|
104
|
+
if ('id' not in params or
|
|
105
|
+
params['id'] is None):
|
|
106
|
+
raise ValueError("Missing the required parameter `id` when calling `volume_service_get_volume`") # noqa: E501
|
|
107
|
+
|
|
108
|
+
collection_formats = {}
|
|
109
|
+
|
|
110
|
+
path_params = {}
|
|
111
|
+
if 'project_id' in params:
|
|
112
|
+
path_params['projectId'] = params['project_id'] # noqa: E501
|
|
113
|
+
if 'id' in params:
|
|
114
|
+
path_params['id'] = params['id'] # noqa: E501
|
|
115
|
+
|
|
116
|
+
query_params = []
|
|
117
|
+
|
|
118
|
+
header_params = {}
|
|
119
|
+
|
|
120
|
+
form_params = []
|
|
121
|
+
local_var_files = {}
|
|
122
|
+
|
|
123
|
+
body_params = None
|
|
124
|
+
# HTTP header `Accept`
|
|
125
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
126
|
+
['application/json']) # noqa: E501
|
|
127
|
+
|
|
128
|
+
# Authentication setting
|
|
129
|
+
auth_settings = [] # noqa: E501
|
|
130
|
+
|
|
131
|
+
return self.api_client.call_api(
|
|
132
|
+
'/v1/projects/{projectId}/volumes/{id}', 'GET',
|
|
133
|
+
path_params,
|
|
134
|
+
query_params,
|
|
135
|
+
header_params,
|
|
136
|
+
body=body_params,
|
|
137
|
+
post_params=form_params,
|
|
138
|
+
files=local_var_files,
|
|
139
|
+
response_type='V1GetVolumeResponse', # noqa: E501
|
|
140
|
+
auth_settings=auth_settings,
|
|
141
|
+
async_req=params.get('async_req'),
|
|
142
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
143
|
+
_preload_content=params.get('_preload_content', True),
|
|
144
|
+
_request_timeout=params.get('_request_timeout'),
|
|
145
|
+
collection_formats=collection_formats)
|
|
146
|
+
|
|
147
|
+
def volume_service_update_volume(self, body: 'VolumesIdBody', project_id: 'str', id: 'str', **kwargs) -> 'V1UpdateVolumeResponse': # noqa: E501
|
|
148
|
+
"""volume_service_update_volume # noqa: E501
|
|
149
|
+
|
|
150
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
151
|
+
asynchronous HTTP request, please pass async_req=True
|
|
152
|
+
>>> thread = api.volume_service_update_volume(body, project_id, id, async_req=True)
|
|
153
|
+
>>> result = thread.get()
|
|
154
|
+
|
|
155
|
+
:param async_req bool
|
|
156
|
+
:param VolumesIdBody body: (required)
|
|
157
|
+
:param str project_id: (required)
|
|
158
|
+
:param str id: (required)
|
|
159
|
+
:return: V1UpdateVolumeResponse
|
|
160
|
+
If the method is called asynchronously,
|
|
161
|
+
returns the request thread.
|
|
162
|
+
"""
|
|
163
|
+
kwargs['_return_http_data_only'] = True
|
|
164
|
+
if kwargs.get('async_req'):
|
|
165
|
+
return self.volume_service_update_volume_with_http_info(body, project_id, id, **kwargs) # noqa: E501
|
|
166
|
+
else:
|
|
167
|
+
(data) = self.volume_service_update_volume_with_http_info(body, project_id, id, **kwargs) # noqa: E501
|
|
168
|
+
return data
|
|
169
|
+
|
|
170
|
+
def volume_service_update_volume_with_http_info(self, body: 'VolumesIdBody', project_id: 'str', id: 'str', **kwargs) -> 'V1UpdateVolumeResponse': # noqa: E501
|
|
171
|
+
"""volume_service_update_volume # noqa: E501
|
|
172
|
+
|
|
173
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
174
|
+
asynchronous HTTP request, please pass async_req=True
|
|
175
|
+
>>> thread = api.volume_service_update_volume_with_http_info(body, project_id, id, async_req=True)
|
|
176
|
+
>>> result = thread.get()
|
|
177
|
+
|
|
178
|
+
:param async_req bool
|
|
179
|
+
:param VolumesIdBody body: (required)
|
|
180
|
+
:param str project_id: (required)
|
|
181
|
+
:param str id: (required)
|
|
182
|
+
:return: V1UpdateVolumeResponse
|
|
183
|
+
If the method is called asynchronously,
|
|
184
|
+
returns the request thread.
|
|
185
|
+
"""
|
|
186
|
+
|
|
187
|
+
all_params = ['body', 'project_id', 'id'] # noqa: E501
|
|
188
|
+
all_params.append('async_req')
|
|
189
|
+
all_params.append('_return_http_data_only')
|
|
190
|
+
all_params.append('_preload_content')
|
|
191
|
+
all_params.append('_request_timeout')
|
|
192
|
+
|
|
193
|
+
params = locals()
|
|
194
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
195
|
+
if key not in all_params:
|
|
196
|
+
raise TypeError(
|
|
197
|
+
"Got an unexpected keyword argument '%s'"
|
|
198
|
+
" to method volume_service_update_volume" % key
|
|
199
|
+
)
|
|
200
|
+
params[key] = val
|
|
201
|
+
del params['kwargs']
|
|
202
|
+
# verify the required parameter 'body' is set
|
|
203
|
+
if ('body' not in params or
|
|
204
|
+
params['body'] is None):
|
|
205
|
+
raise ValueError("Missing the required parameter `body` when calling `volume_service_update_volume`") # noqa: E501
|
|
206
|
+
# verify the required parameter 'project_id' is set
|
|
207
|
+
if ('project_id' not in params or
|
|
208
|
+
params['project_id'] is None):
|
|
209
|
+
raise ValueError("Missing the required parameter `project_id` when calling `volume_service_update_volume`") # noqa: E501
|
|
210
|
+
# verify the required parameter 'id' is set
|
|
211
|
+
if ('id' not in params or
|
|
212
|
+
params['id'] is None):
|
|
213
|
+
raise ValueError("Missing the required parameter `id` when calling `volume_service_update_volume`") # noqa: E501
|
|
214
|
+
|
|
215
|
+
collection_formats = {}
|
|
216
|
+
|
|
217
|
+
path_params = {}
|
|
218
|
+
if 'project_id' in params:
|
|
219
|
+
path_params['projectId'] = params['project_id'] # noqa: E501
|
|
220
|
+
if 'id' in params:
|
|
221
|
+
path_params['id'] = params['id'] # noqa: E501
|
|
222
|
+
|
|
223
|
+
query_params = []
|
|
224
|
+
|
|
225
|
+
header_params = {}
|
|
226
|
+
|
|
227
|
+
form_params = []
|
|
228
|
+
local_var_files = {}
|
|
229
|
+
|
|
230
|
+
body_params = None
|
|
231
|
+
if 'body' in params:
|
|
232
|
+
body_params = params['body']
|
|
233
|
+
# HTTP header `Accept`
|
|
234
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
235
|
+
['application/json']) # noqa: E501
|
|
236
|
+
|
|
237
|
+
# HTTP header `Content-Type`
|
|
238
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
|
239
|
+
['application/json']) # noqa: E501
|
|
240
|
+
|
|
241
|
+
# Authentication setting
|
|
242
|
+
auth_settings = [] # noqa: E501
|
|
243
|
+
|
|
244
|
+
return self.api_client.call_api(
|
|
245
|
+
'/v1/projects/{projectId}/volumes/{id}', 'PUT',
|
|
246
|
+
path_params,
|
|
247
|
+
query_params,
|
|
248
|
+
header_params,
|
|
249
|
+
body=body_params,
|
|
250
|
+
post_params=form_params,
|
|
251
|
+
files=local_var_files,
|
|
252
|
+
response_type='V1UpdateVolumeResponse', # noqa: E501
|
|
253
|
+
auth_settings=auth_settings,
|
|
254
|
+
async_req=params.get('async_req'),
|
|
255
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
256
|
+
_preload_content=params.get('_preload_content', True),
|
|
257
|
+
_request_timeout=params.get('_request_timeout'),
|
|
258
|
+
collection_formats=collection_formats)
|
|
@@ -348,6 +348,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_data_connection import V1Da
|
|
|
348
348
|
from lightning_sdk.lightning_cloud.openapi.models.v1_data_connection_artifact import V1DataConnectionArtifact
|
|
349
349
|
from lightning_sdk.lightning_cloud.openapi.models.v1_data_connection_mount import V1DataConnectionMount
|
|
350
350
|
from lightning_sdk.lightning_cloud.openapi.models.v1_data_connection_state import V1DataConnectionState
|
|
351
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_data_connection_tier import V1DataConnectionTier
|
|
351
352
|
from lightning_sdk.lightning_cloud.openapi.models.v1_data_path import V1DataPath
|
|
352
353
|
from lightning_sdk.lightning_cloud.openapi.models.v1_dataset import V1Dataset
|
|
353
354
|
from lightning_sdk.lightning_cloud.openapi.models.v1_dataset_type import V1DatasetType
|
|
@@ -529,6 +530,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_balance_response i
|
|
|
529
530
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_notification_preferences_response import V1GetUserNotificationPreferencesResponse
|
|
530
531
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_response import V1GetUserResponse
|
|
531
532
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_storage_breakdown_response import V1GetUserStorageBreakdownResponse
|
|
533
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_get_volume_response import V1GetVolumeResponse
|
|
532
534
|
from lightning_sdk.lightning_cloud.openapi.models.v1_git_credentials import V1GitCredentials
|
|
533
535
|
from lightning_sdk.lightning_cloud.openapi.models.v1_google_cloud_direct_v1 import V1GoogleCloudDirectV1
|
|
534
536
|
from lightning_sdk.lightning_cloud.openapi.models.v1_google_cloud_direct_v1_status import V1GoogleCloudDirectV1Status
|
|
@@ -823,6 +825,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_slurm_job import V1SLURMJob
|
|
|
823
825
|
from lightning_sdk.lightning_cloud.openapi.models.v1_ssh_key_pair import V1SSHKeyPair
|
|
824
826
|
from lightning_sdk.lightning_cloud.openapi.models.v1_ssh_public_key import V1SSHPublicKey
|
|
825
827
|
from lightning_sdk.lightning_cloud.openapi.models.v1_schedule import V1Schedule
|
|
828
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_schedule_action_type import V1ScheduleActionType
|
|
826
829
|
from lightning_sdk.lightning_cloud.openapi.models.v1_schedule_resource_type import V1ScheduleResourceType
|
|
827
830
|
from lightning_sdk.lightning_cloud.openapi.models.v1_search_job_logs_response import V1SearchJobLogsResponse
|
|
828
831
|
from lightning_sdk.lightning_cloud.openapi.models.v1_search_user import V1SearchUser
|
|
@@ -901,6 +904,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_update_user_credits_auto_re
|
|
|
901
904
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_user_request import V1UpdateUserRequest
|
|
902
905
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_user_viewed_new_features_request import V1UpdateUserViewedNewFeaturesRequest
|
|
903
906
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_user_viewed_new_features_response import V1UpdateUserViewedNewFeaturesResponse
|
|
907
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_update_volume_response import V1UpdateVolumeResponse
|
|
904
908
|
from lightning_sdk.lightning_cloud.openapi.models.v1_upload_agent_job_artifact_response import V1UploadAgentJobArtifactResponse
|
|
905
909
|
from lightning_sdk.lightning_cloud.openapi.models.v1_upload_agent_job_output_response import V1UploadAgentJobOutputResponse
|
|
906
910
|
from lightning_sdk.lightning_cloud.openapi.models.v1_upload_lightningapp_instance_artifact_response import V1UploadLightningappInstanceArtifactResponse
|
|
@@ -945,4 +949,5 @@ from lightning_sdk.lightning_cloud.openapi.models.version_uploads_body1 import V
|
|
|
945
949
|
from lightning_sdk.lightning_cloud.openapi.models.versions_id_body import VersionsIdBody
|
|
946
950
|
from lightning_sdk.lightning_cloud.openapi.models.versions_version_body import VersionsVersionBody
|
|
947
951
|
from lightning_sdk.lightning_cloud.openapi.models.versions_version_body1 import VersionsVersionBody1
|
|
952
|
+
from lightning_sdk.lightning_cloud.openapi.models.volumes_id_body import VolumesIdBody
|
|
948
953
|
from lightning_sdk.lightning_cloud.openapi.models.works_id_body import WorksIdBody
|