lightning-sdk 0.1.56__py3-none-any.whl → 0.1.57__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 (39) hide show
  1. lightning_sdk/__init__.py +3 -2
  2. lightning_sdk/cli/ai_hub.py +61 -10
  3. lightning_sdk/cli/configure.py +110 -65
  4. lightning_sdk/cli/connect.py +32 -16
  5. lightning_sdk/cli/delete.py +81 -32
  6. lightning_sdk/cli/download.py +177 -90
  7. lightning_sdk/cli/entrypoint.py +44 -16
  8. lightning_sdk/cli/generate.py +48 -16
  9. lightning_sdk/cli/inspect.py +43 -3
  10. lightning_sdk/cli/list.py +130 -41
  11. lightning_sdk/cli/run.py +0 -6
  12. lightning_sdk/cli/teamspace_menu.py +1 -1
  13. lightning_sdk/helpers.py +20 -0
  14. lightning_sdk/job/job.py +1 -1
  15. lightning_sdk/lightning_cloud/openapi/__init__.py +5 -0
  16. lightning_sdk/lightning_cloud/openapi/api/data_connection_service_api.py +105 -0
  17. lightning_sdk/lightning_cloud/openapi/api/jobs_service_api.py +113 -0
  18. lightning_sdk/lightning_cloud/openapi/api/lit_logger_service_api.py +4 -4
  19. lightning_sdk/lightning_cloud/openapi/models/__init__.py +5 -0
  20. lightning_sdk/lightning_cloud/openapi/models/agents_id_body.py +105 -1
  21. lightning_sdk/lightning_cloud/openapi/models/deployments_id_body.py +29 -3
  22. lightning_sdk/lightning_cloud/openapi/models/id_visibility_body1.py +149 -0
  23. lightning_sdk/lightning_cloud/openapi/models/model_id_visibility_body.py +27 -1
  24. lightning_sdk/lightning_cloud/openapi/models/setup.py +149 -0
  25. lightning_sdk/lightning_cloud/openapi/models/v1_assistant.py +105 -1
  26. lightning_sdk/lightning_cloud/openapi/models/v1_deployment.py +29 -3
  27. lightning_sdk/lightning_cloud/openapi/models/v1_gcp_data_connection_setup.py +123 -0
  28. lightning_sdk/lightning_cloud/openapi/models/v1_job_spec.py +27 -1
  29. lightning_sdk/lightning_cloud/openapi/models/v1_setup_data_connection_response.py +123 -0
  30. lightning_sdk/lightning_cloud/openapi/models/v1_update_deployment_visibility_response.py +97 -0
  31. lightning_sdk/lightning_cloud/openapi/models/v1_update_metrics_stream_visibility_response.py +27 -1
  32. lightning_sdk/lightning_cloud/openapi/models/v1_update_model_visibility_response.py +27 -1
  33. lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +79 -1
  34. {lightning_sdk-0.1.56.dist-info → lightning_sdk-0.1.57.dist-info}/METADATA +2 -1
  35. {lightning_sdk-0.1.56.dist-info → lightning_sdk-0.1.57.dist-info}/RECORD +39 -34
  36. {lightning_sdk-0.1.56.dist-info → lightning_sdk-0.1.57.dist-info}/LICENSE +0 -0
  37. {lightning_sdk-0.1.56.dist-info → lightning_sdk-0.1.57.dist-info}/WHEEL +0 -0
  38. {lightning_sdk-0.1.56.dist-info → lightning_sdk-0.1.57.dist-info}/entry_points.txt +0 -0
  39. {lightning_sdk-0.1.56.dist-info → lightning_sdk-0.1.57.dist-info}/top_level.txt +0 -0
lightning_sdk/cli/list.py CHANGED
@@ -1,27 +1,58 @@
1
- from typing import Optional
1
+ from contextlib import suppress
2
+ from typing import Callable, Optional
2
3
 
3
4
  from rich.console import Console
4
5
  from rich.table import Table
6
+ from typing_extensions import Literal
5
7
 
6
- from lightning_sdk import Machine
8
+ from lightning_sdk import Job, Machine, Studio, Teamspace
7
9
  from lightning_sdk.cli.teamspace_menu import _TeamspacesMenu
10
+ from lightning_sdk.lightning_cloud.openapi import V1MultiMachineJob
8
11
  from lightning_sdk.lit_container import LitContainer
12
+ from lightning_sdk.utils.resolve import _get_authed_user
9
13
 
10
14
 
11
15
  class _List(_TeamspacesMenu):
12
16
  """List resources on the Lightning AI platform."""
13
17
 
