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
@@ -14,10 +14,16 @@ from anyscale._private.models.image_uri import ImageURI
14
14
  from anyscale._private.models.model_base import ListResponse
15
15
  from anyscale.cli_logger import BlockLogger
16
16
  from anyscale.client.openapi_client.models import (
17
+ AdminCreatedUser,
18
+ AdminCreateUser,
17
19
  Cloud,
20
+ CloudProviders,
18
21
  ComputeTemplateConfig,
22
+ CreateCloudCollaborator,
19
23
  CreateExperimentalWorkspace,
20
24
  CreateInternalProductionJob,
25
+ CreateResourceQuota,
26
+ CreateUserProjectCollaborator,
21
27
  DecoratedComputeTemplate,
22
28
  DeletedPlatformFineTunedModel,
23
29
  ExperimentalWorkspace,
@@ -26,9 +32,15 @@ from anyscale.client.openapi_client.models import (
26
32
  HaJobGoalStates,
27
33
  HaJobStates,
28
34
  InternalProductionJob,
35
+ MiniCloud,
36
+ MiniUser,
37
+ OrganizationCollaborator,
38
+ OrganizationInvitation,
39
+ OrganizationPermissionLevel,
29
40
  ProductionJob,
30
41
  ProductionJobStateTransition,
31
42
  Project,
43
+ ResourceQuota,
32
44
  WorkspaceDataplaneProxiedArtifacts,
33
45
  )
34
46
  from anyscale.client.openapi_client.models.create_schedule import CreateSchedule
@@ -133,6 +145,7 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
133
145
  self._jobs: Dict[str, ProductionJob] = {}
134
146
  self._job_runs: Dict[str, List[APIJobRun]] = defaultdict(list)
135
147
  self._project_to_id: Dict[Optional[str] : Dict[Optional[str], str]] = {}
148
+ self._project_collaborators: Dict[str, List[CreateUserProjectCollaborator]] = {}
136
149
  self._rolled_out_model: Optional[ApplyServiceModel] = None
137
150
  self._sent_workspace_notifications: List[WorkspaceNotification] = []
138
151
  self._rolled_back_service: Optional[Tuple[str, Optional[int]]] = None
@@ -146,11 +159,14 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
146
159
  self._controller_logs: Dict[str, str] = {}
147
160
  self._schedules: Dict[str, DecoratedSchedule] = {}
148
161
  self._schedule_trigger_counts: Dict[str, int] = defaultdict(int)
162
+ self._users: Dict[str, AdminCreatedUser] = {}
149
163
  self._workspaces: Dict[str, ExperimentalWorkspace] = {}
150
164
  self._workspaces_dependencies: Dict[str, List[str]] = {}
151
165
  self._workspaces_env_vars: Dict[str, Dict[str, str]] = {}
152
166
  self._clusters_headnode_ip: Dict[str, str] = {}
153
167
  self._clusters_ssh_key: Dict[str, SessionSshKey] = {}
168
+ self._organization_invitations: Dict[str, OrganizationInvitation] = {}
169
+ self._resource_quotas: Dict[str, ResourceQuota] = {}
154
170
 
155
171
  # Cloud ID -> Cloud.
156
172
  self._clouds: Dict[str, Cloud] = {
@@ -161,6 +177,9 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
161
177
  ),
162
178
  }
163
179
 
180
+ # Cloud ID -> collaborators
181
+ self._cloud_collaborators: Dict[str, List[CreateCloudCollaborator]] = {}
182
+
164
183
  # Cloud ID -> default ClusterCompute.
