lightning-sdk 0.1.19__py3-none-any.whl → 0.1.21__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 (48) hide show
  1. lightning_sdk/__init__.py +1 -1
  2. lightning_sdk/api/org_api.py +0 -2
  3. lightning_sdk/api/studio_api.py +7 -10
  4. lightning_sdk/api/teamspace_api.py +14 -14
  5. lightning_sdk/api/user_api.py +7 -5
  6. lightning_sdk/lightning_cloud/login.py +7 -6
  7. lightning_sdk/lightning_cloud/openapi/__init__.py +8 -2
  8. lightning_sdk/lightning_cloud/openapi/api/cluster_service_api.py +89 -0
  9. lightning_sdk/lightning_cloud/openapi/api/deployment_templates_service_api.py +312 -4
  10. lightning_sdk/lightning_cloud/openapi/api/jobs_service_api.py +123 -0
  11. lightning_sdk/lightning_cloud/openapi/api/lit_logger_service_api.py +2 -10
  12. lightning_sdk/lightning_cloud/openapi/models/__init__.py +8 -2
  13. lightning_sdk/lightning_cloud/openapi/models/cloudspaces_id_body.py +32 -6
  14. lightning_sdk/lightning_cloud/openapi/models/deploymenttemplates_id_body.py +331 -0
  15. lightning_sdk/lightning_cloud/openapi/models/metrics_stream_id_loggerartifacts_body.py +1 -27
  16. lightning_sdk/lightning_cloud/openapi/models/orgs_id_body.py +27 -1
  17. lightning_sdk/lightning_cloud/openapi/models/v1_aws_direct_v1.py +81 -3
  18. lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space.py +6 -6
  19. lightning_sdk/lightning_cloud/openapi/models/v1_cluster_spec.py +1 -27
  20. lightning_sdk/lightning_cloud/openapi/models/v1_cluster_type.py +0 -1
  21. lightning_sdk/lightning_cloud/openapi/models/v1_create_deployment_template_request.py +53 -1
  22. lightning_sdk/lightning_cloud/openapi/models/v1_create_organization_request.py +27 -1
  23. lightning_sdk/lightning_cloud/openapi/models/v1_create_project_request.py +27 -1
  24. lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template.py +79 -1
  25. lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template_gallery_response.py +591 -0
  26. lightning_sdk/lightning_cloud/openapi/models/v1_deployment_template_summary.py +53 -1
  27. lightning_sdk/lightning_cloud/openapi/models/v1_get_deployment_routing_telemetry_aggregated_response.py +123 -0
  28. lightning_sdk/lightning_cloud/openapi/models/v1_job.py +27 -1
  29. lightning_sdk/lightning_cloud/openapi/models/v1_list_cloud_space_tags_response.py +6 -6
  30. lightning_sdk/lightning_cloud/openapi/models/v1_list_cluster_availabilities_response.py +123 -0
  31. lightning_sdk/lightning_cloud/openapi/models/{v1_cluster_performance_profile.py → v1_list_deployment_tags_response.py} +33 -14
  32. lightning_sdk/lightning_cloud/openapi/models/v1_list_published_deployment_templates_response.py +175 -0
  33. lightning_sdk/lightning_cloud/openapi/models/v1_metrics_tracker.py +53 -1
  34. lightning_sdk/lightning_cloud/openapi/models/v1_organization.py +27 -1
  35. lightning_sdk/lightning_cloud/openapi/models/v1_published_cloud_space_response.py +6 -6
  36. lightning_sdk/lightning_cloud/openapi/models/v1_regional_load_balancer.py +149 -0
  37. lightning_sdk/lightning_cloud/openapi/models/{v1_cloud_space_tag.py → v1_resource_tag.py} +18 -18
  38. lightning_sdk/lightning_cloud/openapi/models/v1_telemetry.py +29 -3
  39. lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +27 -131
  40. lightning_sdk/lightning_cloud/source_code/logs_socket_api.py +1 -1
  41. lightning_sdk/teamspace.py +7 -1
  42. lightning_sdk/utils/resolve.py +6 -3
  43. {lightning_sdk-0.1.19.dist-info → lightning_sdk-0.1.21.dist-info}/METADATA +1 -1
  44. {lightning_sdk-0.1.19.dist-info → lightning_sdk-0.1.21.dist-info}/RECORD +48 -42
  45. {lightning_sdk-0.1.19.dist-info → lightning_sdk-0.1.21.dist-info}/LICENSE +0 -0
  46. {lightning_sdk-0.1.19.dist-info → lightning_sdk-0.1.21.dist-info}/WHEEL +0 -0
  47. {lightning_sdk-0.1.19.dist-info → lightning_sdk-0.1.21.dist-info}/entry_points.txt +0 -0
  48. {lightning_sdk-0.1.19.dist-info → lightning_sdk-0.1.21.dist-info}/top_level.txt +0 -0