14
- def studios(self, teamspace: Optional[str] = None) -> None:
18
+ @staticmethod
19
+ def _sort_studios_key(sort_by: str) -> Callable[[Studio], str]:
20
+ """Return a key function to sort studios by a given attribute."""
21
+ sort_key_map = {
22
+ "name": lambda s: str(s.name or ""),
23
+ "teamspace": lambda s: str(s.teamspace.name or ""),
24
+ "status": lambda s: str(s.status or ""),
25
+ "machine": lambda s: str(s.machine or ""),
26
+ "cloud-account": lambda s: str(s.cloud_account or ""),
27
+ }
28
+ return sort_key_map.get(sort_by, lambda s: s.name)
29
+
30
+ def studios(
31
+ self,
32
+ teamspace: Optional[str] = None,
33
+ all: bool = False, # noqa: A002
34
+ sort_by: Optional[Literal["name", "teamspace", "status", "machine", "cloud-account"]] = None,
35
+ ) -> None:
15
36
  """List studios for a given teamspace.
16
37
 
17
38
  Args:
18
39
  teamspace: the teamspace to list studios from. Should be specified as {owner}/{name}
19
40
  If not provided, can be selected in an interactive menu.
41
+ all: if teamspece is not provided, list all studios in all teamspaces.
42
+ sort_by: the attribute to sort the studios by.
43
+ Can be one of "name", "teamspace", "status", "machine", "cloud-account".
20
44
 
21
45
  """
22
- resolved_teamspace = self._resolve_teamspace(teamspace=teamspace)
23
-
24
- studios = resolved_teamspace.studios
46
+ studios = []
47
+ if all and not teamspace:
48
+ user = _get_authed_user()
49
+ possible_teamspaces = self._get_possible_teamspaces(user)
50
+ for ts in possible_teamspaces.values():
51
+ teamspace = Teamspace(**ts)
52
+ studios.extend(teamspace.studios)
53
+ else:
54
+ resolved_teamspace = self._resolve_teamspace(teamspace=teamspace)
55
+ studios = resolved_teamspace.studios
25
56
 
