nextmv 0.40.0__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.
Files changed (163) hide show
  1. nextmv/__about__.py +1 -1
  2. nextmv/__entrypoint__.py +1 -2
  3. nextmv/__init__.py +2 -4
  4. nextmv/cli/CONTRIBUTING.md +583 -0
  5. nextmv/cli/cloud/__init__.py +49 -0
  6. nextmv/cli/cloud/acceptance/__init__.py +27 -0
  7. nextmv/cli/cloud/acceptance/create.py +391 -0
  8. nextmv/cli/cloud/acceptance/delete.py +64 -0
  9. nextmv/cli/cloud/acceptance/get.py +103 -0
  10. nextmv/cli/cloud/acceptance/list.py +62 -0
  11. nextmv/cli/cloud/acceptance/update.py +95 -0
  12. nextmv/cli/cloud/account/__init__.py +28 -0
  13. nextmv/cli/cloud/account/create.py +83 -0
  14. nextmv/cli/cloud/account/delete.py +59 -0
  15. nextmv/cli/cloud/account/get.py +66 -0
  16. nextmv/cli/cloud/account/update.py +70 -0
  17. nextmv/cli/cloud/app/__init__.py +35 -0
  18. nextmv/cli/cloud/app/create.py +140 -0
  19. nextmv/cli/cloud/app/delete.py +57 -0
  20. nextmv/cli/cloud/app/exists.py +44 -0
  21. nextmv/cli/cloud/app/get.py +66 -0
  22. nextmv/cli/cloud/app/list.py +61 -0
  23. nextmv/cli/cloud/app/push.py +432 -0
  24. nextmv/cli/cloud/app/update.py +124 -0
  25. nextmv/cli/cloud/batch/__init__.py +29 -0
  26. nextmv/cli/cloud/batch/create.py +452 -0
  27. nextmv/cli/cloud/batch/delete.py +64 -0
  28. nextmv/cli/cloud/batch/get.py +104 -0
  29. nextmv/cli/cloud/batch/list.py +63 -0
  30. nextmv/cli/cloud/batch/metadata.py +66 -0
  31. nextmv/cli/cloud/batch/update.py +95 -0
  32. nextmv/cli/cloud/data/__init__.py +26 -0
  33. nextmv/cli/cloud/data/upload.py +162 -0
  34. nextmv/cli/cloud/ensemble/__init__.py +33 -0
  35. nextmv/cli/cloud/ensemble/create.py +413 -0
  36. nextmv/cli/cloud/ensemble/delete.py +63 -0
  37. nextmv/cli/cloud/ensemble/get.py +65 -0
  38. nextmv/cli/cloud/ensemble/list.py +63 -0
  39. nextmv/cli/cloud/ensemble/update.py +103 -0
  40. nextmv/cli/cloud/input_set/__init__.py +32 -0
  41. nextmv/cli/cloud/input_set/create.py +168 -0
  42. nextmv/cli/cloud/input_set/delete.py +64 -0
  43. nextmv/cli/cloud/input_set/get.py +63 -0
  44. nextmv/cli/cloud/input_set/list.py +63 -0
  45. nextmv/cli/cloud/input_set/update.py +123 -0
  46. nextmv/cli/cloud/instance/__init__.py +35 -0
  47. nextmv/cli/cloud/instance/create.py +289 -0
  48. nextmv/cli/cloud/instance/delete.py +61 -0
  49. nextmv/cli/cloud/instance/exists.py +39 -0
  50. nextmv/cli/cloud/instance/get.py +62 -0
  51. nextmv/cli/cloud/instance/list.py +60 -0
  52. nextmv/cli/cloud/instance/update.py +216 -0
  53. nextmv/cli/cloud/managed_input/__init__.py +31 -0
  54. nextmv/cli/cloud/managed_input/create.py +144 -0
  55. nextmv/cli/cloud/managed_input/delete.py +64 -0
  56. nextmv/cli/cloud/managed_input/get.py +63 -0
  57. nextmv/cli/cloud/managed_input/list.py +60 -0
  58. nextmv/cli/cloud/managed_input/update.py +97 -0
  59. nextmv/cli/cloud/run/__init__.py +37 -0
  60. nextmv/cli/cloud/run/cancel.py +37 -0
  61. nextmv/cli/cloud/run/create.py +524 -0
  62. nextmv/cli/cloud/run/get.py +199 -0
  63. nextmv/cli/cloud/run/input.py +86 -0
  64. nextmv/cli/cloud/run/list.py +80 -0
  65. nextmv/cli/cloud/run/logs.py +166 -0
  66. nextmv/cli/cloud/run/metadata.py +67 -0
  67. nextmv/cli/cloud/run/track.py +500 -0
  68. nextmv/cli/cloud/scenario/__init__.py +29 -0
  69. nextmv/cli/cloud/scenario/create.py +451 -0
  70. nextmv/cli/cloud/scenario/delete.py +61 -0
  71. nextmv/cli/cloud/scenario/get.py +102 -0
  72. nextmv/cli/cloud/scenario/list.py +63 -0
  73. nextmv/cli/cloud/scenario/metadata.py +67 -0
  74. nextmv/cli/cloud/scenario/update.py +93 -0
  75. nextmv/cli/cloud/secrets/__init__.py +33 -0
  76. nextmv/cli/cloud/secrets/create.py +206 -0
  77. nextmv/cli/cloud/secrets/delete.py +63 -0
  78. nextmv/cli/cloud/secrets/get.py +66 -0
  79. nextmv/cli/cloud/secrets/list.py +60 -0
  80. nextmv/cli/cloud/secrets/update.py +144 -0
  81. nextmv/cli/cloud/shadow/__init__.py +33 -0
  82. nextmv/cli/cloud/shadow/create.py +184 -0
  83. nextmv/cli/cloud/shadow/delete.py +64 -0
  84. nextmv/cli/cloud/shadow/get.py +61 -0
  85. nextmv/cli/cloud/shadow/list.py +63 -0
  86. nextmv/cli/cloud/shadow/metadata.py +66 -0
  87. nextmv/cli/cloud/shadow/start.py +43 -0
  88. nextmv/cli/cloud/shadow/stop.py +53 -0
  89. nextmv/cli/cloud/shadow/update.py +96 -0
  90. nextmv/cli/cloud/switchback/__init__.py +33 -0
  91. nextmv/cli/cloud/switchback/create.py +151 -0
  92. nextmv/cli/cloud/switchback/delete.py +64 -0
  93. nextmv/cli/cloud/switchback/get.py +62 -0
  94. nextmv/cli/cloud/switchback/list.py +63 -0
  95. nextmv/cli/cloud/switchback/metadata.py +68 -0
  96. nextmv/cli/cloud/switchback/start.py +43 -0
  97. nextmv/cli/cloud/switchback/stop.py +53 -0
  98. nextmv/cli/cloud/switchback/update.py +96 -0
  99. nextmv/cli/cloud/upload/__init__.py +22 -0
  100. nextmv/cli/cloud/upload/create.py +39 -0
  101. nextmv/cli/cloud/version/__init__.py +33 -0
  102. nextmv/cli/cloud/version/create.py +96 -0
  103. nextmv/cli/cloud/version/delete.py +61 -0
  104. nextmv/cli/cloud/version/exists.py +39 -0
  105. nextmv/cli/cloud/version/get.py +62 -0
  106. nextmv/cli/cloud/version/list.py +60 -0
  107. nextmv/cli/cloud/version/update.py +92 -0
  108. nextmv/cli/community/__init__.py +24 -0
  109. nextmv/cli/community/clone.py +20 -204
  110. nextmv/cli/community/list.py +61 -126
  111. nextmv/cli/configuration/__init__.py +23 -0
  112. nextmv/cli/configuration/config.py +103 -6
  113. nextmv/cli/configuration/create.py +17 -18
  114. nextmv/cli/configuration/delete.py +25 -13
  115. nextmv/cli/configuration/list.py +4 -4
  116. nextmv/cli/confirm.py +34 -0
  117. nextmv/cli/main.py +68 -36
  118. nextmv/cli/message.py +170 -0
  119. nextmv/cli/options.py +196 -0
  120. nextmv/cli/version.py +20 -1
  121. nextmv/cloud/__init__.py +17 -38
  122. nextmv/cloud/acceptance_test.py +20 -83
  123. nextmv/cloud/account.py +269 -30
  124. nextmv/cloud/application/__init__.py +898 -0
  125. nextmv/cloud/application/_acceptance.py +424 -0
  126. nextmv/cloud/application/_batch_scenario.py +845 -0
  127. nextmv/cloud/application/_ensemble.py +251 -0
  128. nextmv/cloud/application/_input_set.py +263 -0
  129. nextmv/cloud/application/_instance.py +289 -0
  130. nextmv/cloud/application/_managed_input.py +227 -0
  131. nextmv/cloud/application/_run.py +1393 -0
  132. nextmv/cloud/application/_secrets.py +294 -0
  133. nextmv/cloud/application/_shadow.py +320 -0
  134. nextmv/cloud/application/_switchback.py +332 -0
  135. nextmv/cloud/application/_utils.py +54 -0
  136. nextmv/cloud/application/_version.py +304 -0
  137. nextmv/cloud/batch_experiment.py +6 -2
  138. nextmv/cloud/community.py +446 -0
  139. nextmv/cloud/instance.py +11 -1
  140. nextmv/cloud/integration.py +8 -5
  141. nextmv/cloud/package.py +50 -9
  142. nextmv/cloud/shadow.py +254 -0
  143. nextmv/cloud/switchback.py +228 -0
  144. nextmv/deprecated.py +5 -3
  145. nextmv/input.py +20 -88
  146. nextmv/local/application.py +3 -15
  147. nextmv/local/runner.py +1 -1
  148. nextmv/model.py +50 -11
  149. nextmv/options.py +11 -256
  150. nextmv/output.py +0 -62
  151. nextmv/polling.py +54 -16
  152. nextmv/run.py +84 -37
  153. nextmv/status.py +1 -51
  154. {nextmv-0.40.0.dist-info → nextmv-1.0.0.dist-info}/METADATA +37 -11
  155. nextmv-1.0.0.dist-info/RECORD +185 -0
  156. nextmv-1.0.0.dist-info/entry_points.txt +2 -0
  157. nextmv/cli/community/community.py +0 -24
  158. nextmv/cli/configuration/configuration.py +0 -23
  159. nextmv/cli/error.py +0 -22
  160. nextmv/cloud/application.py +0 -4204
  161. nextmv-0.40.0.dist-info/RECORD +0 -66
  162. {nextmv-0.40.0.dist-info → nextmv-1.0.0.dist-info}/WHEEL +0 -0
  163. {nextmv-0.40.0.dist-info → nextmv-1.0.0.dist-info}/licenses/LICENSE +0 -0
