nextmv 0.18.0__py3-none-any.whl → 1.0.0.dev2__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 +8 -13
- nextmv/__init__.py +53 -0
- nextmv/_serialization.py +96 -0
- nextmv/base_model.py +54 -9
- nextmv/cli/CONTRIBUTING.md +511 -0
- nextmv/cli/__init__.py +0 -0
- nextmv/cli/cloud/__init__.py +47 -0
- nextmv/cli/cloud/acceptance/__init__.py +27 -0
- nextmv/cli/cloud/acceptance/create.py +393 -0
- nextmv/cli/cloud/acceptance/delete.py +68 -0
- nextmv/cli/cloud/acceptance/get.py +104 -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 +60 -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 +141 -0
- nextmv/cli/cloud/app/delete.py +58 -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 +137 -0
- nextmv/cli/cloud/app/update.py +124 -0
- nextmv/cli/cloud/batch/__init__.py +29 -0
- nextmv/cli/cloud/batch/create.py +454 -0
- nextmv/cli/cloud/batch/delete.py +68 -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 +31 -0
- nextmv/cli/cloud/ensemble/create.py +414 -0
- nextmv/cli/cloud/ensemble/delete.py +67 -0
- nextmv/cli/cloud/ensemble/get.py +65 -0
- nextmv/cli/cloud/ensemble/update.py +103 -0
- nextmv/cli/cloud/input_set/__init__.py +30 -0
- nextmv/cli/cloud/input_set/create.py +170 -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 +290 -0
- nextmv/cli/cloud/instance/delete.py +62 -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 +146 -0
- nextmv/cli/cloud/managed_input/delete.py +65 -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 +530 -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 +167 -0
- nextmv/cli/cloud/run/metadata.py +67 -0
- nextmv/cli/cloud/run/track.py +501 -0
- nextmv/cli/cloud/scenario/__init__.py +29 -0
- nextmv/cli/cloud/scenario/create.py +451 -0
- nextmv/cli/cloud/scenario/delete.py +65 -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 +67 -0
- nextmv/cli/cloud/secrets/get.py +66 -0
- nextmv/cli/cloud/secrets/list.py +60 -0
- nextmv/cli/cloud/secrets/update.py +147 -0
- nextmv/cli/cloud/shadow/__init__.py +33 -0
- nextmv/cli/cloud/shadow/create.py +184 -0
- nextmv/cli/cloud/shadow/delete.py +68 -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 +43 -0
- nextmv/cli/cloud/shadow/update.py +95 -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 +97 -0
- nextmv/cli/cloud/version/delete.py +62 -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 +270 -0
- nextmv/cli/community/list.py +265 -0
- nextmv/cli/configuration/__init__.py +23 -0
- nextmv/cli/configuration/config.py +195 -0
- nextmv/cli/configuration/create.py +94 -0
- nextmv/cli/configuration/delete.py +67 -0
- nextmv/cli/configuration/list.py +77 -0
- nextmv/cli/main.py +188 -0
- nextmv/cli/message.py +153 -0
- nextmv/cli/options.py +206 -0
- nextmv/cli/version.py +38 -0
- nextmv/cloud/__init__.py +71 -17
- nextmv/cloud/acceptance_test.py +757 -51
- nextmv/cloud/account.py +406 -17
- nextmv/cloud/application/__init__.py +957 -0
- nextmv/cloud/application/_acceptance.py +419 -0
- nextmv/cloud/application/_batch_scenario.py +860 -0
- nextmv/cloud/application/_ensemble.py +251 -0
- nextmv/cloud/application/_input_set.py +227 -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 +314 -0
- nextmv/cloud/application/_utils.py +54 -0
- nextmv/cloud/application/_version.py +303 -0
- nextmv/cloud/assets.py +48 -0
- nextmv/cloud/batch_experiment.py +294 -33
- nextmv/cloud/client.py +307 -66
- nextmv/cloud/ensemble.py +247 -0
- nextmv/cloud/input_set.py +120 -2
- nextmv/cloud/instance.py +133 -8
- nextmv/cloud/integration.py +533 -0
- nextmv/cloud/package.py +168 -53
- nextmv/cloud/scenario.py +410 -0
- nextmv/cloud/secrets.py +234 -0
- nextmv/cloud/shadow.py +190 -0
- nextmv/cloud/url.py +73 -0
- nextmv/cloud/version.py +132 -4
- nextmv/default_app/.gitignore +1 -0
- nextmv/default_app/README.md +32 -0
- nextmv/default_app/app.yaml +12 -0
- nextmv/default_app/input.json +5 -0
- nextmv/default_app/main.py +37 -0
- nextmv/default_app/requirements.txt +2 -0
- nextmv/default_app/src/__init__.py +0 -0
- nextmv/default_app/src/visuals.py +36 -0
- nextmv/deprecated.py +47 -0
- nextmv/input.py +861 -90
- nextmv/local/__init__.py +5 -0
- nextmv/local/application.py +1251 -0
- nextmv/local/executor.py +1042 -0
- nextmv/local/geojson_handler.py +323 -0
- nextmv/local/local.py +97 -0
- nextmv/local/plotly_handler.py +61 -0
- nextmv/local/runner.py +274 -0
- nextmv/logger.py +80 -9
- nextmv/manifest.py +1466 -0
- nextmv/model.py +241 -66
- nextmv/options.py +708 -115
- nextmv/output.py +1301 -274
- nextmv/polling.py +325 -0
- nextmv/run.py +1702 -0
- nextmv/safe.py +145 -0
- nextmv/status.py +122 -0
- nextmv-1.0.0.dev2.dist-info/METADATA +311 -0
- nextmv-1.0.0.dev2.dist-info/RECORD +170 -0
- {nextmv-0.18.0.dist-info → nextmv-1.0.0.dev2.dist-info}/WHEEL +1 -1
- nextmv-1.0.0.dev2.dist-info/entry_points.txt +2 -0
- nextmv/cloud/application.py +0 -1405
- nextmv/cloud/manifest.py +0 -234
- nextmv/cloud/status.py +0 -29
- nextmv-0.18.0.dist-info/METADATA +0 -770
- nextmv-0.18.0.dist-info/RECORD +0 -25
- {nextmv-0.18.0.dist-info → nextmv-1.0.0.dev2.dist-info}/licenses/LICENSE +0 -0
nextmv/cli/message.py
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
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 error(msg: str) -> None:
|
|
15
|
+
"""
|
|
16
|
+
Pretty-print an error message and exit with code 1. Your message should end
|
|
17
|
+
with a period.
|
|
18
|
+
|
|
19
|
+
Parameters
|
|
20
|
+
----------
|
|
21
|
+
msg : str
|
|
22
|
+
The error message to display.
|
|
23
|
+
|
|
24
|
+
Raises
|
|
25
|
+
------
|
|
26
|
+
typer.Exit
|
|
27
|
+
Exits the program with code 1.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
msg = msg.rstrip("\n")
|
|
31
|
+
if not msg.endswith("."):
|
|
32
|
+
msg += "."
|
|
33
|
+
|
|
34
|
+
rich.print(f"[red]Error:[/red] {msg}", file=sys.stderr)
|
|
35
|
+
|
|
36
|
+
raise typer.Exit(code=1)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def success(msg: str) -> None:
|
|
40
|
+
"""
|
|
41
|
+
Pretty-print a success message. Your message should end with a period.
|
|
42
|
+
|
|
43
|
+
Parameters
|
|
44
|
+
----------
|
|
45
|
+
msg : str
|
|
46
|
+
The success message to display.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
msg = msg.rstrip("\n")
|
|
50
|
+
if not msg.endswith("."):
|
|
51
|
+
msg += "."
|
|
52
|
+
|
|
53
|
+
rich.print(f":white_check_mark: {msg}", file=sys.stderr)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def warning(msg: str) -> None:
|
|
57
|
+
"""
|
|
58
|
+
Pretty-print a warning message. Your message should end with a period.
|
|
59
|
+
|
|
60
|
+
Parameters
|
|
61
|
+
----------
|
|
62
|
+
msg : str
|
|
63
|
+
The warning message to display.
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
msg = msg.rstrip("\n")
|
|
67
|
+
if not msg.endswith("."):
|
|
68
|
+
msg += "."
|
|
69
|
+
|
|
70
|
+
rich.print(f":construction: {msg}", file=sys.stderr)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def info(msg: str, emoji: str | None = None) -> None:
|
|
74
|
+
"""
|
|
75
|
+
Pretty-print an informational message. Your message should end with a
|
|
76
|
+
period. The use of emojis is encouraged to give context to the message. An
|
|
77
|
+
emoji should be a string as specified in:
|
|
78
|
+
https://rich.readthedocs.io/en/latest/markup.html#emoji.
|
|
79
|
+
|
|
80
|
+
Parameters
|
|
81
|
+
----------
|
|
82
|
+
msg : str
|
|
83
|
+
The informational message to display.
|
|
84
|
+
emoji : str | None
|
|
85
|
+
An optional emoji to prefix the message. If None, no emoji is used. The
|
|
86
|
+
emoji should be a string as specified in:
|
|
87
|
+
https://rich.readthedocs.io/en/latest/markup.html#emoji. For example:
|
|
88
|
+
`:hourglass_flowing_sand:`.
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
msg = msg.rstrip("\n")
|
|
92
|
+
if not msg.endswith("."):
|
|
93
|
+
msg += "."
|
|
94
|
+
|
|
95
|
+
if emoji:
|
|
96
|
+
rich.print(f"{emoji} {msg}", file=sys.stderr)
|
|
97
|
+
return
|
|
98
|
+
|
|
99
|
+
rich.print(msg, file=sys.stderr)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def in_progress(msg: str) -> None:
|
|
103
|
+
"""
|
|
104
|
+
Pretty-print an in-progress message with an hourglass emoji. Your message
|
|
105
|
+
should end with a period.
|
|
106
|
+
|
|
107
|
+
Parameters
|
|
108
|
+
----------
|
|
109
|
+
msg : str
|
|
110
|
+
The in-progress message to display.
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
info(msg, emoji=":hourglass_flowing_sand:")
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def print_json(data: dict[str, Any] | list[dict[str, Any]]) -> None:
|
|
117
|
+
"""
|
|
118
|
+
Pretty-print json-serializable data as JSON to stdout.
|
|
119
|
+
|
|
120
|
+
Parameters
|
|
121
|
+
----------
|
|
122
|
+
data : dict[str, Any] | list[dict[str, Any]]
|
|
123
|
+
The data to print as JSON.
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
rich.print_json(data=data)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def enum_values(enum_class: Enum) -> str:
|
|
130
|
+
"""
|
|
131
|
+
Get a nicely formatted string of the values of an Enum class, using commas
|
|
132
|
+
and an oxford comma.
|
|
133
|
+
|
|
134
|
+
Parameters
|
|
135
|
+
----------
|
|
136
|
+
enum_class : Enum
|
|
137
|
+
The Enum class to get the values from.
|
|
138
|
+
|
|
139
|
+
Returns
|
|
140
|
+
-------
|
|
141
|
+
str
|
|
142
|
+
A nicely formatted string of the values of the Enum class.
|
|
143
|
+
"""
|
|
144
|
+
|
|
145
|
+
values = [f"[magenta]{member.value}[/magenta]" for member in enum_class]
|
|
146
|
+
if len(values) == 0:
|
|
147
|
+
return ""
|
|
148
|
+
if len(values) == 1:
|
|
149
|
+
return values[0]
|
|
150
|
+
if len(values) == 2:
|
|
151
|
+
return " and ".join(values)
|
|
152
|
+
|
|
153
|
+
return ", ".join(values[:-1]) + ", and " + values[-1]
|
nextmv/cli/options.py
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Shared CLI options for the Nextmv CLI.
|
|
3
|
+
|
|
4
|
+
This module defines reusable option types that can be imported
|
|
5
|
+
and used across all CLI commands.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from typing import Annotated
|
|
9
|
+
|
|
10
|
+
import typer
|
|
11
|
+
|
|
12
|
+
# profile option - can be used in any command to specify which profile to use.
|
|
13
|
+
# Define it as follows in commands or callbacks, as necessary:
|
|
14
|
+
# profile: ProfileOption = None
|
|
15
|
+
ProfileOption = Annotated[
|
|
16
|
+
str | None,
|
|
17
|
+
typer.Option(
|
|
18
|
+
"--profile",
|
|
19
|
+
"-p",
|
|
20
|
+
help="Profile to use for this action. Use [code]nextmv configuration[/code] to manage profiles.",
|
|
21
|
+
envvar="NEXTMV_PROFILE",
|
|
22
|
+
metavar="PROFILE_NAME",
|
|
23
|
+
),
|
|
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
|
+
]
|
nextmv/cli/version.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module defines the version command for the Nextmv CLI.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from nextmv.__about__ import __version__
|
|
8
|
+
|
|
9
|
+
# Set up subcommand application.
|
|
10
|
+
app = typer.Typer()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@app.command()
|
|
14
|
+
def version() -> None:
|
|
15
|
+
"""
|
|
16
|
+
Show the current version of the Nextmv CLI.
|
|
17
|
+
|
|
18
|
+
[bold][underline]Examples[/underline][/bold]
|
|
19
|
+
|
|
20
|
+
- Show the version.
|
|
21
|
+
$ [green]nextmv version[/green]
|
|
22
|
+
"""
|
|
23
|
+
|
|
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,48 +1,102 @@
|
|
|
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.polling import poll as poll
|
|
19
|
+
from nextmv.run import ErrorLog as ErrorLog
|
|
20
|
+
from nextmv.run import ExternalRunResult as ExternalRunResult
|
|
21
|
+
from nextmv.run import Format as Format
|
|
22
|
+
from nextmv.run import FormatInput as FormatInput
|
|
23
|
+
from nextmv.run import FormatOutput as FormatOutput
|
|
24
|
+
from nextmv.run import Metadata as Metadata
|
|
25
|
+
from nextmv.run import RunConfiguration as RunConfiguration
|
|
26
|
+
from nextmv.run import RunInformation as RunInformation
|
|
27
|
+
from nextmv.run import RunLog as RunLog
|
|
28
|
+
from nextmv.run import RunQueuing as RunQueuing
|
|
29
|
+
from nextmv.run import RunResult as RunResult
|
|
30
|
+
from nextmv.run import RunType as RunType
|
|
31
|
+
from nextmv.run import RunTypeConfiguration as RunTypeConfiguration
|
|
32
|
+
from nextmv.run import TrackedRun as TrackedRun
|
|
33
|
+
from nextmv.run import TrackedRunStatus as TrackedRunStatus
|
|
34
|
+
from nextmv.run import run_duration as run_duration
|
|
35
|
+
from nextmv.safe import safe_id as safe_id
|
|
36
|
+
from nextmv.safe import safe_name_and_id as safe_name_and_id
|
|
37
|
+
from nextmv.status import Status as Status
|
|
38
|
+
from nextmv.status import StatusV2 as StatusV2
|
|
39
|
+
|
|
3
40
|
from .acceptance_test import AcceptanceTest as AcceptanceTest
|
|
4
41
|
from .acceptance_test import AcceptanceTestResults as AcceptanceTestResults
|
|
5
42
|
from .acceptance_test import Comparison as Comparison
|
|
6
43
|
from .acceptance_test import ComparisonInstance as ComparisonInstance
|
|
7
44
|
from .acceptance_test import DistributionPercentiles as DistributionPercentiles
|
|
8
45
|
from .acceptance_test import DistributionSummaryStatistics as DistributionSummaryStatistics
|
|
9
|
-
from .acceptance_test import ExperimentStatus as ExperimentStatus
|
|
10
46
|
from .acceptance_test import Metric as Metric
|
|
11
47
|
from .acceptance_test import MetricParams as MetricParams
|
|
12
48
|
from .acceptance_test import MetricResult as MetricResult
|
|
13
49
|
from .acceptance_test import MetricStatistics as MetricStatistics
|
|
14
50
|
from .acceptance_test import MetricTolerance as MetricTolerance
|
|
51
|
+
from .acceptance_test import MetricToleranceType as MetricToleranceType
|
|
15
52
|
from .acceptance_test import MetricType as MetricType
|
|
16
53
|
from .acceptance_test import ResultStatistics as ResultStatistics
|
|
17
54
|
from .acceptance_test import StatisticType as StatisticType
|
|
18
55
|
from .acceptance_test import ToleranceType as ToleranceType
|
|
19
56
|
from .account import Account as Account
|
|
57
|
+
from .account import AccountMember as AccountMember
|
|
20
58
|
from .account import Queue as Queue
|
|
21
59
|
from .account import QueuedRun as QueuedRun
|
|
22
60
|
from .application import Application as Application
|
|
23
|
-
from .application import
|
|
24
|
-
from .application import
|
|
25
|
-
from .
|
|
26
|
-
from .application import PollingOptions as PollingOptions
|
|
27
|
-
from .application import RunInformation as RunInformation
|
|
28
|
-
from .application import RunResult as RunResult
|
|
29
|
-
from .application import UploadURL as UploadURL
|
|
61
|
+
from .application import ApplicationType as ApplicationType
|
|
62
|
+
from .application import list_applications as list_applications
|
|
63
|
+
from .assets import RunAsset as RunAsset
|
|
30
64
|
from .batch_experiment import BatchExperiment as BatchExperiment
|
|
31
65
|
from .batch_experiment import BatchExperimentInformation as BatchExperimentInformation
|
|
32
66
|
from .batch_experiment import BatchExperimentMetadata as BatchExperimentMetadata
|
|
33
67
|
from .batch_experiment import BatchExperimentRun as BatchExperimentRun
|
|
68
|
+
from .batch_experiment import ExperimentStatus as ExperimentStatus
|
|
34
69
|
from .client import Client as Client
|
|
70
|
+
from .client import get_size as get_size
|
|
71
|
+
from .ensemble import EnsembleDefinition as EnsembleDefinition
|
|
72
|
+
from .ensemble import EvaluationRule as EvaluationRule
|
|
73
|
+
from .ensemble import RuleObjective as RuleObjective
|
|
74
|
+
from .ensemble import RuleTolerance as RuleTolerance
|
|
75
|
+
from .ensemble import RuleToleranceType as RuleToleranceType
|
|
76
|
+
from .ensemble import RunGroup as RunGroup
|
|
35
77
|
from .input_set import InputSet as InputSet
|
|
36
|
-
from .
|
|
78
|
+
from .input_set import ManagedInput as ManagedInput
|
|
37
79
|
from .instance import Instance as Instance
|
|
38
|
-
from .
|
|
39
|
-
from .
|
|
40
|
-
from .
|
|
41
|
-
from .
|
|
42
|
-
from .
|
|
43
|
-
from .
|
|
44
|
-
from .
|
|
45
|
-
from .
|
|
80
|
+
from .instance import InstanceConfiguration as InstanceConfiguration
|
|
81
|
+
from .integration import Integration as Integration
|
|
82
|
+
from .integration import IntegrationProvider as IntegrationProvider
|
|
83
|
+
from .integration import IntegrationType as IntegrationType
|
|
84
|
+
from .integration import list_integrations as list_integrations
|
|
85
|
+
from .scenario import Scenario as Scenario
|
|
86
|
+
from .scenario import ScenarioConfiguration as ScenarioConfiguration
|
|
87
|
+
from .scenario import ScenarioInput as ScenarioInput
|
|
88
|
+
from .scenario import ScenarioInputType as ScenarioInputType
|
|
89
|
+
from .secrets import Secret as Secret
|
|
90
|
+
from .secrets import SecretsCollection as SecretsCollection
|
|
91
|
+
from .secrets import SecretsCollectionSummary as SecretsCollectionSummary
|
|
92
|
+
from .secrets import SecretType as SecretType
|
|
93
|
+
from .shadow import ShadowTest as ShadowTest
|
|
94
|
+
from .shadow import ShadowTestMetadata as ShadowTestMetadata
|
|
95
|
+
from .shadow import StartEvents as StartEvents
|
|
96
|
+
from .shadow import TerminationEvents as TerminationEvents
|
|
97
|
+
from .shadow import TestComparison as TestComparison
|
|
98
|
+
from .url import DownloadURL as DownloadURL
|
|
99
|
+
from .url import UploadURL as UploadURL
|
|
46
100
|
from .version import Version as Version
|
|
47
101
|
from .version import VersionExecutable as VersionExecutable
|
|
48
102
|
from .version import VersionExecutableRequirements as VersionExecutableRequirements
|