26
57
  table = Table(
27
58
  pad_edge=True,
@@ -31,32 +62,59 @@ class _List(_TeamspacesMenu):
31
62
  table.add_column("Status")
32
63
  table.add_column("Machine")
33
64
  table.add_column("Cloud account")
34
- for studio in studios:
65
+ for studio in sorted(studios, key=self._sort_studios_key(sort_by)):
35
66
  table.add_row(
36
67
  studio.name,
37
68
  f"{studio.teamspace.owner.name}/{studio.teamspace.name}",
38
69
  str(studio.status),
39
- str(studio.machine) if studio.machine is not None else None,
70
+ str(studio.machine) if studio.machine is not None else None, # when None the cell is empty
40
71
  str(studio.cloud_account),
41
72
  )
42
73
 
43
74
  Console().print(table)
44
75
 
45
- def jobs(self, teamspace: Optional[str] = None) -> None:
76
+ @staticmethod
77
+ def _sort_jobs_key(sort_by: str) -> Callable[[Job], str]:
78
+ """Return a key function to sort studios by a given attribute."""
79
+ sort_key_map = {
80
+ "name": lambda j: str(j.name or ""),
81
+ "teamspace": lambda j: str(j.teamspace.name or ""),
82
+ "status": lambda j: str(j.status or ""),
83
+ "machine": lambda j: str(j.machine or ""),
84
+ "studio": lambda j: str(j.studio or ""),
85
+ "image": lambda j: str(j.image or ""),
86
+ "cloud-account": lambda j: str(j.cloud_account or ""),
87
+ }
88
+ return sort_key_map.get(sort_by, lambda j: j.name)
89
+
90
+ def jobs(
91
+ self,
92
+ teamspace: Optional[str] = None,
93
+ all: bool = False, # noqa: A002
94
+ sort_by: Optional[Literal["name", "teamspace", "status", "studio", "machine", "image", "cloud-account"]] = None,
95
+ ) -> None:
46
96
  """List jobs for a given teamspace.
47
97
 
48
98
  Args:
49
99
  teamspace: the teamspace to list jobs from. Should be specified as {owner}/{name}
50
100
  If not provided, can be selected in an interactive menu.
101
+ all: if teamspece is not provided, list all jobs in all teamspaces.
102
+ sort_by: the attribute to sort the jobs by.
103
+ Can be one of "name", "teamspace", "status", "studio", "machine", "image", "cloud-account".
51
104
 
52
105
  """
53
- resolved_teamspace = self._resolve_teamspace(teamspace=teamspace)
54
-
55
- jobs = resolved_teamspace.jobs
106
+ jobs = []
107
+ if all and not teamspace:
108
+ user = _get_authed_user()
109
+ possible_teamspaces = self._get_possible_teamspaces(user)
110
+ for ts in possible_teamspaces.values():
111
+ teamspace = Teamspace(**ts)
112
+ jobs.extend(teamspace.jobs)
113
+ else:
114
+ resolved_teamspace = self._resolve_teamspace(teamspace=teamspace)
115
+ jobs = resolved_teamspace.jobs
56
116
 
57
- table = Table(
58
- pad_edge=True,
59
- )
117
+ table = Table(pad_edge=True)
60
118
  table.add_column("Name")
61
119
  table.add_column("Teamspace")
62
120
  table.add_column("Studio")
@@ -64,35 +122,64 @@ class _List(_TeamspacesMenu):
64
122
  table.add_column("Status")
65
123
  table.add_column("Machine")
66
124
  table.add_column("Total Cost")
67
- for j in jobs:
125
+ for j in sorted(jobs, key=self._sort_jobs_key(sort_by)):
68
126
  # we know we just fetched these, so no need to refetch
69
127
  j._prevent_refetch_latest = True
70
128
  j._internal_job._prevent_refetch_latest = True
71
129
 
72
130
  studio = j.studio
73
- table.add_row(
74
- j.name,
75
- f"{j.teamspace.owner.name}/{j.teamspace.name}",
76
- studio.name if studio else None,
77
- j.image,
78
- str(j.status),
79
- str(j.machine),
80
- f"{j.total_cost:.3f}",
81
- )
131
+ with suppress(RuntimeError):
132
+ table.add_row(
133
+ j.name,
134
+ f"{j.teamspace.owner.name}/{j.teamspace.name}",
135
+ studio.name if studio else None,
136
+ j.image,
137
+ str(j.status) if j.status is not None else None,
138
+ str(j.machine),
139
+ f"{j.total_cost:.3f}",
140
+ )
82
141
 
83
142
  Console().print(table)
84
143
 
85
- def mmts(self, teamspace: Optional[str] = None) -> None:
144
+ def _sort_mmts_key(self, sort_by: str) -> Callable[[V1MultiMachineJob], str]:
145
+ """Return a key function to sort multi-machine jobs by a given attribute."""
146
+ sort_key_map = {
147
+ "name": lambda j: str(j.name or ""),
148
+ "teamspace": lambda j: str(j.teamspace.name or ""),
149
+ "studio": lambda j: str(j.studio.name or ""),
150
+ "image": lambda j: str(j.image or ""),
151
+ "status": lambda j: str(j.status or ""),
152
+ "machine": lambda j: str(j.machine or ""),
153
+ "cloud-account": lambda j: str(j.cloud_account or ""),
154
+ }
155
+ return sort_key_map.get(sort_by, lambda j: j.name)
156
+
157
+ def mmts(
158
+ self,
159
+ teamspace: Optional[str] = None,
160
+ all: bool = False, # noqa: A002
161
+ sort_by: Optional[Literal["name", "teamspace", "studio", "image", "status", "machine", "cloud-account"]] = None,
162
+ ) -> None:
86
163
  """List multi-machine jobs for a given teamspace.
87
164
 
88
165
  Args:
89
166
  teamspace: the teamspace to list jobs from. Should be specified as {owner}/{name}
90
167
  If not provided, can be selected in an interactive menu.
168
+ all: if teamspece is not provided, list all multi-machine jobs in all teamspaces.
169
+ sort_by: the attribute to sort the multi-machine jobs by.
170
+ Can be one of "name", "teamspace", "studio", "image", "status", "machine", "cloud-account".
91
171
 
92
172
  """
93
- resolved_teamspace = self._resolve_teamspace(teamspace=teamspace)
94
-
95
- jobs = resolved_teamspace.multi_machine_jobs
173
+ jobs = []
174
+ if all and not teamspace:
175
+ user = _get_authed_user()
176
+ possible_teamspaces = self._get_possible_teamspaces(user)
177
+ for ts in possible_teamspaces.values():
178
+ teamspace = Teamspace(**ts)
179
+ jobs.extend(teamspace.multi_machine_jobs)
180
+ else:
181
+ resolved_teamspace = self._resolve_teamspace(teamspace=teamspace)
182
+ jobs = resolved_teamspace.multi_machine_jobs
96
183
 
97
184
  table = Table(pad_edge=True)
98
185
  table.add_column("Name")
@@ -103,22 +190,24 @@ class _List(_TeamspacesMenu):
103
190
  table.add_column("Machine")
104
191
  table.add_column("Num Machines")
105
192
  table.add_column("Total Cost")
106
- for j in jobs:
193
+ for j in sorted(jobs, key=self._sort_mmts_key(sort_by)):
107
194
  # we know we just fetched these, so no need to refetch
108
195
  j._prevent_refetch_latest = True
109
- j._internal_job._prevent_refetch_latest = True
196
+ with suppress(AttributeError):
197
+ j._internal_job._prevent_refetch_latest = True
110
198
 
111
199
  studio = j.studio
112
- table.add_row(
113
- j.name,
114
- f"{j.teamspace.owner.name}/{j.teamspace.name}",
115
- studio.name if studio else None,
116
- j.image,
117
- str(j.status),
118
- str(j.machine),
119
- str(j.num_machines),
120
- str(j.total_cost),
121
- )
200
+ with suppress(RuntimeError):
201
+ table.add_row(
202
+ j.name,
203
+ f"{j.teamspace.owner.name}/{j.teamspace.name}",
204
+ studio.name if studio else None,
205
+ j.image,
206
+ str(j.status),
207
+ str(j.machine),
208
+ str(j.num_machines),
209
+ str(j.total_cost),
210
+ )
122
211
 
123
212
  Console().print(table)
124
213
 
lightning_sdk/cli/run.py CHANGED
@@ -162,10 +162,6 @@ class _Run:
162
162
 
163
163
  resolved_teamspace = Teamspace(name=teamspace, org=org, user=user)
164
164
 
165
- if cloud_account is None:
166
- cloud_account = resolved_teamspace.default_cloud_account
167
- machine_enum = Machine(machine.upper())
168
-
169
165
  path_mappings_dict = self._resolve_path_mapping(path_mappings=path_mappings)
170
166
 
171
167
  Job.run(
@@ -227,8 +223,6 @@ class _Run:
227
223
  machine_enum = machine
228
224
 
229
225
  resolved_teamspace = Teamspace(name=teamspace, org=org, user=user)
230
- if cloud_account is None:
231
- cloud_account = resolved_teamspace.default_cloud_account
232
226
 
233
227
  if image is None:
234
228
  raise RuntimeError("Image needs to be specified to run a multi-machine job")
@@ -27,7 +27,7 @@ class _TeamspacesMenu:
27
27
  if ts["name"] == name and (ts["user"] == owner or ts["org"] == owner):
28
28
  return ts
29
29
 
30
- Console().print("Could not find Teamspace {teamspace}, please select it from the list:")
30
+ Console().print(f"Could not find Teamspace {teamspace}, please select it from the list:")
31
31
  return self._get_teamspace_from_interactive_menu(possible_teamspaces)
32
32
 
33
33
  @staticmethod
lightning_sdk/helpers.py CHANGED
@@ -1,8 +1,13 @@
1
1
  import functools
2
+ import importlib
3
+ import os
4
+ import sys
2
5
  import warnings
3
6
  from typing import Optional
4
7
 
5
8
  import requests
9
+ import tqdm
10
+ import tqdm.std
6
11
  from packaging import version as packaging_version
7
12
 
8
13
  __package_name__ = "lightning-sdk"
@@ -47,3 +52,18 @@ def _check_version_and_prompt_upgrade(curr_version: str) -> None:
47
52
  UserWarning,
48
53
  )
49
54
  return
55
+
56
+
57
+ def _set_tqdm_envvars_noninteractive() -> None:
58
+ # note: stderr is the default stream tqdm writes progressbars to
59
+ # so we check that one.
60
+ if os.isatty(sys.stderr.fileno()):
61
+ os.unsetenv("TQDM_POSITION")
62
+ os.unsetenv("TQDM_MININTERVAL")
63
+ else:
64
+ # makes use of https://github.com/tqdm/tqdm/blob/master/tqdm/utils.py#L34 to set defaults
65
+ os.environ.update({"TQDM_POSITION": "-1", "TQDM_MININTERVAL": "1"})
66
+
67
+ # reload to make sure env vars are parsed again
68
+ importlib.reload(tqdm.std)
69
+ importlib.reload(tqdm)
lightning_sdk/job/job.py CHANGED
@@ -235,7 +235,7 @@ class Job(_BaseJob):
235
235
  return self._internal_job.delete()
236
236
 
237
237
  @property
238
- def status(self) -> "Status":
238
+ def status(self) -> Optional["Status"]:
239
239
  """The current status of the job."""
240
240
  return self._internal_job.status
241
241
 
@@ -130,6 +130,7 @@ from lightning_sdk.lightning_cloud.openapi.models.id_storage_body import IdStora
130
130
  from lightning_sdk.lightning_cloud.openapi.models.id_uploads_body import IdUploadsBody
131
131
  from lightning_sdk.lightning_cloud.openapi.models.id_uploads_body1 import IdUploadsBody1
132
132
  from lightning_sdk.lightning_cloud.openapi.models.id_visibility_body import IdVisibilityBody
133
+ from lightning_sdk.lightning_cloud.openapi.models.id_visibility_body1 import IdVisibilityBody1
133
134
  from lightning_sdk.lightning_cloud.openapi.models.jobs_id_body import JobsIdBody
134
135
  from lightning_sdk.lightning_cloud.openapi.models.jobs_id_body1 import JobsIdBody1
135
136
  from lightning_sdk.lightning_cloud.openapi.models.jobs_id_body2 import JobsIdBody2
@@ -182,6 +183,7 @@ from lightning_sdk.lightning_cloud.openapi.models.servers_server_id_body import
182
183
  from lightning_sdk.lightning_cloud.openapi.models.service_artifact_artifact_kind import ServiceArtifactArtifactKind
183
184
  from lightning_sdk.lightning_cloud.openapi.models.service_health_service_status import ServiceHealthServiceStatus
184
185
  from lightning_sdk.lightning_cloud.openapi.models.serviceexecution_id_body import ServiceexecutionIdBody
186
+ from lightning_sdk.lightning_cloud.openapi.models.setup import Setup
185
187
  from lightning_sdk.lightning_cloud.openapi.models.slurm_jobs_body import SlurmJobsBody
186
188
  from lightning_sdk.lightning_cloud.openapi.models.snowflake_export_body import SnowflakeExportBody
187
189
  from lightning_sdk.lightning_cloud.openapi.models.snowflake_query_body import SnowflakeQueryBody
@@ -440,6 +442,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_gpu_system_metrics import V
440
442
  from lightning_sdk.lightning_cloud.openapi.models.v1_gallery_app import V1GalleryApp
441
443
  from lightning_sdk.lightning_cloud.openapi.models.v1_gallery_component import V1GalleryComponent
442
444
  from lightning_sdk.lightning_cloud.openapi.models.v1_gcp_data_connection import V1GcpDataConnection
445
+ from lightning_sdk.lightning_cloud.openapi.models.v1_gcp_data_connection_setup import V1GcpDataConnectionSetup
443
446
  from lightning_sdk.lightning_cloud.openapi.models.v1_generate_ssh_key_pair_request import V1GenerateSSHKeyPairRequest
444
447
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_affiliate_link_response import V1GetAffiliateLinkResponse
445
448
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_agent_job_env_response import V1GetAgentJobEnvResponse
@@ -737,6 +740,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_service_artifact import V1S
737
740
  from lightning_sdk.lightning_cloud.openapi.models.v1_service_execution import V1ServiceExecution
738
741
  from lightning_sdk.lightning_cloud.openapi.models.v1_service_health import V1ServiceHealth
739
742
  from lightning_sdk.lightning_cloud.openapi.models.v1_setup_confirmed_ssh_public_key_response import V1SetupConfirmedSSHPublicKeyResponse
743
+ from lightning_sdk.lightning_cloud.openapi.models.v1_setup_data_connection_response import V1SetupDataConnectionResponse
740
744
  from lightning_sdk.lightning_cloud.openapi.models.v1_should_start_syncing_response import V1ShouldStartSyncingResponse
741
745
  from lightning_sdk.lightning_cloud.openapi.models.v1_signed_url import V1SignedUrl
742
746
  from lightning_sdk.lightning_cloud.openapi.models.v1_slurm_node import V1SlurmNode
@@ -773,6 +777,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_update_cloud_space_publicat
773
777
  from lightning_sdk.lightning_cloud.openapi.models.v1_update_cluster_accelerators_request import V1UpdateClusterAcceleratorsRequest
774
778
  from lightning_sdk.lightning_cloud.openapi.models.v1_update_cluster_accelerators_response import V1UpdateClusterAcceleratorsResponse
775
779
  from lightning_sdk.lightning_cloud.openapi.models.v1_update_cluster_availability_request import V1UpdateClusterAvailabilityRequest
780
+ from lightning_sdk.lightning_cloud.openapi.models.v1_update_deployment_visibility_response import V1UpdateDeploymentVisibilityResponse
776
781
  from lightning_sdk.lightning_cloud.openapi.models.v1_update_index_response import V1UpdateIndexResponse
777
782
  from lightning_sdk.lightning_cloud.openapi.models.v1_update_lit_page_response import V1UpdateLitPageResponse
778
783
  from lightning_sdk.lightning_cloud.openapi.models.v1_update_lit_repository_response import V1UpdateLitRepositoryResponse
@@ -920,6 +920,111 @@ class DataConnectionServiceApi(object):
920
920
  _request_timeout=params.get('_request_timeout'),
921
921
  collection_formats=collection_formats)