nextmv/cli/message.py ADDED
@@ -0,0 +1,170 @@
1
+ """
2
+ The message module is used to print messages to the user with pre-defined
3
+ formatting. Logging, in general, is always printed to stderr.
4
+ """
5
+
6
+ import sys
7
+ from enum import Enum
8
+ from typing import Any
9
+
10
+ import rich
11
+ import typer
12
+
13
+
14
+ def message(msg: str, emoji: str | None = None) -> None:
15
+ """
16
+ Pretty-print a message. Your message should end with a period. The use of
17
+ emojis is encouraged to give context to the message. An emoji should be a
18
+ string as specified in:
19
+ https://rich.readthedocs.io/en/latest/markup.html#emoji.
20
+
21
+ Parameters
22
+ ----------
23
+ msg : str
24
+ The message to display.
25
+ emoji : str | None
26
+ An optional emoji to prefix the message. If None, no emoji is used. The
27
+ emoji should be a string as specified in:
28
+ https://rich.readthedocs.io/en/latest/markup.html#emoji. For example:
29
+ `:hourglass_flowing_sand:`.
30
+ """
31
+
32
+ msg = _format(msg)
33
+ if emoji:
34
+ rich.print(f"{emoji} {msg}", file=sys.stderr)
35
+ return
36
+
37
+ rich.print(msg, file=sys.stderr)
38
+
39
+
40
+ def info(msg: str) -> None:
41
+ """
42
+ Pretty-print an informational message. Your message should end with a
43
+ period.
44
+
45
+ Parameters
46
+ ----------
47
+ msg : str
48
+ The informational message to display.
49
+ """
50
+
51
+ message(msg, emoji=":bulb:")
52
+
53
+
54
+ def in_progress(msg: str) -> None:
55
+ """
56
+ Pretty-print an in-progress message with an hourglass emoji. Your message
57
+ should end with a period.
58
+
59
+ Parameters
60
+ ----------
61
+ msg : str
62
+ The in-progress message to display.
63
+ """
64
+
65
+ message(msg, emoji=":hourglass_flowing_sand:")
66
+
67
+
68
+ def success(msg: str) -> None:
69
+ """
70
+ Pretty-print a success message. Your message should end with a period.
71
+
72
+ Parameters
73
+ ----------
74
+ msg : str
75
+ The success message to display.
76
+ """
77
+
78
+ message(msg, emoji=":white_check_mark:")
79
+
80
+
81
+ def warning(msg: str) -> None:
82
+ """
83
+ Pretty-print a warning message. Your message should end with a period.
84
+
85
+ Parameters
86
+ ----------
87
+ msg : str
88
+ The warning message to display.
89
+ """
90
+
91
+ msg = _format(msg)
92
+ rich.print(f":construction: [yellow] Warning:[/yellow] {msg}", file=sys.stderr)
93
+
94
+
95
+ def error(msg: str) -> None:
96
+ """
97
+ Pretty-print an error message and exit with code 1. Your message should end
98
+ with a period.
99
+
100
+ Parameters
101
+ ----------
102
+ msg : str
103
+ The error message to display.
104
+
105
+ Raises
106
+ ------
107
+ typer.Exit
108
+ Exits the program with code 1.
109
+ """
110
+
111
+ msg = _format(msg)
112
+ rich.print(f":x: [red]Error:[/red] {msg}", file=sys.stderr)
113
+
114
+ raise typer.Exit(code=1)
115
+
116
+
117
+ def print_json(data: dict[str, Any] | list[dict[str, Any]]) -> None:
118
+ """
119
+ Pretty-print json-serializable data as JSON to stdout.
120
+
121
+ Parameters
122
+ ----------
123
+ data : dict[str, Any] | list[dict[str, Any]]
124
+ The data to print as JSON.
125
+ """
126
+
127
+ rich.print_json(data=data)
128
+
129
+
130
+ def enum_values(enum_class: Enum) -> str:
131
+ """
132
+ Get a nicely formatted string of the values of an Enum class, using commas
133
+ and an oxford comma.
134
+
135
+ Parameters
136
+ ----------
137
+ enum_class : Enum
138
+ The Enum class to get the values from.
139
+
140
+ Returns
141
+ -------
142
+ str
143
+ A nicely formatted string of the values of the Enum class.
144
+ """
145
+
146
+ values = [f"[magenta]{member.value}[/magenta]" for member in enum_class]
147
+ if len(values) == 0:
148
+ return ""
149
+ if len(values) == 1:
150
+ return values[0]
151
+ if len(values) == 2:
152
+ return " and ".join(values)
153
+
154
+ return ", ".join(values[:-1]) + ", and " + values[-1]
155
+
156
+
157
+ def _format(msg: str) -> str:
158
+ """
159
+ Format a message to ensure it ends with a period.
160
+
161
+ Parameters
162
+ ----------
163
+ msg : str
164
+ The message to format.
165
+ """
166
+ msg = msg.rstrip("\n")
167
+ if not msg.endswith("."):
168
+ msg += "."
169
+
170
+ return msg
nextmv/cli/options.py CHANGED
@@ -22,3 +22,199 @@ ProfileOption = Annotated[
22
22
  metavar="PROFILE_NAME",
23
23
  ),