165
184
  compute_config = ClusterCompute(
166
185
  id=self.DEFAULT_CLUSTER_COMPUTE_ID,
@@ -344,6 +363,25 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
344
363
  def get_cloud(self, *, cloud_id: str) -> Optional[Cloud]:
345
364
  return self._clouds.get(cloud_id, None)
346
365
 
366
+ def add_cloud_collaborators(
367
+ self, cloud_id: str, collaborators: List[CreateCloudCollaborator]
368
+ ) -> None:
369
+ existing_collaborators = [
370
+ collaborator.email
371
+ for collaborator in self._cloud_collaborators.get(cloud_id, [])
372
+ ]
373
+
374
+ for collaborator in collaborators:
375
+ if collaborator.email in existing_collaborators:
376
+ raise ValueError(
377
+ f"Collaborator with email '{collaborator.email}' already exists in cloud '{cloud_id}'."
378
+ )
379
+
380
+ if cloud_id not in self._cloud_collaborators:
381
+ self._cloud_collaborators[cloud_id] = collaborators
382
+ else:
383
+ self._cloud_collaborators[cloud_id].extend(collaborators)
384
+
347
385
  def add_compute_config(self, compute_config: DecoratedComputeTemplate) -> int:
348
386
  compute_config.version = (
349
387
  len(self._compute_config_name_to_ids[compute_config.name]) + 1
@@ -576,6 +614,28 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
576
614
  )
577
615
  return None
578
616
 
617
+ def add_project_collaborators(
618
+ self, project_id: str, collaborators: List[CreateUserProjectCollaborator]
619
+ ):
620
+ existing_collaborators = [
621
+ collaborator.value.email if collaborator.value else None
622
+ for collaborator in self._project_collaborators.get(project_id, [])
623
+ ]
624
+
625
+ for collaborator in collaborators:
626
+ if (
627
+ collaborator.value
628
+ and collaborator.value.email in existing_collaborators
629
+ ):
630
+ raise ValueError(
631
+ f"Collaborator with email '{collaborator.value.email}' already exists in project '{project_id}'."
632
+ )
633
+
634
+ if project_id not in self._project_collaborators:
635
+ self._project_collaborators[project_id] = collaborators
636
+ else:
637
+ self._project_collaborators[project_id].extend(collaborators)
638
+
579
639
  def get_job(
580
640
  self,
581
641
  *,
@@ -905,7 +965,7 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
905
965
  compute_config_id=model.compute_config_id,
906
966
  environment_id=model.cluster_environment_build_id,
907
967
  cloud_id=model.cloud_id or self.get_cloud_id(),
908
- created_at=datetime.now(),
968
+ created_at=datetime.utcnow(),
909
969
  creator_id=self.DEFAULT_USER_ID,
910
970
  creator_email=self.DEFAULT_USER_EMAIL,
911
971
  organization_id=self.DEFAULT_ORGANIZATION_ID,
@@ -1078,3 +1138,135 @@ class FakeAnyscaleClient(AnyscaleClientInterface):
1078
1138
  filepath = filename
1079
1139
 
1080
1140
  return filepath
1141
+
1142
+ def admin_batch_create_users(
1143
+ self, admin_create_users: List[AdminCreateUser]
1144
+ ) -> List[AdminCreatedUser]:
1145
+ created_users = []
1146
+ for admin_create_user in admin_create_users:
1147
+ if admin_create_user.email in self._users:
1148
+ raise ValueError(
1149
+ f"User with email '{admin_create_user.email}' already exists."
1150
+ )
1151
+
1152
+ user_id = f"user-id-{uuid.uuid4()!s}"
1153
+ created_user = AdminCreatedUser(
1154
+ user_id=user_id,
1155
+ email=admin_create_user.email,
1156
+ created_at=datetime.utcnow(),
1157
+ name=admin_create_user.name,
1158
+ lastname=admin_create_user.lastname,
1159
+ title=admin_create_user.title,
1160
+ is_sso_user=admin_create_user.is_sso_user,
1161
+ )
1162
+ created_users.append(created_user)
1163
+ self._users[admin_create_user.email] = created_user
1164
+
1165
+ return created_users
1166
+
1167
+ def create_organization_invitations(
1168
+ self, emails: List[str]
1169
+ ) -> Tuple[List[str], List[str]]:
1170
+ success_emails, error_messages = [], []
1171
+ for email in emails:
1172
+ if email in self._users:
1173
+ error_messages.append(
1174
+ f"User with email {email} is already a member of your organization."
1175
+ )
1176
+ else:
1177
+ orginv_id = f"orginv_{uuid.uuid4()!s}"
1178
+ self._organization_invitations[email] = OrganizationInvitation(
1179
+ email=email,
1180
+ id=orginv_id,
1181
+ organization_id="org_1",
1182
+ created_at=datetime.utcnow(),
1183
+ expires_at=datetime.utcnow(),
1184
+ )
1185
+ success_emails.append(email)
1186
+
1187
+ return success_emails, error_messages
1188
+
1189
+ def list_organization_invitations(self) -> List[OrganizationInvitation]:
1190
+ return list(self._organization_invitations.values())
1191
+
1192
+ def delete_organization_invitation(self, email: str) -> OrganizationInvitation:
1193
+ if email not in self._organization_invitations:
1194
+ raise ValueError(f"Invitation for email '{email}' not found.")
1195
+
1196
+ return self._organization_invitations.pop(email)
1197
+
1198
+ def get_organization_collaborator(self, email):
1199
+ return OrganizationCollaborator(
1200
+ id="identity_1",
1201
+ permission_level=OrganizationPermissionLevel.COLLABORATOR,
1202
+ name="Test User",
1203
+ created_at=datetime.utcnow(),
1204
+ email=email,
1205
+ user_id="usr_1",
1206
+ )
1207
+
1208
+ def create_resource_quota(
1209
+ self, create_resource_quota: CreateResourceQuota
1210
+ ) -> ResourceQuota:
1211
+ resource_quota_id = f"rq_{uuid.uuid4()!s}"
1212
+ resource_quota = ResourceQuota(
1213
+ id=resource_quota_id,
1214
+ name=create_resource_quota.name,
1215
+ cloud_id=create_resource_quota.cloud_id,
1216
+ project_id=create_resource_quota.project_id,
1217
+ quota=create_resource_quota.quota,
1218
+ is_enabled=True,
1219
+ created_at=datetime.utcnow(),
1220
+ creator=MiniUser(
1221
+ id="user_1",
1222
+ email="test@anyscale.com",
1223
+ name="Test User",
1224
+ username="testuser",
1225
+ ),
1226
+ cloud=MiniCloud(
1227
+ id=create_resource_quota.cloud_id,
1228
+ name="Test Cloud",
1229
+ provider=CloudProviders.AWS,
1230
+ ),
1231
+ )
1232
+
1233
+ self._resource_quotas[resource_quota_id] = resource_quota
1234
+
1235
+ return self._resource_quotas[resource_quota_id]
1236
+
1237
+ def list_resource_quotas(
1238
+ self,
1239
+ name: Optional[str] = None,
1240
+ cloud_id: Optional[str] = None,
1241
+ creator_id: Optional[str] = None,
1242
+ is_enabled: Optional[bool] = None,
1243
+ max_items: int = 20,
1244
+ ) -> List[ResourceQuota]:
1245
+ results = []
1246
+ for resource_quota in self._resource_quotas.values():
1247
+ if name and resource_quota.name != name:
1248
+ continue
1249
+ if cloud_id and resource_quota.cloud_id != cloud_id:
1250
+ continue
1251
+ if creator_id and resource_quota.creator.id != creator_id:
1252
+ continue
1253
+ if is_enabled is not None and resource_quota.is_enabled != is_enabled:
1254
+ continue
1255
+ results.append(resource_quota)
1256
+
1257
+ return results[:max_items]
1258
+
1259
+ def delete_resource_quota(self, resource_quota_id: str) -> None:
1260
+ if resource_quota_id not in self._resource_quotas:
1261
+ raise ValueError(f"Resource Quota with id '{resource_quota_id}' not found.")
1262
+
1263
+ self._resource_quotas.pop(resource_quota_id)
1264
+
1265
+ def set_resource_quota_status(
1266
+ self, resource_quota_id: str, is_enabled: bool
1267
+ ) -> None:
1268
+ resource_quota = self._resource_quotas.get(resource_quota_id)
1269
+ if resource_quota is None:
1270
+ raise ValueError(f"Resource Quota with id '{resource_quota_id}' not found.")
1271
+
1272
+ resource_quota.is_enabled = is_enabled
@@ -1,4 +1,4 @@
1
- Tool to autogenerate documentation for the Anyscale SDK/CLI that can be embedded in a [Docusarus](https://docusaurus.io/) site.
1
+ Tool to autogenerate documentation for the Anyscale SDK/CLI that can be embedded in a [Docusarus](https://docusaurus.io/) site. If you're adding a new API reference in anyscale/product, follow this guide to see what changes you need to make: https://www.notion.so/anyscale-hq/How-to-document-new-anyscale-API-references-173027c809cb8080b8e3e53fc244d70b.
2
2
 
3
3
  This is used by: https://github.com/anyscale/docs/tree/master/docs/reference.
4
4
 
@@ -10,6 +10,10 @@ import anyscale
10
10
  from anyscale import scripts
11
11
  from anyscale._private.docgen.generator import MarkdownGenerator, Module
12
12
  from anyscale.aggregated_instance_usage.models import DownloadCSVFilters
13
+ from anyscale.cloud.models import (
14
+ CloudPermissionLevel,
15
+ CreateCloudCollaborator,
16
+ )
13
17
  from anyscale.commands import (
14
18
  aggregated_instance_usage_commands,
15
19
  cloud_commands,
@@ -22,11 +26,13 @@ from anyscale.commands import (
22
26
  logs_commands,
23
27
  machine_commands,
24
28
  machine_pool_commands,
29
+ organization_invitation_commands,
25
30
  project_commands,
26
31
  resource_quota_commands,
27
32
  schedule_commands,
28
33
  service_account_commands,
29
34
  service_commands,
35
+ user_commands,
30
36
  workspace_commands,
31
37
  workspace_commands_v2,
32
38
  )
@@ -57,6 +63,9 @@ from anyscale.llm.model.models import (
57
63
  FineTunedModel,
58
64
  FineTuningType,
59
65
  )
66
+ from anyscale.organization_invitation.models import OrganizationInvitation
67
+ from anyscale.project.models import CreateProjectCollaborator, ProjectPermissionLevel
68
+ from anyscale.resource_quota.models import CreateResourceQuota, Quota, ResourceQuota
60
69
  from anyscale.schedule.models import ScheduleConfig, ScheduleState, ScheduleStatus
61
70
  from anyscale.service.models import (
62
71
  RayGCSExternalStorageConfig,
@@ -67,6 +76,7 @@ from anyscale.service.models import (
67
76
  ServiceVersionStatus,
68
77
  TracingConfig,
69
78
  )
79
+ from anyscale.user.models import AdminCreatedUser, AdminCreateUser
70
80
  from anyscale.workspace.models import WorkspaceConfig
71
81
 
72
82
 
@@ -81,6 +91,41 @@ ALL_MODULES = [
81
91
  sdk_commands=[anyscale.aggregated_instance_usage.download_csv,],
82
92
  models=[DownloadCSVFilters],
83
93
  ),
94
+ Module(
95
+ title="User",
96
+ filename="user.md",
97
+ cli_prefix="user",
98
+ cli_commands=[user_commands.admin_batch_create],
99
+ sdk_prefix="anyscale.user",
100
+ sdk_commands=[anyscale.user.admin_batch_create,],
101
+ models=[AdminCreateUser, AdminCreatedUser],
102
+ ),
103
+ Module(
104
+ title="Project",
105
+ filename="project-api.md",
106
+ cli_prefix="anyscale project",
107
+ cli_commands=[project_commands.add_collaborators,],
108
+ sdk_prefix="anyscale.project",
109
+ sdk_commands=[anyscale.project.add_collaborators,],
110
+ models=[ProjectPermissionLevel, CreateProjectCollaborator],
111
+ legacy_cli_commands=[project_commands.create, project_commands.list,],
112
+ legacy_sdk_commands={
113
+ "create_project": None,
114
+ "delete_project": None,
115
+ "get_default_project": None,
116
+ "get_project": None,
117
+ "search_projects": None,
118
+ "update_project": None,
119
+ },
120
+ legacy_sdk_models=[
121
+ "CreateProject",
122
+ "Project",
123
+ "ProjectListResponse",
124
+ "ProjectResponse",
125
+ "ProjectsQuery",
126
+ "UpdateProject",
127
+ ],
128
+ ),
84
129
  Module(
85
130
  title="Job",
86
131
  filename="job-api.md",
@@ -389,10 +434,12 @@ ALL_MODULES = [
389
434
  cloud_commands.cloud_verify,
390
435
  cloud_commands.list_cloud,
391
436
  cloud_commands.cloud_config_update,
437
+ cloud_commands.cloud_set_default,
438
+ cloud_commands.add_collaborators,
392
439
  ],
393
440
  sdk_prefix="anyscale.cloud",
394
- sdk_commands=[],
395
- models=[],
441
+ sdk_commands=[anyscale.cloud.add_collaborators],
442
+ models=[CloudPermissionLevel, CreateCloudCollaborator],
396
443
  cli_command_group_prefix={cloud_commands.cloud_config_update: "config"},
397
444
  legacy_sdk_commands={
398
445
  # limited support, no replacement yet
@@ -568,8 +615,31 @@ ALL_MODULES = [
568
615
  resource_quota_commands.disable,
569
616
  ],
570
617
  sdk_prefix="anyscale.resource_quota",
571
- sdk_commands=[], # No SDK commands for resource quotas
572
- models=[],
618
+ sdk_commands=[
619
+ anyscale.resource_quota.create,
620
+ anyscale.resource_quota.list,
621
+ anyscale.resource_quota.delete,
622
+ anyscale.resource_quota.enable,
623
+ anyscale.resource_quota.disable,
624
+ ],
625
+ models=[CreateResourceQuota, Quota, ResourceQuota],
626
+ ),
627
+ Module(
628
+ title="Organization Invitation",
629
+ filename="organization-invitation.md",
630
+ cli_prefix="anyscale organization-invitation",
631
+ cli_commands=[
632
+ organization_invitation_commands.create,
633
+ organization_invitation_commands.list,
634
+ organization_invitation_commands.delete,
635
+ ],
636
+ sdk_prefix="anyscale.organization-invitation",
637
+ sdk_commands=[
638
+ anyscale.organization_invitation.create,
639
+ anyscale.organization_invitation.list,
640
+ anyscale.organization_invitation.delete,
641
+ ],
642
+ models=[OrganizationInvitation],
573
643
  ),
574
644
  Module(
575
645
  title="Other",
@@ -588,23 +658,14 @@ ALL_MODULES = [
588
658
  legacy_cli_commands=[
589
659
  machine_commands.delete_machine,
590
660
  machine_commands.list_machines,
591
- project_commands.create,
592
- project_commands.list,
593
661
  ],
594
662
  legacy_sdk_commands={
595
663
  "get_organization_temporary_object_storage_credentials": None,
596
664
  "partial_update_organization": None,
597
- "create_project": None,
598
- "delete_project": None,
599
- "get_default_project": None,
600
- "get_project": None,
601
- "search_projects": None,
602
- "update_project": None,
603
665
  "get_runtime_environment": None,
604
666
  "create_session_command": None,
605
667
  "get_session_command": None,
606
668
  "list_session_commands": None,
607
- "get_session_event_log": None,
608
669
  "upsert_sso_config": None,
609
670
  "upsert_test_sso_config": None,
610
671
  },
@@ -618,7 +679,6 @@ ALL_MODULES = [
618
679
  "BuildResponse",
619
680
  "BuildStatus",
620
681
  "CreateBuild",
621
- "CreateProject",
622
682
  "CreateSSOConfig",
623
683
  "GrpcProtocolConfig",
624
684
  "HTTPValidationError",
@@ -635,10 +695,6 @@ ALL_MODULES = [
635
695
  "Organization",
636
696
  "OrganizationResponse",
637
697
  "PageQuery",
638
- "Project",
639
- "ProjectListResponse",
640
- "ProjectResponse",
641
- "ProjectsQuery",
642
698
  "Protocols",
643
699
  "PythonModules",
644
700
  "PythonVersion",
@@ -653,7 +709,6 @@ ALL_MODULES = [
653
709
  "TextQuery",
654
710
  "TracingConfig",
655
711
  "UpdateOrganization",
656
- "UpdateProject",
657
712
  "UserServiceAccessTypes",
658
713
  "WorkerNodeType",
659
714
  ],
@@ -1058,26 +1058,6 @@ Name | Type | Description | Notes
1058
1058
 
1059
1059
  Returns [SessioncommandListResponse](./models.md#sessioncommandlistresponse)
1060
1060
 
1061
- ## Session Events
1062
-
1063
- ### get_session_event_log
1064
-
1065
- Retrieves a session's event log.
1066
-
1067
- Parameters
1068
-
1069
- Name | Type | Description | Notes
1070
- ------------- | ------------- | ------------- | -------------
1071
- `session_id` | str| ID of the Session to retrieve event logs for. | Defaults to null
1072
- `before` | optional datetime| Filters events occurring before this datetime. | Defaults to null
1073
- `after` | optional datetime| Filters events occurring after this datetime. | Defaults to null
1074
- `event_types` | [List[SessionEventTypes]](./models.md#sessioneventtypes)| Filters events to these types. | Defaults to null
1075
- `log_level_types` | [List[LogLevelTypes]](./models.md#logleveltypes)| Filters logs to these leves. | Defaults to null
1076
- `paging_token` | optional str| | Defaults to null
1077
- `count` | optional int| | Defaults to 20
1078
-
1079
- Returns [SessioneventListResponse](./models.md#sessioneventlistresponse)
1080
-
1081
1061
  ## Sso Configs
1082
1062
 
1083
1063
  ### upsert_sso_config
@@ -26,6 +26,7 @@ CLI_NO_EXAMPLES = {
26
26
  "anyscale",
27
27
  "anyscale cloud",
28
28
  "anyscale cloud config",
29
+ "anyscale cloud set-default",
29
30
  "anyscale logs",
30
31
  "anyscale service-account",
31
32
  "anyscale service",
@@ -178,10 +179,11 @@ class MarkdownGenerator:
178
179
  output = f"## {m.title} CLI\n"
179
180
 
180
181
  for t in commands or []:
182
+ cli_command_prefix = cli_prefix
181
183
  if m.cli_command_group_prefix and t in m.cli_command_group_prefix:
182
- cli_prefix = f"{cli_prefix} {m.cli_command_group_prefix[t]}"
184
+ cli_command_prefix = f"{cli_prefix} {m.cli_command_group_prefix[t]}"
183
185
  output += "\n" + self._gen_markdown_for_cli_command(
184
- t, cli_prefix=cli_prefix or ""
186
+ t, cli_prefix=cli_command_prefix or ""
185
187
  )
186
188
 
187
189
  return output
@@ -548,7 +548,7 @@ Possible Values:
548
548
  ClusterStatusDetails is a more granular status than ClusterStatus.
549
549
 
550
550
  Possible Values:
551
- ['LAUNCHING_NODES', 'CONFIGURING_HEAD_NODE']
551
+ ['LAUNCHING_NODES', 'CONFIGURING_HEAD_NODE', 'UPDATING_CONTAINERS']
552
552
 
553
553
  ## ClustercomputeListResponse
554
554
 
@@ -1251,13 +1251,6 @@ Name | Type | Description | Notes
1251
1251
  **ray_worker_id** | **str** | The Ray worker ID that this file originated from, if appropriate. | [optional] [default to null]
1252
1252
  **job_id** | **str** | The Ray job ID that this file originated from, if appropriate. | [optional] [default to null]
1253
1253
 
1254
- ## LogLevelTypes
1255
-
1256
- The classification of a session event.
1257
-
1258
- Possible Values:
1259
- ['info', 'error']
1260
-
1261
1254
  ## LogStream
1262
1255
 
1263
1256
 
@@ -1886,35 +1879,6 @@ An enumeration.
1886
1879
  Possible Values:
1887
1880
  ['WEBTERMINAL', 'COMMAND_LINE_RUNNER']
1888
1881
 
1889
- ## SessionEvent
1890
-
1891
- Model of a session event item from the session event log.
1892
-
1893
- Name | Type | Description | Notes
1894
- ------------ | ------------- | ------------- | -------------
1895
- **event_type** | **str** | The category of session event. | [default to null]
1896
- **log_level** | [**LogLevelTypes**](#logleveltypes) | The severity of the session event. | [default to null]
1897
- **timestamp** | **datetime** | The time at which the session event occurred. | [default to null]
1898
- **description** | **str** | A human readable description of the session event. | [default to null]
1899
- **cause** | [**SessionEventCause**](#sessioneventcause) | The reason why the session event occurred. None indicates an unknown cause. | [optional] [default to null]
1900
- **id** | **str** | A unique identifier for the session event. | [default to null]
1901
-
1902
- ## SessionEventCause
1903
-
1904
- Model of a session event cause. Exactly one of cause_user or cause_system is non-None.
1905
-
1906
- Name | Type | Description | Notes
1907
- ------------ | ------------- | ------------- | -------------
1908
- **cause_user** | **str** | The username of the user who caused the session event. | [optional] [default to null]
1909
- **cause_system** | **str** | The name of the internal anyscale system that caused the session event. | [optional] [default to null]
1910
-
1911
- ## SessionEventTypes
1912
-
1913
- The type of session event.
1914
-
1915
- Possible Values:
1916
- ['edited', 'terminate_command', 'start_command', 'running', 'terminated', 'awaiting_file_mounts', 'starting', 'updating', 'terminating', 'created', 'terminating_errored', 'updating_errored', 'startup_errored']
1917
-
1918
1882
  ## SessionListResponse
1919
1883
 
1920
1884
  A list response form the API. Contains a field \"results\" which has the contents of the response.
@@ -2001,15 +1965,6 @@ Name | Type | Description | Notes
2001
1965
  ------------ | ------------- | ------------- | -------------
2002
1966
  **result** | [**SessionCommand**](#sessioncommand) | | [default to null]
2003
1967
 
2004
- ## SessioneventListResponse
2005
-
2006
- A list response form the API. Contains a field \"results\" which has the contents of the response.
2007
-
2008
- Name | Type | Description | Notes
2009
- ------------ | ------------- | ------------- | -------------
2010
- **results** | [**List[SessionEvent]**](#sessionevent) | | [default to null]
2011
- **metadata** | [**ListResponseMetadata**](#listresponsemetadata) | | [optional] [default to null]
2012
-
2013
1968
  ## SessionoperationResponse
2014
1969
 
2015
1970
  A response from the API. Contains a field \"result\" which has the contents of the response.
@@ -93,7 +93,7 @@ class WorkloadConfig(ModelBase):
93
93
  default=None,
94
94
  repr=False,
95
95
  metadata={
96
- "docstring": "A list of pip requirements or a path to a `requirements.txt` file for the workload. When running inside a workspace, this defaults to the workspace-tracked requirements."
96
+ "docstring": "A list of pip requirements or a path to a `requirements.txt` file for the workload. Anyscale installs these dependencies on top of the image. If you run a workload from a workspace, the default is to use the workspace dependencies, but specifying this option overrides them."
97
97
  },
98
98
  )
99
99
 
@@ -31,6 +31,6 @@ class AggregatedInstanceUsageSDK:
31
31
  doc_py_example=_DOWNLOAD_CSV_EXAMPLE, arg_docstrings=_DOWNLOAD_ARG_DOCSTRINGS,
32
32
  )
33
33
  def download_csv(self, filters: DownloadCSVFilters,) -> str: # noqa: F811
34
- """Downloads aggregated instance usage CSV.
34
+ """Download an aggregated instance usage report as a zipped CSV to the provided directory.
35
35
  """
36
36
  return self._private_sdk.download_csv(filters=filters)
@@ -23,9 +23,7 @@ anyscale.aggregated_instance_usage.download_csv(
23
23
  )
24
24
  """
25
25
 
26
- _DOWNLOAD_ARG_DOCSTRINGS = {
27
- "filters": "The filter of the instance usage to be downloaded."
28
- }
26
+ _DOWNLOAD_ARG_DOCSTRINGS = {"filters": "The filter of the instance usage to download."}
29
27
 
30
28
 
31
29
  @sdk_command(
@@ -37,6 +35,6 @@ _DOWNLOAD_ARG_DOCSTRINGS = {
37
35
  def download_csv(
38
36
  filters: DownloadCSVFilters, *, _sdk: PrivateAggregatedInstanceUsageSDK
39
37
  ) -> str:
40
- """Downloads aggregated instance usage CSV.
38
+ """Download an aggregated instance usage report as a zipped CSV to the provided directory.
41
39
  """
42
40
  return _sdk.download_csv(filters)
@@ -15,17 +15,17 @@ import anyscale
15
15
  from anyscale.aggregated_instance_usage.models import DownloadCSVFilters
16
16
 
17
17
  download_csv_filters = DownloadCSVFilters(
18
- # Start date for the usage CSV (inclusive)
18
+ # Start date (inclusive) for the usage CSV.
19
19
  start_date="2024-10-01",
20
- # End date for the usage CSV (inclusive)
20
+ # End date (inclusive) for the usage CSV.
21
21
  end_date="2024-10-31",
22
- # Optional cloud name to filter by
22
+ # Optional cloud name to filter by.
23
23
  cloud="cloud_name",
24
- # Optional project name to filter by
24
+ # Optional project name to filter by.
25
25
  project="project_name",
26
- # Optional directory to save the CSV to
26
+ # Optional directory to save the CSV to.
27
27
  directory="/directory",
28
- # Optional hide progress bar
28
+ # Optional hide progress bar.
29
29
  hide_progress_bar=False,
30
30
  )
31
31
  """
@@ -39,14 +39,14 @@ download_csv_filters = DownloadCSVFilters(
39
39
  raise ValueError("Incorrect date format, should be YYYY-MM-DD")
40
40
 
41
41
  start_date: str = field(
42
- metadata={"docstring": "Start date for the usage CSV (inclusive)."}
42
+ metadata={"docstring": "Start date (inclusive) for the usage CSV."}
43
43
  )
44
44
 
45
45
  def _validate_start_date(self, start_date: str):
46
46
  self._validate_date(start_date)
47
47
 
48
48
  end_date: str = field(
49
- metadata={"docstring": "End date for the usage CSV (inclusive)."}
49
+ metadata={"docstring": "End date (inclusive) for the usage CSV."}
50
50
  )
51
51
 
52
52
  def _validate_end_date(self, end_date: str):