922
922
 
923
+ def data_connection_service_setup_data_connection(self, body: 'Setup', project_id: 'str', **kwargs) -> 'V1SetupDataConnectionResponse': # noqa: E501
924
+ """data_connection_service_setup_data_connection # noqa: E501
925
+
926
+ This method makes a synchronous HTTP request by default. To make an
927
+ asynchronous HTTP request, please pass async_req=True
928
+ >>> thread = api.data_connection_service_setup_data_connection(body, project_id, async_req=True)
929
+ >>> result = thread.get()
930
+
931
+ :param async_req bool
932
+ :param Setup body: (required)
933
+ :param str project_id: (required)
934
+ :return: V1SetupDataConnectionResponse
935
+ If the method is called asynchronously,
936
+ returns the request thread.
937
+ """
938
+ kwargs['_return_http_data_only'] = True
939
+ if kwargs.get('async_req'):
940
+ return self.data_connection_service_setup_data_connection_with_http_info(body, project_id, **kwargs) # noqa: E501
941
+ else:
942
+ (data) = self.data_connection_service_setup_data_connection_with_http_info(body, project_id, **kwargs) # noqa: E501
943
+ return data
944
+
945
+ def data_connection_service_setup_data_connection_with_http_info(self, body: 'Setup', project_id: 'str', **kwargs) -> 'V1SetupDataConnectionResponse': # noqa: E501
946
+ """data_connection_service_setup_data_connection # noqa: E501
947
+
948
+ This method makes a synchronous HTTP request by default. To make an
949
+ asynchronous HTTP request, please pass async_req=True
950
+ >>> thread = api.data_connection_service_setup_data_connection_with_http_info(body, project_id, async_req=True)
951
+ >>> result = thread.get()
952
+
953
+ :param async_req bool
954
+ :param Setup body: (required)
955
+ :param str project_id: (required)
956
+ :return: V1SetupDataConnectionResponse
957
+ If the method is called asynchronously,
958
+ returns the request thread.
959
+ """
960
+
961
+ all_params = ['body', 'project_id'] # noqa: E501
962
+ all_params.append('async_req')
963
+ all_params.append('_return_http_data_only')
964
+ all_params.append('_preload_content')
965
+ all_params.append('_request_timeout')
966
+
967
+ params = locals()
968
+ for key, val in six.iteritems(params['kwargs']):
969
+ if key not in all_params:
970
+ raise TypeError(
971
+ "Got an unexpected keyword argument '%s'"
972
+ " to method data_connection_service_setup_data_connection" % key
973
+ )
974
+ params[key] = val
975
+ del params['kwargs']
976
+ # verify the required parameter 'body' is set
977
+ if ('body' not in params or
978
+ params['body'] is None):
979
+ raise ValueError("Missing the required parameter `body` when calling `data_connection_service_setup_data_connection`") # noqa: E501
980
+ # verify the required parameter 'project_id' is set
981
+ if ('project_id' not in params or
982
+ params['project_id'] is None):
983
+ raise ValueError("Missing the required parameter `project_id` when calling `data_connection_service_setup_data_connection`") # noqa: E501
984
+
985
+ collection_formats = {}
986
+
987
+ path_params = {}
988
+ if 'project_id' in params:
989
+ path_params['projectId'] = params['project_id'] # noqa: E501
990
+
991
+ query_params = []
992
+
993
+ header_params = {}
994
+
995
+ form_params = []
996
+ local_var_files = {}
997
+
998
+ body_params = None
999
+ if 'body' in params:
1000
+ body_params = params['body']
1001
+ # HTTP header `Accept`
1002
+ header_params['Accept'] = self.api_client.select_header_accept(
1003
+ ['application/json']) # noqa: E501
1004
+
1005
+ # HTTP header `Content-Type`
1006
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
1007
+ ['application/json']) # noqa: E501
1008
+
1009
+ # Authentication setting
1010
+ auth_settings = [] # noqa: E501
1011
+
1012
+ return self.api_client.call_api(
1013
+ '/v1/projects/{projectId}/data-connections/setup', 'POST',
1014
+ path_params,
1015
+ query_params,
1016
+ header_params,
1017
+ body=body_params,
1018
+ post_params=form_params,
1019
+ files=local_var_files,
1020
+ response_type='V1SetupDataConnectionResponse', # noqa: E501
1021
+ auth_settings=auth_settings,
1022
+ async_req=params.get('async_req'),
1023
+ _return_http_data_only=params.get('_return_http_data_only'),
1024
+ _preload_content=params.get('_preload_content', True),
1025
+ _request_timeout=params.get('_request_timeout'),
1026
+ collection_formats=collection_formats)
1027
+
923
1028
  def data_connection_service_update_data_connection(self, body: 'Update', project_id: 'str', id: 'str', **kwargs) -> 'V1DataConnection': # noqa: E501