24
24
  ]
25
+
26
+ # app_id option - can be used in any command that requires an application ID.
27
+ # Define it as follows in commands or callbacks, as necessary:
28
+ # app_id: AppIDOption
29
+ AppIDOption = Annotated[
30
+ str,
31
+ typer.Option(
32
+ "--app-id",
33
+ "-a",
34
+ help="The Nextmv Cloud application ID to use for this action.",
35
+ envvar="NEXTMV_APP_ID",
36
+ metavar="APP_ID",
37
+ ),
38
+ ]
39
+
40
+ # run_id option - can be used in any command that requires a run ID.
41
+ # Define it as follows in commands or callbacks, as necessary:
42
+ # run_id: RunIDOption
43
+ RunIDOption = Annotated[
44
+ str,
45
+ typer.Option(
46
+ "--run-id",
47
+ "-r",
48
+ help="The Nextmv Cloud run ID to use for this action.",
49
+ envvar="NEXTMV_RUN_ID",
50
+ metavar="RUN_ID",
51
+ ),
52
+ ]
53
+
54
+ # version_id option - can be used in any command that requires a version ID.
55
+ # Define it as follows in commands or callbacks, as necessary:
56
+ # version_id: VersionIDOption
57
+ VersionIDOption = Annotated[
58
+ str,
59
+ typer.Option(
60
+ "--version-id",
61
+ "-v",
62
+ help="The Nextmv Cloud version ID to use for this action.",
63
+ envvar="NEXTMV_VERSION_ID",
64
+ metavar="VERSION_ID",
65
+ ),
66
+ ]
67
+
68
+ # input_set_id option - can be used in any command that requires an input set ID.
69
+ # Define it as follows in commands or callbacks, as necessary:
70
+ # input_set_id: InputSetIDOption
71
+ InputSetIDOption = Annotated[
72
+ str,
73
+ typer.Option(
74
+ "--input-set-id",
75
+ "-s",
76
+ help="The Nextmv Cloud input set ID to use for this action.",
77
+ envvar="NEXTMV_INPUT_SET_ID",
78
+ metavar="INPUT_SET_ID",
79
+ ),
80
+ ]
81
+
82
+ # instance_id option - can be used in any command that requires an instance ID.
83
+ # Define it as follows in commands or callbacks, as necessary:
84
+ # instance_id: InstanceIDOption
85
+ InstanceIDOption = Annotated[
86
+ str,
87
+ typer.Option(
88
+ "--instance-id",
89
+ "-i",
90
+ help="The Nextmv Cloud instance ID to use for this action.",
91
+ envvar="NEXTMV_INSTANCE_ID",
92
+ metavar="INSTANCE_ID",
93
+ ),
94
+ ]
95
+
96
+ # managed_input_id option - can be used in any command that requires a managed input ID.
97
+ # Define it as follows in commands or callbacks, as necessary:
98
+ # managed_input_id: ManagedInputIDOption
99
+ ManagedInputIDOption = Annotated[
100
+ str,
101
+ typer.Option(
102
+ "--managed-input-id",
103
+ "-m",
104
+ help="The Nextmv Cloud managed input ID to use for this action.",
105
+ envvar="NEXTMV_MANAGED_INPUT_ID",
106
+ metavar="MANAGED_INPUT_ID",
107
+ ),
108
+ ]
109
+
110
+ # ensemble_definition_id option - can be used in any command that requires an ensemble definition ID.
111
+ # Define it as follows in commands or callbacks, as necessary:
112
+ # ensemble_definition_id: EnsembleDefinitionIDOption
113
+ EnsembleDefinitionIDOption = Annotated[
114
+ str,
115
+ typer.Option(
116
+ "--ensemble-definition-id",
117
+ "-e",
118
+ help="The Nextmv Cloud ensemble definition ID to use for this action.",
119
+ envvar="NEXTMV_ENSEMBLE_DEFINITION_ID",
120
+ metavar="ENSEMBLE_DEFINITION_ID",
121
+ ),
122
+ ]
123
+
124
+ # account_id option - can be used in any command that requires an account ID.
125
+ # Define it as follows in commands or callbacks, as necessary:
126
+ # account_id: AccountIDOption
127
+ AccountIDOption = Annotated[
128
+ str,
129
+ typer.Option(
130
+ "--account-id",
131
+ "-a",
132
+ help="The Nextmv Cloud account ID to use for this action.",
133
+ envvar="NEXTMV_ACCOUNT_ID",
134
+ metavar="ACCOUNT_ID",
135
+ ),
136
+ ]
137
+
138
+ # acceptance_test_id option - can be used in any command that requires an acceptance test ID.
139
+ # Define it as follows in commands or callbacks, as necessary:
140
+ # acceptance_test_id: AcceptanceTestIDOption
141
+ AcceptanceTestIDOption = Annotated[
142
+ str,
143
+ typer.Option(
144
+ "--acceptance-test-id",
145
+ "-t",
146
+ help="The Nextmv Cloud acceptance test ID to use for this action.",
147
+ envvar="NEXTMV_ACCEPTANCE_TEST_ID",
148
+ metavar="ACCEPTANCE_TEST_ID",
149
+ ),
150
+ ]
151
+
152
+ # batch_experiment_id option - can be used in any command that requires a batch experiment ID.
153
+ # Define it as follows in commands or callbacks, as necessary:
154
+ # batch_experiment_id: BatchExperimentIDOption
155
+ BatchExperimentIDOption = Annotated[
156
+ str,
157
+ typer.Option(
158
+ "--batch-experiment-id",
159
+ "-b",
160
+ help="The Nextmv Cloud batch experiment ID to use for this action.",
161
+ envvar="NEXTMV_BATCH_EXPERIMENT_ID",
162
+ metavar="BATCH_EXPERIMENT_ID",
163
+ ),
164
+ ]
165
+
166
+ # scenario_test_id option - can be used in any command that requires a scenario test ID.
167
+ # Define it as follows in commands or callbacks, as necessary:
168
+ # scenario_test_id: ScenarioTestIDOption
169
+ ScenarioTestIDOption = Annotated[
170
+ str,
171
+ typer.Option(
172
+ "--scenario-test-id",
173
+ "-i",
174
+ help="The Nextmv Cloud scenario test ID to use for this action.",
175
+ envvar="NEXTMV_SCENARIO_TEST_ID",
176
+ metavar="SCENARIO_TEST_ID",
177
+ ),
178
+ ]
179
+
180
+ # secrets_collection_id option - can be used in any command that requires a secrets collection ID.
181
+ # Define it as follows in commands or callbacks, as necessary:
182
+ # secrets_collection_id: SecretsCollectionIDOption
183
+ SecretsCollectionIDOption = Annotated[
184
+ str,
185
+ typer.Option(
186
+ "--secrets-collection-id",
187
+ "-s",
188
+ help="The Nextmv Cloud secrets collection ID to use for this action.",
189
+ envvar="NEXTMV_SECRETS_COLLECTION_ID",
190
+ metavar="SECRETS_COLLECTION_ID",
191
+ ),
192
+ ]
193
+
194
+ # shadow_test_id option - can be used in any command that requires a shadow test ID.
195
+ # Define it as follows in commands or callbacks, as necessary:
196
+ # shadow_test_id: ShadowTestIDOption
197
+ ShadowTestIDOption = Annotated[
198
+ str,
199
+ typer.Option(
200
+ "--shadow-test-id",
201
+ "-s",
202
+ help="The Nextmv Cloud shadow test ID to use for this action.",
203
+ envvar="NEXTMV_SHADOW_TEST_ID",
204
+ metavar="SHADOW_TEST_ID",
205
+ ),
206
+ ]
207
+
208
+ # switchback_test_id option - can be used in any command that requires a switchback test ID.
209
+ # Define it as follows in commands or callbacks, as necessary:
210
+ # switchback_test_id: SwitchbackTestIDOption
211
+ SwitchbackTestIDOption = Annotated[
212
+ str,
213
+ typer.Option(
214
+ "--switchback-test-id",
215
+ "-s",
216
+ help="The Nextmv Cloud switchback test ID to use for this action.",
217
+ envvar="NEXTMV_SWITCHBACK_TEST_ID",
218
+ metavar="SWITCHBACK_TEST_ID",
219
+ ),
220
+ ]
nextmv/cli/version.py CHANGED
@@ -14,6 +14,25 @@ app = typer.Typer()
14
14
  def version() -> None:
15
15
  """
16
16
  Show the current version of the Nextmv CLI.
17
+
18
+ [bold][underline]Examples[/underline][/bold]
19
+
20
+ - Show the version.
21
+ $ [dim]nextmv version[/dim]
17
22
  """
18
23
 
19
- print(__version__)
24
+ version_callback(True)
25
+
26
+
27
+ def version_callback(value: bool):
28
+ """
29
+ Callback function to display the version.
30
+
31
+ Parameters
32
+ ----------
33
+ value : bool
34
+ If True, print the version and exit.
35
+ """
36
+ if value:
37
+ print(__version__)
38
+ raise typer.Exit()
nextmv/cloud/__init__.py CHANGED
@@ -1,41 +1,5 @@
1
1
  """Functionality for interacting with the Nextmv Cloud."""
2
2
 
3
- # These imports are kept for backwards compatibility but the preferred import path is
4
- # from nextmv directly. These imports will be removed in a future release.
5
- from nextmv.manifest import MANIFEST_FILE_NAME as MANIFEST_FILE_NAME
6
- from nextmv.manifest import Manifest as Manifest
7
- from nextmv.manifest import ManifestBuild as ManifestBuild
8
- from nextmv.manifest import ManifestContent as ManifestContent
9
- from nextmv.manifest import ManifestContentMultiFile as ManifestContentMultiFile
10
- from nextmv.manifest import ManifestContentMultiFileInput as ManifestContentMultiFileInput
11
- from nextmv.manifest import ManifestContentMultiFileOutput as ManifestContentMultiFileOutput
12
- from nextmv.manifest import ManifestOption as ManifestOption
13
- from nextmv.manifest import ManifestPython as ManifestPython
14
- from nextmv.manifest import ManifestPythonModel as ManifestPythonModel
15
- from nextmv.manifest import ManifestRuntime as ManifestRuntime
16
- from nextmv.manifest import ManifestType as ManifestType
17
- from nextmv.polling import PollingOptions as PollingOptions
18
- from nextmv.run import ErrorLog as ErrorLog
19
- from nextmv.run import ExternalRunResult as ExternalRunResult
20
- from nextmv.run import Format as Format
21
- from nextmv.run import FormatInput as FormatInput
22
- from nextmv.run import FormatOutput as FormatOutput
23
- from nextmv.run import Metadata as Metadata
24
- from nextmv.run import RunConfiguration as RunConfiguration
25
- from nextmv.run import RunInformation as RunInformation
26
- from nextmv.run import RunLog as RunLog
27
- from nextmv.run import RunQueuing as RunQueuing
28
- from nextmv.run import RunResult as RunResult
29
- from nextmv.run import RunType as RunType
30
- from nextmv.run import RunTypeConfiguration as RunTypeConfiguration
31
- from nextmv.run import TrackedRun as TrackedRun
32
- from nextmv.run import TrackedRunStatus as TrackedRunStatus
33
- from nextmv.run import run_duration as run_duration
34
- from nextmv.safe import safe_id as safe_id
35
- from nextmv.safe import safe_name_and_id as safe_name_and_id
36
- from nextmv.status import Status as Status
37
- from nextmv.status import StatusV2 as StatusV2
38
-
39
3
  from .acceptance_test import AcceptanceTest as AcceptanceTest
