anyscale 0.26.4__py3-none-any.whl → 0.26.6__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 (53) hide show
  1. anyscale/_private/anyscale_client/anyscale_client.py +1 -5
  2. anyscale/_private/docgen/__main__.py +0 -3
  3. anyscale/_private/docgen/api.md +0 -40
  4. anyscale/_private/docgen/models.md +0 -49
  5. anyscale/anyscale-cloud-setup-gcp-oa.yaml +2 -1
  6. anyscale/anyscale-cloud-setup-gcp.yaml +4 -2
  7. anyscale/client/README.md +9 -27
  8. anyscale/client/openapi_client/__init__.py +7 -13
  9. anyscale/client/openapi_client/api/default_api.py +476 -1946
  10. anyscale/client/openapi_client/models/__init__.py +7 -13
  11. anyscale/client/openapi_client/models/{clusterconfigwithsessionidletimeout_response.py → backend_server_api_product_models_dataset_runs_dataset_response.py} +22 -22
  12. anyscale/client/openapi_client/models/{dataset_response.py → backend_server_api_product_routers_datasets_router_dataset_response.py} +8 -8
  13. anyscale/client/openapi_client/models/create_session_from_snapshot_options.py +3 -30
  14. anyscale/client/openapi_client/models/{clusterconfig_response.py → dataset_jobs.py} +22 -22
  15. anyscale/client/openapi_client/models/dataset_metrics.py +390 -0
  16. anyscale/{sdk/anyscale_client/models/session_command_types.py → client/openapi_client/models/dataset_state.py} +11 -9
  17. anyscale/client/openapi_client/models/{organization_availability.py → metric.py} +64 -39
  18. anyscale/client/openapi_client/models/operator_metrics.py +256 -0
  19. anyscale/client/openapi_client/models/train_run.py +28 -1
  20. anyscale/cluster.py +5 -2
  21. anyscale/commands/anyscale_api/api_commands.py +0 -2
  22. anyscale/commands/workspace_commands.py +3 -3
  23. anyscale/connect_utils/start_interactive_session.py +4 -1
  24. anyscale/controllers/cluster_controller.py +15 -26
  25. anyscale/controllers/project_controller.py +1 -6
  26. anyscale/job/_private/job_sdk.py +6 -1
  27. anyscale/job/models.py +8 -0
  28. anyscale/project_utils.py +9 -20
  29. anyscale/sdk/anyscale_client/__init__.py +0 -5
  30. anyscale/sdk/anyscale_client/api/default_api.py +0 -474
  31. anyscale/sdk/anyscale_client/models/__init__.py +0 -5
  32. anyscale/version.py +1 -1
  33. {anyscale-0.26.4.dist-info → anyscale-0.26.6.dist-info}/METADATA +1 -1
  34. {anyscale-0.26.4.dist-info → anyscale-0.26.6.dist-info}/RECORD +39 -51
  35. anyscale/client/openapi_client/models/anyscale_version_response.py +0 -121
  36. anyscale/client/openapi_client/models/anyscaleversionresponse_response.py +0 -121
  37. anyscale/client/openapi_client/models/cluster_config.py +0 -178
  38. anyscale/client/openapi_client/models/cluster_config_with_session_idle_timeout.py +0 -204
  39. anyscale/client/openapi_client/models/cluster_startup.py +0 -208
  40. anyscale/client/openapi_client/models/decoratedjob_list_response.py +0 -147
  41. anyscale/client/openapi_client/models/execute_shell_command_options.py +0 -121
  42. anyscale/client/openapi_client/models/organizationavailability_response.py +0 -121
  43. anyscale/client/openapi_client/models/setup_initialize_session_options.py +0 -225
  44. anyscale/commands/anyscale_api/session_commands_commands.py +0 -80
  45. anyscale/sdk/anyscale_client/models/create_session_command.py +0 -152
  46. anyscale/sdk/anyscale_client/models/session_command.py +0 -350
  47. anyscale/sdk/anyscale_client/models/sessioncommand_list_response.py +0 -147
  48. anyscale/sdk/anyscale_client/models/sessioncommand_response.py +0 -121
  49. {anyscale-0.26.4.dist-info → anyscale-0.26.6.dist-info}/LICENSE +0 -0
  50. {anyscale-0.26.4.dist-info → anyscale-0.26.6.dist-info}/NOTICE +0 -0
  51. {anyscale-0.26.4.dist-info → anyscale-0.26.6.dist-info}/WHEEL +0 -0
  52. {anyscale-0.26.4.dist-info → anyscale-0.26.6.dist-info}/entry_points.txt +0 -0
  53. {anyscale-0.26.4.dist-info → anyscale-0.26.6.dist-info}/top_level.txt +0 -0