924
1029
  """data_connection_service_update_data_connection # noqa: E501
925
1030
 
@@ -3503,6 +3503,119 @@ class JobsServiceApi(object):
3503
3503
  _request_timeout=params.get('_request_timeout'),
3504
3504
  collection_formats=collection_formats)
3505
3505
 
3506
+ def jobs_service_update_deployment_visibility(self, body: 'IdVisibilityBody', project_id: 'str', id: 'str', **kwargs) -> 'V1UpdateDeploymentVisibilityResponse': # noqa: E501
3507
+ """UpdateDeploymentVisibility updates the deployment visibility, mainly switch between public and private # noqa: E501
3508
+
3509
+ This method makes a synchronous HTTP request by default. To make an
3510
+ asynchronous HTTP request, please pass async_req=True
3511
+ >>> thread = api.jobs_service_update_deployment_visibility(body, project_id, id, async_req=True)
3512
+ >>> result = thread.get()
3513
+
3514
+ :param async_req bool
3515
+ :param IdVisibilityBody body: (required)
3516
+ :param str project_id: (required)
3517
+ :param str id: (required)
3518
+ :return: V1UpdateDeploymentVisibilityResponse
3519
+ If the method is called asynchronously,
3520
+ returns the request thread.
3521
+ """
3522
+ kwargs['_return_http_data_only'] = True
3523
+ if kwargs.get('async_req'):
3524
+ return self.jobs_service_update_deployment_visibility_with_http_info(body, project_id, id, **kwargs) # noqa: E501
3525
+ else:
3526
+ (data) = self.jobs_service_update_deployment_visibility_with_http_info(body, project_id, id, **kwargs) # noqa: E501
3527
+ return data
3528
+
3529
+ def jobs_service_update_deployment_visibility_with_http_info(self, body: 'IdVisibilityBody', project_id: 'str', id: 'str', **kwargs) -> 'V1UpdateDeploymentVisibilityResponse': # noqa: E501
3530
+ """UpdateDeploymentVisibility updates the deployment visibility, mainly switch between public and private # noqa: E501
3531
+
3532
+ This method makes a synchronous HTTP request by default. To make an
3533
+ asynchronous HTTP request, please pass async_req=True
3534
+ >>> thread = api.jobs_service_update_deployment_visibility_with_http_info(body, project_id, id, async_req=True)
3535
+ >>> result = thread.get()
3536
+
3537
+ :param async_req bool
3538
+ :param IdVisibilityBody body: (required)
3539
+ :param str project_id: (required)
3540
+ :param str id: (required)
3541
+ :return: V1UpdateDeploymentVisibilityResponse
3542
+ If the method is called asynchronously,
3543
+ returns the request thread.
3544
+ """
3545
+
3546
+ all_params = ['body', 'project_id', 'id'] # noqa: E501
3547
+ all_params.append('async_req')
3548
+ all_params.append('_return_http_data_only')
3549
+ all_params.append('_preload_content')
3550
+ all_params.append('_request_timeout')
3551
+
3552
+ params = locals()
3553
+ for key, val in six.iteritems(params['kwargs']):
3554
+ if key not in all_params:
3555
+ raise TypeError(
3556
+ "Got an unexpected keyword argument '%s'"
3557
+ " to method jobs_service_update_deployment_visibility" % key
3558
+ )
3559
+ params[key] = val
3560
+ del params['kwargs']
3561
+ # verify the required parameter 'body' is set
3562
+ if ('body' not in params or
3563
+ params['body'] is None):
3564
+ raise ValueError("Missing the required parameter `body` when calling `jobs_service_update_deployment_visibility`") # noqa: E501
3565
+ # verify the required parameter 'project_id' is set
3566
+ if ('project_id' not in params or
3567
+ params['project_id'] is None):
3568
+ raise ValueError("Missing the required parameter `project_id` when calling `jobs_service_update_deployment_visibility`") # noqa: E501
3569
+ # verify the required parameter 'id' is set
3570
+ if ('id' not in params or
3571
+ params['id'] is None):
3572
+ raise ValueError("Missing the required parameter `id` when calling `jobs_service_update_deployment_visibility`") # noqa: E501
3573
+
3574
+ collection_formats = {}
3575
+
3576
+ path_params = {}
3577
+ if 'project_id' in params:
3578
+ path_params['projectId'] = params['project_id'] # noqa: E501
3579
+ if 'id' in params:
3580
+ path_params['id'] = params['id'] # noqa: E501
3581
+
3582
+ query_params = []
3583
+
3584
+ header_params = {}
3585
+
3586
+ form_params = []
3587
+ local_var_files = {}
3588
+
3589
+ body_params = None
3590
+ if 'body' in params:
3591
+ body_params = params['body']
3592
+ # HTTP header `Accept`
3593
+ header_params['Accept'] = self.api_client.select_header_accept(
3594
+ ['application/json']) # noqa: E501
3595
+
3596
+ # HTTP header `Content-Type`
3597
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
3598
+ ['application/json']) # noqa: E501
3599
+
3600
+ # Authentication setting
3601
+ auth_settings = [] # noqa: E501
3602
+
3603
+ return self.api_client.call_api(
3604
+ '/v1/projects/{projectId}/deployments/{id}/visibility', 'PUT',
3605
+ path_params,
3606
+ query_params,
3607
+ header_params,
3608
+ body=body_params,
3609
+ post_params=form_params,
3610
+ files=local_var_files,
3611
+ response_type='V1UpdateDeploymentVisibilityResponse', # noqa: E501
3612
+ auth_settings=auth_settings,
3613
+ async_req=params.get('async_req'),
3614
+ _return_http_data_only=params.get('_return_http_data_only'),
3615
+ _preload_content=params.get('_preload_content', True),
3616
+ _request_timeout=params.get('_request_timeout'),
3617
+ collection_formats=collection_formats)
3618
+
3506
3619
  def jobs_service_update_job(self, body: 'JobsIdBody1', project_id: 'str', id: 'str', **kwargs) -> 'V1Job': # noqa: E501
3507
3620
  """jobs_service_update_job # noqa: E501