40
4
  from .acceptance_test import AcceptanceTestResults as AcceptanceTestResults
41
5
  from .acceptance_test import Comparison as Comparison
@@ -51,12 +15,13 @@ from .acceptance_test import MetricToleranceType as MetricToleranceType
51
15
  from .acceptance_test import MetricType as MetricType
52
16
  from .acceptance_test import ResultStatistics as ResultStatistics
53
17
  from .acceptance_test import StatisticType as StatisticType
54
- from .acceptance_test import ToleranceType as ToleranceType
55
18
  from .account import Account as Account
19
+ from .account import AccountMember as AccountMember
56
20
  from .account import Queue as Queue
57
21
  from .account import QueuedRun as QueuedRun
58
22
  from .application import Application as Application
59
- from .application import poll as poll
23
+ from .application import ApplicationType as ApplicationType
24
+ from .application import list_applications as list_applications
60
25
  from .assets import RunAsset as RunAsset
61
26
  from .batch_experiment import BatchExperiment as BatchExperiment
62
27
  from .batch_experiment import BatchExperimentInformation as BatchExperimentInformation
@@ -65,6 +30,9 @@ from .batch_experiment import BatchExperimentRun as BatchExperimentRun
65
30
  from .batch_experiment import ExperimentStatus as ExperimentStatus
