anyscale 0.24.87__py3-none-any.whl → 0.24.91__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 (120) hide show
  1. anyscale/__init__.py +56 -0
  2. anyscale/_private/anyscale_client/anyscale_client.py +158 -28
  3. anyscale/_private/anyscale_client/common.py +82 -0
  4. anyscale/_private/anyscale_client/fake_anyscale_client.py +193 -1
  5. anyscale/_private/docgen/README.md +1 -1
  6. anyscale/_private/docgen/__main__.py +74 -19
  7. anyscale/_private/docgen/api.md +0 -20
  8. anyscale/_private/docgen/generator.py +4 -2
  9. anyscale/_private/docgen/models.md +1 -46
  10. anyscale/_private/workload/workload_config.py +1 -1
  11. anyscale/aggregated_instance_usage/__init__.py +1 -1
  12. anyscale/aggregated_instance_usage/commands.py +2 -4
  13. anyscale/aggregated_instance_usage/models.py +8 -8
  14. anyscale/client/README.md +19 -23
  15. anyscale/client/openapi_client/__init__.py +13 -15
  16. anyscale/client/openapi_client/api/default_api.py +825 -962
  17. anyscale/client/openapi_client/models/__init__.py +13 -15
  18. anyscale/client/openapi_client/models/admin_create_user.py +255 -0
  19. anyscale/client/openapi_client/models/admin_created_user.py +281 -0
  20. anyscale/client/openapi_client/models/{sessionevent_list_response.py → admincreateduser_list_response.py} +15 -15
  21. anyscale/client/openapi_client/models/aggregated_usage_query.py +1 -29
  22. anyscale/client/openapi_client/models/{session_event_types.py → cloud_deployment_config.py} +35 -24
  23. anyscale/client/openapi_client/models/{platformfinetuningjob_response.py → clouddeploymentconfig_response.py} +11 -11
  24. anyscale/client/openapi_client/models/{company_size.py → cluster_size.py} +10 -10
  25. anyscale/client/openapi_client/models/cluster_status_details.py +2 -1
  26. anyscale/client/openapi_client/models/create_experimental_workspace.py +29 -1
  27. anyscale/client/openapi_client/models/{resubmit_ft_job_request.py → describe_machine_pool_request.py} +21 -20
  28. anyscale/client/openapi_client/models/describe_machine_pool_response.py +123 -0
  29. anyscale/client/openapi_client/models/{fine_tuning_job_status.py → describemachinepoolresponse_response.py} +34 -16
  30. anyscale/client/openapi_client/models/machine_allocation_state.py +3 -1
  31. anyscale/client/openapi_client/models/machine_state_info.py +326 -0
  32. anyscale/client/openapi_client/models/organization_marketing_questions.py +80 -54
  33. anyscale/client/openapi_client/models/request_state_info.py +210 -0
  34. anyscale/client/openapi_client/models/{platformfinetuningjob_list_response.py → scheduler_info.py} +43 -38
  35. anyscale/client/openapi_client/models/usage_by_cluster.py +28 -1
  36. anyscale/client/openapi_client/models/usage_by_user.py +30 -3
  37. anyscale/client/openapi_client/models/workload_info.py +210 -0
  38. anyscale/cloud/__init__.py +83 -0
  39. anyscale/cloud/_private/cloud_sdk.py +25 -0
  40. anyscale/cloud/commands.py +45 -0
  41. anyscale/cloud/models.py +91 -0
  42. anyscale/cluster_compute.py +1 -1
  43. anyscale/commands/aggregated_instance_usage_commands.py +4 -4
  44. anyscale/commands/cloud_commands.py +38 -2
  45. anyscale/commands/command_examples.py +67 -0
  46. anyscale/commands/job_commands.py +15 -3
  47. anyscale/commands/machine_pool_commands.py +113 -1
  48. anyscale/commands/organization_invitation_commands.py +98 -0
  49. anyscale/commands/project_commands.py +52 -2
  50. anyscale/commands/resource_quota_commands.py +98 -11
  51. anyscale/commands/service_commands.py +1 -1
  52. anyscale/commands/session_commands_hidden.py +5 -1
  53. anyscale/commands/user_commands.py +49 -0
  54. anyscale/commands/util.py +1 -1
  55. anyscale/commands/workspace_commands.py +1 -1
  56. anyscale/connect.py +1 -1
  57. anyscale/connect_utils/project.py +7 -4
  58. anyscale/controllers/cloud_controller.py +6 -6
  59. anyscale/controllers/cloud_functional_verification_controller.py +1 -1
  60. anyscale/controllers/cluster_controller.py +2 -2
  61. anyscale/controllers/compute_config_controller.py +1 -1
  62. anyscale/controllers/experimental_integrations_controller.py +1 -1
  63. anyscale/controllers/job_controller.py +8 -3
  64. anyscale/controllers/list_controller.py +2 -2
  65. anyscale/controllers/machine_pool_controller.py +12 -1
  66. anyscale/controllers/project_controller.py +4 -3
  67. anyscale/controllers/schedule_controller.py +1 -1
  68. anyscale/controllers/service_controller.py +1 -1
  69. anyscale/controllers/workspace_controller.py +1 -1
  70. anyscale/models/job_model.py +1 -1
  71. anyscale/organization_invitation/__init__.py +61 -0
  72. anyscale/organization_invitation/_private/organization_invitation_sdk.py +24 -0
  73. anyscale/organization_invitation/commands.py +84 -0
  74. anyscale/organization_invitation/models.py +45 -0
  75. anyscale/project/__init__.py +35 -0
  76. anyscale/project/_private/project_sdk.py +27 -0
  77. anyscale/project/commands.py +56 -0
  78. anyscale/project/models.py +91 -0
  79. anyscale/{project.py → project_utils.py} +3 -4
  80. anyscale/resource_quota/__init__.py +99 -0
  81. anyscale/resource_quota/_private/resource_quota_sdk.py +111 -0
  82. anyscale/resource_quota/commands.py +150 -0
  83. anyscale/resource_quota/models.py +303 -0
  84. anyscale/scripts.py +6 -0
  85. anyscale/sdk/anyscale_client/__init__.py +0 -5
  86. anyscale/sdk/anyscale_client/api/default_api.py +0 -150
  87. anyscale/sdk/anyscale_client/models/__init__.py +0 -5
  88. anyscale/sdk/anyscale_client/models/cluster_status_details.py +2 -1
  89. anyscale/sdk/anyscale_client/sdk.py +1 -1
  90. anyscale/user/__init__.py +35 -0
  91. anyscale/user/_private/user_sdk.py +32 -0
  92. anyscale/user/commands.py +42 -0
  93. anyscale/user/models.py +201 -0
  94. anyscale/util.py +15 -0
  95. anyscale/utils/cloud_utils.py +1 -1
  96. anyscale/version.py +1 -1
  97. anyscale/workspace_utils.py +1 -1
  98. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/METADATA +1 -5
  99. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/RECORD +105 -92
  100. anyscale/client/openapi_client/models/create_fine_tuning_hyperparameters.py +0 -156
  101. anyscale/client/openapi_client/models/create_fine_tuning_job_product_request.py +0 -353
  102. anyscale/client/openapi_client/models/finish_ft_job_request.py +0 -204
  103. anyscale/client/openapi_client/models/log_level_types.py +0 -100
  104. anyscale/client/openapi_client/models/paging_context.py +0 -172
  105. anyscale/client/openapi_client/models/platform_fine_tuning_job.py +0 -577
  106. anyscale/client/openapi_client/models/session_event.py +0 -267
  107. anyscale/client/openapi_client/models/session_event_cause.py +0 -150
  108. anyscale/controllers/resource_quota_controller.py +0 -183
  109. anyscale/sdk/anyscale_client/models/log_level_types.py +0 -100
  110. anyscale/sdk/anyscale_client/models/session_event.py +0 -267
  111. anyscale/sdk/anyscale_client/models/session_event_cause.py +0 -150
  112. anyscale/sdk/anyscale_client/models/session_event_types.py +0 -111
  113. anyscale/sdk/anyscale_client/models/sessionevent_list_response.py +0 -147
  114. anyscale/utils/imports/azure.py +0 -14
  115. /anyscale/{cloud.py → cloud_utils.py} +0 -0
  116. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/LICENSE +0 -0
  117. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/NOTICE +0 -0
  118. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/WHEEL +0 -0
  119. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/entry_points.txt +0 -0
  120. {anyscale-0.24.87.dist-info → anyscale-0.24.91.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,303 @@
1
+ from dataclasses import dataclass, field
2
+ from datetime import datetime
3
+ from typing import Dict, Optional
4
+
5
+ from anyscale._private.models import ModelBase
6
+
7
+
8
+ @dataclass(frozen=True)
9
+ class CreateResourceQuota(ModelBase):
10
+ """Resource quota creation model.
11
+ """
12
+
13
+ __doc_py_example__ = """\
14
+ import anyscale
15
+ from anyscale.resource_quota.models import CreateResourceQuota
16
+
17
+ create_resource_quota = CreateResourceQuota(
18
+ # Name of the resource quota to create
19
+ name="resource_quota_name",
20
+ # Name of the cloud that this resource quota applies to
21
+ cloud="cloud_name",
22
+ # Name of the project that this resource quota applies to (optional)
23
+ project="project_name",
24
+ # Email of the user that this resource quota applies to (optional)
25
+ user_email="test@anyscale.com",
26
+ # The quota limit for the number of CPUs (optional)
27
+ num_cpus=50,
28
+ # The quota limit for the number of instances (optional)
29
+ num_instances=100,
30
+ # The quota limit for the total number of GPUs (optional)
31
+ num_gpus=30,
32
+ # The quota limit for the number of accelerators (optional)
33
+ num_accelerators={"A100-80G": 10, "T4": 20},
34
+ )
35
+ """
36
+
37
+ name: str = field(metadata={"docstring": "Name of the resource quota to create."})
38
+
39
+ def _validate_name(self, name: str):
40
+ if not isinstance(name, str):
41
+ raise TypeError("name must be a string.")
42
+
43
+ cloud: str = field(
44
+ metadata={"docstring": "Name of the cloud that this resource quota applies to."}
45
+ )
46
+
47
+ def _validate_cloud(self, cloud: str):
48
+ if not isinstance(cloud, str):
49
+ raise TypeError("cloud must be a string.")
50
+
51
+ project: Optional[str] = field(
52
+ default=None,
53
+ metadata={
54
+ "docstring": "Name of the project that this resource quota applies to (optional)."
55
+ },
56
+ )
57
+
58
+ def _validate_project(self, project: Optional[str]):
59
+ if project is not None and not isinstance(project, str):
60
+ raise TypeError("project must be a string.")
61
+
62
+ user_email: Optional[str] = field(
63
+ default=None,
64
+ metadata={
65
+ "docstring": "Email of the user that this resource quota applies to (optional)."
66
+ },
67
+ )
68
+
69
+ def _validate_user_email(self, user_email: Optional[str]):
70
+ if user_email is not None and not isinstance(user_email, str):
71
+ raise TypeError("user_email must be a string.")
72
+
73
+ num_cpus: Optional[int] = field(
74
+ default=None,
75
+ metadata={"docstring": "The quota limit for the number of CPUs (optional)."},
76
+ )
77
+
78
+ def _validate_num_cpus(self, num_cpus: Optional[int]):
79
+ if num_cpus is not None and not isinstance(num_cpus, int):
80
+ raise TypeError("num_cpus must be an integer.")
81
+
82
+ num_instances: Optional[int] = field(
83
+ default=None,
84
+ metadata={
85
+ "docstring": "The quota limit for the number of instances. (optional)."
86
+ },
87
+ )
88
+
89
+ def _validate_num_instances(self, num_instances: Optional[int]):
90
+ if num_instances is not None and not isinstance(num_instances, int):
91
+ raise TypeError("num_instances must be an integer.")
92
+
93
+ num_gpus: Optional[int] = field(
94
+ default=None,
95
+ metadata={
96
+ "docstring": "The quota limit for the total number of GPUs (optional)."
97
+ },
98
+ )
99
+
100
+ def _validate_num_gpus(self, num_gpus: Optional[int]):
101
+ if num_gpus is not None and not isinstance(num_gpus, int):
102
+ raise TypeError("num_gpus must be an integer.")
103
+
104
+ num_accelerators: Optional[Dict[str, int]] = field(
105
+ default=None,
106
+ metadata={
107
+ "docstring": "The quota limit for the number of accelerators (optional)."
108
+ },
109
+ )
110
+
111
+ def _validate_num_accelerators(self, num_accelerators: Optional[Dict[str, int]]):
112
+ if num_accelerators is not None and not isinstance(num_accelerators, dict):
113
+ raise TypeError("num_accelerators must be a dictionary.")
114
+ if num_accelerators is not None:
115
+ for key, value in num_accelerators.items():
116
+ if not isinstance(key, str):
117
+ raise TypeError("num_accelerators keys must be strings.")
118
+ if not isinstance(value, int):
119
+ raise TypeError("num_accelerators values must be integers.")
120
+
121
+
122
+ @dataclass(frozen=True)
123
+ class Quota(ModelBase):
124
+ """Resource quota limit
125
+ """
126
+
127
+ __doc_py_example__ = """\
128
+ import anyscale
129
+ from anyscale.resource_quota.models import CreateResourceQuota, ResourceQuota, Quota
130
+
131
+ create_resource_quota = CreateResourceQuota(
132
+ # Name of the resource quota to create
133
+ name="resource_quota_name",
134
+ # Name of the cloud that this resource quota applies to
135
+ cloud="cloud_name",
136
+ # Name of the project that this resource quota applies to (optional)
137
+ project="project_name",
138
+ # Email of the user that this resource quota applies to (optional)
139
+ user_email="test@anyscale.com",
140
+ # The quota limit for the number of CPUs (optional)
141
+ num_cpus=50,
142
+ # The quota limit for the number of instances (optional)
143
+ num_instances=100,
144
+ # The quota limit for the total number of GPUs (optional)
145
+ num_gpus=30,
146
+ # The quota limit for the number of accelerators (optional)
147
+ num_accelerators={"A100-80G": 10, "T4": 20},
148
+ )
149
+
150
+ resource_quota: ResourceQuota = anyscale.resource_quota.create(create_resource_quota)
151
+
152
+ quota: Quota = resource_quota.quota
153
+ """
154
+ num_cpus: Optional[int] = field(
155
+ default=None,
156
+ metadata={"docstring": "The quota limit for the number of CPUs (optional)."},
157
+ )
158
+
159
+ def _validate_num_cpus(self, num_cpus: Optional[int]):
160
+ if num_cpus is not None and not isinstance(num_cpus, int):
161
+ raise TypeError("num_cpus must be an integer.")
162
+
163
+ num_instances: Optional[int] = field(
164
+ default=None,
165
+ metadata={
166
+ "docstring": "The quota limit for the number of instances. (optional)."
167
+ },
168
+ )
169
+
170
+ def _validate_num_instances(self, num_instances: Optional[int]):
171
+ if num_instances is not None and not isinstance(num_instances, int):
172
+ raise TypeError("num_instances must be an integer.")
173
+
174
+ num_gpus: Optional[int] = field(
175
+ default=None,
176
+ metadata={
177
+ "docstring": "The quota limit for the total number of GPUs (optional)."
178
+ },
179
+ )
180
+
181
+ def _validate_num_gpus(self, num_gpus: Optional[int]):
182
+ if num_gpus is not None and not isinstance(num_gpus, int):
183
+ raise TypeError("num_gpus must be an integer.")
184
+
185
+ num_accelerators: Optional[Dict[str, int]] = field(
186
+ default=None,
187
+ metadata={
188
+ "docstring": "The quota limit for the number of accelerators (optional)."
189
+ },
190
+ )
191
+
192
+ def _validate_num_accelerators(self, num_accelerators: Optional[Dict[str, int]]):
193
+ if num_accelerators is not None and not isinstance(num_accelerators, dict):
194
+ raise TypeError("num_accelerators must be a dictionary.")
195
+ if num_accelerators is not None:
196
+ for key, value in num_accelerators.items():
197
+ if not isinstance(key, str):
198
+ raise TypeError("num_accelerators keys must be strings.")
199
+ if not isinstance(value, int):
200
+ raise TypeError("num_accelerators values must be integers.")
201
+
202
+
203
+ @dataclass(frozen=True)
204
+ class ResourceQuota(ModelBase):
205
+ """Resource quota
206
+ """
207
+
208
+ __doc_py_example__ = """\
209
+ import anyscale
210
+ from anyscale.resource_quota.models import CreateResourceQuota, ResourceQuota
211
+
212
+ create_resource_quota = CreateResourceQuota(
213
+ # Name of the resource quota to create
214
+ name="resource_quota_name",
215
+ # Name of the cloud that this resource quota applies to
216
+ cloud="cloud_name",
217
+ # Name of the project that this resource quota applies to (optional)
218
+ project="project_name",
219
+ # Email of the user that this resource quota applies to (optional)
220
+ user_email="test@anyscale.com",
221
+ # The quota limit for the number of CPUs (optional)
222
+ num_cpus=50,
223
+ # The quota limit for the number of instances (optional)
224
+ num_instances=100,
225
+ # The quota limit for the total number of GPUs (optional)
226
+ num_gpus=30,
227
+ # The quota limit for the number of accelerators (optional)
228
+ num_accelerators={"A100-80G": 10, "T4": 20},
229
+ )
230
+ resource_quota: ResourceQuota = anyscale.resource_quota.create(create_resource_quota)
231
+ """
232
+ id: str = field(metadata={"docstring": "The ID of the resource quota."})
233
+
234
+ def _validate_id(self, id: str): # noqa: A002
235
+ if not isinstance(id, str):
236
+ raise TypeError("id must be a string.")
237
+
238
+ name: str = field(metadata={"docstring": "Name of the resource quota."})
239
+
240
+ def _validate_name(self, name: str):
241
+ if not isinstance(name, str):
242
+ raise TypeError("name must be a string.")
243
+
244
+ quota: Quota = field(metadata={"docstring": "The quota limit."})
245
+
246
+ def _validate_quota(self, quota: Quota):
247
+ if not isinstance(quota, Quota):
248
+ raise TypeError("quota must be a Quota.")
249
+
250
+ created_at: datetime = field(
251
+ metadata={"docstring": "The timestamp when this resource quota was created."}
252
+ )
253
+
254
+ def _validate_created_at(self, created_at: datetime):
255
+ if not isinstance(created_at, datetime):
256
+ raise TypeError("created_at must be a datetime.")
257
+
258
+ cloud_id: str = field(
259
+ metadata={"docstring": "ID of the cloud that this resource quota applies to."}
260
+ )
261
+
262
+ def _validate_cloud_id(self, cloud_id: str):
263
+ if not isinstance(cloud_id, str):
264
+ raise TypeError("cloud_id must be a string.")
265
+
266
+ project_id: Optional[str] = field(
267
+ default=None,
268
+ metadata={
269
+ "docstring": "ID of the project that this resource quota applies to (optional)."
270
+ },
271
+ )
272
+
273
+ def _validate_project_id(self, project_id: Optional[str]):
274
+ if project_id is not None and not isinstance(project_id, str):
275
+ raise TypeError("project_id must be a string.")
276
+
277
+ user_id: Optional[str] = field(
278
+ default=None,
279
+ metadata={
280
+ "docstring": "ID of the user that this resource quota applies to (optional)."
281
+ },
282
+ )
283
+
284
+ def _validate_user_id(self, user_id: Optional[str]):
285
+ if user_id is not None and not isinstance(user_id, str):
286
+ raise TypeError("user_id must be a string.")
287
+
288
+ is_enabled: bool = field(
289
+ default=True, metadata={"docstring": "Whether the resource quota is enabled."}
290
+ )
291
+
292
+ def _validate_is_enabled(self, is_enabled: bool):
293
+ if not isinstance(is_enabled, bool):
294
+ raise TypeError("is_enabled must be a boolean.")
295
+
296
+ deleted_at: Optional[datetime] = field(
297
+ default=None,
298
+ metadata={"docstring": "The timestamp when this resource quota was deleted."},
299
+ )
300
+
301
+ def _validate_deleted_at(self, deleted_at: Optional[datetime]):
302
+ if deleted_at is not None and not isinstance(deleted_at, datetime):
303
+ raise TypeError("deleted_at must be a datetime.")
anyscale/scripts.py CHANGED
@@ -29,12 +29,16 @@ from anyscale.commands.logs_commands import log_cli
29
29
  from anyscale.commands.machine_commands import machine_cli
30
30
  from anyscale.commands.machine_pool_commands import machine_pool_cli
31
31
  from anyscale.commands.migrate_commands import migrate_cli
32
+ from anyscale.commands.organization_invitation_commands import (
33
+ organization_invitation_cli,
34
+ )
32
35
  from anyscale.commands.project_commands import anyscale_init, project_cli
33
36
  from anyscale.commands.resource_quota_commands import resource_quota_cli
34
37
  from anyscale.commands.schedule_commands import schedule_cli
35
38
  from anyscale.commands.service_account_commands import service_account_cli
36
39
  from anyscale.commands.service_commands import service_cli
37
40
  from anyscale.commands.session_commands_hidden import session_cli
41
+ from anyscale.commands.user_commands import user_cli
38
42
  from anyscale.commands.workspace_commands import workspace_cli
39
43
  from anyscale.commands.workspace_commands_v2 import workspace_cli as workspace_cli_v2
40
44
  import anyscale.conf
@@ -142,6 +146,8 @@ cli.add_command(machine_pool_cli)
142
146
  cli.add_command(service_account_cli)
143
147
  cli.add_command(resource_quota_cli)
144
148
  cli.add_command(aggregated_instance_usage_cli)
149
+ cli.add_command(user_cli)
150
+ cli.add_command(organization_invitation_cli)
145
151
 
146
152
  ALIASES = {
147
153
  "h": anyscale_help,
@@ -137,7 +137,6 @@ from anyscale_client.models.list_service_model import ListServiceModel
137
137
  from anyscale_client.models.listservicemodel_list_response import ListservicemodelListResponse
138
138
  from anyscale_client.models.log_download_result import LogDownloadResult
139
139
  from anyscale_client.models.log_file_chunk import LogFileChunk
140
- from anyscale_client.models.log_level_types import LogLevelTypes
141
140
  from anyscale_client.models.log_stream import LogStream
142
141
  from anyscale_client.models.logdownloadresult_response import LogdownloadresultResponse
143
142
  from anyscale_client.models.logstream_response import LogstreamResponse
@@ -194,9 +193,6 @@ from anyscale_client.models.servicemodel_response import ServicemodelResponse
194
193
  from anyscale_client.models.session import Session
195
194
  from anyscale_client.models.session_command import SessionCommand
196
195
  from anyscale_client.models.session_command_types import SessionCommandTypes
197
- from anyscale_client.models.session_event import SessionEvent
198
- from anyscale_client.models.session_event_cause import SessionEventCause
199
- from anyscale_client.models.session_event_types import SessionEventTypes
200
196
  from anyscale_client.models.session_list_response import SessionListResponse
201
197
  from anyscale_client.models.session_operation import SessionOperation
202
198
  from anyscale_client.models.session_operation_type import SessionOperationType
@@ -207,7 +203,6 @@ from anyscale_client.models.session_state_data import SessionStateData
207
203
  from anyscale_client.models.session_stopping_data import SessionStoppingData
208
204
  from anyscale_client.models.sessioncommand_list_response import SessioncommandListResponse
209
205
  from anyscale_client.models.sessioncommand_response import SessioncommandResponse
210
- from anyscale_client.models.sessionevent_list_response import SessioneventListResponse
211
206
  from anyscale_client.models.sessionoperation_response import SessionoperationResponse
212
207
  from anyscale_client.models.sessions_query import SessionsQuery
213
208
  from anyscale_client.models.sort_by_clause_jobs_sort_field import SortByClauseJobsSortField
@@ -6140,156 +6140,6 @@ class DefaultApi(object):
6140
6140
  _request_timeout=local_var_params.get('_request_timeout'),
6141
6141
  collection_formats=collection_formats)
6142
6142
 
6143
- def get_session_event_log(self, session_id, **kwargs): # noqa: E501
6144
- """Get Session Event Log # noqa: E501
6145
-
6146
- Retrieves a session's event log. # noqa: E501
6147
- This method makes a synchronous HTTP request by default. To make an
6148
- asynchronous HTTP request, please pass async_req=True
6149
- >>> thread = api.get_session_event_log(session_id, async_req=True)
6150
- >>> result = thread.get()
6151
-
6152
- :param async_req bool: execute request asynchronously
6153
- :param str session_id: ID of the Session to retrieve event logs for. (required)
6154
- :param datetime before: Filters events occurring before this datetime.
6155
- :param datetime after: Filters events occurring after this datetime.
6156
- :param list[SessionEventTypes] event_types: Filters events to these types.
6157
- :param list[LogLevelTypes] log_level_types: Filters logs to these leves.
6158
- :param str paging_token:
6159
- :param int count:
6160
- :param _preload_content: if False, the urllib3.HTTPResponse object will
6161
- be returned without reading/decoding response
6162
- data. Default is True.
6163
- :param _request_timeout: timeout setting for this request. If one
6164
- number provided, it will be total request
6165
- timeout. It can also be a pair (tuple) of
6166
- (connection, read) timeouts.
6167
- :return: SessioneventListResponse
6168
- If the method is called asynchronously,
6169
- returns the request thread.
6170
- """
6171
- kwargs['_return_http_data_only'] = True
6172
- return self.get_session_event_log_with_http_info(session_id, **kwargs) # noqa: E501
6173
-
6174
- def get_session_event_log_with_http_info(self, session_id, **kwargs): # noqa: E501
6175
- """Get Session Event Log # noqa: E501
6176
-
6177
- Retrieves a session's event log. # noqa: E501
6178
- This method makes a synchronous HTTP request by default. To make an
6179
- asynchronous HTTP request, please pass async_req=True
6180
- >>> thread = api.get_session_event_log_with_http_info(session_id, async_req=True)
6181
- >>> result = thread.get()
6182
-
6183
- :param async_req bool: execute request asynchronously
6184
- :param str session_id: ID of the Session to retrieve event logs for. (required)
6185
- :param datetime before: Filters events occurring before this datetime.
6186
- :param datetime after: Filters events occurring after this datetime.
6187
- :param list[SessionEventTypes] event_types: Filters events to these types.
6188
- :param list[LogLevelTypes] log_level_types: Filters logs to these leves.
6189
- :param str paging_token:
6190
- :param int count:
6191
- :param _return_http_data_only: response data without head status code
6192
- and headers
6193
- :param _preload_content: if False, the urllib3.HTTPResponse object will
6194
- be returned without reading/decoding response
6195
- data. Default is True.
6196
- :param _request_timeout: timeout setting for this request. If one
6197
- number provided, it will be total request
6198
- timeout. It can also be a pair (tuple) of
6199
- (connection, read) timeouts.
6200
- :return: tuple(SessioneventListResponse, status_code(int), headers(HTTPHeaderDict))
6201
- If the method is called asynchronously,
6202
- returns the request thread.
6203
- """
6204
-
6205
- local_var_params = locals()
6206
-
6207
- all_params = [
6208
- 'session_id',
6209
- 'before',
6210
- 'after',
6211
- 'event_types',
6212
- 'log_level_types',
6213
- 'paging_token',
6214
- 'count'
6215
- ]
6216
- all_params.extend(
6217
- [
6218
- 'async_req',
6219
- '_return_http_data_only',
6220
- '_preload_content',
6221
- '_request_timeout'
6222
- ]
6223
- )
6224
-
6225
- for key, val in six.iteritems(local_var_params['kwargs']):
6226
- if key not in all_params:
6227
- raise ApiTypeError(
6228
- "Got an unexpected keyword argument '%s'"
6229
- " to method get_session_event_log" % key
6230
- )
6231
- local_var_params[key] = val
6232
- del local_var_params['kwargs']
6233
- # verify the required parameter 'session_id' is set
6234
- if self.api_client.client_side_validation and ('session_id' not in local_var_params or # noqa: E501
6235
- local_var_params['session_id'] is None): # noqa: E501
6236
- raise ApiValueError("Missing the required parameter `session_id` when calling `get_session_event_log`") # noqa: E501
6237
-
6238
- if self.api_client.client_side_validation and 'count' in local_var_params and local_var_params['count'] > 1000: # noqa: E501
6239
- raise ApiValueError("Invalid value for parameter `count` when calling `get_session_event_log`, must be a value less than or equal to `1000`") # noqa: E501
6240
- if self.api_client.client_side_validation and 'count' in local_var_params and local_var_params['count'] < 0: # noqa: E501
6241
- raise ApiValueError("Invalid value for parameter `count` when calling `get_session_event_log`, must be a value greater than or equal to `0`") # noqa: E501
6242
- collection_formats = {}
6243
-
6244
- path_params = {}
6245
-
6246
- query_params = []
6247
- if 'session_id' in local_var_params and local_var_params['session_id'] is not None: # noqa: E501
6248
- query_params.append(('session_id', local_var_params['session_id'])) # noqa: E501
6249
- if 'before' in local_var_params and local_var_params['before'] is not None: # noqa: E501
6250
- query_params.append(('before', local_var_params['before'])) # noqa: E501
6251
- if 'after' in local_var_params and local_var_params['after'] is not None: # noqa: E501
6252
- query_params.append(('after', local_var_params['after'])) # noqa: E501
6253
- if 'event_types' in local_var_params and local_var_params['event_types'] is not None: # noqa: E501
6254
- query_params.append(('event_types', local_var_params['event_types'])) # noqa: E501
6255
- collection_formats['event_types'] = 'multi' # noqa: E501
6256
- if 'log_level_types' in local_var_params and local_var_params['log_level_types'] is not None: # noqa: E501
6257
- query_params.append(('log_level_types', local_var_params['log_level_types'])) # noqa: E501
6258
- collection_formats['log_level_types'] = 'multi' # noqa: E501
6259
- if 'paging_token' in local_var_params and local_var_params['paging_token'] is not None: # noqa: E501
6260
- query_params.append(('paging_token', local_var_params['paging_token'])) # noqa: E501
6261
- if 'count' in local_var_params and local_var_params['count'] is not None: # noqa: E501
6262
- query_params.append(('count', local_var_params['count'])) # noqa: E501
6263
-
6264
- header_params = {}
6265
-
6266
- form_params = []
6267
- local_var_files = {}
6268
-
6269
- body_params = None
6270
- # HTTP header `Accept`
6271
- header_params['Accept'] = self.api_client.select_header_accept(
6272
- ['application/json']) # noqa: E501
6273
-
6274
- # Authentication setting
6275
- auth_settings = [] # noqa: E501
6276
-
6277
- return self.api_client.call_api(
6278
- '/session_events/', 'GET',
6279
- path_params,
6280
- query_params,
6281
- header_params,
6282
- body=body_params,
6283
- post_params=form_params,
6284
- files=local_var_files,
6285
- response_type='SessioneventListResponse', # noqa: E501
6286
- auth_settings=auth_settings,
6287
- async_req=local_var_params.get('async_req'),
6288
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
6289
- _preload_content=local_var_params.get('_preload_content', True),
6290
- _request_timeout=local_var_params.get('_request_timeout'),
6291
- collection_formats=collection_formats)
6292
-
6293
6143
  def get_session_for_job(self, production_job_id, **kwargs): # noqa: E501
6294
6144
  """Get Session For Job # noqa: E501
6295
6145
 
@@ -123,7 +123,6 @@ from anyscale_client.models.list_service_model import ListServiceModel
123
123
  from anyscale_client.models.listservicemodel_list_response import ListservicemodelListResponse
124
124
  from anyscale_client.models.log_download_result import LogDownloadResult
125
125
  from anyscale_client.models.log_file_chunk import LogFileChunk
126
- from anyscale_client.models.log_level_types import LogLevelTypes
127
126
  from anyscale_client.models.log_stream import LogStream
128
127
  from anyscale_client.models.logdownloadresult_response import LogdownloadresultResponse
129
128
  from anyscale_client.models.logstream_response import LogstreamResponse
@@ -180,9 +179,6 @@ from anyscale_client.models.servicemodel_response import ServicemodelResponse
180
179
  from anyscale_client.models.session import Session
181
180
  from anyscale_client.models.session_command import SessionCommand
182
181
  from anyscale_client.models.session_command_types import SessionCommandTypes
183
- from anyscale_client.models.session_event import SessionEvent
184
- from anyscale_client.models.session_event_cause import SessionEventCause
185
- from anyscale_client.models.session_event_types import SessionEventTypes
186
182
  from anyscale_client.models.session_list_response import SessionListResponse
187
183
  from anyscale_client.models.session_operation import SessionOperation
188
184
  from anyscale_client.models.session_operation_type import SessionOperationType
@@ -193,7 +189,6 @@ from anyscale_client.models.session_state_data import SessionStateData
193
189
  from anyscale_client.models.session_stopping_data import SessionStoppingData
194
190
  from anyscale_client.models.sessioncommand_list_response import SessioncommandListResponse
195
191
  from anyscale_client.models.sessioncommand_response import SessioncommandResponse
196
- from anyscale_client.models.sessionevent_list_response import SessioneventListResponse
197
192
  from anyscale_client.models.sessionoperation_response import SessionoperationResponse
198
193
  from anyscale_client.models.sessions_query import SessionsQuery
199
194
  from anyscale_client.models.sort_by_clause_jobs_sort_field import SortByClauseJobsSortField
@@ -30,8 +30,9 @@ class ClusterStatusDetails(object):
30
30
  """
31
31
  LAUNCHING_NODES = "LAUNCHING_NODES"
32
32
  CONFIGURING_HEAD_NODE = "CONFIGURING_HEAD_NODE"
33
+ UPDATING_CONTAINERS = "UPDATING_CONTAINERS"
33
34
 
34
- allowable_values = [LAUNCHING_NODES, CONFIGURING_HEAD_NODE] # noqa: E501
35
+ allowable_values = [LAUNCHING_NODES, CONFIGURING_HEAD_NODE, UPDATING_CONTAINERS] # noqa: E501
35
36
 
36
37
  """
37
38
  Attributes:
@@ -39,7 +39,7 @@ from anyscale.util import get_endpoint
39
39
  from anyscale.authenticate import AuthenticationBlock
40
40
  from anyscale_client.models import ClusterEnvironmentBuildStatus
41
41
  from anyscale.util import get_ray_and_py_version_for_default_cluster_env
42
- from anyscale.project import get_default_project
42
+ from anyscale.project_utils import get_default_project
43
43
  from anyscale.utils.ray_version_utils import get_correct_name_for_base_image_name
44
44
 
45
45
  logger = logging.getLogger(__file__)
@@ -0,0 +1,35 @@
1
+ from typing import List, Optional
2
+
3
+ from anyscale._private.anyscale_client import AnyscaleClientInterface
4
+ from anyscale._private.sdk import sdk_docs
5
+ from anyscale._private.sdk.base_sdk import Timer
6
+ from anyscale.cli_logger import BlockLogger
7
+ from anyscale.user._private.user_sdk import PrivateUserSDK
8
+ from anyscale.user.commands import (
9
+ _ADMIN_BATCH_CREATE_ARG_DOCSTRINGS,
10
+ _ADMIN_BATCH_CREATE_EXAMPLE,
11
+ admin_batch_create,
12
+ )
13
+ from anyscale.user.models import AdminCreatedUser, AdminCreateUser
14
+
15
+
16
+ class UserSDK:
17
+ def __init__(
18
+ self,
19
+ *,
20
+ client: Optional[AnyscaleClientInterface] = None,
21
+ logger: Optional[BlockLogger] = None,
22
+ timer: Optional[Timer] = None,
23
+ ):
24
+ self._private_sdk = PrivateUserSDK(client=client, logger=logger, timer=timer)
25
+
26
+ @sdk_docs(
27
+ doc_py_example=_ADMIN_BATCH_CREATE_EXAMPLE,
28
+ arg_docstrings=_ADMIN_BATCH_CREATE_ARG_DOCSTRINGS,
29
+ )
30
+ def admin_batch_create( # noqa: F811
31
+ self, admin_create_users: List[AdminCreateUser],
32
+ ) -> List[AdminCreatedUser]:
33
+ """Batch create, as an admin, users without email verification.
34
+ """
35
+ return self._private_sdk.admin_batch_create(admin_create_users)
@@ -0,0 +1,32 @@
1
+ from typing import List
2
+
3
+ from anyscale._private.sdk.base_sdk import BaseSDK
4
+ from anyscale.client.openapi_client.models import (
5
+ AdminCreateUser as AdminCreateUserModel,
6
+ )
7
+ from anyscale.user.models import AdminCreatedUser, AdminCreateUser
8
+
9
+
10
+ class PrivateUserSDK(BaseSDK):
11
+ def admin_batch_create(
12
+ self, admin_create_users: List[AdminCreateUser]
13
+ ) -> List[AdminCreatedUser]:
14
+ created_users = self.client.admin_batch_create_users(
15
+ [
16
+ AdminCreateUserModel(**admin_create_user.to_dict())
17
+ for admin_create_user in admin_create_users
18
+ ]
19
+ )
20
+
21
+ return [
22
+ AdminCreatedUser(
23
+ user_id=created_user.user_id,
24
+ name=created_user.name,
25
+ email=created_user.email,
26
+ created_at=created_user.created_at,
27
+ is_sso_user=created_user.is_sso_user,
28
+ lastname=created_user.lastname,
29
+ title=created_user.title,
30
+ )
31
+ for created_user in created_users
32
+ ]
@@ -0,0 +1,42 @@
1
+ from typing import List
2
+
3
+ from anyscale._private.sdk import sdk_command
4
+ from anyscale.user._private.user_sdk import PrivateUserSDK
5
+ from anyscale.user.models import AdminCreatedUser, AdminCreateUser
6
+
7
+
8
+ _USER_SDK_SINGLETON_KEY = "user_sdk"
9
+
10
+ _ADMIN_BATCH_CREATE_EXAMPLE = """
11
+ import anyscale
12
+ from anyscale.user.models import AdminCreateUser
13
+
14
+ anyscale.user.admin_batch_create(
15
+ [AdminCreateUser(
16
+ name="name",
17
+ email="test@anyscale.com",
18
+ password="",
19
+ is_sso_user=False,
20
+ lastname="lastname",
21
+ title="title",
22
+ ),],
23
+ )
24
+ """
25
+
26
+ _ADMIN_BATCH_CREATE_ARG_DOCSTRINGS = {
27
+ "admin_create_users": "Users to be created by an admin.",
28
+ }
29
+
30
+
31
+ @sdk_command(
32
+ _USER_SDK_SINGLETON_KEY,
33
+ PrivateUserSDK,
34
+ doc_py_example=_ADMIN_BATCH_CREATE_EXAMPLE,
35
+ arg_docstrings=_ADMIN_BATCH_CREATE_ARG_DOCSTRINGS,
36
+ )
37
+ def admin_batch_create(
38
+ admin_create_users: List[AdminCreateUser], *, _sdk: PrivateUserSDK
39
+ ) -> List[AdminCreatedUser]:
40
+ """Batch create, as an admin, users without email verification.
41
+ """
42
+ return _sdk.admin_batch_create(admin_create_users)