lightning-sdk 0.2.19__py3-none-any.whl → 0.2.21rc0__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 (55) hide show
  1. lightning_sdk/__init__.py +1 -1
  2. lightning_sdk/api/license_api.py +28 -6
  3. lightning_sdk/api/llm_api.py +53 -1
  4. lightning_sdk/api/studio_api.py +5 -0
  5. lightning_sdk/cli/deploy/_auth.py +11 -19
  6. lightning_sdk/cli/entrypoint.py +20 -2
  7. lightning_sdk/lightning_cloud/login.py +2 -2
  8. lightning_sdk/lightning_cloud/openapi/__init__.py +2 -3
  9. lightning_sdk/lightning_cloud/openapi/api/endpoint_service_api.py +11 -1
  10. lightning_sdk/lightning_cloud/openapi/api/jobs_service_api.py +121 -0
  11. lightning_sdk/lightning_cloud/openapi/api/user_service_api.py +0 -85
  12. lightning_sdk/lightning_cloud/openapi/models/__init__.py +2 -3
  13. lightning_sdk/lightning_cloud/openapi/models/alertingevents_id_body.py +409 -0
  14. lightning_sdk/lightning_cloud/openapi/models/id_codeconfig_body.py +29 -3
  15. lightning_sdk/lightning_cloud/openapi/models/update.py +105 -1
  16. lightning_sdk/lightning_cloud/openapi/models/v1_author.py +201 -0
  17. lightning_sdk/lightning_cloud/openapi/models/v1_blog_post.py +53 -1
  18. lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space.py +27 -1
  19. lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_environment_template.py +53 -1
  20. lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_environment_template_config.py +27 -1
  21. lightning_sdk/lightning_cloud/openapi/models/v1_cluster_deletion_options.py +27 -1
  22. lightning_sdk/lightning_cloud/openapi/models/v1_create_cloud_space_environment_template_request.py +105 -1
  23. lightning_sdk/lightning_cloud/openapi/models/v1_create_project_request.py +79 -1
  24. lightning_sdk/lightning_cloud/openapi/models/v1_data_connection.py +79 -1
  25. lightning_sdk/lightning_cloud/openapi/models/v1_deployment_alerting_policy_type.py +1 -0
  26. lightning_sdk/lightning_cloud/openapi/models/v1_get_organization_storage_metadata_response.py +79 -1
  27. lightning_sdk/lightning_cloud/openapi/models/v1_get_project_storage_metadata_response.py +105 -1
  28. lightning_sdk/lightning_cloud/openapi/models/v1_get_user_storage_breakdown_response.py +27 -1
  29. lightning_sdk/lightning_cloud/openapi/models/v1_membership.py +27 -1
  30. lightning_sdk/lightning_cloud/openapi/models/v1_message.py +53 -1
  31. lightning_sdk/lightning_cloud/openapi/models/v1_notification_type.py +1 -0
  32. lightning_sdk/lightning_cloud/openapi/models/v1_organization.py +105 -1
  33. lightning_sdk/lightning_cloud/openapi/models/v1_project_storage.py +131 -1
  34. lightning_sdk/lightning_cloud/openapi/models/v1_routing_telemetry.py +27 -1
  35. lightning_sdk/lightning_cloud/openapi/models/v1_storage_asset.py +27 -1
  36. lightning_sdk/lightning_cloud/openapi/models/v1_storage_asset_type.py +2 -0
  37. lightning_sdk/lightning_cloud/openapi/models/v1_transaction.py +27 -1
  38. lightning_sdk/lightning_cloud/openapi/models/v1_usage.py +27 -27
  39. lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +79 -365
  40. lightning_sdk/lightning_cloud/openapi/models/v1_volume.py +499 -31
  41. lightning_sdk/lightning_cloud/rest_client.py +13 -11
  42. lightning_sdk/lightning_cloud/source_code/logs_socket_api.py +8 -3
  43. lightning_sdk/llm/__init__.py +2 -1
  44. lightning_sdk/llm/asyncllm.py +48 -0
  45. lightning_sdk/services/license.py +78 -22
  46. lightning_sdk/services/utilities.py +15 -1
  47. {lightning_sdk-0.2.19.dist-info → lightning_sdk-0.2.21rc0.dist-info}/METADATA +1 -1
  48. {lightning_sdk-0.2.19.dist-info → lightning_sdk-0.2.21rc0.dist-info}/RECORD +52 -52
  49. lightning_sdk/lightning_cloud/openapi/models/v1_ebs.py +0 -279
  50. lightning_sdk/lightning_cloud/openapi/models/v1_get_user_storage_response.py +0 -201
  51. lightning_sdk/lightning_cloud/openapi/models/v1_reservation_billing_session.py +0 -279
  52. {lightning_sdk-0.2.19.dist-info → lightning_sdk-0.2.21rc0.dist-info}/LICENSE +0 -0
  53. {lightning_sdk-0.2.19.dist-info → lightning_sdk-0.2.21rc0.dist-info}/WHEEL +0 -0
  54. {lightning_sdk-0.2.19.dist-info → lightning_sdk-0.2.21rc0.dist-info}/entry_points.txt +0 -0
  55. {lightning_sdk-0.2.19.dist-info → lightning_sdk-0.2.21rc0.dist-info}/top_level.txt +0 -0