66
31
  from .client import Client as Client
67
32
  from .client import get_size as get_size
33
+ from .community import CommunityApp as CommunityApp
34
+ from .community import clone_community_app as clone_community_app
35
+ from .community import list_community_apps as list_community_apps
68
36
  from .ensemble import EnsembleDefinition as EnsembleDefinition
69
37
  from .ensemble import EvaluationRule as EvaluationRule
70
38
  from .ensemble import RuleObjective as RuleObjective
@@ -87,6 +55,17 @@ from .secrets import Secret as Secret
87
55
  from .secrets import SecretsCollection as SecretsCollection
88
56
  from .secrets import SecretsCollectionSummary as SecretsCollectionSummary
89
57
  from .secrets import SecretType as SecretType
58
+ from .shadow import ShadowTest as ShadowTest
59
+ from .shadow import ShadowTestMetadata as ShadowTestMetadata
60
+ from .shadow import StartEvents as StartEvents
61
+ from .shadow import StopIntent as StopIntent
62
+ from .shadow import TerminationEvents as TerminationEvents
63
+ from .shadow import TestComparison as TestComparison
64
+ from .switchback import SwitchbackPlan as SwitchbackPlan
65
+ from .switchback import SwitchbackPlanUnit as SwitchbackPlanUnit
66
+ from .switchback import SwitchbackTest as SwitchbackTest
67
+ from .switchback import SwitchbackTestMetadata as SwitchbackTestMetadata
68
+ from .switchback import TestComparisonSingle as TestComparisonSingle
90
69
  from .url import DownloadURL as DownloadURL
