nextmv 1.0.0__py3-none-any.whl → 1.0.0.dev0__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 +2 -1
- nextmv/__init__.py +4 -0
- nextmv/cli/CONTRIBUTING.md +40 -112
- nextmv/cli/cloud/__init__.py +0 -4
- nextmv/cli/cloud/acceptance/create.py +22 -20
- nextmv/cli/cloud/acceptance/delete.py +12 -8
- nextmv/cli/cloud/acceptance/get.py +10 -9
- nextmv/cli/cloud/acceptance/list.py +3 -3
- nextmv/cli/cloud/acceptance/update.py +6 -6
- nextmv/cli/cloud/account/__init__.py +3 -3
- nextmv/cli/cloud/account/create.py +11 -11
- nextmv/cli/cloud/account/delete.py +8 -7
- nextmv/cli/cloud/account/get.py +3 -3
- nextmv/cli/cloud/account/update.py +5 -5
- nextmv/cli/cloud/app/create.py +26 -25
- nextmv/cli/cloud/app/delete.py +7 -6
- nextmv/cli/cloud/app/exists.py +2 -2
- nextmv/cli/cloud/app/get.py +2 -2
- nextmv/cli/cloud/app/list.py +3 -3
- nextmv/cli/cloud/app/push.py +54 -349
- nextmv/cli/cloud/app/update.py +12 -12
- nextmv/cli/cloud/batch/create.py +28 -26
- nextmv/cli/cloud/batch/delete.py +10 -6
- nextmv/cli/cloud/batch/get.py +9 -9
- nextmv/cli/cloud/batch/list.py +3 -3
- nextmv/cli/cloud/batch/metadata.py +4 -4
- nextmv/cli/cloud/batch/update.py +6 -6
- nextmv/cli/cloud/data/__init__.py +1 -1
- nextmv/cli/cloud/data/upload.py +15 -15
- nextmv/cli/cloud/ensemble/__init__.py +0 -2
- nextmv/cli/cloud/ensemble/create.py +22 -21
- nextmv/cli/cloud/ensemble/delete.py +10 -6
- nextmv/cli/cloud/ensemble/get.py +4 -4
- nextmv/cli/cloud/ensemble/update.py +9 -9
- nextmv/cli/cloud/input_set/__init__.py +0 -2
- nextmv/cli/cloud/input_set/create.py +22 -22
- nextmv/cli/cloud/input_set/get.py +3 -3
- nextmv/cli/cloud/input_set/list.py +3 -3
- nextmv/cli/cloud/input_set/update.py +24 -24
- nextmv/cli/cloud/instance/create.py +15 -14
- nextmv/cli/cloud/instance/delete.py +7 -6
- nextmv/cli/cloud/instance/exists.py +2 -2
- nextmv/cli/cloud/instance/get.py +2 -2
- nextmv/cli/cloud/instance/list.py +3 -3
- nextmv/cli/cloud/instance/update.py +14 -14
- nextmv/cli/cloud/managed_input/create.py +16 -14
- nextmv/cli/cloud/managed_input/delete.py +8 -7
- nextmv/cli/cloud/managed_input/get.py +3 -3
- nextmv/cli/cloud/managed_input/list.py +3 -3
- nextmv/cli/cloud/managed_input/update.py +9 -9
- nextmv/cli/cloud/run/cancel.py +2 -2
- nextmv/cli/cloud/run/create.py +40 -34
- nextmv/cli/cloud/run/get.py +8 -8
- nextmv/cli/cloud/run/input.py +4 -4
- nextmv/cli/cloud/run/list.py +6 -6
- nextmv/cli/cloud/run/logs.py +10 -9
- nextmv/cli/cloud/run/metadata.py +4 -4
- nextmv/cli/cloud/run/track.py +33 -32
- nextmv/cli/cloud/scenario/create.py +21 -21
- nextmv/cli/cloud/scenario/delete.py +10 -6
- nextmv/cli/cloud/scenario/get.py +9 -9
- nextmv/cli/cloud/scenario/list.py +3 -3
- nextmv/cli/cloud/scenario/metadata.py +4 -4
- nextmv/cli/cloud/scenario/update.py +6 -6
- nextmv/cli/cloud/secrets/create.py +17 -17
- nextmv/cli/cloud/secrets/delete.py +10 -6
- nextmv/cli/cloud/secrets/get.py +4 -4
- nextmv/cli/cloud/secrets/list.py +3 -3
- nextmv/cli/cloud/secrets/update.py +20 -17
- nextmv/cli/cloud/upload/create.py +2 -2
- nextmv/cli/cloud/version/create.py +10 -9
- nextmv/cli/cloud/version/delete.py +7 -6
- nextmv/cli/cloud/version/exists.py +2 -2
- nextmv/cli/cloud/version/get.py +2 -2
- nextmv/cli/cloud/version/list.py +3 -3
- nextmv/cli/cloud/version/update.py +8 -8
- nextmv/cli/community/__init__.py +1 -1
- nextmv/cli/community/clone.py +204 -20
- nextmv/cli/community/list.py +125 -60
- nextmv/cli/configuration/config.py +10 -43
- nextmv/cli/configuration/create.py +7 -7
- nextmv/cli/configuration/delete.py +8 -8
- nextmv/cli/configuration/list.py +3 -3
- nextmv/cli/main.py +36 -26
- nextmv/cli/message.py +54 -71
- nextmv/cli/options.py +0 -28
- nextmv/cli/version.py +1 -1
- nextmv/cloud/__init__.py +38 -14
- nextmv/cloud/acceptance_test.py +65 -1
- nextmv/cloud/account.py +6 -1
- nextmv/cloud/application/__init__.py +75 -18
- nextmv/cloud/application/_acceptance.py +8 -13
- nextmv/cloud/application/_batch_scenario.py +19 -4
- nextmv/cloud/application/_input_set.py +6 -42
- nextmv/cloud/application/_instance.py +3 -3
- nextmv/cloud/application/_managed_input.py +2 -2
- nextmv/cloud/application/_version.py +3 -4
- nextmv/cloud/batch_experiment.py +1 -3
- nextmv/cloud/integration.py +4 -7
- nextmv/deprecated.py +3 -5
- nextmv/input.py +52 -0
- nextmv/local/runner.py +1 -1
- nextmv/model.py +11 -50
- nextmv/options.py +256 -11
- nextmv/output.py +62 -0
- nextmv/run.py +10 -1
- nextmv/status.py +51 -1
- {nextmv-1.0.0.dist-info → nextmv-1.0.0.dev0.dist-info}/METADATA +4 -5
- nextmv-1.0.0.dev0.dist-info/RECORD +158 -0
- nextmv/cli/cloud/ensemble/list.py +0 -63
- nextmv/cli/cloud/input_set/delete.py +0 -64
- nextmv/cli/cloud/shadow/__init__.py +0 -33
- nextmv/cli/cloud/shadow/create.py +0 -184
- nextmv/cli/cloud/shadow/delete.py +0 -64
- nextmv/cli/cloud/shadow/get.py +0 -61
- nextmv/cli/cloud/shadow/list.py +0 -63
- nextmv/cli/cloud/shadow/metadata.py +0 -66
- nextmv/cli/cloud/shadow/start.py +0 -43
- nextmv/cli/cloud/shadow/stop.py +0 -53
- nextmv/cli/cloud/shadow/update.py +0 -96
- nextmv/cli/cloud/switchback/__init__.py +0 -33
- nextmv/cli/cloud/switchback/create.py +0 -151
- nextmv/cli/cloud/switchback/delete.py +0 -64
- nextmv/cli/cloud/switchback/get.py +0 -62
- nextmv/cli/cloud/switchback/list.py +0 -63
- nextmv/cli/cloud/switchback/metadata.py +0 -68
- nextmv/cli/cloud/switchback/start.py +0 -43
- nextmv/cli/cloud/switchback/stop.py +0 -53
- nextmv/cli/cloud/switchback/update.py +0 -96
- nextmv/cli/confirm.py +0 -34
- nextmv/cloud/application/_shadow.py +0 -320
- nextmv/cloud/application/_switchback.py +0 -332
- nextmv/cloud/community.py +0 -446
- nextmv/cloud/shadow.py +0 -254
- nextmv/cloud/switchback.py +0 -228
- nextmv-1.0.0.dist-info/RECORD +0 -185
- nextmv-1.0.0.dist-info/entry_points.txt +0 -2
- {nextmv-1.0.0.dist-info → nextmv-1.0.0.dev0.dist-info}/WHEEL +0 -0
- {nextmv-1.0.0.dist-info → nextmv-1.0.0.dev0.dist-info}/licenses/LICENSE +0 -0
|
@@ -5,9 +5,9 @@ This module defines the cloud scenario delete command for the Nextmv CLI.
|
|
|
5
5
|
from typing import Annotated
|
|
6
6
|
|
|
7
7
|
import typer
|
|
8
|
+
from rich.prompt import Confirm
|
|
8
9
|
|
|
9
10
|
from nextmv.cli.configuration.config import build_app
|
|
10
|
-
from nextmv.cli.confirm import get_confirmation
|
|
11
11
|
from nextmv.cli.message import info, success
|
|
12
12
|
from nextmv.cli.options import AppIDOption, ProfileOption, ScenarioTestIDOption
|
|
13
13
|
|
|
@@ -33,27 +33,31 @@ def delete(
|
|
|
33
33
|
Deletes a Nextmv Cloud scenario test.
|
|
34
34
|
|
|
35
35
|
This action is permanent and cannot be undone. The scenario test and all
|
|
36
|
-
associated data will be deleted. Use the --yes flag to skip
|
|
36
|
+
associated data will be deleted. Use the [code]--yes[/code] flag to skip
|
|
37
37
|
the confirmation prompt.
|
|
38
38
|
|
|
39
39
|
[bold][underline]Examples[/underline][/bold]
|
|
40
40
|
|
|
41
41
|
- Delete the scenario test with the ID [magenta]hop-analysis[/magenta] from application
|
|
42
42
|
[magenta]hare-app[/magenta].
|
|
43
|
-
$ [
|
|
43
|
+
$ [green]nextmv cloud scenario delete --app-id hare-app --scenario-test-id hop-analysis[/green]
|
|
44
44
|
|
|
45
45
|
- Delete the scenario test without confirmation prompt.
|
|
46
|
-
$ [
|
|
46
|
+
$ [green]nextmv cloud scenario delete --app-id hare-app --scenario-test-id carrot-routes --yes[/green]
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
49
|
if not yes:
|
|
50
|
-
confirm =
|
|
50
|
+
confirm = Confirm.ask(
|
|
51
51
|
f"Are you sure you want to delete scenario test [magenta]{scenario_test_id}[/magenta] "
|
|
52
52
|
f"from application [magenta]{app_id}[/magenta]? This action cannot be undone.",
|
|
53
|
+
default=False,
|
|
53
54
|
)
|
|
54
55
|
|
|
55
56
|
if not confirm:
|
|
56
|
-
info(
|
|
57
|
+
info(
|
|
58
|
+
msg=f"Scenario test [magenta]{scenario_test_id}[/magenta] will not be deleted.",
|
|
59
|
+
emoji=":bulb:",
|
|
60
|
+
)
|
|
57
61
|
return
|
|
58
62
|
|
|
59
63
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
nextmv/cli/cloud/scenario/get.py
CHANGED
|
@@ -42,16 +42,16 @@ def get(
|
|
|
42
42
|
"--wait",
|
|
43
43
|
"-w",
|
|
44
44
|
help="Wait for the scenario test to complete. Results are printed to [magenta]stdout[/magenta]. "
|
|
45
|
-
"Specify output location with --output.",
|
|
45
|
+
"Specify output location with [code]--output[/code].",
|
|
46
46
|
),
|
|
47
47
|
] = False,
|
|
48
48
|
profile: ProfileOption = None,
|
|
49
49
|
) -> None:
|
|
50
50
|
"""
|
|
51
|
-
Get a Nextmv Cloud scenario test
|
|
51
|
+
Get a Nextmv Cloud scenario test.
|
|
52
52
|
|
|
53
|
-
Use the --wait flag to wait for the scenario test to
|
|
54
|
-
complete, polling for results. Using the --output flag will
|
|
53
|
+
Use the [code]--wait[/code] flag to wait for the scenario test to
|
|
54
|
+
complete, polling for results. Using the [code]--output[/code] flag will
|
|
55
55
|
also activate waiting, and allows you to specify a destination file for the
|
|
56
56
|
results.
|
|
57
57
|
|
|
@@ -59,17 +59,17 @@ def get(
|
|
|
59
59
|
|
|
60
60
|
- Get the scenario test with ID [magenta]carrot-optimization[/magenta] from application
|
|
61
61
|
[magenta]hare-app[/magenta].
|
|
62
|
-
$ [
|
|
62
|
+
$ [green]nextmv cloud scenario get --app-id hare-app --scenario-test-id carrot-optimization[/green]
|
|
63
63
|
|
|
64
64
|
- Get the scenario test and wait for it to complete if necessary.
|
|
65
|
-
$ [
|
|
65
|
+
$ [green]nextmv cloud scenario get --app-id hare-app --scenario-test-id bunny-hop-test --wait[/green]
|
|
66
66
|
|
|
67
67
|
- Get the scenario test and save the results to a file.
|
|
68
|
-
$ [
|
|
69
|
-
--output results.json[/
|
|
68
|
+
$ [green]nextmv cloud scenario get --app-id hare-app --scenario-test-id warren-planning \\
|
|
69
|
+
--output results.json[/green]
|
|
70
70
|
|
|
71
71
|
- Get the scenario test using a specific profile.
|
|
72
|
-
$ [
|
|
72
|
+
$ [green]nextmv cloud scenario get --app-id hare-app --scenario-test-id lettuce-routes --profile prod[/green]
|
|
73
73
|
"""
|
|
74
74
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
75
75
|
|
|
@@ -38,13 +38,13 @@ def list(
|
|
|
38
38
|
[bold][underline]Examples[/underline][/bold]
|
|
39
39
|
|
|
40
40
|
- List all scenario tests for application [magenta]hare-app[/magenta].
|
|
41
|
-
$ [
|
|
41
|
+
$ [green]nextmv cloud scenario list --app-id hare-app[/green]
|
|
42
42
|
|
|
43
43
|
- List all scenario tests and save to a file.
|
|
44
|
-
$ [
|
|
44
|
+
$ [green]nextmv cloud scenario list --app-id hare-app --output scenario_tests.json[/green]
|
|
45
45
|
|
|
46
46
|
- List all scenario tests using a specific profile.
|
|
47
|
-
$ [
|
|
47
|
+
$ [green]nextmv cloud scenario list --app-id hare-app --profile prod[/green]
|
|
48
48
|
"""
|
|
49
49
|
|
|
50
50
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
@@ -41,14 +41,14 @@ def metadata(
|
|
|
41
41
|
|
|
42
42
|
- Get metadata for scenario test [magenta]bunny-warren-optimization[/magenta] from application
|
|
43
43
|
[magenta]hare-app[/magenta].
|
|
44
|
-
$ [
|
|
44
|
+
$ [green]nextmv cloud scenario metadata --app-id hare-app --scenario-test-id bunny-warren-optimization[/green]
|
|
45
45
|
|
|
46
46
|
- Get metadata and save to a file.
|
|
47
|
-
$ [
|
|
48
|
-
--output metadata.json[/
|
|
47
|
+
$ [green]nextmv cloud scenario metadata --app-id hare-app --scenario-test-id lettuce-delivery \\
|
|
48
|
+
--output metadata.json[/green]
|
|
49
49
|
|
|
50
50
|
- Get metadata using a specific profile.
|
|
51
|
-
$ [
|
|
51
|
+
$ [green]nextmv cloud scenario metadata --app-id hare-app --scenario-test-id hop-schedule --profile prod[/green]
|
|
52
52
|
"""
|
|
53
53
|
|
|
54
54
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
@@ -57,17 +57,17 @@ def update(
|
|
|
57
57
|
[bold][underline]Examples[/underline][/bold]
|
|
58
58
|
|
|
59
59
|
- Update the name of a scenario test.
|
|
60
|
-
$ [
|
|
61
|
-
--name "Spring Carrot Harvest"[/
|
|
60
|
+
$ [green]nextmv cloud scenario update --app-id hare-app --scenario-test-id carrot-feast \\
|
|
61
|
+
--name "Spring Carrot Harvest"[/green]
|
|
62
62
|
|
|
63
63
|
- Update the description of a scenario test.
|
|
64
|
-
$ [
|
|
65
|
-
--description "Optimizing hop paths through the meadow"[/
|
|
64
|
+
$ [green]nextmv cloud scenario update --app-id hare-app --scenario-test-id bunny-hop-routes \\
|
|
65
|
+
--description "Optimizing hop paths through the meadow"[/green]
|
|
66
66
|
|
|
67
67
|
- Update both name and description and save the result.
|
|
68
|
-
$ [
|
|
68
|
+
$ [green]nextmv cloud scenario update --app-id hare-app --scenario-test-id lettuce-delivery \\
|
|
69
69
|
--name "Warren Lettuce Express" --description "Fast lettuce delivery to all burrows" \\
|
|
70
|
-
--output updated-scenario.json[/
|
|
70
|
+
--output updated-scenario.json[/green]
|
|
71
71
|
"""
|
|
72
72
|
|
|
73
73
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
@@ -27,7 +27,7 @@ def create(
|
|
|
27
27
|
"Pass multiple secrets by repeating the flag, or providing a list of objects. "
|
|
28
28
|
"Allowed values for [magenta]type[/magenta] are: "
|
|
29
29
|
f"{enum_values(SecretType)}. "
|
|
30
|
-
"Object format: [
|
|
30
|
+
"Object format: [green]{'type': type, 'location': location, 'value': value}[/green].",
|
|
31
31
|
metavar="SECRETS",
|
|
32
32
|
),
|
|
33
33
|
],
|
|
@@ -67,7 +67,7 @@ def create(
|
|
|
67
67
|
A secrets collection is a group of key-value pairs that can be used by
|
|
68
68
|
your application instances during execution. Each collection can contain
|
|
69
69
|
up to 20 secrets. Secrets are provided as JSON objects using the
|
|
70
|
-
--secrets flag.
|
|
70
|
+
[code]--secrets[/code] flag.
|
|
71
71
|
|
|
72
72
|
Each secret must include three fields:
|
|
73
73
|
- [magenta]type[/magenta]: Either [magenta]env[/magenta] or [magenta]file[/magenta],
|
|
@@ -80,43 +80,43 @@ def create(
|
|
|
80
80
|
|
|
81
81
|
You can provide secrets in three ways:
|
|
82
82
|
- A single secret as a [magenta]json[/magenta] object.
|
|
83
|
-
- Multiple secrets by repeating the --secrets flag.
|
|
84
|
-
- Multiple secrets as a [magenta]json[/magenta] array in a single --secrets flag.
|
|
83
|
+
- Multiple secrets by repeating the [code]--secrets[/code] flag.
|
|
84
|
+
- Multiple secrets as a [magenta]json[/magenta] array in a single [code]--secrets[/code] flag.
|
|
85
85
|
|
|
86
|
-
The --secrets-collection-id and --name are optional.
|
|
86
|
+
The [code]--secrets-collection-id[/code] and [code]--name[/code] are optional.
|
|
87
87
|
If not provided, they will be automatically generated.
|
|
88
88
|
|
|
89
89
|
[bold][underline]Examples[/underline][/bold]
|
|
90
90
|
|
|
91
91
|
- Create a secrets collection with a single environment variable secret.
|
|
92
|
-
$ [
|
|
93
|
-
--secrets '{"type": "env", "location": "API_KEY", "value": "secret-value"}'[/
|
|
92
|
+
$ [green]nextmv cloud secrets create --app-id hare-app \\
|
|
93
|
+
--secrets '{"type": "env", "location": "API_KEY", "value": "secret-value"}'[/green]
|
|
94
94
|
|
|
95
95
|
- Create a secrets collection with multiple secrets by repeating the flag.
|
|
96
|
-
$ [
|
|
96
|
+
$ [green]nextmv cloud secrets create --app-id hare-app \\
|
|
97
97
|
--secrets '{"type": "env", "location": "API_KEY", "value": "secret-value"}' \\
|
|
98
|
-
--secrets '{"type": "env", "location": "DATABASE_URL", "value": "postgres://localhost"}'[/
|
|
98
|
+
--secrets '{"type": "env", "location": "DATABASE_URL", "value": "postgres://localhost"}'[/green]
|
|
99
99
|
|
|
100
100
|
- Create a secrets collection with multiple secrets in a single JSON array.
|
|
101
|
-
$ [
|
|
102
|
-
--secrets '[{"type": "env", "location": "DB_USER", "value": "admin"}, {...}]'[/
|
|
101
|
+
$ [green]nextmv cloud secrets create --app-id hare-app \\
|
|
102
|
+
--secrets '[{"type": "env", "location": "DB_USER", "value": "admin"}, {...}]'[/green]
|
|
103
103
|
|
|
104
104
|
- Create a secrets collection with custom ID, name, and description.
|
|
105
|
-
$ [
|
|
105
|
+
$ [green]nextmv cloud secrets create --app-id hare-app \\
|
|
106
106
|
--secrets-collection-id db-creds --name "Database Credentials" \\
|
|
107
107
|
--description "Production database credentials" \\
|
|
108
108
|
--secrets '{"type": "env", "location": "DB_USER", "value": "admin"}' \\
|
|
109
|
-
--secrets '{"type": "env", "location": "DB_PASS", "value": "secure123"}'[/
|
|
109
|
+
--secrets '{"type": "env", "location": "DB_PASS", "value": "secure123"}'[/green]
|
|
110
110
|
|
|
111
111
|
- Create a secrets collection with file-based secrets.
|
|
112
|
-
$ [
|
|
112
|
+
$ [green]nextmv cloud secrets create --app-id hare-app \\
|
|
113
113
|
--secrets-collection-id certs --name "Certificates" \\
|
|
114
|
-
--secrets '{"type": "file", "location": "licenses/acme.lic", "value": "LICENSE_CONTENT_HERE"}'[/
|
|
114
|
+
--secrets '{"type": "file", "location": "licenses/acme.lic", "value": "LICENSE_CONTENT_HERE"}'[/green]
|
|
115
115
|
|
|
116
116
|
- Mix environment and file-based secrets.
|
|
117
|
-
$ [
|
|
117
|
+
$ [green]nextmv cloud secrets create --app-id hare-app \\
|
|
118
118
|
--secrets '{"type": "env", "location": "ACME_LICENSE_KEY", "value": "abc123"}' \\
|
|
119
|
-
--secrets '{"type": "file", "location": "config/app.conf", "value": "server=prod\\nport=8080"}'[/
|
|
119
|
+
--secrets '{"type": "file", "location": "config/app.conf", "value": "server=prod\\nport=8080"}'[/green]
|
|
120
120
|
"""
|
|
121
121
|
|
|
122
122
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
@@ -5,9 +5,9 @@ This module defines the cloud secrets delete command for the Nextmv CLI.
|
|
|
5
5
|
from typing import Annotated
|
|
6
6
|
|
|
7
7
|
import typer
|
|
8
|
+
from rich.prompt import Confirm
|
|
8
9
|
|
|
9
10
|
from nextmv.cli.configuration.config import build_app
|
|
10
|
-
from nextmv.cli.confirm import get_confirmation
|
|
11
11
|
from nextmv.cli.message import info, success
|
|
12
12
|
from nextmv.cli.options import AppIDOption, ProfileOption, SecretsCollectionIDOption
|
|
13
13
|
|
|
@@ -32,27 +32,31 @@ def delete(
|
|
|
32
32
|
"""
|
|
33
33
|
Deletes a Nextmv Cloud secrets collection.
|
|
34
34
|
|
|
35
|
-
This action is permanent and cannot be undone. Use the --yes
|
|
35
|
+
This action is permanent and cannot be undone. Use the [code]--yes[/code]
|
|
36
36
|
flag to skip the confirmation prompt.
|
|
37
37
|
|
|
38
38
|
[bold][underline]Examples[/underline][/bold]
|
|
39
39
|
|
|
40
40
|
- Delete the secrets collection with the ID [magenta]api-keys[/magenta] from application
|
|
41
41
|
[magenta]hare-app[/magenta].
|
|
42
|
-
$ [
|
|
42
|
+
$ [green]nextmv cloud secrets delete --app-id hare-app --secrets-collection-id api-keys[/green]
|
|
43
43
|
|
|
44
44
|
- Delete the secrets collection without confirmation prompt.
|
|
45
|
-
$ [
|
|
45
|
+
$ [green]nextmv cloud secrets delete --app-id hare-app --secrets-collection-id api-keys --yes[/green]
|
|
46
46
|
"""
|
|
47
47
|
|
|
48
48
|
if not yes:
|
|
49
|
-
confirm =
|
|
49
|
+
confirm = Confirm.ask(
|
|
50
50
|
f"Are you sure you want to delete secrets collection [magenta]{secrets_collection_id}[/magenta] "
|
|
51
51
|
f"from application [magenta]{app_id}[/magenta]? This action cannot be undone.",
|
|
52
|
+
default=False,
|
|
52
53
|
)
|
|
53
54
|
|
|
54
55
|
if not confirm:
|
|
55
|
-
info(
|
|
56
|
+
info(
|
|
57
|
+
msg=f"Secrets collection [magenta]{secrets_collection_id}[/magenta] will not be deleted.",
|
|
58
|
+
emoji=":bulb:",
|
|
59
|
+
)
|
|
56
60
|
return
|
|
57
61
|
|
|
58
62
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
nextmv/cli/cloud/secrets/get.py
CHANGED
|
@@ -41,13 +41,13 @@ def get(
|
|
|
41
41
|
|
|
42
42
|
- Get the secrets collection with the ID [magenta]api-keys[/magenta] from
|
|
43
43
|
application [magenta]hare-app[/magenta].
|
|
44
|
-
$ [
|
|
45
|
-
--secrets-collection-id api-keys[/
|
|
44
|
+
$ [green]nextmv cloud secrets get --app-id hare-app \\
|
|
45
|
+
--secrets-collection-id api-keys[/green]
|
|
46
46
|
|
|
47
47
|
- Get the secrets collection with the ID [magenta]api-keys[/magenta] and
|
|
48
48
|
save the information to a [magenta]secrets.json[/magenta] file.
|
|
49
|
-
$ [
|
|
50
|
-
--secrets-collection-id api-keys --output secrets.json[/
|
|
49
|
+
$ [green]nextmv cloud secrets get --app-id hare-app \\
|
|
50
|
+
--secrets-collection-id api-keys --output secrets.json[/green]
|
|
51
51
|
"""
|
|
52
52
|
|
|
53
53
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
nextmv/cli/cloud/secrets/list.py
CHANGED
|
@@ -35,13 +35,13 @@ def list(
|
|
|
35
35
|
[bold][underline]Examples[/underline][/bold]
|
|
36
36
|
|
|
37
37
|
- List all secrets collections of application [magenta]hare-app[/magenta].
|
|
38
|
-
$ [
|
|
38
|
+
$ [green]nextmv cloud secrets list --app-id hare-app[/green]
|
|
39
39
|
|
|
40
40
|
- List all secrets collections using the profile named [magenta]hare[/magenta].
|
|
41
|
-
$ [
|
|
41
|
+
$ [green]nextmv cloud secrets list --app-id hare-app --profile hare[/green]
|
|
42
42
|
|
|
43
43
|
- List all secrets collections and save the information to a [magenta]secrets.json[/magenta] file.
|
|
44
|
-
$ [
|
|
44
|
+
$ [green]nextmv cloud secrets list --app-id hare-app --output secrets.json[/green]
|
|
45
45
|
"""
|
|
46
46
|
|
|
47
47
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
@@ -57,7 +57,7 @@ def update(
|
|
|
57
57
|
"Pass multiple secrets by repeating the flag, or providing a list of objects. "
|
|
58
58
|
"Allowed values for [magenta]type[/magenta] are: "
|
|
59
59
|
f"{enum_values(SecretType)}. "
|
|
60
|
-
"Object format: [
|
|
60
|
+
"Object format: [magenta]{'type': type, 'location': location, 'value': value}[/magenta]. "
|
|
61
61
|
"This will replace all existing secrets in the collection.",
|
|
62
62
|
metavar="SECRETS",
|
|
63
63
|
),
|
|
@@ -71,49 +71,52 @@ def update(
|
|
|
71
71
|
secrets collection. When updating secrets, all existing secrets will be
|
|
72
72
|
replaced with the new ones provided.
|
|
73
73
|
|
|
74
|
-
Secrets are provided as JSON objects using the --secrets flag,
|
|
74
|
+
Secrets are provided as JSON objects using the [code]--secrets[/code] flag,
|
|
75
75
|
following the same format as the create command. You can provide secrets as:
|
|
76
76
|
- A single secret as a JSON object
|
|
77
|
-
- Multiple secrets by repeating the --secrets flag
|
|
78
|
-
- Multiple secrets as a JSON array in a single --secrets flag
|
|
77
|
+
- Multiple secrets by repeating the [code]--secrets[/code] flag
|
|
78
|
+
- Multiple secrets as a JSON array in a single [code]--secrets[/code] flag
|
|
79
79
|
|
|
80
80
|
[bold][underline]Examples[/underline][/bold]
|
|
81
81
|
|
|
82
82
|
- Update the name of a secrets collection.
|
|
83
|
-
$ [
|
|
84
|
-
--secrets-collection-id api-keys --name "Updated API Keys"[/
|
|
83
|
+
$ [green]nextmv cloud secrets update --app-id hare-app \\
|
|
84
|
+
--secrets-collection-id api-keys --name "Updated API Keys"[/green]
|
|
85
85
|
|
|
86
86
|
- Update the description of a secrets collection.
|
|
87
|
-
$ [
|
|
87
|
+
$ [green]nextmv cloud secrets update --app-id hare-app \\
|
|
88
88
|
--secrets-collection-id api-keys \\
|
|
89
|
-
--description "Updated collection of API keys"[/
|
|
89
|
+
--description "Updated collection of API keys"[/green]
|
|
90
90
|
|
|
91
91
|
- Update both name and description.
|
|
92
|
-
$ [
|
|
92
|
+
$ [green]nextmv cloud secrets update --app-id hare-app \\
|
|
93
93
|
--secrets-collection-id api-keys --name "Production API Keys" \\
|
|
94
|
-
--description "API keys for production environment"[/
|
|
94
|
+
--description "API keys for production environment"[/green]
|
|
95
95
|
|
|
96
96
|
- Replace all secrets in a collection with new secrets.
|
|
97
|
-
$ [
|
|
97
|
+
$ [green]nextmv cloud secrets update --app-id hare-app \\
|
|
98
98
|
--secrets-collection-id api-keys \\
|
|
99
99
|
--secrets '{"type": "env", "location": "API_KEY", "value": "new-value"}' \\
|
|
100
|
-
--secrets '{"type": "env", "location": "DATABASE_URL", "value": "postgres://newhost"}'[/
|
|
100
|
+
--secrets '{"type": "env", "location": "DATABASE_URL", "value": "postgres://newhost"}'[/green]
|
|
101
101
|
|
|
102
102
|
- Replace all secrets with a JSON array.
|
|
103
|
-
$ [
|
|
103
|
+
$ [green]nextmv cloud secrets update --app-id hare-app \\
|
|
104
104
|
--secrets-collection-id api-keys \\
|
|
105
|
-
--secrets '[{"type": "env", "location": "API_KEY", "value": "new-value"}, {...}]'[/
|
|
105
|
+
--secrets '[{"type": "env", "location": "API_KEY", "value": "new-value"}, {...}]'[/green]
|
|
106
106
|
|
|
107
107
|
- Update multiple attributes at once and save the result.
|
|
108
|
-
$ [
|
|
108
|
+
$ [green]nextmv cloud secrets update --app-id hare-app \\
|
|
109
109
|
--secrets-collection-id api-keys --name "New Name" \\
|
|
110
110
|
--description "New Description" \\
|
|
111
111
|
--secrets '{"type": "env", "location": "NEW_KEY", "value": "new-value"}' \\
|
|
112
|
-
--output updated.json[/
|
|
112
|
+
--output updated.json[/green]
|
|
113
113
|
"""
|
|
114
114
|
|
|
115
115
|
if name is None and description is None and secrets is None:
|
|
116
|
-
error(
|
|
116
|
+
error(
|
|
117
|
+
"Provide at least one option to update: "
|
|
118
|
+
"[code]--name[/code], [code]--description[/code], or [code]--secrets[/code]."
|
|
119
|
+
)
|
|
117
120
|
|
|
118
121
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
119
122
|
|
|
@@ -23,10 +23,10 @@ def create(
|
|
|
23
23
|
[bold][underline]Examples[/underline][/bold]
|
|
24
24
|
|
|
25
25
|
- Create an upload URL for application [magenta]hare-app[/magenta].
|
|
26
|
-
$ [
|
|
26
|
+
$ [green]nextmv cloud upload create --app-id hare-app[/green]
|
|
27
27
|
|
|
28
28
|
- Create an upload URL for application [magenta]hare-app[/magenta] using profile [magenta]hare[/magenta].
|
|
29
|
-
$ [
|
|
29
|
+
$ [green]nextmv cloud upload create --app-id hare-app --profile hare[/green]
|
|
30
30
|
"""
|
|
31
31
|
|
|
32
32
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
@@ -58,27 +58,28 @@ def create(
|
|
|
58
58
|
"""
|
|
59
59
|
Create a new Nextmv Cloud application version.
|
|
60
60
|
|
|
61
|
-
Use the --exist-ok flag to avoid errors when creating a
|
|
62
|
-
that already exists. This is useful for scripts that
|
|
63
|
-
version exists without worrying about whether it was
|
|
61
|
+
Use the [code]--exist-ok[/code] flag to avoid errors when creating a
|
|
62
|
+
version with an ID that already exists. This is useful for scripts that
|
|
63
|
+
need to ensure a version exists without worrying about whether it was
|
|
64
|
+
created previously.
|
|
64
65
|
|
|
65
66
|
[bold][underline]Examples[/underline][/bold]
|
|
66
67
|
|
|
67
68
|
- Create a version for application [magenta]hare-app[/magenta]. A random ID will be generated.
|
|
68
|
-
$ [
|
|
69
|
+
$ [green]nextmv cloud version create --app-id hare-app[/green]
|
|
69
70
|
|
|
70
71
|
- Create a version with a specific name.
|
|
71
|
-
$ [
|
|
72
|
+
$ [green]nextmv cloud version create --app-id hare-app --name "v1.0.0"[/green]
|
|
72
73
|
|
|
73
74
|
- Create a version with a specific ID.
|
|
74
|
-
$ [
|
|
75
|
+
$ [green]nextmv cloud version create --app-id hare-app --version-id v1[/green]
|
|
75
76
|
|
|
76
77
|
- Create a version with a name and description.
|
|
77
|
-
$ [
|
|
78
|
-
--description "Initial release with routing optimization"[/
|
|
78
|
+
$ [green]nextmv cloud version create --app-id hare-app --name "v1.0.0" \\
|
|
79
|
+
--description "Initial release with routing optimization"[/green]
|
|
79
80
|
|
|
80
81
|
- Create a version, or get it if it already exists.
|
|
81
|
-
$ [
|
|
82
|
+
$ [green]nextmv cloud version create --app-id hare-app --version-id v1 --exist-ok[/green]
|
|
82
83
|
"""
|
|
83
84
|
|
|
84
85
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
@@ -5,9 +5,9 @@ This module defines the cloud version delete command for the Nextmv CLI.
|
|
|
5
5
|
from typing import Annotated
|
|
6
6
|
|
|
7
7
|
import typer
|
|
8
|
+
from rich.prompt import Confirm
|
|
8
9
|
|
|
9
10
|
from nextmv.cli.configuration.config import build_app
|
|
10
|
-
from nextmv.cli.confirm import get_confirmation
|
|
11
11
|
from nextmv.cli.message import info, success
|
|
12
12
|
from nextmv.cli.options import AppIDOption, ProfileOption, VersionIDOption
|
|
13
13
|
|
|
@@ -32,26 +32,27 @@ def delete(
|
|
|
32
32
|
"""
|
|
33
33
|
Deletes a Nextmv Cloud application version.
|
|
34
34
|
|
|
35
|
-
This action is permanent and cannot be undone. Use the --yes
|
|
35
|
+
This action is permanent and cannot be undone. Use the [code]--yes[/code]
|
|
36
36
|
flag to skip the confirmation prompt.
|
|
37
37
|
|
|
38
38
|
[bold][underline]Examples[/underline][/bold]
|
|
39
39
|
|
|
40
40
|
- Delete the version with the ID [magenta]v1[/magenta] from application [magenta]hare-app[/magenta].
|
|
41
|
-
$ [
|
|
41
|
+
$ [green]nextmv cloud version delete --app-id hare-app --version-id v1[/green]
|
|
42
42
|
|
|
43
43
|
- Delete the version without confirmation prompt.
|
|
44
|
-
$ [
|
|
44
|
+
$ [green]nextmv cloud version delete --app-id hare-app --version-id v1 --yes[/green]
|
|
45
45
|
"""
|
|
46
46
|
|
|
47
47
|
if not yes:
|
|
48
|
-
confirm =
|
|
48
|
+
confirm = Confirm.ask(
|
|
49
49
|
f"Are you sure you want to delete version [magenta]{version_id}[/magenta] "
|
|
50
50
|
f"from application [magenta]{app_id}[/magenta]? This action cannot be undone.",
|
|
51
|
+
default=False,
|
|
51
52
|
)
|
|
52
53
|
|
|
53
54
|
if not confirm:
|
|
54
|
-
info(f"Version [magenta]{version_id}[/magenta] will not be deleted.")
|
|
55
|
+
info(msg=f"Version [magenta]{version_id}[/magenta] will not be deleted.", emoji=":bulb:")
|
|
55
56
|
return
|
|
56
57
|
|
|
57
58
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
@@ -27,10 +27,10 @@ def exists(
|
|
|
27
27
|
[bold][underline]Examples[/underline][/bold]
|
|
28
28
|
|
|
29
29
|
- Check if the version with the ID [magenta]v1[/magenta] exists in application [magenta]hare-app[/magenta].
|
|
30
|
-
$ [
|
|
30
|
+
$ [green]nextmv cloud version exists --app-id hare-app --version-id v1[/green]
|
|
31
31
|
|
|
32
32
|
- Check if the version exists using the profile named [magenta]hare[/magenta].
|
|
33
|
-
$ [
|
|
33
|
+
$ [green]nextmv cloud version exists --app-id hare-app --version-id v1 --profile hare[/green]
|
|
34
34
|
"""
|
|
35
35
|
|
|
36
36
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
nextmv/cli/cloud/version/get.py
CHANGED
|
@@ -39,11 +39,11 @@ def get(
|
|
|
39
39
|
[bold][underline]Examples[/underline][/bold]
|
|
40
40
|
|
|
41
41
|
- Get the version with the ID [magenta]v1[/magenta] from application [magenta]hare-app[/magenta].
|
|
42
|
-
$ [
|
|
42
|
+
$ [green]nextmv cloud version get --app-id hare-app --version-id v1[/green]
|
|
43
43
|
|
|
44
44
|
- Get the version with the ID [magenta]v1[/magenta] and save the information to a
|
|
45
45
|
[magenta]version.json[/magenta] file.
|
|
46
|
-
$ [
|
|
46
|
+
$ [green]nextmv cloud version get --app-id hare-app --version-id v1 --output version.json[/green]
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
49
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
nextmv/cli/cloud/version/list.py
CHANGED
|
@@ -35,13 +35,13 @@ def list(
|
|
|
35
35
|
[bold][underline]Examples[/underline][/bold]
|
|
36
36
|
|
|
37
37
|
- List all versions of application [magenta]hare-app[/magenta].
|
|
38
|
-
$ [
|
|
38
|
+
$ [green]nextmv cloud version list --app-id hare-app[/green]
|
|
39
39
|
|
|
40
40
|
- List all versions using the profile named [magenta]hare[/magenta].
|
|
41
|
-
$ [
|
|
41
|
+
$ [green]nextmv cloud version list --app-id hare-app --profile hare[/green]
|
|
42
42
|
|
|
43
43
|
- List all versions and save the information to a [magenta]versions.json[/magenta] file.
|
|
44
|
-
$ [
|
|
44
|
+
$ [green]nextmv cloud version list --app-id hare-app --output versions.json[/green]
|
|
45
45
|
"""
|
|
46
46
|
|
|
47
47
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
@@ -54,23 +54,23 @@ def update(
|
|
|
54
54
|
[bold][underline]Examples[/underline][/bold]
|
|
55
55
|
|
|
56
56
|
- Update a version's name.
|
|
57
|
-
$ [
|
|
57
|
+
$ [green]nextmv cloud version update --app-id hare-app --version-id v1 --name "Version 1.0"[/green]
|
|
58
58
|
|
|
59
59
|
- Update a version's description.
|
|
60
|
-
$ [
|
|
61
|
-
--description "Initial stable release"[/
|
|
60
|
+
$ [green]nextmv cloud version update --app-id hare-app --version-id v1 \\
|
|
61
|
+
--description "Initial stable release"[/green]
|
|
62
62
|
|
|
63
63
|
- Update a version's name and description at once.
|
|
64
|
-
$ [
|
|
65
|
-
--name "Version 1.0" --description "Initial stable release"[/
|
|
64
|
+
$ [green]nextmv cloud version update --app-id hare-app --version-id v1 \\
|
|
65
|
+
--name "Version 1.0" --description "Initial stable release"[/green]
|
|
66
66
|
|
|
67
67
|
- Update a version and save the updated information to a [magenta]updated_version.json[/magenta] file.
|
|
68
|
-
$ [
|
|
69
|
-
--name "Version 1.0" --output updated_version.json[/
|
|
68
|
+
$ [green]nextmv cloud version update --app-id hare-app --version-id v1 \\
|
|
69
|
+
--name "Version 1.0" --output updated_version.json[/green]
|
|
70
70
|
"""
|
|
71
71
|
|
|
72
72
|
if name is None and description is None:
|
|
73
|
-
error("Provide at least one option to update: --name or --description.")
|
|
73
|
+
error("Provide at least one option to update: [code]--name[/code] or [code]--description[/code].")
|
|
74
74
|
|
|
75
75
|
cloud_app = build_app(app_id=app_id, profile=profile)
|
|
76
76
|
updated_version = cloud_app.update_version(
|
nextmv/cli/community/__init__.py
CHANGED