lightning_sdk/__init__.py CHANGED
@@ -31,6 +31,6 @@ __all__ = [
31
31
  "User",
32
32
  ]
33
33
 
34
- __version__ = "0.2.19"
34
+ __version__ = "0.2.21.rc0"
35
35
  _check_version_and_prompt_upgrade(__version__)
36
36
  _set_tqdm_envvars_noninteractive()
@@ -1,11 +1,35 @@
1
+ import os
1
2
  from typing import Optional
3
+ from urllib.parse import urlencode
2
4
 
5
+ from lightning_sdk.lightning_cloud import env
3
6
  from lightning_sdk.lightning_cloud.rest_client import LightningClient
4
7
 
8
+ LICENSE_CODE = os.environ.get("LICENSE_CODE", "d9s79g79ss")
9
+ # https://lightning.ai/home?settings=licenses
10
+ LICENSE_SIGNING_URL = f"{env.LIGHTNING_CLOUD_URL}?settings=licenses"
11
+
12
+
13
+ def generate_url_user_settings(redirect_to: str = LICENSE_SIGNING_URL) -> str:
14
+ params = urlencode({"redirectTo": redirect_to, "mode": "licenses", "okbhrt": LICENSE_CODE})
15
+ return f"{env.LIGHTNING_CLOUD_URL}/sign-in?{params}"
16
+
5
17
 
6
18
  class LicenseApi:
7
- def __init__(self) -> None:
8
- self._client = LightningClient(retry=False, max_tries=0)
19
+ _client_authenticated: LightningClient = None
20
+ _client_public: LightningClient = None
21
+
22
+ @property
23
+ def client_public(self) -> LightningClient:
24
+ if not self._client_public:
25
+ self._client_public = LightningClient(retry=False, max_tries=0, with_auth=False)
26
+ return self._client_public
27
+
28
+ @property
29
+ def client_authenticated(self) -> LightningClient:
30
+ if not self._client_authenticated:
31
+ self._client_authenticated = LightningClient(retry=True, max_tries=3, with_auth=True)
32
+ return self._client_authenticated
9
33
 
