anyscale 0.24.88__py3-none-any.whl → 0.25.5__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.
- anyscale/__init__.py +56 -0
- anyscale/_private/anyscale_client/anyscale_client.py +179 -28
- anyscale/_private/anyscale_client/common.py +109 -2
- anyscale/_private/anyscale_client/fake_anyscale_client.py +239 -1
- anyscale/_private/docgen/README.md +1 -1
- anyscale/_private/docgen/__main__.py +71 -21
- anyscale/_private/docgen/api.md +13 -20
- anyscale/_private/docgen/generator.py +3 -2
- anyscale/_private/docgen/models.md +4 -49
- anyscale/_private/workload/workload_config.py +21 -7
- anyscale/aggregated_instance_usage/__init__.py +1 -1
- anyscale/aggregated_instance_usage/commands.py +2 -4
- anyscale/aggregated_instance_usage/models.py +8 -8
- anyscale/client/README.md +25 -22
- anyscale/client/openapi_client/__init__.py +16 -14
- anyscale/client/openapi_client/api/default_api.py +1139 -959
- anyscale/client/openapi_client/models/__init__.py +16 -14
- anyscale/client/openapi_client/models/baseimagesenum.py +43 -1
- anyscale/client/openapi_client/models/{session_event_types.py → cloud_deployment_config.py} +35 -24
- anyscale/client/openapi_client/models/{platformfinetuningjob_response.py → clouddeploymentconfig_response.py} +11 -11
- anyscale/client/openapi_client/models/{log_level_types.py → cluster_event_source.py} +12 -7
- anyscale/client/openapi_client/models/{company_size.py → cluster_size.py} +10 -10
- anyscale/client/openapi_client/models/cluster_status_details.py +2 -1
- anyscale/client/openapi_client/models/{sessionevent_list_response.py → clusterevent_list_response.py} +15 -15
- anyscale/client/openapi_client/models/create_experimental_workspace.py +29 -1
- anyscale/client/openapi_client/models/create_notification_channel_record.py +29 -3
- anyscale/client/openapi_client/models/decorated_interactive_session.py +1 -57
- anyscale/client/openapi_client/models/decorated_job.py +1 -57
- anyscale/client/openapi_client/models/decorated_job_submission.py +1 -29
- anyscale/client/openapi_client/models/decorated_production_job.py +1 -29
- anyscale/client/openapi_client/models/decorated_session.py +1 -57
- anyscale/client/openapi_client/models/decorated_unified_job.py +1 -30
- anyscale/client/openapi_client/models/{resubmit_ft_job_request.py → describe_machine_pool_request.py} +21 -20
- anyscale/client/openapi_client/models/describe_machine_pool_response.py +123 -0
- anyscale/client/openapi_client/models/describemachinepoolresponse_response.py +121 -0
- anyscale/client/openapi_client/models/ha_jobs_sort_field.py +1 -2
- anyscale/client/openapi_client/models/internal_production_job.py +1 -29
- anyscale/client/openapi_client/models/jobs_sort_field.py +1 -2
- anyscale/client/openapi_client/models/machine_allocation_state.py +3 -1
- anyscale/client/openapi_client/models/machine_state_info.py +326 -0
- anyscale/client/openapi_client/models/{fine_tuning_job_status.py → notification_channel_slack_config.py} +34 -16
- anyscale/client/openapi_client/models/organization_marketing_questions.py +80 -54
- anyscale/client/openapi_client/models/request_state_info.py +210 -0
- anyscale/client/openapi_client/models/{platformfinetuningjob_list_response.py → scheduler_info.py} +43 -38
- anyscale/client/openapi_client/models/serve_deployment_fast_api_docs_status.py +123 -0
- anyscale/client/openapi_client/models/serve_deployment_state.py +2 -1
- anyscale/client/openapi_client/models/servedeploymentfastapidocsstatus_response.py +121 -0
- anyscale/client/openapi_client/models/sessions_sort_field.py +1 -2
- anyscale/client/openapi_client/models/supportedbaseimagesenum.py +43 -1
- anyscale/client/openapi_client/models/unified_job_sort_field.py +1 -2
- anyscale/client/openapi_client/models/update_cloud_collaborator.py +121 -0
- anyscale/client/openapi_client/models/usage_by_cluster.py +28 -1
- anyscale/client/openapi_client/models/usage_by_user.py +30 -3
- anyscale/client/openapi_client/models/workload_info.py +210 -0
- anyscale/cloud/__init__.py +83 -0
- anyscale/cloud/_private/cloud_sdk.py +25 -0
- anyscale/cloud/commands.py +45 -0
- anyscale/cloud/models.py +91 -0
- anyscale/cluster_compute.py +1 -1
- anyscale/commands/aggregated_instance_usage_commands.py +4 -4
- anyscale/commands/cloud_commands.py +87 -14
- anyscale/commands/command_examples.py +65 -0
- anyscale/commands/job_commands.py +15 -3
- anyscale/commands/machine_pool_commands.py +113 -1
- anyscale/commands/organization_invitation_commands.py +98 -0
- anyscale/commands/project_commands.py +52 -2
- anyscale/commands/resource_quota_commands.py +98 -11
- anyscale/commands/service_account_commands.py +65 -8
- anyscale/commands/service_commands.py +61 -1
- anyscale/commands/session_commands_hidden.py +5 -1
- anyscale/commands/user_commands.py +1 -1
- anyscale/commands/util.py +2 -2
- anyscale/commands/workspace_commands.py +1 -1
- anyscale/connect.py +1 -1
- anyscale/connect_utils/project.py +7 -4
- anyscale/controllers/cloud_controller.py +63 -30
- anyscale/controllers/cloud_functional_verification_controller.py +1 -1
- anyscale/controllers/cluster_controller.py +3 -11
- anyscale/controllers/compute_config_controller.py +1 -1
- anyscale/controllers/experimental_integrations_controller.py +1 -1
- anyscale/controllers/job_controller.py +8 -6
- anyscale/controllers/list_controller.py +2 -2
- anyscale/controllers/machine_pool_controller.py +12 -1
- anyscale/controllers/project_controller.py +4 -3
- anyscale/controllers/schedule_controller.py +1 -1
- anyscale/controllers/service_controller.py +1 -1
- anyscale/controllers/workspace_controller.py +1 -1
- anyscale/models/job_model.py +1 -1
- anyscale/organization_invitation/__init__.py +61 -0
- anyscale/organization_invitation/_private/organization_invitation_sdk.py +24 -0
- anyscale/organization_invitation/commands.py +84 -0
- anyscale/organization_invitation/models.py +45 -0
- anyscale/project/__init__.py +35 -0
- anyscale/project/_private/project_sdk.py +27 -0
- anyscale/project/commands.py +56 -0
- anyscale/project/models.py +91 -0
- anyscale/{project.py → project_utils.py} +3 -4
- anyscale/resource_quota/__init__.py +99 -0
- anyscale/resource_quota/_private/resource_quota_sdk.py +120 -0
- anyscale/resource_quota/commands.py +150 -0
- anyscale/resource_quota/models.py +303 -0
- anyscale/scripts.py +4 -0
- anyscale/sdk/anyscale_client/__init__.py +0 -5
- anyscale/sdk/anyscale_client/api/default_api.py +119 -150
- anyscale/sdk/anyscale_client/models/__init__.py +0 -5
- anyscale/sdk/anyscale_client/models/baseimagesenum.py +43 -1
- anyscale/sdk/anyscale_client/models/cluster_status_details.py +2 -1
- anyscale/sdk/anyscale_client/models/jobs_sort_field.py +1 -2
- anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +43 -1
- anyscale/sdk/anyscale_client/sdk.py +1 -1
- anyscale/service/__init__.py +21 -0
- anyscale/service/_private/service_sdk.py +13 -0
- anyscale/service/commands.py +35 -0
- anyscale/service_account/__init__.py +88 -0
- anyscale/service_account/_private/service_account_sdk.py +101 -0
- anyscale/service_account/commands.py +147 -0
- anyscale/service_account/models.py +66 -0
- anyscale/shared_anyscale_utils/latest_ray_version.py +1 -1
- anyscale/shared_anyscale_utils/utils/id_gen.py +2 -0
- anyscale/user/__init__.py +1 -1
- anyscale/user/commands.py +1 -1
- anyscale/user/models.py +25 -15
- anyscale/util.py +23 -0
- anyscale/utils/cloud_utils.py +1 -1
- anyscale/version.py +1 -1
- anyscale/workspace_utils.py +1 -1
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/METADATA +1 -5
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/RECORD +134 -119
- anyscale/client/openapi_client/models/create_fine_tuning_hyperparameters.py +0 -156
- anyscale/client/openapi_client/models/create_fine_tuning_job_product_request.py +0 -353
- anyscale/client/openapi_client/models/finish_ft_job_request.py +0 -204
- anyscale/client/openapi_client/models/platform_fine_tuning_job.py +0 -577
- anyscale/client/openapi_client/models/session_event.py +0 -267
- anyscale/client/openapi_client/models/session_event_cause.py +0 -150
- anyscale/controllers/resource_quota_controller.py +0 -183
- anyscale/controllers/service_account_controller.py +0 -168
- anyscale/sdk/anyscale_client/models/log_level_types.py +0 -100
- anyscale/sdk/anyscale_client/models/session_event.py +0 -267
- anyscale/sdk/anyscale_client/models/session_event_cause.py +0 -150
- anyscale/sdk/anyscale_client/models/session_event_types.py +0 -111
- anyscale/sdk/anyscale_client/models/sessionevent_list_response.py +0 -147
- anyscale/utils/imports/azure.py +0 -14
- /anyscale/{cloud.py → cloud_utils.py} +0 -0
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/LICENSE +0 -0
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/NOTICE +0 -0
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/WHEEL +0 -0
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/entry_points.txt +0 -0
- {anyscale-0.24.88.dist-info → anyscale-0.25.5.dist-info}/top_level.txt +0 -0
@@ -1,168 +0,0 @@
|
|
1
|
-
from typing import List, Optional
|
2
|
-
|
3
|
-
import click
|
4
|
-
from rich import box
|
5
|
-
from rich.console import Console
|
6
|
-
from rich.table import Table
|
7
|
-
|
8
|
-
from anyscale.cli_logger import BlockLogger
|
9
|
-
from anyscale.client.openapi_client.models import (
|
10
|
-
AnyscaleServiceAccount,
|
11
|
-
ServerSessionToken,
|
12
|
-
)
|
13
|
-
from anyscale.controllers.base_controller import BaseController
|
14
|
-
|
15
|
-
|
16
|
-
WARNING_COLOR = "bold red"
|
17
|
-
DEFAULT_OVERFLOW = "fold"
|
18
|
-
DEFAULT_COL_WIDTH = 36
|
19
|
-
ONE_HUNDRED_YEARS_IN_SECONDS = 3153600000
|
20
|
-
|
21
|
-
|
22
|
-
class ServiceAccountController(BaseController):
|
23
|
-
def __init__(self):
|
24
|
-
super().__init__()
|
25
|
-
self.log = BlockLogger()
|
26
|
-
self.console = Console()
|
27
|
-
|
28
|
-
def _get_service_account_identifier(
|
29
|
-
self, email: Optional[str], name: Optional[str]
|
30
|
-
) -> str:
|
31
|
-
# Logic can be simplified but kept verbose for clarity and typing
|
32
|
-
if not email and not name:
|
33
|
-
raise click.ClickException("Either email or name must be provided.")
|
34
|
-
if email and name:
|
35
|
-
raise click.ClickException("Only one of email or name can be provided.")
|
36
|
-
if email:
|
37
|
-
return email
|
38
|
-
elif name:
|
39
|
-
return name
|
40
|
-
|
41
|
-
raise click.ClickException("Internal server error. Please contact support.")
|
42
|
-
|
43
|
-
def _validate_exactly_one_service_account_per_email_or_name(
|
44
|
-
self, service_accounts: List[AnyscaleServiceAccount], identifier: str,
|
45
|
-
):
|
46
|
-
if len(service_accounts) == 0:
|
47
|
-
raise click.ClickException(f"No service account {identifier} found.")
|
48
|
-
|
49
|
-
if len(service_accounts) > 1:
|
50
|
-
raise click.ClickException(
|
51
|
-
f"Internal server error when fetching service account {identifier}. Please contact support."
|
52
|
-
)
|
53
|
-
|
54
|
-
def _print_new_api_key(self, api_key: ServerSessionToken):
|
55
|
-
self.console.print(
|
56
|
-
"The following API token for the service account will only appear once:\n",
|
57
|
-
style=WARNING_COLOR,
|
58
|
-
)
|
59
|
-
self.console.print(api_key.server_session_id)
|
60
|
-
|
61
|
-
def create_service_account(self, name: str):
|
62
|
-
service_account = self.api_client.create_service_account_api_v2_users_service_accounts_post(
|
63
|
-
name=name
|
64
|
-
).result
|
65
|
-
api_key = self.api_client.create_api_key_api_v2_users_create_api_key_post(
|
66
|
-
api_key_parameters={
|
67
|
-
"user_id": service_account.user_id,
|
68
|
-
"duration": ONE_HUNDRED_YEARS_IN_SECONDS,
|
69
|
-
}
|
70
|
-
).result
|
71
|
-
|
72
|
-
self.console.print(f"\nService account {name} created successfully.")
|
73
|
-
self._print_new_api_key(api_key)
|
74
|
-
|
75
|
-
def create_new_service_account_api_key(
|
76
|
-
self, email: Optional[str], name: Optional[str]
|
77
|
-
):
|
78
|
-
service_accounts = (
|
79
|
-
self.api_client.list_organization_collaborators_api_v2_organization_collaborators_get(
|
80
|
-
is_service_account=True, email=email, name=name
|
81
|
-
)
|
82
|
-
).results
|
83
|
-
self._validate_exactly_one_service_account_per_email_or_name(
|
84
|
-
service_accounts, self._get_service_account_identifier(email, name)
|
85
|
-
)
|
86
|
-
sa = service_accounts[0]
|
87
|
-
api_key = self.api_client.create_api_key_api_v2_users_create_api_key_post(
|
88
|
-
api_key_parameters={
|
89
|
-
"user_id": sa.user_id,
|
90
|
-
"duration": ONE_HUNDRED_YEARS_IN_SECONDS,
|
91
|
-
}
|
92
|
-
).result
|
93
|
-
|
94
|
-
self._print_new_api_key(api_key)
|
95
|
-
|
96
|
-
def _print_service_account_table(
|
97
|
-
self, service_accounts: List[AnyscaleServiceAccount]
|
98
|
-
):
|
99
|
-
table = Table(box=box.MINIMAL, header_style="bright_cyan")
|
100
|
-
table.add_column("NAME", width=DEFAULT_COL_WIDTH, overflow=DEFAULT_OVERFLOW)
|
101
|
-
table.add_column(
|
102
|
-
"CREATED AT",
|
103
|
-
style="dim",
|
104
|
-
width=DEFAULT_COL_WIDTH,
|
105
|
-
overflow=DEFAULT_OVERFLOW,
|
106
|
-
)
|
107
|
-
table.add_column(
|
108
|
-
"ORGANIZATION ROLE", width=DEFAULT_COL_WIDTH, overflow=DEFAULT_OVERFLOW
|
109
|
-
)
|
110
|
-
table.add_column("EMAIL", width=80, overflow=DEFAULT_OVERFLOW)
|
111
|
-
for sa in service_accounts:
|
112
|
-
table.add_row(
|
113
|
-
sa.name,
|
114
|
-
sa.created_at.strftime("%Y/%m/%d"),
|
115
|
-
sa.permission_level,
|
116
|
-
sa.email,
|
117
|
-
)
|
118
|
-
|
119
|
-
self.console.print(table)
|
120
|
-
|
121
|
-
def list_service_accounts(self, max_items: int):
|
122
|
-
service_accounts = self.api_client.list_organization_collaborators_api_v2_organization_collaborators_get(
|
123
|
-
is_service_account=True
|
124
|
-
).results
|
125
|
-
|
126
|
-
self._print_service_account_table(service_accounts[:max_items])
|
127
|
-
|
128
|
-
def delete_service_account(self, email: Optional[str], name: Optional[str]):
|
129
|
-
service_accounts = self.api_client.list_organization_collaborators_api_v2_organization_collaborators_get(
|
130
|
-
is_service_account=True, email=email, name=name
|
131
|
-
).results
|
132
|
-
identifier = self._get_service_account_identifier(email, name)
|
133
|
-
self._validate_exactly_one_service_account_per_email_or_name(
|
134
|
-
service_accounts, identifier
|
135
|
-
)
|
136
|
-
sa = service_accounts[0]
|
137
|
-
self.api_client.remove_organization_collaborator_api_v2_organization_collaborators_identity_id_delete(
|
138
|
-
identity_id=sa.id
|
139
|
-
)
|
140
|
-
self.console.print(f"Service account {identifier} deleted successfully.")
|
141
|
-
|
142
|
-
def rotate_service_account_api_keys(
|
143
|
-
self, email: Optional[str], name: Optional[str]
|
144
|
-
):
|
145
|
-
service_accounts = (
|
146
|
-
self.api_client.list_organization_collaborators_api_v2_organization_collaborators_get(
|
147
|
-
is_service_account=True, email=email, name=name
|
148
|
-
)
|
149
|
-
).results
|
150
|
-
|
151
|
-
identifier = self._get_service_account_identifier(email, name)
|
152
|
-
self._validate_exactly_one_service_account_per_email_or_name(
|
153
|
-
service_accounts, identifier
|
154
|
-
)
|
155
|
-
sa = service_accounts[0]
|
156
|
-
self.api_client.rotate_api_key_for_user_api_v2_organization_collaborators_rotate_api_key_for_user_user_id_post(
|
157
|
-
sa.user_id
|
158
|
-
)
|
159
|
-
api_key = self.api_client.create_api_key_api_v2_users_create_api_key_post(
|
160
|
-
api_key_parameters={
|
161
|
-
"user_id": sa.user_id,
|
162
|
-
"duration": ONE_HUNDRED_YEARS_IN_SECONDS,
|
163
|
-
}
|
164
|
-
).result
|
165
|
-
self.console.print(
|
166
|
-
f"\nAll API keys for service account {identifier} rotated successfully."
|
167
|
-
)
|
168
|
-
self._print_new_api_key(api_key)
|
@@ -1,100 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Anyscale API
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by: https://openapi-generator.tech
|
10
|
-
"""
|
11
|
-
|
12
|
-
|
13
|
-
import pprint
|
14
|
-
import re # noqa: F401
|
15
|
-
|
16
|
-
import six
|
17
|
-
|
18
|
-
from anyscale_client.configuration import Configuration
|
19
|
-
|
20
|
-
|
21
|
-
class LogLevelTypes(object):
|
22
|
-
"""NOTE: This class is auto generated by OpenAPI Generator.
|
23
|
-
Ref: https://openapi-generator.tech
|
24
|
-
|
25
|
-
Do not edit the class manually.
|
26
|
-
"""
|
27
|
-
|
28
|
-
"""
|
29
|
-
allowed enum values
|
30
|
-
"""
|
31
|
-
INFO = "info"
|
32
|
-
ERROR = "error"
|
33
|
-
|
34
|
-
allowable_values = [INFO, ERROR] # noqa: E501
|
35
|
-
|
36
|
-
"""
|
37
|
-
Attributes:
|
38
|
-
openapi_types (dict): The key is attribute name
|
39
|
-
and the value is attribute type.
|
40
|
-
attribute_map (dict): The key is attribute name
|
41
|
-
and the value is json key in definition.
|
42
|
-
"""
|
43
|
-
openapi_types = {
|
44
|
-
}
|
45
|
-
|
46
|
-
attribute_map = {
|
47
|
-
}
|
48
|
-
|
49
|
-
def __init__(self, local_vars_configuration=None): # noqa: E501
|
50
|
-
"""LogLevelTypes - a model defined in OpenAPI""" # noqa: E501
|
51
|
-
if local_vars_configuration is None:
|
52
|
-
local_vars_configuration = Configuration()
|
53
|
-
self.local_vars_configuration = local_vars_configuration
|
54
|
-
self.discriminator = None
|
55
|
-
|
56
|
-
def to_dict(self):
|
57
|
-
"""Returns the model properties as a dict"""
|
58
|
-
result = {}
|
59
|
-
|
60
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
61
|
-
value = getattr(self, attr)
|
62
|
-
if isinstance(value, list):
|
63
|
-
result[attr] = list(map(
|
64
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
65
|
-
value
|
66
|
-
))
|
67
|
-
elif hasattr(value, "to_dict"):
|
68
|
-
result[attr] = value.to_dict()
|
69
|
-
elif isinstance(value, dict):
|
70
|
-
result[attr] = dict(map(
|
71
|
-
lambda item: (item[0], item[1].to_dict())
|
72
|
-
if hasattr(item[1], "to_dict") else item,
|
73
|
-
value.items()
|
74
|
-
))
|
75
|
-
else:
|
76
|
-
result[attr] = value
|
77
|
-
|
78
|
-
return result
|
79
|
-
|
80
|
-
def to_str(self):
|
81
|
-
"""Returns the string representation of the model"""
|
82
|
-
return pprint.pformat(self.to_dict())
|
83
|
-
|
84
|
-
def __repr__(self):
|
85
|
-
"""For `print` and `pprint`"""
|
86
|
-
return self.to_str()
|
87
|
-
|
88
|
-
def __eq__(self, other):
|
89
|
-
"""Returns true if both objects are equal"""
|
90
|
-
if not isinstance(other, LogLevelTypes):
|
91
|
-
return False
|
92
|
-
|
93
|
-
return self.to_dict() == other.to_dict()
|
94
|
-
|
95
|
-
def __ne__(self, other):
|
96
|
-
"""Returns true if both objects are not equal"""
|
97
|
-
if not isinstance(other, LogLevelTypes):
|
98
|
-
return True
|
99
|
-
|
100
|
-
return self.to_dict() != other.to_dict()
|
@@ -1,267 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Anyscale API
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by: https://openapi-generator.tech
|
10
|
-
"""
|
11
|
-
|
12
|
-
|
13
|
-
import pprint
|
14
|
-
import re # noqa: F401
|
15
|
-
|
16
|
-
import six
|
17
|
-
|
18
|
-
from anyscale_client.configuration import Configuration
|
19
|
-
|
20
|
-
|
21
|
-
class SessionEvent(object):
|
22
|
-
"""NOTE: This class is auto generated by OpenAPI Generator.
|
23
|
-
Ref: https://openapi-generator.tech
|
24
|
-
|
25
|
-
Do not edit the class manually.
|
26
|
-
"""
|
27
|
-
|
28
|
-
"""
|
29
|
-
Attributes:
|
30
|
-
openapi_types (dict): The key is attribute name
|
31
|
-
and the value is attribute type.
|
32
|
-
attribute_map (dict): The key is attribute name
|
33
|
-
and the value is json key in definition.
|
34
|
-
"""
|
35
|
-
openapi_types = {
|
36
|
-
'event_type': 'str',
|
37
|
-
'log_level': 'LogLevelTypes',
|
38
|
-
'timestamp': 'datetime',
|
39
|
-
'description': 'str',
|
40
|
-
'cause': 'SessionEventCause',
|
41
|
-
'id': 'str'
|
42
|
-
}
|
43
|
-
|
44
|
-
attribute_map = {
|
45
|
-
'event_type': 'event_type',
|
46
|
-
'log_level': 'log_level',
|
47
|
-
'timestamp': 'timestamp',
|
48
|
-
'description': 'description',
|
49
|
-
'cause': 'cause',
|
50
|
-
'id': 'id'
|
51
|
-
}
|
52
|
-
|
53
|
-
def __init__(self, event_type=None, log_level=None, timestamp=None, description=None, cause=None, id=None, local_vars_configuration=None): # noqa: E501
|
54
|
-
"""SessionEvent - a model defined in OpenAPI""" # noqa: E501
|
55
|
-
if local_vars_configuration is None:
|
56
|
-
local_vars_configuration = Configuration()
|
57
|
-
self.local_vars_configuration = local_vars_configuration
|
58
|
-
|
59
|
-
self._event_type = None
|
60
|
-
self._log_level = None
|
61
|
-
self._timestamp = None
|
62
|
-
self._description = None
|
63
|
-
self._cause = None
|
64
|
-
self._id = None
|
65
|
-
self.discriminator = None
|
66
|
-
|
67
|
-
self.event_type = event_type
|
68
|
-
self.log_level = log_level
|
69
|
-
self.timestamp = timestamp
|
70
|
-
self.description = description
|
71
|
-
if cause is not None:
|
72
|
-
self.cause = cause
|
73
|
-
self.id = id
|
74
|
-
|
75
|
-
@property
|
76
|
-
def event_type(self):
|
77
|
-
"""Gets the event_type of this SessionEvent. # noqa: E501
|
78
|
-
|
79
|
-
The category of session event. # noqa: E501
|
80
|
-
|
81
|
-
:return: The event_type of this SessionEvent. # noqa: E501
|
82
|
-
:rtype: str
|
83
|
-
"""
|
84
|
-
return self._event_type
|
85
|
-
|
86
|
-
@event_type.setter
|
87
|
-
def event_type(self, event_type):
|
88
|
-
"""Sets the event_type of this SessionEvent.
|
89
|
-
|
90
|
-
The category of session event. # noqa: E501
|
91
|
-
|
92
|
-
:param event_type: The event_type of this SessionEvent. # noqa: E501
|
93
|
-
:type: str
|
94
|
-
"""
|
95
|
-
if self.local_vars_configuration.client_side_validation and event_type is None: # noqa: E501
|
96
|
-
raise ValueError("Invalid value for `event_type`, must not be `None`") # noqa: E501
|
97
|
-
|
98
|
-
self._event_type = event_type
|
99
|
-
|
100
|
-
@property
|
101
|
-
def log_level(self):
|
102
|
-
"""Gets the log_level of this SessionEvent. # noqa: E501
|
103
|
-
|
104
|
-
The severity of the session event. # noqa: E501
|
105
|
-
|
106
|
-
:return: The log_level of this SessionEvent. # noqa: E501
|
107
|
-
:rtype: LogLevelTypes
|
108
|
-
"""
|
109
|
-
return self._log_level
|
110
|
-
|
111
|
-
@log_level.setter
|
112
|
-
def log_level(self, log_level):
|
113
|
-
"""Sets the log_level of this SessionEvent.
|
114
|
-
|
115
|
-
The severity of the session event. # noqa: E501
|
116
|
-
|
117
|
-
:param log_level: The log_level of this SessionEvent. # noqa: E501
|
118
|
-
:type: LogLevelTypes
|
119
|
-
"""
|
120
|
-
if self.local_vars_configuration.client_side_validation and log_level is None: # noqa: E501
|
121
|
-
raise ValueError("Invalid value for `log_level`, must not be `None`") # noqa: E501
|
122
|
-
|
123
|
-
self._log_level = log_level
|
124
|
-
|
125
|
-
@property
|
126
|
-
def timestamp(self):
|
127
|
-
"""Gets the timestamp of this SessionEvent. # noqa: E501
|
128
|
-
|
129
|
-
The time at which the session event occurred. # noqa: E501
|
130
|
-
|
131
|
-
:return: The timestamp of this SessionEvent. # noqa: E501
|
132
|
-
:rtype: datetime
|
133
|
-
"""
|
134
|
-
return self._timestamp
|
135
|
-
|
136
|
-
@timestamp.setter
|
137
|
-
def timestamp(self, timestamp):
|
138
|
-
"""Sets the timestamp of this SessionEvent.
|
139
|
-
|
140
|
-
The time at which the session event occurred. # noqa: E501
|
141
|
-
|
142
|
-
:param timestamp: The timestamp of this SessionEvent. # noqa: E501
|
143
|
-
:type: datetime
|
144
|
-
"""
|
145
|
-
if self.local_vars_configuration.client_side_validation and timestamp is None: # noqa: E501
|
146
|
-
raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501
|
147
|
-
|
148
|
-
self._timestamp = timestamp
|
149
|
-
|
150
|
-
@property
|
151
|
-
def description(self):
|
152
|
-
"""Gets the description of this SessionEvent. # noqa: E501
|
153
|
-
|
154
|
-
A human readable description of the session event. # noqa: E501
|
155
|
-
|
156
|
-
:return: The description of this SessionEvent. # noqa: E501
|
157
|
-
:rtype: str
|
158
|
-
"""
|
159
|
-
return self._description
|
160
|
-
|
161
|
-
@description.setter
|
162
|
-
def description(self, description):
|
163
|
-
"""Sets the description of this SessionEvent.
|
164
|
-
|
165
|
-
A human readable description of the session event. # noqa: E501
|
166
|
-
|
167
|
-
:param description: The description of this SessionEvent. # noqa: E501
|
168
|
-
:type: str
|
169
|
-
"""
|
170
|
-
if self.local_vars_configuration.client_side_validation and description is None: # noqa: E501
|
171
|
-
raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501
|
172
|
-
|
173
|
-
self._description = description
|
174
|
-
|
175
|
-
@property
|
176
|
-
def cause(self):
|
177
|
-
"""Gets the cause of this SessionEvent. # noqa: E501
|
178
|
-
|
179
|
-
The reason why the session event occurred. None indicates an unknown cause. # noqa: E501
|
180
|
-
|
181
|
-
:return: The cause of this SessionEvent. # noqa: E501
|
182
|
-
:rtype: SessionEventCause
|
183
|
-
"""
|
184
|
-
return self._cause
|
185
|
-
|
186
|
-
@cause.setter
|
187
|
-
def cause(self, cause):
|
188
|
-
"""Sets the cause of this SessionEvent.
|
189
|
-
|
190
|
-
The reason why the session event occurred. None indicates an unknown cause. # noqa: E501
|
191
|
-
|
192
|
-
:param cause: The cause of this SessionEvent. # noqa: E501
|
193
|
-
:type: SessionEventCause
|
194
|
-
"""
|
195
|
-
|
196
|
-
self._cause = cause
|
197
|
-
|
198
|
-
@property
|
199
|
-
def id(self):
|
200
|
-
"""Gets the id of this SessionEvent. # noqa: E501
|
201
|
-
|
202
|
-
A unique identifier for the session event. # noqa: E501
|
203
|
-
|
204
|
-
:return: The id of this SessionEvent. # noqa: E501
|
205
|
-
:rtype: str
|
206
|
-
"""
|
207
|
-
return self._id
|
208
|
-
|
209
|
-
@id.setter
|
210
|
-
def id(self, id):
|
211
|
-
"""Sets the id of this SessionEvent.
|
212
|
-
|
213
|
-
A unique identifier for the session event. # noqa: E501
|
214
|
-
|
215
|
-
:param id: The id of this SessionEvent. # noqa: E501
|
216
|
-
:type: str
|
217
|
-
"""
|
218
|
-
if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
|
219
|
-
raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
|
220
|
-
|
221
|
-
self._id = id
|
222
|
-
|
223
|
-
def to_dict(self):
|
224
|
-
"""Returns the model properties as a dict"""
|
225
|
-
result = {}
|
226
|
-
|
227
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
228
|
-
value = getattr(self, attr)
|
229
|
-
if isinstance(value, list):
|
230
|
-
result[attr] = list(map(
|
231
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
232
|
-
value
|
233
|
-
))
|
234
|
-
elif hasattr(value, "to_dict"):
|
235
|
-
result[attr] = value.to_dict()
|
236
|
-
elif isinstance(value, dict):
|
237
|
-
result[attr] = dict(map(
|
238
|
-
lambda item: (item[0], item[1].to_dict())
|
239
|
-
if hasattr(item[1], "to_dict") else item,
|
240
|
-
value.items()
|
241
|
-
))
|
242
|
-
else:
|
243
|
-
result[attr] = value
|
244
|
-
|
245
|
-
return result
|
246
|
-
|
247
|
-
def to_str(self):
|
248
|
-
"""Returns the string representation of the model"""
|
249
|
-
return pprint.pformat(self.to_dict())
|
250
|
-
|
251
|
-
def __repr__(self):
|
252
|
-
"""For `print` and `pprint`"""
|
253
|
-
return self.to_str()
|
254
|
-
|
255
|
-
def __eq__(self, other):
|
256
|
-
"""Returns true if both objects are equal"""
|
257
|
-
if not isinstance(other, SessionEvent):
|
258
|
-
return False
|
259
|
-
|
260
|
-
return self.to_dict() == other.to_dict()
|
261
|
-
|
262
|
-
def __ne__(self, other):
|
263
|
-
"""Returns true if both objects are not equal"""
|
264
|
-
if not isinstance(other, SessionEvent):
|
265
|
-
return True
|
266
|
-
|
267
|
-
return self.to_dict() != other.to_dict()
|
@@ -1,150 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Anyscale API
|
5
|
-
|
6
|
-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
|
7
|
-
|
8
|
-
The version of the OpenAPI document: 0.1.0
|
9
|
-
Generated by: https://openapi-generator.tech
|
10
|
-
"""
|
11
|
-
|
12
|
-
|
13
|
-
import pprint
|
14
|
-
import re # noqa: F401
|
15
|
-
|
16
|
-
import six
|
17
|
-
|
18
|
-
from anyscale_client.configuration import Configuration
|
19
|
-
|
20
|
-
|
21
|
-
class SessionEventCause(object):
|
22
|
-
"""NOTE: This class is auto generated by OpenAPI Generator.
|
23
|
-
Ref: https://openapi-generator.tech
|
24
|
-
|
25
|
-
Do not edit the class manually.
|
26
|
-
"""
|
27
|
-
|
28
|
-
"""
|
29
|
-
Attributes:
|
30
|
-
openapi_types (dict): The key is attribute name
|
31
|
-
and the value is attribute type.
|
32
|
-
attribute_map (dict): The key is attribute name
|
33
|
-
and the value is json key in definition.
|
34
|
-
"""
|
35
|
-
openapi_types = {
|
36
|
-
'cause_user': 'str',
|
37
|
-
'cause_system': 'str'
|
38
|
-
}
|
39
|
-
|
40
|
-
attribute_map = {
|
41
|
-
'cause_user': 'cause_user',
|
42
|
-
'cause_system': 'cause_system'
|
43
|
-
}
|
44
|
-
|
45
|
-
def __init__(self, cause_user=None, cause_system=None, local_vars_configuration=None): # noqa: E501
|
46
|
-
"""SessionEventCause - a model defined in OpenAPI""" # noqa: E501
|
47
|
-
if local_vars_configuration is None:
|
48
|
-
local_vars_configuration = Configuration()
|
49
|
-
self.local_vars_configuration = local_vars_configuration
|
50
|
-
|
51
|
-
self._cause_user = None
|
52
|
-
self._cause_system = None
|
53
|
-
self.discriminator = None
|
54
|
-
|
55
|
-
if cause_user is not None:
|
56
|
-
self.cause_user = cause_user
|
57
|
-
if cause_system is not None:
|
58
|
-
self.cause_system = cause_system
|
59
|
-
|
60
|
-
@property
|
61
|
-
def cause_user(self):
|
62
|
-
"""Gets the cause_user of this SessionEventCause. # noqa: E501
|
63
|
-
|
64
|
-
The username of the user who caused the session event. # noqa: E501
|
65
|
-
|
66
|
-
:return: The cause_user of this SessionEventCause. # noqa: E501
|
67
|
-
:rtype: str
|
68
|
-
"""
|
69
|
-
return self._cause_user
|
70
|
-
|
71
|
-
@cause_user.setter
|
72
|
-
def cause_user(self, cause_user):
|
73
|
-
"""Sets the cause_user of this SessionEventCause.
|
74
|
-
|
75
|
-
The username of the user who caused the session event. # noqa: E501
|
76
|
-
|
77
|
-
:param cause_user: The cause_user of this SessionEventCause. # noqa: E501
|
78
|
-
:type: str
|
79
|
-
"""
|
80
|
-
|
81
|
-
self._cause_user = cause_user
|
82
|
-
|
83
|
-
@property
|
84
|
-
def cause_system(self):
|
85
|
-
"""Gets the cause_system of this SessionEventCause. # noqa: E501
|
86
|
-
|
87
|
-
The name of the internal anyscale system that caused the session event. # noqa: E501
|
88
|
-
|
89
|
-
:return: The cause_system of this SessionEventCause. # noqa: E501
|
90
|
-
:rtype: str
|
91
|
-
"""
|
92
|
-
return self._cause_system
|
93
|
-
|
94
|
-
@cause_system.setter
|
95
|
-
def cause_system(self, cause_system):
|
96
|
-
"""Sets the cause_system of this SessionEventCause.
|
97
|
-
|
98
|
-
The name of the internal anyscale system that caused the session event. # noqa: E501
|
99
|
-
|
100
|
-
:param cause_system: The cause_system of this SessionEventCause. # noqa: E501
|
101
|
-
:type: str
|
102
|
-
"""
|
103
|
-
|
104
|
-
self._cause_system = cause_system
|
105
|
-
|
106
|
-
def to_dict(self):
|
107
|
-
"""Returns the model properties as a dict"""
|
108
|
-
result = {}
|
109
|
-
|
110
|
-
for attr, _ in six.iteritems(self.openapi_types):
|
111
|
-
value = getattr(self, attr)
|
112
|
-
if isinstance(value, list):
|
113
|
-
result[attr] = list(map(
|
114
|
-
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
115
|
-
value
|
116
|
-
))
|
117
|
-
elif hasattr(value, "to_dict"):
|
118
|
-
result[attr] = value.to_dict()
|
119
|
-
elif isinstance(value, dict):
|
120
|
-
result[attr] = dict(map(
|
121
|
-
lambda item: (item[0], item[1].to_dict())
|
122
|
-
if hasattr(item[1], "to_dict") else item,
|
123
|
-
value.items()
|
124
|
-
))
|
125
|
-
else:
|
126
|
-
result[attr] = value
|
127
|
-
|
128
|
-
return result
|
129
|
-
|
130
|
-
def to_str(self):
|
131
|
-
"""Returns the string representation of the model"""
|
132
|
-
return pprint.pformat(self.to_dict())
|
133
|
-
|
134
|
-
def __repr__(self):
|
135
|
-
"""For `print` and `pprint`"""
|
136
|
-
return self.to_str()
|
137
|
-
|
138
|
-
def __eq__(self, other):
|
139
|
-
"""Returns true if both objects are equal"""
|
140
|
-
if not isinstance(other, SessionEventCause):
|
141
|
-
return False
|
142
|
-
|
143
|
-
return self.to_dict() == other.to_dict()
|
144
|
-
|
145
|
-
def __ne__(self, other):
|
146
|
-
"""Returns true if both objects are not equal"""
|
147
|
-
if not isinstance(other, SessionEventCause):
|
148
|
-
return True
|
149
|
-
|
150
|
-
return self.to_dict() != other.to_dict()
|