91
70
  from .url import UploadURL as UploadURL
92
71
  from .version import Version as Version
@@ -13,7 +13,7 @@ StatisticType : Enum
13
13
  Type of statistical process for collapsing multiple values of a metric.
14
14
  Comparison : Enum
15
15
  Comparison operators to use for comparing two metrics.
16
- ToleranceType : Enum
16
+ MetricToleranceType : Enum
17
17
  Type of tolerance used for a metric.
18
18
  ExperimentStatus : Enum
19
19
  Status of an acceptance test experiment.
@@ -46,7 +46,6 @@ from enum import Enum
46
46
 
47
47
  from nextmv.base_model import BaseModel
48
48
  from nextmv.cloud.batch_experiment import ExperimentStatus
49
- from nextmv.deprecated import deprecated
50
49
 
51
50
 
52
51
  class MetricType(str, Enum):
@@ -212,69 +211,6 @@ class Comparison(str, Enum):
212
211
  """Not equal to metric type."""
213
212
 
214
213
 
215
- class ToleranceType(str, Enum):
216
- """
217
- !!! warning
218
- `ToleranceType` is deprecated, use `MetricToleranceType` instead.
219
-
220
- Type of tolerance used for a metric.
221
-
222
- You can import the `ToleranceType` class directly from `cloud`:
223
-
224
- ```python
225
- from nextmv.cloud import ToleranceType
226
- ```
227
-
228
- This enumeration defines the different types of tolerances that can be used
229
- when comparing metrics in acceptance tests.
230
-
231
- Attributes
232
- ----------
233
- undefined : str
234
- Undefined tolerance type (empty string).
235
- absolute : str
236
- Absolute tolerance type, using a fixed value.
237
- relative : str
238
- Relative tolerance type, using a percentage.
239
-
240
- Examples
241
- --------
242
- >>> from nextmv.cloud import ToleranceType
243
- >>> tol_type = ToleranceType.absolute
244
- >>> tol_type
245
- <ToleranceType.absolute: 'absolute'>
246
- """
247
-
248
- undefined = ""
249
- """ToleranceType is deprecated, please use MetricToleranceType instead.
250
- Undefined tolerance type."""
251
- absolute = "absolute"
252
- """ToleranceType is deprecated, please use MetricToleranceType instead.
253
- Absolute tolerance type."""
254
- relative = "relative"
255
- """ToleranceType is deprecated, please use MetricToleranceType instead.
256
- Relative tolerance type."""
257
-
258
-
259
- # Override __getattribute__ to emit deprecation warnings when enum values are accessed
260
- _original_getattribute = ToleranceType.__class__.__getattribute__
261
-
262
-
263
- def _deprecated_getattribute(cls, name: str):
264
- # Only emit deprecation warning if this is specifically the ToleranceType class
265
- if cls is ToleranceType and name in ("undefined", "absolute", "relative"):
266
- deprecated(
267
- f"ToleranceType.{name}",
268
- "ToleranceType is deprecated and will be removed in a future version. "
269
- "Please use MetricToleranceType instead",
270
- )
271
-
272
- return _original_getattribute(cls, name)
273
-
274
-
275
- ToleranceType.__class__.__getattribute__ = _deprecated_getattribute
276
-
277
-
278
214
  class MetricToleranceType(str, Enum):