3508
3621
 
@@ -1534,7 +1534,7 @@ class LitLoggerServiceApi(object):
1534
1534
  _request_timeout=params.get('_request_timeout'),
1535
1535
  collection_formats=collection_formats)
1536
1536
 
1537
- def lit_logger_service_update_metrics_stream_visibility(self, body: 'IdVisibilityBody', project_id: 'str', id: 'str', **kwargs) -> 'V1UpdateMetricsStreamVisibilityResponse': # noqa: E501
1537
+ def lit_logger_service_update_metrics_stream_visibility(self, body: 'IdVisibilityBody1', project_id: 'str', id: 'str', **kwargs) -> 'V1UpdateMetricsStreamVisibilityResponse': # noqa: E501
1538
1538
  """lit_logger_service_update_metrics_stream_visibility # noqa: E501
1539
1539
 
1540
1540
  This method makes a synchronous HTTP request by default. To make an
@@ -1543,7 +1543,7 @@ class LitLoggerServiceApi(object):
1543
1543
  >>> result = thread.get()
1544
1544
 
1545
1545
  :param async_req bool
1546
- :param IdVisibilityBody body: (required)
1546
+ :param IdVisibilityBody1 body: (required)
1547
1547
  :param str project_id: (required)
1548
1548
  :param str id: (required)
1549
1549
  :return: V1UpdateMetricsStreamVisibilityResponse
@@ -1557,7 +1557,7 @@ class LitLoggerServiceApi(object):
1557
1557
  (data) = self.lit_logger_service_update_metrics_stream_visibility_with_http_info(body, project_id, id, **kwargs) # noqa: E501
1558
1558
  return data
1559
1559
 
1560
- def lit_logger_service_update_metrics_stream_visibility_with_http_info(self, body: 'IdVisibilityBody', project_id: 'str', id: 'str', **kwargs) -> 'V1UpdateMetricsStreamVisibilityResponse': # noqa: E501
1560
+ def lit_logger_service_update_metrics_stream_visibility_with_http_info(self, body: 'IdVisibilityBody1', project_id: 'str', id: 'str', **kwargs) -> 'V1UpdateMetricsStreamVisibilityResponse': # noqa: E501
1561
1561
  """lit_logger_service_update_metrics_stream_visibility # noqa: E501
1562
1562
 
1563
1563
  This method makes a synchronous HTTP request by default. To make an
@@ -1566,7 +1566,7 @@ class LitLoggerServiceApi(object):
1566
1566
  >>> result = thread.get()
1567
1567
 
1568
1568
  :param async_req bool
1569
- :param IdVisibilityBody body: (required)
1569
+ :param IdVisibilityBody1 body: (required)
1570
1570
  :param str project_id: (required)
1571
1571
  :param str id: (required)
1572
1572
  :return: V1UpdateMetricsStreamVisibilityResponse