10
34
  def valid_license(
11
35
  self,
@@ -25,14 +49,12 @@ class LicenseApi:
25
49
  Returns:
26
50
  True if the license key is valid, False otherwise.
27
51
  """
28
- response, code, _ = self._client.product_license_service_validate_product_license_with_http_info(
52
+ response = self.client_public.product_license_service_validate_product_license(
29
53
  license_key=license_key,
30
54
  product_name=product_name,
31
55
  product_version=product_version,
32
56
  product_type=product_type,
33
57
  )
34
- if code != 200:
35
- raise ConnectionError(f"Failed to validate license key: {code} - {response}")
36
58
  return response.valid
37
59
 
38
60
  def list_user_licenses(self, user_id: str) -> list:
@@ -44,5 +66,5 @@ class LicenseApi:
44
66
  Returns:
45
67
  A list of licenses for the user.
46
68
  """
47
- response = self._client.product_license_service_list_user_licenses(user_id=user_id)
69
+ response = self.client_authenticated.product_license_service_list_user_licenses(user_id=user_id)
48
70
  return response.licenses
@@ -1,7 +1,8 @@
1
+ import asyncio
1
2
  import base64
2
3
  import json
3
4
  import os
4
- from typing import Dict, Generator, List, Optional, Union
5
+ from typing import AsyncGenerator, Dict, Generator, List, Optional, Union
5
6
 
6
7
  from pip._vendor.urllib3 import HTTPResponse
7
8
 
@@ -110,6 +111,57 @@ class LLMApi:
110
111
  return result.result
111
112
  return self._stream_chat_response(result)
112
113
 
114
+ async def async_start_conversation(
115
+ self,
116
+ prompt: str,
117
+ system_prompt: Optional[str],
118
+ max_completion_tokens: int,
119
+ assistant_id: str,
120
+ images: Optional[List[str]] = None,
121
+ conversation_id: Optional[str] = None,
122
+ billing_project_id: Optional[str] = None,
123
+ name: Optional[str] = None,
124
+ metadata: Optional[Dict[str, str]] = None,
125
+ stream: bool = False,
126
+ ) -> Union[V1ConversationResponseChunk, AsyncGenerator[V1ConversationResponseChunk, None]]:
127
+ is_internal_conversation = os.getenv("LIGHTNING_INTERNAL_CONVERSATION", "false").lower() == "true"
128
+ body = {
129
+ "message": {
130
+ "author": {"role": "user"},
131
+ "content": [
132
+ {"contentType": "text", "parts": [prompt]},
133
+ ],
134
+ },
135
+ "max_completion_tokens": max_completion_tokens,
136
+ "conversation_id": conversation_id,
137
+ "billing_project_id": billing_project_id,
138
+ "name": name,
139
+ "stream": stream,
140
+ "metadata": metadata or {},
141
+ "internal_conversation": is_internal_conversation,
142
+ }
143
+ if images:
144
+ for image in images:
145
+ url = image
146
+ if not image.startswith("http"):
147
+ url = self._encode_image_bytes_to_data_url(image)
148
+
149
+ body["message"]["content"].append(
150
+ {
151
+ "contentType": "image",
152
+ "parts": [url],
153
+ }
154
+ )
155
+
156
+ if not stream:
157
+ thread = await asyncio.to_thread(
158
+ self._client.assistants_service_start_conversation, body, assistant_id, async_req=True
159
+ )
160
+ result = await asyncio.to_thread(thread.get)
161
+ return result.result
162
+
163
+ raise NotImplementedError("Streaming is not supported in this client.")
164
+
113
165
  def list_conversations(self, assistant_id: str) -> List[str]:
114
166
  result = self._client.assistants_service_list_conversations(assistant_id)
115
167
  return result.conversations
@@ -154,6 +154,11 @@ class StudioApi:
154
154
  @backoff.on_exception(backoff.expo, AttributeError, max_tries=10)
155
155
  def _check_code_status_top_up_restore_finished(self, studio_id: str, teamspace_id: str) -> bool:
156
156
  """Retries checking the top_up_restore_finished value of the code status when there's an AttributeError."""
157
+ if (
158
+ self.get_studio_status(studio_id, teamspace_id) is None
159
+ or self.get_studio_status(studio_id, teamspace_id).in_use is None
160
+ ):
161
+ return False
157
162
  startup_status = self.get_studio_status(studio_id, teamspace_id).in_use.startup_status
158
163
  return startup_status and startup_status.top_up_restore_finished
159
164
 
@@ -2,8 +2,7 @@ import os
2
2
  import time
3
3
  from datetime import datetime
4
4
  from enum import Enum
5
- from typing import Any, List, Optional, TypedDict
6
- from urllib.parse import urlencode
5
+ from typing import List, Optional, TypedDict
7
6
 
8
7
  from rich.console import Console
9
8
  from rich.prompt import Confirm
@@ -11,7 +10,6 @@ from rich.prompt import Confirm
11
10
  from lightning_sdk import Teamspace
12
11
  from lightning_sdk.api import UserApi
13
12
  from lightning_sdk.cli.teamspace_menu import _TeamspacesMenu
14
- from lightning_sdk.lightning_cloud import env
15
13
  from lightning_sdk.lightning_cloud.login import Auth, AuthServer
16
14
  from lightning_sdk.lightning_cloud.openapi import V1CloudSpace
17
15
  from lightning_sdk.lightning_cloud.rest_client import LightningClient
@@ -26,18 +24,7 @@ class _AuthMode(Enum):
26
24
  DEPLOY = "deploy"
27
25
 
28
26
 
29
- class _AuthServer(AuthServer):
30
- def __init__(self, mode: _AuthMode, *args: Any, **kwargs: Any) -> None:
31
- self._mode = mode
32
- super().__init__(*args, **kwargs)
33
-
34
- def get_auth_url(self, port: int) -> str:
35
- redirect_uri = f"http://localhost:{port}/login-complete"
36
- params = urlencode({"redirectTo": redirect_uri, "mode": self._mode.value, "okbhrt": LITSERVE_CODE})
37
- return f"{env.LIGHTNING_CLOUD_URL}/sign-in?{params}"
38
-
39
-
40
- class _Auth(Auth):
27
+ class _AuthLitServe(Auth):
41
28
  def __init__(self, mode: _AuthMode, shall_confirm: bool = False) -> None:
42
29
  super().__init__()
43
30
  self._mode = mode
@@ -51,15 +38,20 @@ class _Auth(Auth):
51
38
  if not proceed:
52
39
  raise RuntimeError(
53
40
  "Login cancelled. Please login to Lightning AI to deploy the API. Run `lightning login` to login."
54
- ) from None
41
+ )
55
42
  print("Opening browser for authentication...")
56
43
  print("Please come back to the terminal after logging in.")
57
44
  time.sleep(3)
58
- _AuthServer(self._mode).login_with_browser(self)
45
+ AuthServer({"mode": self._mode, "okbhrt": LITSERVE_CODE}).login_with_browser(self)
59
46
 
60
47
 
61
48
  def authenticate(mode: _AuthMode, shall_confirm: bool = True) -> None:
62
- auth = _Auth(mode, shall_confirm)
49
+ """Authenticate with Lightning AI.
50
+
51
+ This will open a browser window for authentication.
52
+ If `shall_confirm` is True, it will ask for confirmation before proceeding.
53
+ """
54
+ auth = _AuthLitServe(mode, shall_confirm)
63
55
  auth.authenticate()
64
56
 
65
57
 
@@ -87,7 +79,7 @@ def poll_verified_status(timeout: int = _POLL_TIMEOUT) -> _UserStatus:
87
79
  user_api = UserApi()