lightning_sdk/__init__.py CHANGED
@@ -25,5 +25,5 @@ __all__ = [
25
25
  "Agent",
26
26
  ]
27
27
 
28
- __version__ = "0.1.19"
28
+ __version__ = "0.1.21"
29
29
  _check_version_and_prompt_upgrade(__version__)
@@ -8,8 +8,6 @@ class OrgApi:
8
8
  """Internal API client for org requests (mainly http requests)."""
9
9
 
10
10
  def __init__(self) -> None:
11
- super().__init__()
12
-
13
11
  self._client = LightningClient(max_tries=7)
14
12
 
15
13
  def get_org(self, name: str) -> V1Organization:
@@ -59,8 +59,6 @@ class StudioApi:
59
59
  """Internal API client for Studio requests (mainly http requests)."""
60
60
 
61
61
  def __init__(self) -> None:
62
- super().__init__()
63
-
64
62
  self._cloud_url = _cloud_url()
65
63
  self._client = LightningClient(max_tries=7)
66
64
  self._keep_alive_threads: Mapping[str, Thread] = {}
@@ -317,15 +315,14 @@ class StudioApi:
317
315
  teamspace_id=teamspace_id,
318
316
  session_id=response_submit.session_name,
319
317
  ):
320
- if resp.exit_code != -1:
321
- if exit_code is None:
322
- exit_code = resp.exit_code
323
- elif exit_code != resp.exit_code:
324
- raise RuntimeError("Cannot determine exit code")
325
-
326
- output += resp.output
327
- else:
318
+ if resp.exit_code == -1:
328
319
  break
320
+ if exit_code is None:
321
+ exit_code = resp.exit_code
322
+ elif exit_code != resp.exit_code:
323
+ raise RuntimeError("Cannot determine exit code")
324
+
325
+ output += resp.output
329
326
 
330
327
  if exit_code is not None:
331
328
  return output, exit_code
@@ -33,7 +33,7 @@ class TeamspaceApi:
33
33
  """Get the current teamspace from the owner."""
34
34
  teamspaces = self.list_teamspaces(name=name, owner_id=owner_id)
35
35
 
36
- if len(teamspaces) == 0:
36
+ if not teamspaces:
37
37
  raise ValueError(f"Teamspace {name} does not exist")
38
38
 
39
39
  if len(teamspaces) > 1:
@@ -44,7 +44,7 @@ class TeamspaceApi:
44
44
  def _get_teamspace_by_id(self, teamspace_id: str) -> V1Project:
45
45
  return self._client.projects_service_get_project(teamspace_id)
46
46
 
47
- def list_teamspaces(self, owner_id: str, name: Optional[str]) -> Optional[V1Project]:
47
+ def list_teamspaces(self, owner_id: str, name: Optional[str] = None) -> Optional[V1Project]:
48
48
  """Lists teamspaces from owner.
49
49
 
50
50
  If name is passed only teamspaces matching that name will be returned
@@ -54,15 +54,14 @@ class TeamspaceApi:
54
54
  # -> list projects authed users are members of + filter later on
55
55
  res = self._client.projects_service_list_memberships(filter_by_user_id=True)
56
56
 
57
- return [
58
- self._get_teamspace_by_id(m.project_id)
59
- for m in filter(
60
- # only return teamspaces actually owned by the id
61
- lambda x: x.owner_id == owner_id,
62
- # if name is provided, filter for teamspaces matching that name
63
- filter(lambda x: name is None or x.name == name or x.display_name == name, res.memberships),
64
- )
65
- ]
57
+ teamspaces = []
58
+ for teamspace in res.memberships:
59
+ # if name is provided, filter for teamspaces matching that name
60
+ match_name = name is None or teamspace.name == name or teamspace.display_name == name
61
+ # and only return teamspaces actually owned by the id
62
+ if match_name and teamspace.owner_id == owner_id:
63
+ teamspaces.append(self._get_teamspace_by_id(teamspace.project_id))
64
+ return teamspaces
66
65
 
67
66
  def list_studios(self, teamspace_id: str, cluster_id: str = "") -> List[V1CloudSpace]:
68
67
  """List studios in teamspace."""
@@ -90,24 +89,25 @@ class TeamspaceApi:
90
89
  return self._client.projects_service_list_project_cluster_bindings(project_id=teamspace_id).clusters
91
90
 
92
91
  def _get_authed_user_id(self) -> str:
93
- """Gets the currently logged in user."""
92
+ """Gets the currently logged-in user."""
94
93
  auth = Auth()
95
94
  auth.authenticate()
96
95
  return auth.user_id
97
96
 
98
- def _try_get_cluster_id(self, teamspace_id: str) -> str:
97
+ def _determine_cluster_id(self, teamspace_id: str) -> str:
99
98
  """Attempts to determine the cluster id of the teamspace.