279
215
  """
280
216
  Type of tolerance used for a metric.
@@ -888,20 +824,20 @@ class AcceptanceTest(BaseModel):
888
824
  Name of the acceptance test.
889
825
  description : str
890
826
  Description of the acceptance test.
891
- app_id : str
827
+ created_at : datetime
828
+ Creation date of the acceptance test.
829
+ updated_at : datetime
830
+ Last update date of the acceptance test.
831
+ app_id : str, optional
892
832
  ID of the app that owns the acceptance test.
893
- experiment_id : str
833
+ experiment_id : str, optional
894
834
  ID of the batch experiment underlying the acceptance test.
895
- control : ComparisonInstance
835
+ control : ComparisonInstance, optional
896
836
  Control instance of the acceptance test.
897
- candidate : ComparisonInstance
837
+ candidate : ComparisonInstance, optional
898
838
  Candidate instance of the acceptance test.
899
- metrics : list[Metric]
839
+ metrics : list[Metric], optional
900
840
  Metrics to evaluate in the acceptance test.
901
- created_at : datetime
902
- Creation date of the acceptance test.
903
- updated_at : datetime
904
- Last update date of the acceptance test.
905
841
  status : ExperimentStatus, optional
906
842
  Status of the acceptance test.
907
843
  results : AcceptanceTestResults, optional
@@ -942,20 +878,21 @@ class AcceptanceTest(BaseModel):
942
878
  """Name of the acceptance test."""
943
879
  description: str
944
880
  """Description of the acceptance test."""
945
- app_id: str
881
+ created_at: datetime
882
+ """Creation date of the acceptance test."""
883
+ updated_at: datetime
884
+ """Last update date of the acceptance test."""
885
+
886
+ app_id: str | None = None
946
887
  """ID of the app that owns the acceptance test."""
947
- experiment_id: str
888
+ experiment_id: str | None = None
948
889
  """ID of the batch experiment underlying in the acceptance test."""
949
- control: ComparisonInstance
890
+ control: ComparisonInstance | None = None
950
891
  """Control instance of the acceptance test."""
951
- candidate: ComparisonInstance
892
+ candidate: ComparisonInstance | None = None
952
893
  """Candidate instance of the acceptance test."""
953
- metrics: list[Metric]
894
+ metrics: list[Metric] | None = None
954
895
  """Metrics of the acceptance test."""
955
- created_at: datetime
956
- """Creation date of the acceptance test."""
957
- updated_at: datetime
958
- """Last update date of the acceptance test."""
959
896
  status: ExperimentStatus | None = ExperimentStatus.UNKNOWN
960
897
  """Status of the acceptance test."""
961
898
  results: AcceptanceTestResults | None = None