88
80
  user = _get_authed_user()
89
81
  start_time = datetime.now()
90
- result = {"onboarded": False, "verified": False}
82
+ result = _UserStatus(onboarded=False, verified=False)
91
83
  while True:
92
84
  user_resp = user_api.get_user(name=user.name)
93
85
  result["onboarded"] = user_resp.status.completed_project_onboarding
@@ -1,10 +1,12 @@
1
1
  import sys
2
+ import traceback
2
3
  from types import TracebackType
3
4
  from typing import Type
4
5
 
5
6
  import click
6
7
  from rich.console import Console
7
8
  from rich.panel import Panel
9
+ from rich.text import Text
8
10
 
9
11
  from lightning_sdk import __version__
10
12
  from lightning_sdk.api.studio_api import _cloud_url
@@ -26,13 +28,29 @@ from lightning_sdk.cli.start import start
26
28
  from lightning_sdk.cli.stop import stop
27
29
  from lightning_sdk.cli.switch import switch
28
30
  from lightning_sdk.cli.upload import upload
31
+ from lightning_sdk.constants import _LIGHTNING_DEBUG
29
32
  from lightning_sdk.lightning_cloud.login import Auth
30
33
 
31
34
 
32
- def _notify_exception(exception_type: Type[BaseException], value: BaseException, tb: TracebackType) -> None: # No
35
+ def _notify_exception(exception_type: Type[BaseException], value: BaseException, tb: TracebackType) -> None:
33
36
  """CLI won't show tracebacks, just print the exception message."""
37
+ # if debug mode, print the traceback using rich
34
38
  console = Console()
35
- console.print(Panel(value))
39
+ if value.args:
40
+ message = str(value.args[0]) if value.args[0] else str(value)
41
+ else:
42
+ message = str(value) or "An unknown error occurred"
43
+
44
+ error_content = Text()
45
+ error_content.append(f"{exception_type.__name__}: ", style="bold red")
46
+ error_content.append(message, style="white")
47
+
48
+ if _LIGHTNING_DEBUG:
49
+ error_content.append("\n\nFull traceback:\n", style="bold yellow")
50
+ tb_lines = traceback.format_exception(exception_type, value, tb)
51
+ error_content.append("".join(tb_lines), style="dim white")
52
+
53
+ console.print(Panel(error_content, title="⚡ Lightning CLI Error", border_style="red"))
36
54
 
37
55
 
38
56
  @click.group(name="lightning", help="Command line interface (CLI) to interact with/manage Lightning AI Studios.")
@@ -43,8 +43,8 @@ class Auth:
43
43
  for key in Keys:
44
44
  setattr(self, key.suffix, os.environ.get(key.value, None))
45
45
 
46
- self._with_env_var = bool(
47
- self.user_id and self.api_key) # used by authenticate method
46
+ # used by authenticate method
47
+ self._with_env_var = bool(self.user_id and self.api_key)
48
48
  if self.api_key and not self.user_id:
49
49
  raise ValueError(
50
50
  f"{Keys.USER_ID.value} is missing from env variables. "
@@ -69,6 +69,7 @@ from lightning_sdk.lightning_cloud.openapi.configuration import Configuration
69
69
  from lightning_sdk.lightning_cloud.openapi.models.affiliatelinks_id_body import AffiliatelinksIdBody
70
70
  from lightning_sdk.lightning_cloud.openapi.models.agentmanagedendpoints_id_body import AgentmanagedendpointsIdBody
71
71
  from lightning_sdk.lightning_cloud.openapi.models.agents_id_body import AgentsIdBody
72
+ from lightning_sdk.lightning_cloud.openapi.models.alertingevents_id_body import AlertingeventsIdBody
72
73
  from lightning_sdk.lightning_cloud.openapi.models.alerts_config_billing import AlertsConfigBilling
73
74
  from lightning_sdk.lightning_cloud.openapi.models.alerts_config_studios import AlertsConfigStudios
74
75
  from lightning_sdk.lightning_cloud.openapi.models.app_id_works_body import AppIdWorksBody
@@ -256,6 +257,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_assistant import V1Assistan
256
257
  from lightning_sdk.lightning_cloud.openapi.models.v1_assistant_knowledge_item_status import V1AssistantKnowledgeItemStatus
257
258
  from lightning_sdk.lightning_cloud.openapi.models.v1_assistant_knowledge_status import V1AssistantKnowledgeStatus
258
259
  from lightning_sdk.lightning_cloud.openapi.models.v1_assistant_model_status import V1AssistantModelStatus
260
+ from lightning_sdk.lightning_cloud.openapi.models.v1_author import V1Author
259
261
  from lightning_sdk.lightning_cloud.openapi.models.v1_auto_join_domain_validation import V1AutoJoinDomainValidation
260
262
  from lightning_sdk.lightning_cloud.openapi.models.v1_auto_join_org_response import V1AutoJoinOrgResponse
261
263
  from lightning_sdk.lightning_cloud.openapi.models.v1_autoscaling_spec import V1AutoscalingSpec
@@ -485,7 +487,6 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_drive_status import V1Drive
485
487
  from lightning_sdk.lightning_cloud.openapi.models.v1_drive_type import V1DriveType
486
488
  from lightning_sdk.lightning_cloud.openapi.models.v1_drive_type_spec import V1DriveTypeSpec
487
489
  from lightning_sdk.lightning_cloud.openapi.models.v1_drive_type_status import V1DriveTypeStatus
488
- from lightning_sdk.lightning_cloud.openapi.models.v1_ebs import V1Ebs
489
490
  from lightning_sdk.lightning_cloud.openapi.models.v1_efs_config import V1EfsConfig
490
491
  from lightning_sdk.lightning_cloud.openapi.models.v1_endpoint import V1Endpoint
491
492
  from lightning_sdk.lightning_cloud.openapi.models.v1_endpoint_auth import V1EndpointAuth
@@ -562,7 +563,6 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_balance_response i
562
563
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_notification_preferences_response import V1GetUserNotificationPreferencesResponse
563
564
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_response import V1GetUserResponse
564
565
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_storage_breakdown_response import V1GetUserStorageBreakdownResponse
565
- from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_storage_response import V1GetUserStorageResponse
566
566
  from lightning_sdk.lightning_cloud.openapi.models.v1_git_credentials import V1GitCredentials
567
567
  from lightning_sdk.lightning_cloud.openapi.models.v1_google_cloud_direct_v1 import V1GoogleCloudDirectV1
568
568
  from lightning_sdk.lightning_cloud.openapi.models.v1_google_cloud_direct_v1_status import V1GoogleCloudDirectV1Status
@@ -831,7 +831,6 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_report_restart_timings_resp
831
831
  from lightning_sdk.lightning_cloud.openapi.models.v1_request_cluster_access_request import V1RequestClusterAccessRequest
832
832
  from lightning_sdk.lightning_cloud.openapi.models.v1_request_cluster_access_response import V1RequestClusterAccessResponse
833
833
  from lightning_sdk.lightning_cloud.openapi.models.v1_request_verification_code_response import V1RequestVerificationCodeResponse
834
- from lightning_sdk.lightning_cloud.openapi.models.v1_reservation_billing_session import V1ReservationBillingSession
835
834
  from lightning_sdk.lightning_cloud.openapi.models.v1_reservation_details import V1ReservationDetails
836
835
  from lightning_sdk.lightning_cloud.openapi.models.v1_resource_tag import V1ResourceTag
837
836
  from lightning_sdk.lightning_cloud.openapi.models.v1_resource_visibility import V1ResourceVisibility
@@ -1420,6 +1420,8 @@ class EndpointServiceApi(object):
1420
1420
  :param list[str] ids:
1421
1421
  :param bool active_cloudspaces:
1422
1422
  :param bool active_jobs:
1423
+ :param list[str] cloudspace_ids:
1424
+ :param list[str] job_ids:
1423
1425
  :return: V1ListEndpointsResponse
1424
1426
  If the method is called asynchronously,
1425
1427
  returns the request thread.
@@ -1447,12 +1449,14 @@ class EndpointServiceApi(object):
1447
1449
  :param list[str] ids:
1448
1450
  :param bool active_cloudspaces:
1449
1451
  :param bool active_jobs:
1452
+ :param list[str] cloudspace_ids:
1453
+ :param list[str] job_ids:
1450
1454
  :return: V1ListEndpointsResponse
1451
1455
  If the method is called asynchronously,
1452
1456
  returns the request thread.
1453
1457
  """
1454
1458
 
1455
- all_params = ['project_id', 'cloudspace_id', 'auto_start', 'cluster_id', 'ids', 'active_cloudspaces', 'active_jobs'] # noqa: E501
1459
+ all_params = ['project_id', 'cloudspace_id', 'auto_start', 'cluster_id', 'ids', 'active_cloudspaces', 'active_jobs', 'cloudspace_ids', 'job_ids'] # noqa: E501
1456
1460
  all_params.append('async_req')
1457
1461
  all_params.append('_return_http_data_only')
1458
1462
  all_params.append('_preload_content')
@@ -1492,6 +1496,12 @@ class EndpointServiceApi(object):
1492
1496
  query_params.append(('activeCloudspaces', params['active_cloudspaces'])) # noqa: E501
1493
1497
  if 'active_jobs' in params:
1494
1498
  query_params.append(('activeJobs', params['active_jobs'])) # noqa: E501
1499
+ if 'cloudspace_ids' in params:
1500
+ query_params.append(('cloudspaceIds', params['cloudspace_ids'])) # noqa: E501
1501
+ collection_formats['cloudspaceIds'] = 'multi' # noqa: E501
1502
+ if 'job_ids' in params:
1503
+ query_params.append(('jobIds', params['job_ids'])) # noqa: E501
1504
+ collection_formats['jobIds'] = 'multi' # noqa: E501
1495
1505
 
1496
1506
  header_params = {}
1497
1507
 
@@ -4639,6 +4639,127 @@ class JobsServiceApi(object):
4639
4639
  _request_timeout=params.get('_request_timeout'),
4640
4640
  collection_formats=collection_formats)
4641
4641
 
4642
+ def jobs_service_update_deployment_alerting_event(self, body: 'AlertingeventsIdBody', project_id: 'str', deployment_id: 'str', id: 'str', **kwargs) -> 'V1DeploymentAlertingEvent': # noqa: E501
4643
+ """UpdateDeploymentAlertingEvent lists the deployment alert events # noqa: E501
4644
+
4645
+ This method makes a synchronous HTTP request by default. To make an
4646
+ asynchronous HTTP request, please pass async_req=True
4647
+ >>> thread = api.jobs_service_update_deployment_alerting_event(body, project_id, deployment_id, id, async_req=True)
4648
+ >>> result = thread.get()
4649
+
4650
+ :param async_req bool
4651
+ :param AlertingeventsIdBody body: (required)
4652
+ :param str project_id: (required)
4653
+ :param str deployment_id: (required)
4654
+ :param str id: (required)
4655
+ :return: V1DeploymentAlertingEvent
4656
+ If the method is called asynchronously,
4657
+ returns the request thread.
4658
+ """
4659
+ kwargs['_return_http_data_only'] = True
4660
+ if kwargs.get('async_req'):
4661
+ return self.jobs_service_update_deployment_alerting_event_with_http_info(body, project_id, deployment_id, id, **kwargs) # noqa: E501
4662
+ else:
4663
+ (data) = self.jobs_service_update_deployment_alerting_event_with_http_info(body, project_id, deployment_id, id, **kwargs) # noqa: E501
4664
+ return data
4665
+
4666
+ def jobs_service_update_deployment_alerting_event_with_http_info(self, body: 'AlertingeventsIdBody', project_id: 'str', deployment_id: 'str', id: 'str', **kwargs) -> 'V1DeploymentAlertingEvent': # noqa: E501
4667
+ """UpdateDeploymentAlertingEvent lists the deployment alert events # noqa: E501
4668
+
4669
+ This method makes a synchronous HTTP request by default. To make an
4670
+ asynchronous HTTP request, please pass async_req=True
4671
+ >>> thread = api.jobs_service_update_deployment_alerting_event_with_http_info(body, project_id, deployment_id, id, async_req=True)
4672
+ >>> result = thread.get()
4673
+
4674
+ :param async_req bool
4675
+ :param AlertingeventsIdBody body: (required)
4676
+ :param str project_id: (required)
4677
+ :param str deployment_id: (required)
4678
+ :param str id: (required)
4679
+ :return: V1DeploymentAlertingEvent
4680
+ If the method is called asynchronously,
4681
+ returns the request thread.
4682
+ """
4683
+
4684
+ all_params = ['body', 'project_id', 'deployment_id', 'id'] # noqa: E501
4685
+ all_params.append('async_req')
4686
+ all_params.append('_return_http_data_only')
4687
+ all_params.append('_preload_content')
4688
+ all_params.append('_request_timeout')
4689
+
4690
+ params = locals()
4691
+ for key, val in six.iteritems(params['kwargs']):
4692
+ if key not in all_params:
4693
+ raise TypeError(
4694
+ "Got an unexpected keyword argument '%s'"
4695
+ " to method jobs_service_update_deployment_alerting_event" % key
4696
+ )
4697
+ params[key] = val
4698
+ del params['kwargs']
4699
+ # verify the required parameter 'body' is set
4700
+ if ('body' not in params or
4701
+ params['body'] is None):
4702
+ raise ValueError("Missing the required parameter `body` when calling `jobs_service_update_deployment_alerting_event`") # noqa: E501
4703
+ # verify the required parameter 'project_id' is set
4704
+ if ('project_id' not in params or
4705
+ params['project_id'] is None):
4706
+ raise ValueError("Missing the required parameter `project_id` when calling `jobs_service_update_deployment_alerting_event`") # noqa: E501
4707
+ # verify the required parameter 'deployment_id' is set
4708
+ if ('deployment_id' not in params or
4709
+ params['deployment_id'] is None):
4710
+ raise ValueError("Missing the required parameter `deployment_id` when calling `jobs_service_update_deployment_alerting_event`") # noqa: E501
4711
+ # verify the required parameter 'id' is set
4712
+ if ('id' not in params or
4713
+ params['id'] is None):
4714
+ raise ValueError("Missing the required parameter `id` when calling `jobs_service_update_deployment_alerting_event`") # noqa: E501
4715
+
4716
+ collection_formats = {}
4717
+
4718
+ path_params = {}
4719
+ if 'project_id' in params:
4720
+ path_params['projectId'] = params['project_id'] # noqa: E501
4721
+ if 'deployment_id' in params:
4722
+ path_params['deploymentId'] = params['deployment_id'] # noqa: E501
4723
+ if 'id' in params:
4724
+ path_params['id'] = params['id'] # noqa: E501
4725
+
4726
+ query_params = []
4727
+
4728
+ header_params = {}
4729
+
4730
+ form_params = []
4731
+ local_var_files = {}
4732
+
4733
+ body_params = None
4734
+ if 'body' in params:
4735
+ body_params = params['body']
4736
+ # HTTP header `Accept`
4737
+ header_params['Accept'] = self.api_client.select_header_accept(
4738
+ ['application/json']) # noqa: E501
4739
+
4740
+ # HTTP header `Content-Type`
4741
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
4742
+ ['application/json']) # noqa: E501
4743
+
4744
+ # Authentication setting
4745
+ auth_settings = [] # noqa: E501
4746
+
4747
+ return self.api_client.call_api(
4748
+ '/v1/projects/{projectId}/deployments/{deploymentId}/alerting-events/{id}', 'PUT',
4749
+ path_params,
4750
+ query_params,
4751
+ header_params,
4752
+ body=body_params,
4753
+ post_params=form_params,
4754
+ files=local_var_files,
4755
+ response_type='V1DeploymentAlertingEvent', # noqa: E501
4756
+ auth_settings=auth_settings,
4757
+ async_req=params.get('async_req'),
4758
+ _return_http_data_only=params.get('_return_http_data_only'),
4759
+ _preload_content=params.get('_preload_content', True),
4760
+ _request_timeout=params.get('_request_timeout'),
4761
+ collection_formats=collection_formats)
4762
+
4642
4763
  def jobs_service_update_deployment_alerting_policy(self, body: 'DeploymentIdAlertingpoliciesBody', project_id: 'str', deployment_id: 'str', **kwargs) -> 'V1DeploymentAlertingPolicy': # noqa: E501
4643
4764
  """jobs_service_update_deployment_alerting_policy # noqa: E501
4644
4765
 
@@ -706,91 +706,6 @@ class UserServiceApi(object):
706
706
  _request_timeout=params.get('_request_timeout'),
707
707
  collection_formats=collection_formats)