100
99
 
101
100
  Raises an error if it's ambiguous.
102
101
 
103
102
  """
103
+ # when you run from studio, the cluster is with env. vars
104
104
  cluster_id = os.getenv("LIGHTNING_CLUSTER_ID")
105
105
  if cluster_id:
106
106
  return cluster_id
107
107
  cluster_ids = [c.cluster_id for c in self.list_clusters(teamspace_id=teamspace_id)]
108
108
  if len(cluster_ids) == 1:
109
109
  return cluster_ids[0]
110
- raise ValueError(
110
+ raise RuntimeError(
111
111
  "Could not determine the current cluster id. Please provide it manually as input."
112
112
  f" Choices are: {', '.join(cluster_ids)}"
113
113
  )
@@ -15,8 +15,6 @@ class UserApi:
15
15
  """Internal API Client for user requests (mainly http requests)."""
16
16
 
17
17
  def __init__(self) -> None:
18
- super().__init__()
19
-
20
18
  self._client = LightningClient(max_tries=7)
21
19
 
22
20
  def get_user(self, name: str) -> V1SearchUser:
@@ -24,13 +22,15 @@ class UserApi:
24
22
  response = self._client.user_service_search_users(query=name)
25
23
 
26
24
  users = [u for u in response.users if u.username == name]
27
- if not len(users):
25
+ if not users:
28
26
  raise ValueError(f"User {name} does not exist.")
29
27
  return users[0]
30
28
 
31
29
  def _get_user_by_id(self, user_id: str) -> V1SearchUser:
32
30
  response = self._client.user_service_search_users(query=user_id)
33
31
  users = [u for u in response.users if u.id == user_id]
32
+ if not users:
33
+ raise ValueError(f"User {user_id} does not exist.")
34
34
  return users[0]
35
35
 
36
36
  def _get_organizations_for_authed_user(
@@ -45,11 +45,13 @@ class UserApi:
45
45
  )
46
46
  return resp.cloudspaces
47
47
 
48
- def _get_all_teamspace_memberships(self, user_id: str) -> List[V1Membership]:
48
+ def _get_all_teamspace_memberships(
49
+ self, user_id: str # todo: this is unused, but still required
50
+ ) -> List[V1Membership]:
49
51
  return self._client.projects_service_list_memberships(filter_by_user_id=True).memberships
50
52
 
51
53
  def _get_authed_user_name(self) -> str:
52
- """Gets the currently logged in user."""
54
+ """Gets the currently logged-in user."""
53
55
  auth = Auth()
54
56
  auth.authenticate()
55
57
  user = self._get_user_by_id(auth.user_id)
@@ -22,7 +22,7 @@ logger = logging.getLogger(__name__)
22
22
 
23
23
 
24
24
  class Keys(Enum):
25
- USERNAME = "LIGHTNING_USERNAME"
25
+ # USERNAME = "LIGHTNING_USERNAME"
26
26
  USER_ID = "LIGHTNING_USER_ID"
27
27
  API_KEY = "LIGHTNING_API_KEY"
28
28
 
@@ -33,7 +33,7 @@ class Keys(Enum):
33
33
 
34
34
  @dataclass
35
35
  class Auth:
36
- username: Optional[str] = None
36
+ # username: Optional[str] = None
37
37
  user_id: Optional[str] = None
38
38
  api_key: Optional[str] = None
39
39
 
@@ -72,20 +72,21 @@ class Auth:
72
72
  token: str = "",
73
73
  user_id: str = "",
74
74
  api_key: str = "",
75
- username: str = "") -> None:
75
+ # username: str = "",
76
+ ) -> None:
76
77
  """save credentials to disk."""
77
78
  self.secrets_file.parent.mkdir(exist_ok=True, parents=True)
78
79
  with self.secrets_file.open("w") as f:
79
80
  json.dump(
80
81
  {
81
- f"{Keys.USERNAME.suffix}": username,
82
+ # f"{Keys.USERNAME.suffix}": username,
82
83
  f"{Keys.USER_ID.suffix}": user_id,
83
84
  f"{Keys.API_KEY.suffix}": api_key,
84
85
  },
85
86
  f,
86
87
  )
87
88
 
88
- self.username = username
89
+ # self.username = username
89
90
  self.user_id = user_id
90
91
  self.api_key = api_key
91
92
  logger.debug("credentials saved successfully")
@@ -173,7 +174,7 @@ class AuthServer:
173
174
  user_id: str = Query("", alias="userID")):
174
175
  if token:
175
176
  auth.save(token=token,
176
- username=user_id,
177
+ # username=user_id,
177
178
  user_id=user_id,
178
179
  api_key=key)
179
180
  logger.info("Authentication Successful")
@@ -86,6 +86,7 @@ from lightning_sdk.lightning_cloud.openapi.models.create_deployment_request_defi
86
86
  from lightning_sdk.lightning_cloud.openapi.models.data_connection_mount_data_connection_mount_copy_status import DataConnectionMountDataConnectionMountCopyStatus
87
87
  from lightning_sdk.lightning_cloud.openapi.models.datasets_id_body import DatasetsIdBody
88
88
  from lightning_sdk.lightning_cloud.openapi.models.deployments_id_body import DeploymentsIdBody
89
+ from lightning_sdk.lightning_cloud.openapi.models.deploymenttemplates_id_body import DeploymenttemplatesIdBody
89
90
  from lightning_sdk.lightning_cloud.openapi.models.endpoints_id_body import EndpointsIdBody
90
91
  from lightning_sdk.lightning_cloud.openapi.models.experiment_name_variant_name_body import ExperimentNameVariantNameBody
91
92
  from lightning_sdk.lightning_cloud.openapi.models.externalv1_cloud_space_instance_status import Externalv1CloudSpaceInstanceStatus
@@ -231,7 +232,6 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_publication_typ
231
232
  from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_seed_file import V1CloudSpaceSeedFile
232
233
  from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_session import V1CloudSpaceSession
233
234
  from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_state import V1CloudSpaceState
234
- from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_tag import V1CloudSpaceTag
235
235
  from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_version import V1CloudSpaceVersion
236
236
  from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_version_publication import V1CloudSpaceVersionPublication
237
237
  from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_accelerator import V1ClusterAccelerator
@@ -240,7 +240,6 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_capacity_reservatio
240
240
  from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_deletion_options import V1ClusterDeletionOptions
241
241
  from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_encryption_key import V1ClusterEncryptionKey
242
242
  from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_names import V1ClusterNames
243
- from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_performance_profile import V1ClusterPerformanceProfile
244
243
  from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_resource_tag import V1ClusterResourceTag
245
244
  from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_security_options import V1ClusterSecurityOptions
246
245
  from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_spec import V1ClusterSpec
@@ -348,6 +347,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_state import V1D
348
347
  from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_status import V1DeploymentStatus
349
348
  from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_strategy import V1DeploymentStrategy
350
349
  from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_template import V1DeploymentTemplate
350
+ from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_template_gallery_response import V1DeploymentTemplateGalleryResponse
351
351
  from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_template_parameter import V1DeploymentTemplateParameter
352
352
  from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_template_summary import V1DeploymentTemplateSummary
353
353
  from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_template_type import V1DeploymentTemplateType
@@ -389,6 +389,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_get_artifacts_page_response
389
389
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_cloud_space_instance_status_response import V1GetCloudSpaceInstanceStatusResponse
390
390
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_cloud_space_size_response import V1GetCloudSpaceSizeResponse
391
391
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_cluster_credentials_response import V1GetClusterCredentialsResponse
392
+ from lightning_sdk.lightning_cloud.openapi.models.v1_get_deployment_routing_telemetry_aggregated_response import V1GetDeploymentRoutingTelemetryAggregatedResponse
392
393
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_deployment_routing_telemetry_response import V1GetDeploymentRoutingTelemetryResponse
393
394
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_folder_index_response import V1GetFolderIndexResponse
394
395
  from lightning_sdk.lightning_cloud.openapi.models.v1_get_job_system_metrics_response import V1GetJobSystemMetricsResponse
@@ -467,6 +468,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_list_cloud_space_version_pu
467
468
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_cloud_space_versions_response import V1ListCloudSpaceVersionsResponse
468
469
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_cloud_spaces_response import V1ListCloudSpacesResponse
469
470
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_cluster_accelerators_response import V1ListClusterAcceleratorsResponse
471
+ from lightning_sdk.lightning_cloud.openapi.models.v1_list_cluster_availabilities_response import V1ListClusterAvailabilitiesResponse
470
472
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_cluster_capacity_reservations_response import V1ListClusterCapacityReservationsResponse
471
473
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_clusters_response import V1ListClustersResponse
472
474
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_conversations_response import V1ListConversationsResponse
@@ -476,6 +478,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_list_datasets_response impo
476
478
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_default_cluster_accelerators_response import V1ListDefaultClusterAcceleratorsResponse
477
479
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_deployment_events_response import V1ListDeploymentEventsResponse
478
480
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_deployment_releases_response import V1ListDeploymentReleasesResponse
481
+ from lightning_sdk.lightning_cloud.openapi.models.v1_list_deployment_tags_response import V1ListDeploymentTagsResponse
479
482
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_deployment_templates_response import V1ListDeploymentTemplatesResponse
480
483
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_deployments_response import V1ListDeploymentsResponse
481
484
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_endpoints_response import V1ListEndpointsResponse
@@ -517,6 +520,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_list_project_membership_rol
517
520
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_project_memberships_response import V1ListProjectMembershipsResponse
518
521
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_project_roles_response import V1ListProjectRolesResponse
519
522
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_published_cloud_spaces_response import V1ListPublishedCloudSpacesResponse
523
+ from lightning_sdk.lightning_cloud.openapi.models.v1_list_published_deployment_templates_response import V1ListPublishedDeploymentTemplatesResponse
520
524
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_quests_response import V1ListQuestsResponse
521
525
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_ssh_public_keys_response import V1ListSSHPublicKeysResponse
522
526
  from lightning_sdk.lightning_cloud.openapi.models.v1_list_secrets_response import V1ListSecretsResponse
@@ -599,9 +603,11 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_refresh_path_response impor
599
603
  from lightning_sdk.lightning_cloud.openapi.models.v1_refresh_request import V1RefreshRequest
600
604
  from lightning_sdk.lightning_cloud.openapi.models.v1_refresh_response import V1RefreshResponse
601
605
  from lightning_sdk.lightning_cloud.openapi.models.v1_region_state import V1RegionState
606
+ from lightning_sdk.lightning_cloud.openapi.models.v1_regional_load_balancer import V1RegionalLoadBalancer
602
607
  from lightning_sdk.lightning_cloud.openapi.models.v1_request_cluster_access_request import V1RequestClusterAccessRequest
603
608
  from lightning_sdk.lightning_cloud.openapi.models.v1_request_cluster_access_response import V1RequestClusterAccessResponse
604
609
  from lightning_sdk.lightning_cloud.openapi.models.v1_request_verification_code_response import V1RequestVerificationCodeResponse
610
+ from lightning_sdk.lightning_cloud.openapi.models.v1_resource_tag import V1ResourceTag
605
611
  from lightning_sdk.lightning_cloud.openapi.models.v1_resources import V1Resources
606
612
  from lightning_sdk.lightning_cloud.openapi.models.v1_response_choice import V1ResponseChoice
607
613
  from lightning_sdk.lightning_cloud.openapi.models.v1_response_choice_delta import V1ResponseChoiceDelta
@@ -1590,6 +1590,95 @@ class ClusterServiceApi(object):
1590
1590
  _request_timeout=params.get('_request_timeout'),
1591
1591
  collection_formats=collection_formats)
1592
1592
 
1593
+ def cluster_service_list_cluster_availabilities(self, **kwargs) -> 'V1ListClusterAvailabilitiesResponse': # noqa: E501
1594
+ """cluster_service_list_cluster_availabilities # noqa: E501
1595
+
1596
+ This method makes a synchronous HTTP request by default. To make an
1597
+ asynchronous HTTP request, please pass async_req=True
1598
+ >>> thread = api.cluster_service_list_cluster_availabilities(async_req=True)
1599
+ >>> result = thread.get()
1600
+
1601
+ :param async_req bool
1602
+ :param str org_id:
1603
+ :return: V1ListClusterAvailabilitiesResponse
1604
+ If the method is called asynchronously,
1605
+ returns the request thread.
1606
+ """
1607
+ kwargs['_return_http_data_only'] = True
1608
+ if kwargs.get('async_req'):
1609
+ return self.cluster_service_list_cluster_availabilities_with_http_info(**kwargs) # noqa: E501
1610
+ else:
1611
+ (data) = self.cluster_service_list_cluster_availabilities_with_http_info(**kwargs) # noqa: E501
1612
+ return data
1613
+
1614
+ def cluster_service_list_cluster_availabilities_with_http_info(self, **kwargs) -> 'V1ListClusterAvailabilitiesResponse': # noqa: E501
1615
+ """cluster_service_list_cluster_availabilities # noqa: E501
1616
+
1617
+ This method makes a synchronous HTTP request by default. To make an
1618
+ asynchronous HTTP request, please pass async_req=True
1619
+ >>> thread = api.cluster_service_list_cluster_availabilities_with_http_info(async_req=True)
1620
+ >>> result = thread.get()
1621
+
1622
+ :param async_req bool
1623
+ :param str org_id:
1624
+ :return: V1ListClusterAvailabilitiesResponse
1625
+ If the method is called asynchronously,
1626
+ returns the request thread.
1627
+ """
1628
+
1629
+ all_params = ['org_id'] # noqa: E501
1630
+ all_params.append('async_req')
1631
+ all_params.append('_return_http_data_only')
1632
+ all_params.append('_preload_content')
1633
+ all_params.append('_request_timeout')
1634
+
1635
+ params = locals()
1636
+ for key, val in six.iteritems(params['kwargs']):
1637
+ if key not in all_params:
1638
+ raise TypeError(
1639
+ "Got an unexpected keyword argument '%s'"
1640
+ " to method cluster_service_list_cluster_availabilities" % key
1641
+ )
1642
+ params[key] = val
1643
+ del params['kwargs']
1644
+
1645
+ collection_formats = {}
1646
+
1647
+ path_params = {}
1648
+
1649
+ query_params = []
1650
+ if 'org_id' in params:
1651
+ query_params.append(('orgId', params['org_id'])) # noqa: E501
1652
+
1653
+ header_params = {}
1654
+
1655
+ form_params = []
1656
+ local_var_files = {}
1657
+
1658
+ body_params = None
1659
+ # HTTP header `Accept`
1660
+ header_params['Accept'] = self.api_client.select_header_accept(
1661
+ ['application/json']) # noqa: E501
1662
+
1663
+ # Authentication setting
1664
+ auth_settings = [] # noqa: E501
1665
+
1666
+ return self.api_client.call_api(
1667
+ '/v1/core/cluster-availabilities', 'GET',
1668
+ path_params,
1669
+ query_params,
1670
+ header_params,
1671
+ body=body_params,
1672
+ post_params=form_params,
1673
+ files=local_var_files,
1674
+ response_type='V1ListClusterAvailabilitiesResponse', # noqa: E501
1675
+ auth_settings=auth_settings,
1676
+ async_req=params.get('async_req'),
1677
+ _return_http_data_only=params.get('_return_http_data_only'),
1678
+ _preload_content=params.get('_preload_content', True),
1679
+ _request_timeout=params.get('_request_timeout'),
1680
+ collection_formats=collection_formats)
1681
+
1593
1682
  def cluster_service_list_cluster_capacity_reservations(self, project_id: 'str', cluster_id: 'str', **kwargs) -> 'V1ListClusterCapacityReservationsResponse': # noqa: E501
1594
1683
  """cluster_service_list_cluster_capacity_reservations # noqa: E501
1595
1684