nextmv 0.39.0.dev1__py3-none-any.whl → 1.0.0__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.
- nextmv/__about__.py +1 -1
- nextmv/__entrypoint__.py +1 -2
- nextmv/__init__.py +2 -4
- nextmv/cli/CONTRIBUTING.md +583 -0
- nextmv/cli/cloud/__init__.py +49 -0
- nextmv/cli/cloud/acceptance/__init__.py +27 -0
- nextmv/cli/cloud/acceptance/create.py +391 -0
- nextmv/cli/cloud/acceptance/delete.py +64 -0
- nextmv/cli/cloud/acceptance/get.py +103 -0
- nextmv/cli/cloud/acceptance/list.py +62 -0
- nextmv/cli/cloud/acceptance/update.py +95 -0
- nextmv/cli/cloud/account/__init__.py +28 -0
- nextmv/cli/cloud/account/create.py +83 -0
- nextmv/cli/cloud/account/delete.py +59 -0
- nextmv/cli/cloud/account/get.py +66 -0
- nextmv/cli/cloud/account/update.py +70 -0
- nextmv/cli/cloud/app/__init__.py +35 -0
- nextmv/cli/cloud/app/create.py +140 -0
- nextmv/cli/cloud/app/delete.py +57 -0
- nextmv/cli/cloud/app/exists.py +44 -0
- nextmv/cli/cloud/app/get.py +66 -0
- nextmv/cli/cloud/app/list.py +61 -0
- nextmv/cli/cloud/app/push.py +432 -0
- nextmv/cli/cloud/app/update.py +124 -0
- nextmv/cli/cloud/batch/__init__.py +29 -0
- nextmv/cli/cloud/batch/create.py +452 -0
- nextmv/cli/cloud/batch/delete.py +64 -0
- nextmv/cli/cloud/batch/get.py +104 -0
- nextmv/cli/cloud/batch/list.py +63 -0
- nextmv/cli/cloud/batch/metadata.py +66 -0
- nextmv/cli/cloud/batch/update.py +95 -0
- nextmv/cli/cloud/data/__init__.py +26 -0
- nextmv/cli/cloud/data/upload.py +162 -0
- nextmv/cli/cloud/ensemble/__init__.py +33 -0
- nextmv/cli/cloud/ensemble/create.py +413 -0
- nextmv/cli/cloud/ensemble/delete.py +63 -0
- nextmv/cli/cloud/ensemble/get.py +65 -0
- nextmv/cli/cloud/ensemble/list.py +63 -0
- nextmv/cli/cloud/ensemble/update.py +103 -0
- nextmv/cli/cloud/input_set/__init__.py +32 -0
- nextmv/cli/cloud/input_set/create.py +168 -0
- nextmv/cli/cloud/input_set/delete.py +64 -0
- nextmv/cli/cloud/input_set/get.py +63 -0
- nextmv/cli/cloud/input_set/list.py +63 -0
- nextmv/cli/cloud/input_set/update.py +123 -0
- nextmv/cli/cloud/instance/__init__.py +35 -0
- nextmv/cli/cloud/instance/create.py +289 -0
- nextmv/cli/cloud/instance/delete.py +61 -0
- nextmv/cli/cloud/instance/exists.py +39 -0
- nextmv/cli/cloud/instance/get.py +62 -0
- nextmv/cli/cloud/instance/list.py +60 -0
- nextmv/cli/cloud/instance/update.py +216 -0
- nextmv/cli/cloud/managed_input/__init__.py +31 -0
- nextmv/cli/cloud/managed_input/create.py +144 -0
- nextmv/cli/cloud/managed_input/delete.py +64 -0
- nextmv/cli/cloud/managed_input/get.py +63 -0
- nextmv/cli/cloud/managed_input/list.py +60 -0
- nextmv/cli/cloud/managed_input/update.py +97 -0
- nextmv/cli/cloud/run/__init__.py +37 -0
- nextmv/cli/cloud/run/cancel.py +37 -0
- nextmv/cli/cloud/run/create.py +524 -0
- nextmv/cli/cloud/run/get.py +199 -0
- nextmv/cli/cloud/run/input.py +86 -0
- nextmv/cli/cloud/run/list.py +80 -0
- nextmv/cli/cloud/run/logs.py +166 -0
- nextmv/cli/cloud/run/metadata.py +67 -0
- nextmv/cli/cloud/run/track.py +500 -0
- nextmv/cli/cloud/scenario/__init__.py +29 -0
- nextmv/cli/cloud/scenario/create.py +451 -0
- nextmv/cli/cloud/scenario/delete.py +61 -0
- nextmv/cli/cloud/scenario/get.py +102 -0
- nextmv/cli/cloud/scenario/list.py +63 -0
- nextmv/cli/cloud/scenario/metadata.py +67 -0
- nextmv/cli/cloud/scenario/update.py +93 -0
- nextmv/cli/cloud/secrets/__init__.py +33 -0
- nextmv/cli/cloud/secrets/create.py +206 -0
- nextmv/cli/cloud/secrets/delete.py +63 -0
- nextmv/cli/cloud/secrets/get.py +66 -0
- nextmv/cli/cloud/secrets/list.py +60 -0
- nextmv/cli/cloud/secrets/update.py +144 -0
- nextmv/cli/cloud/shadow/__init__.py +33 -0
- nextmv/cli/cloud/shadow/create.py +184 -0
- nextmv/cli/cloud/shadow/delete.py +64 -0
- nextmv/cli/cloud/shadow/get.py +61 -0
- nextmv/cli/cloud/shadow/list.py +63 -0
- nextmv/cli/cloud/shadow/metadata.py +66 -0
- nextmv/cli/cloud/shadow/start.py +43 -0
- nextmv/cli/cloud/shadow/stop.py +53 -0
- nextmv/cli/cloud/shadow/update.py +96 -0
- nextmv/cli/cloud/switchback/__init__.py +33 -0
- nextmv/cli/cloud/switchback/create.py +151 -0
- nextmv/cli/cloud/switchback/delete.py +64 -0
- nextmv/cli/cloud/switchback/get.py +62 -0
- nextmv/cli/cloud/switchback/list.py +63 -0
- nextmv/cli/cloud/switchback/metadata.py +68 -0
- nextmv/cli/cloud/switchback/start.py +43 -0
- nextmv/cli/cloud/switchback/stop.py +53 -0
- nextmv/cli/cloud/switchback/update.py +96 -0
- nextmv/cli/cloud/upload/__init__.py +22 -0
- nextmv/cli/cloud/upload/create.py +39 -0
- nextmv/cli/cloud/version/__init__.py +33 -0
- nextmv/cli/cloud/version/create.py +96 -0
- nextmv/cli/cloud/version/delete.py +61 -0
- nextmv/cli/cloud/version/exists.py +39 -0
- nextmv/cli/cloud/version/get.py +62 -0
- nextmv/cli/cloud/version/list.py +60 -0
- nextmv/cli/cloud/version/update.py +92 -0
- nextmv/cli/community/__init__.py +24 -0
- nextmv/cli/community/clone.py +86 -0
- nextmv/cli/community/list.py +200 -0
- nextmv/cli/configuration/__init__.py +23 -0
- nextmv/cli/configuration/config.py +228 -0
- nextmv/cli/configuration/create.py +94 -0
- nextmv/cli/configuration/delete.py +67 -0
- nextmv/cli/configuration/list.py +77 -0
- nextmv/cli/confirm.py +34 -0
- nextmv/cli/main.py +161 -3
- nextmv/cli/message.py +170 -0
- nextmv/cli/options.py +220 -0
- nextmv/cli/version.py +22 -2
- nextmv/cloud/__init__.py +17 -38
- nextmv/cloud/acceptance_test.py +20 -83
- nextmv/cloud/account.py +269 -30
- nextmv/cloud/application/__init__.py +898 -0
- nextmv/cloud/application/_acceptance.py +424 -0
- nextmv/cloud/application/_batch_scenario.py +845 -0
- nextmv/cloud/application/_ensemble.py +251 -0
- nextmv/cloud/application/_input_set.py +263 -0
- nextmv/cloud/application/_instance.py +289 -0
- nextmv/cloud/application/_managed_input.py +227 -0
- nextmv/cloud/application/_run.py +1393 -0
- nextmv/cloud/application/_secrets.py +294 -0
- nextmv/cloud/application/_shadow.py +320 -0
- nextmv/cloud/application/_switchback.py +332 -0
- nextmv/cloud/application/_utils.py +54 -0
- nextmv/cloud/application/_version.py +304 -0
- nextmv/cloud/batch_experiment.py +6 -2
- nextmv/cloud/community.py +446 -0
- nextmv/cloud/instance.py +11 -1
- nextmv/cloud/integration.py +8 -5
- nextmv/cloud/package.py +50 -9
- nextmv/cloud/shadow.py +254 -0
- nextmv/cloud/switchback.py +228 -0
- nextmv/deprecated.py +5 -3
- nextmv/input.py +20 -88
- nextmv/local/application.py +3 -15
- nextmv/local/runner.py +1 -1
- nextmv/model.py +50 -11
- nextmv/options.py +11 -256
- nextmv/output.py +0 -62
- nextmv/polling.py +54 -16
- nextmv/run.py +84 -37
- nextmv/status.py +1 -51
- {nextmv-0.39.0.dev1.dist-info → nextmv-1.0.0.dist-info}/METADATA +37 -11
- nextmv-1.0.0.dist-info/RECORD +185 -0
- nextmv-1.0.0.dist-info/entry_points.txt +2 -0
- nextmv/cloud/application.py +0 -4204
- nextmv-0.39.0.dev1.dist-info/RECORD +0 -55
- nextmv-0.39.0.dev1.dist-info/entry_points.txt +0 -2
- {nextmv-0.39.0.dev1.dist-info → nextmv-1.0.0.dist-info}/WHEEL +0 -0
- {nextmv-0.39.0.dev1.dist-info → nextmv-1.0.0.dist-info}/licenses/LICENSE +0 -0
nextmv/cloud/shadow.py
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Classes for working with Nextmv Cloud shadow tests.
|
|
3
|
+
|
|
4
|
+
This module provides classes for interacting with shadow tests in Nextmv Cloud.
|
|
5
|
+
It details the core data structures for these types of experiments.
|
|
6
|
+
|
|
7
|
+
Classes
|
|
8
|
+
-------
|
|
9
|
+
TestComparison
|
|
10
|
+
A structure to define comparison parameters for tests.
|
|
11
|
+
StartEvents
|
|
12
|
+
A structure to define start events for tests.
|
|
13
|
+
TerminationEvents
|
|
14
|
+
A structure to define termination events for tests.
|
|
15
|
+
ShadowTestMetadata
|
|
16
|
+
Metadata for a Nextmv Cloud shadow test.
|
|
17
|
+
ShadowTest
|
|
18
|
+
A Nextmv Cloud shadow test definition.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
from enum import Enum
|
|
23
|
+
from typing import Any
|
|
24
|
+
|
|
25
|
+
from pydantic import AliasChoices, Field
|
|
26
|
+
|
|
27
|
+
from nextmv.base_model import BaseModel
|
|
28
|
+
from nextmv.cloud.batch_experiment import ExperimentStatus
|
|
29
|
+
from nextmv.run import Run
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class TestComparison(BaseModel):
|
|
33
|
+
"""
|
|
34
|
+
A structure to define comparison parameters for tests.
|
|
35
|
+
|
|
36
|
+
You can import the `TestComparison` class directly from `cloud`:
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from nextmv.cloud import TestComparison
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Parameters
|
|
43
|
+
----------
|
|
44
|
+
baseline_instance_id : str
|
|
45
|
+
ID of the baseline instance for comparison.
|
|
46
|
+
candidate_instance_ids : list[str]
|
|
47
|
+
List of candidate instance IDs to compare against the baseline.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
baseline_instance_id: str
|
|
51
|
+
"""ID of the baseline instance for comparison."""
|
|
52
|
+
candidate_instance_ids: list[str]
|
|
53
|
+
"""List of candidate instance IDs to compare against the baseline."""
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class StartEvents(BaseModel):
|
|
57
|
+
"""
|
|
58
|
+
A structure to define start events for tests.
|
|
59
|
+
|
|
60
|
+
You can import the `StartEvents` class directly from `cloud`:
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from nextmv.cloud import StartEvents
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Parameters
|
|
67
|
+
----------
|
|
68
|
+
time : datetime, optional
|
|
69
|
+
Scheduled time for the test to start.
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
time: datetime | None = None
|
|
73
|
+
"""Scheduled time for the test to start."""
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class TerminationEvents(BaseModel):
|
|
77
|
+
"""
|
|
78
|
+
A structure to define termination events for tests.
|
|
79
|
+
|
|
80
|
+
You can import the `TerminationEvents` class directly from `cloud`:
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
from nextmv.cloud import TerminationEvents
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Parameters
|
|
87
|
+
----------
|
|
88
|
+
time : datetime, optional
|
|
89
|
+
Scheduled time for the test to terminate.
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
maximum_runs: int
|
|
93
|
+
"""
|
|
94
|
+
Maximum number of runs for the test. Value must be between 1 and 300.
|
|
95
|
+
"""
|
|
96
|
+
time: datetime | None = None
|
|
97
|
+
"""
|
|
98
|
+
Scheduled time for the test to terminate. A zero value means no
|
|
99
|
+
limit.
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
def model_post_init(self, __context):
|
|
103
|
+
if self.maximum_runs < 1 or self.maximum_runs > 300:
|
|
104
|
+
raise ValueError("maximum_runs must be between 1 and 300")
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class ShadowTestMetadata(BaseModel):
|
|
108
|
+
"""
|
|
109
|
+
Metadata for a Nextmv Cloud shadow test.
|
|
110
|
+
|
|
111
|
+
You can import the `ShadowTestMetadata` class directly from `cloud`:
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from nextmv.cloud import ShadowTestMetadata
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Parameters
|
|
118
|
+
----------
|
|
119
|
+
shadow_test_id : str, optional
|
|
120
|
+
The unique identifier of the shadow test.
|
|
121
|
+
name : str, optional
|
|
122
|
+
Name of the shadow test.
|
|
123
|
+
description : str, optional
|
|
124
|
+
Description of the shadow test.
|
|
125
|
+
app_id : str, optional
|
|
126
|
+
ID of the application to which the shadow test belongs.
|
|
127
|
+
created_at : datetime, optional
|
|
128
|
+
Creation date of the shadow test.
|
|
129
|
+
updated_at : datetime, optional
|
|
130
|
+
Last update date of the shadow test.
|
|
131
|
+
status : ExperimentStatus, optional
|
|
132
|
+
The current status of the shadow test.
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
shadow_test_id: str | None = Field(
|
|
136
|
+
serialization_alias="id",
|
|
137
|
+
validation_alias=AliasChoices("id", "shadow_test_id"),
|
|
138
|
+
default=None,
|
|
139
|
+
)
|
|
140
|
+
"""The unique identifier of the shadow test."""
|
|
141
|
+
name: str | None = None
|
|
142
|
+
"""Name of the shadow test."""
|
|
143
|
+
description: str | None = None
|
|
144
|
+
"""Description of the shadow test."""
|
|
145
|
+
app_id: str | None = None
|
|
146
|
+
"""ID of the application to which the shadow test belongs."""
|
|
147
|
+
created_at: datetime | None = None
|
|
148
|
+
"""Creation date of the shadow test."""
|
|
149
|
+
updated_at: datetime | None = None
|
|
150
|
+
"""Last update date of the shadow test."""
|
|
151
|
+
status: ExperimentStatus | None = None
|
|
152
|
+
"""The current status of the shadow test."""
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
# This class uses some fields defined in ShadowTestMetadata. We are not
|
|
156
|
+
# using inheritance to help the user understand the full structure when using
|
|
157
|
+
# tools like intellisense.
|
|
158
|
+
class ShadowTest(BaseModel):
|
|
159
|
+
"""
|
|
160
|
+
A Nextmv Cloud shadow test definition.
|
|
161
|
+
|
|
162
|
+
A shadow test is a type of experiment where runs are executed in parallel
|
|
163
|
+
to compare different instances.
|
|
164
|
+
|
|
165
|
+
You can import the `ShadowTest` class directly from `cloud`:
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
from nextmv.cloud import ShadowTest
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Parameters
|
|
172
|
+
----------
|
|
173
|
+
shadow_test_id : str, optional
|
|
174
|
+
The unique identifier of the shadow test.
|
|
175
|
+
name : str, optional
|
|
176
|
+
Name of the shadow test.
|
|
177
|
+
description : str, optional
|
|
178
|
+
Description of the shadow test.
|
|
179
|
+
app_id : str, optional
|
|
180
|
+
ID of the application to which the shadow test belongs.
|
|
181
|
+
created_at : datetime, optional
|
|
182
|
+
Creation date of the shadow test.
|
|
183
|
+
updated_at : datetime, optional
|
|
184
|
+
Last update date of the shadow test.
|
|
185
|
+
status : ExperimentStatus, optional
|
|
186
|
+
The current status of the shadow test.
|
|
187
|
+
completed_at : datetime, optional
|
|
188
|
+
Completion date of the shadow test, if applicable.
|
|
189
|
+
comparisons : list[TestComparison], optional
|
|
190
|
+
List of test comparisons defined in the shadow test.
|
|
191
|
+
start_events : StartEvents, optional
|
|
192
|
+
Start events for the shadow test.
|
|
193
|
+
termination_events : TerminationEvents, optional
|
|
194
|
+
Termination events for the shadow test.
|
|
195
|
+
grouped_distributional_summaries : list[dict[str, Any]], optional
|
|
196
|
+
Grouped distributional summaries of the shadow test.
|
|
197
|
+
runs : list[Run], optional
|
|
198
|
+
List of runs in the shadow test.
|
|
199
|
+
"""
|
|
200
|
+
|
|
201
|
+
shadow_test_id: str | None = Field(
|
|
202
|
+
serialization_alias="id",
|
|
203
|
+
validation_alias=AliasChoices("id", "shadow_test_id"),
|
|
204
|
+
default=None,
|
|
205
|
+
)
|
|
206
|
+
"""The unique identifier of the shadow test."""
|
|
207
|
+
name: str | None = None
|
|
208
|
+
"""Name of the shadow test."""
|
|
209
|
+
description: str | None = None
|
|
210
|
+
"""Description of the shadow test."""
|
|
211
|
+
app_id: str | None = None
|
|
212
|
+
"""ID of the application to which the shadow test belongs."""
|
|
213
|
+
created_at: datetime | None = None
|
|
214
|
+
"""Creation date of the shadow test."""
|
|
215
|
+
updated_at: datetime | None = None
|
|
216
|
+
"""Last update date of the shadow test."""
|
|
217
|
+
status: ExperimentStatus | None = None
|
|
218
|
+
"""The current status of the shadow test."""
|
|
219
|
+
completed_at: datetime | None = None
|
|
220
|
+
"""Completion date of the shadow test, if applicable."""
|
|
221
|
+
comparisons: list[TestComparison] | None = None
|
|
222
|
+
"""List of test comparisons defined in the shadow test."""
|
|
223
|
+
start_events: StartEvents | None = None
|
|
224
|
+
"""Start events for the shadow test."""
|
|
225
|
+
termination_events: TerminationEvents | None = None
|
|
226
|
+
"""Termination events for the shadow test."""
|
|
227
|
+
grouped_distributional_summaries: list[dict[str, Any]] | None = None
|
|
228
|
+
"""Grouped distributional summaries of the shadow test."""
|
|
229
|
+
runs: list[Run] | None = None
|
|
230
|
+
"""List of runs in the shadow test."""
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class StopIntent(str, Enum):
|
|
234
|
+
"""
|
|
235
|
+
Intent for stopping a shadow test.
|
|
236
|
+
|
|
237
|
+
You can import the `StopIntent` class directly from `cloud`:
|
|
238
|
+
|
|
239
|
+
```python
|
|
240
|
+
from nextmv.cloud import StopIntent
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Attributes
|
|
244
|
+
----------
|
|
245
|
+
complete : str
|
|
246
|
+
The test is marked as complete.
|
|
247
|
+
cancel : str
|
|
248
|
+
The test is canceled.
|
|
249
|
+
"""
|
|
250
|
+
|
|
251
|
+
complete = "complete"
|
|
252
|
+
"""The test is marked as complete."""
|
|
253
|
+
cancel = "cancel"
|
|
254
|
+
"""The test is canceled."""
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Classes for working with Nextmv Cloud switchback tests.
|
|
3
|
+
|
|
4
|
+
This module provides classes for interacting with switchback tests in Nextmv Cloud.
|
|
5
|
+
It details the core data structures for these types of experiments.
|
|
6
|
+
|
|
7
|
+
Classes
|
|
8
|
+
-------
|
|
9
|
+
TestComparisonSingle
|
|
10
|
+
A structure to define a single comparison for tests.
|
|
11
|
+
SwitchbackPlanUnit
|
|
12
|
+
A structure to define a single unit in the switchback plan.
|
|
13
|
+
SwitchbackPlan
|
|
14
|
+
A structure to define the switchback plan for tests.
|
|
15
|
+
SwitchbackTestMetadata
|
|
16
|
+
Metadata for a Nextmv Cloud switchback test.
|
|
17
|
+
SwitchbackTest
|
|
18
|
+
A Nextmv Cloud switchback test definition.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
|
|
23
|
+
from pydantic import AliasChoices, Field
|
|
24
|
+
|
|
25
|
+
from nextmv.base_model import BaseModel
|
|
26
|
+
from nextmv.cloud.batch_experiment import ExperimentStatus
|
|
27
|
+
from nextmv.run import Run
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class TestComparisonSingle(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
A structure to define a single comparison for tests.
|
|
33
|
+
|
|
34
|
+
You can import the `TestComparisonSingle` class directly from `cloud`:
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
from nextmv.cloud import TestComparisonSingle
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Parameters
|
|
41
|
+
----------
|
|
42
|
+
baseline_instance_id : str
|
|
43
|
+
ID of the baseline instance for comparison.
|
|
44
|
+
candidate_instance_id : str
|
|
45
|
+
ID of the candidate instance for comparison.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
__test__ = False # Prevents pytest from collecting this class as a test case
|
|
49
|
+
|
|
50
|
+
baseline_instance_id: str
|
|
51
|
+
"""ID of the baseline instance for comparison."""
|
|
52
|
+
candidate_instance_id: str
|
|
53
|
+
"""ID of the candidate instance for comparison."""
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class SwitchbackPlanUnit(BaseModel):
|
|
57
|
+
"""
|
|
58
|
+
A structure to define a single unit in the switchback plan.
|
|
59
|
+
|
|
60
|
+
You can import the `SwitchbackPlanUnit` class directly from `cloud`:
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from nextmv.cloud import SwitchbackPlanUnit
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Parameters
|
|
67
|
+
----------
|
|
68
|
+
duration_minutes : float
|
|
69
|
+
Duration of this interval in minutes.
|
|
70
|
+
instance_id : str
|
|
71
|
+
ID of the instance to run during this unit.
|
|
72
|
+
index : int
|
|
73
|
+
Index of this unit in the switchback plan.
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
duration_minutes: float
|
|
77
|
+
"""Duration of this interval in minutes."""
|
|
78
|
+
instance_id: str
|
|
79
|
+
"""ID of the instance to run during this unit."""
|
|
80
|
+
index: int
|
|
81
|
+
"""Index of this unit in the switchback plan."""
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class SwitchbackPlan(BaseModel):
|
|
85
|
+
"""
|
|
86
|
+
A structure to define the switchback plan for tests.
|
|
87
|
+
|
|
88
|
+
You can import the `SwitchbackPlan` class directly from `cloud`:
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
from nextmv.cloud import SwitchbackPlan
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Parameters
|
|
95
|
+
----------
|
|
96
|
+
start : datetime, optional
|
|
97
|
+
Start time of the switchback test.
|
|
98
|
+
units : list[SwitchbackPlanUnit], optional
|
|
99
|
+
List of switchback plan units.
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
start: datetime | None = None
|
|
103
|
+
"""Start time of the switchback test."""
|
|
104
|
+
units: list[SwitchbackPlanUnit] | None = None
|
|
105
|
+
"""List of switchback plan units."""
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class SwitchbackTestMetadata(BaseModel):
|
|
109
|
+
"""
|
|
110
|
+
Metadata for a Nextmv Cloud switchback test.
|
|
111
|
+
|
|
112
|
+
You can import the `SwitchbackTestMetadata` class directly from `cloud`:
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from nextmv.cloud import SwitchbackTestMetadata
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Parameters
|
|
119
|
+
----------
|
|
120
|
+
switchback_test_id : str, optional
|
|
121
|
+
The unique identifier of the switchback test.
|
|
122
|
+
name : str, optional
|
|
123
|
+
Name of the switchback test.
|
|
124
|
+
description : str, optional
|
|
125
|
+
Description of the switchback test.
|
|
126
|
+
app_id : str, optional
|
|
127
|
+
ID of the application to which the switchback test belongs.
|
|
128
|
+
created_at : datetime, optional
|
|
129
|
+
Creation date of the switchback test.
|
|
130
|
+
updated_at : datetime, optional
|
|
131
|
+
Last update date of the switchback test.
|
|
132
|
+
status : ExperimentStatus, optional
|
|
133
|
+
The current status of the switchback test.
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
switchback_test_id: str | None = Field(
|
|
137
|
+
serialization_alias="id",
|
|
138
|
+
validation_alias=AliasChoices("id", "switchback_test_id"),
|
|
139
|
+
default=None,
|
|
140
|
+
)
|
|
141
|
+
"""The unique identifier of the switchback test."""
|
|
142
|
+
name: str | None = None
|
|
143
|
+
"""Name of the switchback test."""
|
|
144
|
+
description: str | None = None
|
|
145
|
+
"""Description of the switchback test."""
|
|
146
|
+
app_id: str | None = None
|
|
147
|
+
"""ID of the application to which the switchback test belongs."""
|
|
148
|
+
created_at: datetime | None = None
|
|
149
|
+
"""Creation date of the switchback test."""
|
|
150
|
+
updated_at: datetime | None = None
|
|
151
|
+
"""Last update date of the switchback test."""
|
|
152
|
+
status: ExperimentStatus | None = None
|
|
153
|
+
"""The current status of the switchback test."""
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
# This class uses some fields defined in SwitchbackTestMetadata. We are not
|
|
157
|
+
# using inheritance to help the user understand the full structure when using
|
|
158
|
+
# tools like intellisense.
|
|
159
|
+
class SwitchbackTest(BaseModel):
|
|
160
|
+
"""
|
|
161
|
+
A Nextmv Cloud switchback test definition.
|
|
162
|
+
|
|
163
|
+
A switchback test is a type of experiment where runs are executed in
|
|
164
|
+
sequential intervals, alternating between different instances to compare
|
|
165
|
+
their performance.
|
|
166
|
+
|
|
167
|
+
You can import the `SwitchbackTest` class directly from `cloud`:
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
from nextmv.cloud import SwitchbackTest
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Parameters
|
|
174
|
+
----------
|
|
175
|
+
switchback_test_id : str, optional
|
|
176
|
+
The unique identifier of the switchback test.
|
|
177
|
+
name : str, optional
|
|
178
|
+
Name of the switchback test.
|
|
179
|
+
description : str, optional
|
|
180
|
+
Description of the switchback test.
|
|
181
|
+
app_id : str, optional
|
|
182
|
+
ID of the application to which the switchback test belongs.
|
|
183
|
+
created_at : datetime, optional
|
|
184
|
+
Creation date of the switchback test.
|
|
185
|
+
updated_at : datetime, optional
|
|
186
|
+
Last update date of the switchback test.
|
|
187
|
+
status : ExperimentStatus, optional
|
|
188
|
+
The current status of the switchback test.
|
|
189
|
+
started_at : datetime, optional
|
|
190
|
+
Start date of the switchback test, if applicable.
|
|
191
|
+
completed_at : datetime, optional
|
|
192
|
+
Completion date of the switchback test, if applicable.
|
|
193
|
+
comparison : TestComparisonSingle, optional
|
|
194
|
+
Test comparison defined in the switchback test.
|
|
195
|
+
plan : SwitchbackPlan, optional
|
|
196
|
+
Switchback plan defining the intervals and instance switching.
|
|
197
|
+
runs : list[Run], optional
|
|
198
|
+
List of runs in the switchback test.
|
|
199
|
+
"""
|
|
200
|
+
|
|
201
|
+
switchback_test_id: str | None = Field(
|
|
202
|
+
serialization_alias="id",
|
|
203
|
+
validation_alias=AliasChoices("id", "switchback_test_id"),
|
|
204
|
+
default=None,
|
|
205
|
+
)
|
|
206
|
+
"""The unique identifier of the switchback test."""
|
|
207
|
+
name: str | None = None
|
|
208
|
+
"""Name of the switchback test."""
|
|
209
|
+
description: str | None = None
|
|
210
|
+
"""Description of the switchback test."""
|
|
211
|
+
app_id: str | None = None
|
|
212
|
+
"""ID of the application to which the switchback test belongs."""
|
|
213
|
+
created_at: datetime | None = None
|
|
214
|
+
"""Creation date of the switchback test."""
|
|
215
|
+
updated_at: datetime | None = None
|
|
216
|
+
"""Last update date of the switchback test."""
|
|
217
|
+
status: ExperimentStatus | None = None
|
|
218
|
+
"""The current status of the switchback test."""
|
|
219
|
+
started_at: datetime | None = None
|
|
220
|
+
"""Start date of the switchback test, if applicable."""
|
|
221
|
+
completed_at: datetime | None = None
|
|
222
|
+
"""Completion date of the switchback test, if applicable."""
|
|
223
|
+
comparison: TestComparisonSingle | None = None
|
|
224
|
+
"""Test comparison defined in the switchback test."""
|
|
225
|
+
plan: SwitchbackPlan | None = None
|
|
226
|
+
"""Switchback plan defining the intervals and instance switching."""
|
|
227
|
+
runs: list[Run] | None = None
|
|
228
|
+
"""List of runs in the switchback test."""
|
nextmv/deprecated.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""
|
|
2
|
+
Utilities for handling deprecated functionality within the Nextmv Python SDK.
|
|
2
3
|
|
|
3
4
|
This module provides tools to mark functions, methods, or features as deprecated,
|
|
4
5
|
emitting appropriate warnings to users. These warnings inform users that the
|
|
@@ -13,7 +14,8 @@ import warnings
|
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
def deprecated(name: str, reason: str) -> None:
|
|
16
|
-
"""
|
|
17
|
+
"""
|
|
18
|
+
Mark functionality as deprecated with a warning message.
|
|
17
19
|
|
|
18
20
|
This function emits a DeprecationWarning when called, indicating that
|
|
19
21
|
the functionality will be removed in a future release.
|
|
@@ -40,7 +42,7 @@ def deprecated(name: str, reason: str) -> None:
|
|
|
40
42
|
|
|
41
43
|
warnings.simplefilter("always", DeprecationWarning)
|
|
42
44
|
warnings.warn(
|
|
43
|
-
f"{name}: {reason}. This functionality will be removed in
|
|
45
|
+
f"{name}: {reason}. This functionality will be removed in the next major release.",
|
|
44
46
|
category=DeprecationWarning,
|
|
45
47
|
stacklevel=2,
|
|
46
48
|
)
|