708
708
 
709
- def user_service_get_user_storage(self, **kwargs) -> 'V1GetUserStorageResponse': # noqa: E501
710
- """user_service_get_user_storage # noqa: E501
711
-
712
- This method makes a synchronous HTTP request by default. To make an
713
- asynchronous HTTP request, please pass async_req=True
714
- >>> thread = api.user_service_get_user_storage(async_req=True)
715
- >>> result = thread.get()
716
-
717
- :param async_req bool
718
- :return: V1GetUserStorageResponse
719
- If the method is called asynchronously,
720
- returns the request thread.
721
- """
722
- kwargs['_return_http_data_only'] = True
723
- if kwargs.get('async_req'):
724
- return self.user_service_get_user_storage_with_http_info(**kwargs) # noqa: E501
725
- else:
726
- (data) = self.user_service_get_user_storage_with_http_info(**kwargs) # noqa: E501
727
- return data
728
-
729
- def user_service_get_user_storage_with_http_info(self, **kwargs) -> 'V1GetUserStorageResponse': # noqa: E501
730
- """user_service_get_user_storage # noqa: E501
731
-
732
- This method makes a synchronous HTTP request by default. To make an
733
- asynchronous HTTP request, please pass async_req=True
734
- >>> thread = api.user_service_get_user_storage_with_http_info(async_req=True)
735
- >>> result = thread.get()
736
-
737
- :param async_req bool
738
- :return: V1GetUserStorageResponse
739
- If the method is called asynchronously,
740
- returns the request thread.
741
- """
742
-
743
- all_params = [] # noqa: E501
744
- all_params.append('async_req')
745
- all_params.append('_return_http_data_only')
746
- all_params.append('_preload_content')
747
- all_params.append('_request_timeout')
748
-
749
- params = locals()
750
- for key, val in six.iteritems(params['kwargs']):
751
- if key not in all_params:
752
- raise TypeError(
753
- "Got an unexpected keyword argument '%s'"
754
- " to method user_service_get_user_storage" % key
755
- )
756
- params[key] = val
757
- del params['kwargs']
758
-
759
- collection_formats = {}
760
-
761
- path_params = {}
762
-
763
- query_params = []
764
-
765
- header_params = {}
766
-
767
- form_params = []
768
- local_var_files = {}
769
-
770
- body_params = None
771
- # HTTP header `Accept`
772
- header_params['Accept'] = self.api_client.select_header_accept(
773
- ['application/json']) # noqa: E501
774
-
775
- # Authentication setting
776
- auth_settings = [] # noqa: E501
777
-
778
- return self.api_client.call_api(
779
- '/v1/users/storage', 'GET',
780
- path_params,
781
- query_params,
782
- header_params,
783
- body=body_params,
784
- post_params=form_params,
785
- files=local_var_files,
786
- response_type='V1GetUserStorageResponse', # noqa: E501
787
- auth_settings=auth_settings,
788
- async_req=params.get('async_req'),
789
- _return_http_data_only=params.get('_return_http_data_only'),
790
- _preload_content=params.get('_preload_content', True),
791
- _request_timeout=params.get('_request_timeout'),
792
- collection_formats=collection_formats)
793
-
794
709
  def user_service_get_user_storage_breakdown(self, **kwargs) -> 'V1GetUserStorageBreakdownResponse': # noqa: E501