@@ -1,147 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Managed Ray 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 openapi_client.configuration import Configuration
19
-
20
-
21
- class DecoratedjobListResponse(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
- 'results': 'list[DecoratedJob]',
37
- 'metadata': 'ListResponseMetadata'
38
- }
39
-
40
- attribute_map = {
41
- 'results': 'results',
42
- 'metadata': 'metadata'
43
- }
44
-
45
- def __init__(self, results=None, metadata=None, local_vars_configuration=None): # noqa: E501
46
- """DecoratedjobListResponse - 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._results = None
52
- self._metadata = None
53
- self.discriminator = None
54
-
55
- self.results = results
56
- if metadata is not None:
57
- self.metadata = metadata
58
-
59
- @property
60
- def results(self):
61
- """Gets the results of this DecoratedjobListResponse. # noqa: E501
62
-
63
-
64
- :return: The results of this DecoratedjobListResponse. # noqa: E501
65
- :rtype: list[DecoratedJob]
66
- """
67
- return self._results
68
-
69
- @results.setter
70
- def results(self, results):
71
- """Sets the results of this DecoratedjobListResponse.
72
-
73
-
74
- :param results: The results of this DecoratedjobListResponse. # noqa: E501
75
- :type: list[DecoratedJob]
76
- """
77
- if self.local_vars_configuration.client_side_validation and results is None: # noqa: E501
78
- raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501
79
-
80
- self._results = results
81
-
82
- @property
83
- def metadata(self):
84
- """Gets the metadata of this DecoratedjobListResponse. # noqa: E501
85
-
86
-
87
- :return: The metadata of this DecoratedjobListResponse. # noqa: E501
88
- :rtype: ListResponseMetadata
89
- """
90
- return self._metadata
91
-
92
- @metadata.setter
93
- def metadata(self, metadata):
94
- """Sets the metadata of this DecoratedjobListResponse.
95
-
96
-
97
- :param metadata: The metadata of this DecoratedjobListResponse. # noqa: E501
98
- :type: ListResponseMetadata
99
- """
100
-
101
- self._metadata = metadata
102
-
103
- def to_dict(self):
104
- """Returns the model properties as a dict"""
105
- result = {}
106
-
107
- for attr, _ in six.iteritems(self.openapi_types):
108
- value = getattr(self, attr)
109
- if isinstance(value, list):
110
- result[attr] = list(map(
111
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
112
- value
113
- ))
114
- elif hasattr(value, "to_dict"):
115
- result[attr] = value.to_dict()
116
- elif isinstance(value, dict):
117
- result[attr] = dict(map(
118
- lambda item: (item[0], item[1].to_dict())
119
- if hasattr(item[1], "to_dict") else item,
120
- value.items()
121
- ))
122
- else:
123
- result[attr] = value
124
-
125
- return result
126
-
127
- def to_str(self):
128
- """Returns the string representation of the model"""
129
- return pprint.pformat(self.to_dict())
130
-
131
- def __repr__(self):
132
- """For `print` and `pprint`"""
133
- return self.to_str()
134
-
135
- def __eq__(self, other):
136
- """Returns true if both objects are equal"""
137
- if not isinstance(other, DecoratedjobListResponse):
138
- return False
139
-
140
- return self.to_dict() == other.to_dict()
141
-
142
- def __ne__(self, other):
143
- """Returns true if both objects are not equal"""
144
- if not isinstance(other, DecoratedjobListResponse):
145
- return True
146
-
147
- return self.to_dict() != other.to_dict()
@@ -1,121 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Managed Ray 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 openapi_client.configuration import Configuration
19
-
20
-
21
- class ExecuteShellCommandOptions(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
- 'shell_command': 'str'
37
- }
38
-
39
- attribute_map = {
40
- 'shell_command': 'shell_command'
41
- }
42
-
43
- def __init__(self, shell_command=None, local_vars_configuration=None): # noqa: E501
44
- """ExecuteShellCommandOptions - a model defined in OpenAPI""" # noqa: E501
45
- if local_vars_configuration is None:
46
- local_vars_configuration = Configuration()
47
- self.local_vars_configuration = local_vars_configuration
48
-
49
- self._shell_command = None
50
- self.discriminator = None
51
-
52
- self.shell_command = shell_command
53
-
54
- @property
55
- def shell_command(self):
56
- """Gets the shell_command of this ExecuteShellCommandOptions. # noqa: E501
57
-
58
-
59
- :return: The shell_command of this ExecuteShellCommandOptions. # noqa: E501
60
- :rtype: str
61
- """
62
- return self._shell_command
63
-
64
- @shell_command.setter
65
- def shell_command(self, shell_command):
66
- """Sets the shell_command of this ExecuteShellCommandOptions.
67
-
68
-
69
- :param shell_command: The shell_command of this ExecuteShellCommandOptions. # noqa: E501
70
- :type: str
71
- """
72
- if self.local_vars_configuration.client_side_validation and shell_command is None: # noqa: E501
73
- raise ValueError("Invalid value for `shell_command`, must not be `None`") # noqa: E501
74
-
75
- self._shell_command = shell_command
76
-
77
- def to_dict(self):
78
- """Returns the model properties as a dict"""
79
- result = {}
80
-
81
- for attr, _ in six.iteritems(self.openapi_types):
82
- value = getattr(self, attr)
83
- if isinstance(value, list):
84
- result[attr] = list(map(
85
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
86
- value
87
- ))
88
- elif hasattr(value, "to_dict"):
89
- result[attr] = value.to_dict()
90
- elif isinstance(value, dict):
91
- result[attr] = dict(map(
92
- lambda item: (item[0], item[1].to_dict())
93
- if hasattr(item[1], "to_dict") else item,
94
- value.items()
95
- ))
96
- else:
97
- result[attr] = value
98
-
99
- return result
100
-
101
- def to_str(self):
102
- """Returns the string representation of the model"""
103
- return pprint.pformat(self.to_dict())
104
-
105
- def __repr__(self):
106
- """For `print` and `pprint`"""
107
- return self.to_str()
108
-
109
- def __eq__(self, other):
110
- """Returns true if both objects are equal"""
111
- if not isinstance(other, ExecuteShellCommandOptions):
112
- return False
113
-
114
- return self.to_dict() == other.to_dict()
115
-
116
- def __ne__(self, other):
117
- """Returns true if both objects are not equal"""
118
- if not isinstance(other, ExecuteShellCommandOptions):
119
- return True
120
-
121
- return self.to_dict() != other.to_dict()
@@ -1,121 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Managed Ray 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 openapi_client.configuration import Configuration
19
-
20
-
21
- class OrganizationavailabilityResponse(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
- 'result': 'OrganizationAvailability'
37
- }
38
-
39
- attribute_map = {
40
- 'result': 'result'
41
- }
42
-
43
- def __init__(self, result=None, local_vars_configuration=None): # noqa: E501
44
- """OrganizationavailabilityResponse - a model defined in OpenAPI""" # noqa: E501
45
- if local_vars_configuration is None:
46
- local_vars_configuration = Configuration()
47
- self.local_vars_configuration = local_vars_configuration
48
-
49
- self._result = None
50
- self.discriminator = None
51
-
52
- self.result = result
53
-
54
- @property
55
- def result(self):
56
- """Gets the result of this OrganizationavailabilityResponse. # noqa: E501
57
-
58
-
59
- :return: The result of this OrganizationavailabilityResponse. # noqa: E501
60
- :rtype: OrganizationAvailability
61
- """
62
- return self._result
63
-
64
- @result.setter
65
- def result(self, result):
66
- """Sets the result of this OrganizationavailabilityResponse.
67
-
68
-
69
- :param result: The result of this OrganizationavailabilityResponse. # noqa: E501
70
- :type: OrganizationAvailability
71
- """
72
- if self.local_vars_configuration.client_side_validation and result is None: # noqa: E501
73
- raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501
74
-
75
- self._result = result
76
-
77
- def to_dict(self):
78
- """Returns the model properties as a dict"""
79
- result = {}
80
-
81
- for attr, _ in six.iteritems(self.openapi_types):
82
- value = getattr(self, attr)
83
- if isinstance(value, list):
84
- result[attr] = list(map(
85
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
86
- value
87
- ))
88
- elif hasattr(value, "to_dict"):
89
- result[attr] = value.to_dict()
90
- elif isinstance(value, dict):
91
- result[attr] = dict(map(
92
- lambda item: (item[0], item[1].to_dict())
93
- if hasattr(item[1], "to_dict") else item,
94
- value.items()
95
- ))
96
- else:
97
- result[attr] = value
98
-
99
- return result
100
-
101
- def to_str(self):
102
- """Returns the string representation of the model"""
103
- return pprint.pformat(self.to_dict())
104
-
105
- def __repr__(self):
106
- """For `print` and `pprint`"""
107
- return self.to_str()
108
-
109
- def __eq__(self, other):
110
- """Returns true if both objects are equal"""
111
- if not isinstance(other, OrganizationavailabilityResponse):
112
- return False
113
-
114
- return self.to_dict() == other.to_dict()
115
-
116
- def __ne__(self, other):
117
- """Returns true if both objects are not equal"""
118
- if not isinstance(other, OrganizationavailabilityResponse):
119
- return True
120
-
121
- return self.to_dict() != other.to_dict()
@@ -1,225 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Managed Ray 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 openapi_client.configuration import Configuration
19
-
20
-
21
- class SetupInitializeSessionOptions(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
- 'project_id': 'str',
37
- 'cluster_config': 'WriteClusterConfig',
38
- 'no_restart': 'bool',
39
- 'restart_only': 'bool',
40
- 'no_update': 'bool'
41
- }
42
-
43
- attribute_map = {
44
- 'project_id': 'project_id',
45
- 'cluster_config': 'cluster_config',
46
- 'no_restart': 'no_restart',
47
- 'restart_only': 'restart_only',
48
- 'no_update': 'no_update'
49
- }
50
-
51
- def __init__(self, project_id=None, cluster_config=None, no_restart=False, restart_only=False, no_update=False, local_vars_configuration=None): # noqa: E501
52
- """SetupInitializeSessionOptions - a model defined in OpenAPI""" # noqa: E501
53
- if local_vars_configuration is None:
54
- local_vars_configuration = Configuration()
55
- self.local_vars_configuration = local_vars_configuration
56
-
57
- self._project_id = None
58
- self._cluster_config = None
59
- self._no_restart = None
60
- self._restart_only = None
61
- self._no_update = None
62
- self.discriminator = None
63
-
64
- self.project_id = project_id
65
- if cluster_config is not None:
66
- self.cluster_config = cluster_config
67
- if no_restart is not None:
68
- self.no_restart = no_restart
69
- if restart_only is not None:
70
- self.restart_only = restart_only
71
- if no_update is not None:
72
- self.no_update = no_update
73
-
74
- @property
75
- def project_id(self):
76
- """Gets the project_id of this SetupInitializeSessionOptions. # noqa: E501
77
-
78
-
79
- :return: The project_id of this SetupInitializeSessionOptions. # noqa: E501
80
- :rtype: str
81
- """
82
- return self._project_id
83
-
84
- @project_id.setter
85
- def project_id(self, project_id):
86
- """Sets the project_id of this SetupInitializeSessionOptions.
87
-
88
-
89
- :param project_id: The project_id of this SetupInitializeSessionOptions. # noqa: E501
90
- :type: str
91
- """
92
- if self.local_vars_configuration.client_side_validation and project_id is None: # noqa: E501
93
- raise ValueError("Invalid value for `project_id`, must not be `None`") # noqa: E501
94
-
95
- self._project_id = project_id
96
-
97
- @property
98
- def cluster_config(self):
99
- """Gets the cluster_config of this SetupInitializeSessionOptions. # noqa: E501
100
-
101
-
102
- :return: The cluster_config of this SetupInitializeSessionOptions. # noqa: E501
103
- :rtype: WriteClusterConfig
104
- """
105
- return self._cluster_config
106
-
107
- @cluster_config.setter
108
- def cluster_config(self, cluster_config):
109
- """Sets the cluster_config of this SetupInitializeSessionOptions.
110
-
111
-
112
- :param cluster_config: The cluster_config of this SetupInitializeSessionOptions. # noqa: E501
113
- :type: WriteClusterConfig
114
- """
115
-
116
- self._cluster_config = cluster_config
117
-
118
- @property
119
- def no_restart(self):
120
- """Gets the no_restart of this SetupInitializeSessionOptions. # noqa: E501
121
-
122
-
123
- :return: The no_restart of this SetupInitializeSessionOptions. # noqa: E501
124
- :rtype: bool
125
- """
126
- return self._no_restart
127
-
128
- @no_restart.setter
129
- def no_restart(self, no_restart):
130
- """Sets the no_restart of this SetupInitializeSessionOptions.
131
-
132
-
133
- :param no_restart: The no_restart of this SetupInitializeSessionOptions. # noqa: E501
134
- :type: bool
135
- """
136
-
137
- self._no_restart = no_restart
138
-
139
- @property
140
- def restart_only(self):
141
- """Gets the restart_only of this SetupInitializeSessionOptions. # noqa: E501
142
-
143
-
144
- :return: The restart_only of this SetupInitializeSessionOptions. # noqa: E501
145
- :rtype: bool
146
- """
147
- return self._restart_only
148
-
149
- @restart_only.setter
150
- def restart_only(self, restart_only):
151
- """Sets the restart_only of this SetupInitializeSessionOptions.
152
-
153
-
154
- :param restart_only: The restart_only of this SetupInitializeSessionOptions. # noqa: E501
155
- :type: bool
156
- """
157
-
158
- self._restart_only = restart_only
159
-
160
- @property
161
- def no_update(self):
162
- """Gets the no_update of this SetupInitializeSessionOptions. # noqa: E501
163
-
164
-
165
- :return: The no_update of this SetupInitializeSessionOptions. # noqa: E501
166
- :rtype: bool
167
- """
168
- return self._no_update
169
-
170
- @no_update.setter
171
- def no_update(self, no_update):
172
- """Sets the no_update of this SetupInitializeSessionOptions.
173
-
174
-
175
- :param no_update: The no_update of this SetupInitializeSessionOptions. # noqa: E501
176
- :type: bool
177
- """
178
-
179
- self._no_update = no_update
180
-
181
- def to_dict(self):
182
- """Returns the model properties as a dict"""
183
- result = {}
184
-
185
- for attr, _ in six.iteritems(self.openapi_types):
186
- value = getattr(self, attr)
187
- if isinstance(value, list):
188
- result[attr] = list(map(
189
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
190
- value
191
- ))
192
- elif hasattr(value, "to_dict"):
193
- result[attr] = value.to_dict()
194
- elif isinstance(value, dict):
195
- result[attr] = dict(map(
196
- lambda item: (item[0], item[1].to_dict())
197
- if hasattr(item[1], "to_dict") else item,
198
- value.items()
199
- ))
200
- else:
201
- result[attr] = value
202
-
203
- return result
204
-
205
- def to_str(self):
206
- """Returns the string representation of the model"""
207
- return pprint.pformat(self.to_dict())
208
-
209
- def __repr__(self):
210
- """For `print` and `pprint`"""
211
- return self.to_str()
212
-
213
- def __eq__(self, other):
214
- """Returns true if both objects are equal"""
215
- if not isinstance(other, SetupInitializeSessionOptions):
216
- return False
217
-
218
- return self.to_dict() == other.to_dict()
219
-
220
- def __ne__(self, other):
221
- """Returns true if both objects are not equal"""
222
- if not isinstance(other, SetupInitializeSessionOptions):
223
- return True
224
-
225
- return self.to_dict() != other.to_dict()
@@ -1,80 +0,0 @@
1
- """
2
- Commands to interact with the Anyscale Session Commands API
3
- """
4
-
5
- from typing import Optional
6
-
7
- import click
8
-
9
- from anyscale.authenticate import get_auth_api_client
10
- from anyscale.formatters import common_formatter
11
- from anyscale.sdk.anyscale_client import CreateSessionCommand
12
-
13
-
14
- @click.group(
15
- "commands", help="Commands to interact with the Session Commands API.",
16
- )
17
- def session_commands() -> None:
18
- pass
19
-
20
-
21
- @session_commands.command(name="list", short_help="Lists Session Commands.")
22
- @click.argument("session-id", required=True)
23
- @click.option(
24
- "--count", type=int, default=10, help="Number of commands to show. Defaults to 10"
25
- )
26
- @click.option(
27
- "--paging-token",
28
- required=False,
29
- help="Paging token used to fetch subsequent pages of commands.",
30
- )
31
- def list_session_commands(
32
- session_id: str, count: int, paging_token: Optional[str],
33
- ) -> None:
34
- """Lists commands that have been executed on Session with SESSION_ID"""
35
-
36
- api_client = get_auth_api_client().anyscale_api_client
37
- response = api_client.list_session_commands(
38
- session_id, count=count, paging_token=paging_token
39
- )
40
-
41
- print(common_formatter.prettify_json(response.to_dict()))
42
-
43
-
44
- @session_commands.command(name="get", short_help="Get details about a Session Command.")
45
- @click.argument("session-command-id", required=True)
46
- def get_session_command(session_command_id: str) -> None:
47
- """Get details about the Session Command with id SESSION_COMMAND_ID"""
48
-
49
- api_client = get_auth_api_client().anyscale_api_client
50
- response = api_client.get_session_command(session_command_id)
51
-
52
- print(common_formatter.prettify_json(response.to_dict()))
53
-
54
-
55
- @session_commands.command(name="kill", short_help="Kills a Session Command.")
56
- @click.argument("session-command-id", required=True)
57
- def kill_session_command(session_command_id: str) -> None:
58
- """Kills the Session Command with id SESSION_COMMAND_ID"""
59
-
60
- api_client = get_auth_api_client().anyscale_api_client
61
- response = api_client.kill_session_command(session_command_id)
62
-
63
- print(common_formatter.prettify_json(response.to_dict()))
64
-
65
-
66
- @session_commands.command(
67
- name="create", short_help="Creates and executes a Session Command."
68
- )
69
- @click.argument("session-id", required=True)
70
- @click.argument("shell-command", required=True)
71
- def create_session_command(session_id: str, shell_command: str) -> None:
72
- """Creates and executes SHELL_COMMAND on the session with id SESSION_ID."""
73
-
74
- api_client = get_auth_api_client().anyscale_api_client
75
- create_data = CreateSessionCommand(
76
- session_id=session_id, shell_command=shell_command
77
- )
78
- response = api_client.create_session_command(create_data)
79
-
80
- print(common_formatter.prettify_json(response.to_dict()))