795
710
  """user_service_get_user_storage_breakdown # noqa: E501
796
711
 
@@ -24,6 +24,7 @@ from __future__ import absolute_import
24
24
  from lightning_sdk.lightning_cloud.openapi.models.affiliatelinks_id_body import AffiliatelinksIdBody
25
25
  from lightning_sdk.lightning_cloud.openapi.models.agentmanagedendpoints_id_body import AgentmanagedendpointsIdBody
26
26
  from lightning_sdk.lightning_cloud.openapi.models.agents_id_body import AgentsIdBody
27
+ from lightning_sdk.lightning_cloud.openapi.models.alertingevents_id_body import AlertingeventsIdBody
27
28
  from lightning_sdk.lightning_cloud.openapi.models.alerts_config_billing import AlertsConfigBilling
28
29
  from lightning_sdk.lightning_cloud.openapi.models.alerts_config_studios import AlertsConfigStudios
29
30
  from lightning_sdk.lightning_cloud.openapi.models.app_id_works_body import AppIdWorksBody
@@ -211,6 +212,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_assistant import V1Assistan
211
212
  from lightning_sdk.lightning_cloud.openapi.models.v1_assistant_knowledge_item_status import V1AssistantKnowledgeItemStatus
212
213
  from lightning_sdk.lightning_cloud.openapi.models.v1_assistant_knowledge_status import V1AssistantKnowledgeStatus
213
214
  from lightning_sdk.lightning_cloud.openapi.models.v1_assistant_model_status import V1AssistantModelStatus
215
+ from lightning_sdk.lightning_cloud.openapi.models.v1_author import V1Author
214
216
  from lightning_sdk.lightning_cloud.openapi.models.v1_auto_join_domain_validation import V1AutoJoinDomainValidation
215
217
  from lightning_sdk.lightning_cloud.openapi.models.v1_auto_join_org_response import V1AutoJoinOrgResponse
216
218
  from lightning_sdk.lightning_cloud.openapi.models.v1_autoscaling_spec import V1AutoscalingSpec
@@ -440,7 +442,6 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_drive_status import V1Drive
440
442
  from lightning_sdk.lightning_cloud.openapi.models.v1_drive_type import V1DriveType
441
443
  from lightning_sdk.lightning_cloud.openapi.models.v1_drive_type_spec import V1DriveTypeSpec
442
444
  from lightning_sdk.lightning_cloud.openapi.models.v1_drive_type_status import V1DriveTypeStatus
443
- from lightning_sdk.lightning_cloud.openapi.models.v1_ebs import V1Ebs
444
445
  from lightning_sdk.lightning_cloud.openapi.models.v1_efs_config import V1EfsConfig
445
446
  from lightning_sdk.lightning_cloud.openapi.models.v1_endpoint import V1Endpoint
446
447
  from lightning_sdk.lightning_cloud.openapi.models.v1_endpoint_auth import V1EndpointAuth
@@ -517,7 +518,6 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_balance_response i
517
518
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_notification_preferences_response import V1GetUserNotificationPreferencesResponse
518
519
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_response import V1GetUserResponse
519
520
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_storage_breakdown_response import V1GetUserStorageBreakdownResponse
520
- from lightning_sdk.lightning_cloud.openapi.models.v1_get_user_storage_response import V1GetUserStorageResponse
521
521
  from lightning_sdk.lightning_cloud.openapi.models.v1_git_credentials import V1GitCredentials
522
522
  from lightning_sdk.lightning_cloud.openapi.models.v1_google_cloud_direct_v1 import V1GoogleCloudDirectV1
523
523
  from lightning_sdk.lightning_cloud.openapi.models.v1_google_cloud_direct_v1_status import V1GoogleCloudDirectV1Status
@@ -786,7 +786,6 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_report_restart_timings_resp
786
786
  from lightning_sdk.lightning_cloud.openapi.models.v1_request_cluster_access_request import V1RequestClusterAccessRequest
787
787
  from lightning_sdk.lightning_cloud.openapi.models.v1_request_cluster_access_response import V1RequestClusterAccessResponse
788
788
  from lightning_sdk.lightning_cloud.openapi.models.v1_request_verification_code_response import V1RequestVerificationCodeResponse
789
- from lightning_sdk.lightning_cloud.openapi.models.v1_reservation_billing_session import V1ReservationBillingSession
790
789
  from lightning_sdk.lightning_cloud.openapi.models.v1_reservation_details import V1ReservationDetails
791
790
  from lightning_sdk.lightning_cloud.openapi.models.v1_resource_tag import V1ResourceTag
792
791
  from lightning_sdk.lightning_cloud.openapi.models.v1_resource_visibility import V1ResourceVisibility