snapctl 0.48.0__tar.gz → 0.48.1__tar.gz
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.
Potentially problematic release.
This version of snapctl might be problematic. Click here for more details.
- {snapctl-0.48.0 → snapctl-0.48.1}/PKG-INFO +10 -4
- {snapctl-0.48.0 → snapctl-0.48.1}/README.md +9 -3
- {snapctl-0.48.0 → snapctl-0.48.1}/pyproject.toml +1 -1
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/commands/snapend.py +15 -2
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/config/constants.py +3 -1
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/main.py +5 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/LICENSE +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/__init__.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/__main__.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/commands/__init__.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/commands/byogs.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/commands/byosnap.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/commands/game.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/commands/generate.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/commands/release_notes.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/config/__init__.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/config/endpoints.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/config/hashes.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/data/profiles/snapser-byosnap-profile.json +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/data/profiles/snapser-byosnap-profile.yaml +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/data/profiles/snapser-byosnap-profile.yml +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/data/releases/beta-0.46.0.mdx +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/data/releases/beta-0.46.4.mdx +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/data/releases/beta-0.47.0.mdx +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/data/releases/beta-0.47.1.mdx +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/data/releases/beta-0.47.2.mdx +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/data/releases/beta-0.48.0.mdx +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/types/__init__.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/types/definitions.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/utils/__init__.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/utils/echo.py +0 -0
- {snapctl-0.48.0 → snapctl-0.48.1}/snapctl/utils/helper.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: snapctl
|
|
3
|
-
Version: 0.48.
|
|
3
|
+
Version: 0.48.1
|
|
4
4
|
Summary: Snapser CLI Tool
|
|
5
5
|
Author: Ajinkya Apte
|
|
6
6
|
Author-email: aj@snapser.com
|
|
@@ -640,8 +640,12 @@ snapctl snapend clone --game-id $game_id --name $snapend_name --env $env --manif
|
|
|
640
640
|
|
|
641
641
|
#### 4. Apply Snapend Changes
|
|
642
642
|
|
|
643
|
-
Apply changes to your Snapend from a manifest. You should have the latest manifest before applying changes. This is
|
|
644
|
-
|
|
643
|
+
Apply changes to your Snapend from a manifest. You should have the latest manifest before applying changes. Basically, when you download a manifest, Snapser adds an `applied_configuration` section to your manifest, which stores the state of the Snapend during export. Now, if someone manually updates the Snapend or a configuration of a Snap, you are no longer going to have the latest Snapend representation in the `applied_configuration`. This is how Snapser prevents you from stomping over someone elses changes.
|
|
644
|
+
|
|
645
|
+
You can optionally pass a `--force` flag telling Snapser to ignore any diffs it may find in the current state of the Snapend and the one in the `applied_configuration` field of your manifest. Essentially, this flag allows you to stomp over any changes and tell Snapser to force apply.
|
|
646
|
+
|
|
647
|
+
Separately, you can pass a blocking flag to make your CLI wait for the Snapend update to complete.
|
|
648
|
+
|
|
645
649
|
|
|
646
650
|
```bash
|
|
647
651
|
# Help for the apply command
|
|
@@ -649,10 +653,12 @@ snapctl snapend apply --help
|
|
|
649
653
|
|
|
650
654
|
# Apply changes to a snapend via manifest
|
|
651
655
|
# $path_to_manifest = Path to the manifest file; should include the file name
|
|
656
|
+
# --force = Optional flag to tell Snapser that you do not want it to check the diff between the Snapend states and just force apply the changes
|
|
652
657
|
# Example:
|
|
653
|
-
# snapctl snapend apply --manifest-path-filename "C:\Users\name\Downloads\snapser-ox1bcyim-manifest.json" --blocking
|
|
658
|
+
# snapctl snapend apply --manifest-path-filename "C:\Users\name\Downloads\snapser-ox1bcyim-manifest.json" --force --blocking
|
|
654
659
|
snapctl snapend apply --manifest-path-filename "$path_to_manifest"
|
|
655
660
|
snapctl snapend apply --manifest-path-filename "$path_to_manifest" --blocking
|
|
661
|
+
snapctl snapend apply --manifest-path-filename "$path_to_manifest" --force --blocking
|
|
656
662
|
```
|
|
657
663
|
|
|
658
664
|
#### 5. Update Snapend BYOSnap or BYOGs versions
|
|
@@ -620,8 +620,12 @@ snapctl snapend clone --game-id $game_id --name $snapend_name --env $env --manif
|
|
|
620
620
|
|
|
621
621
|
#### 4. Apply Snapend Changes
|
|
622
622
|
|
|
623
|
-
Apply changes to your Snapend from a manifest. You should have the latest manifest before applying changes. This is
|
|
624
|
-
|
|
623
|
+
Apply changes to your Snapend from a manifest. You should have the latest manifest before applying changes. Basically, when you download a manifest, Snapser adds an `applied_configuration` section to your manifest, which stores the state of the Snapend during export. Now, if someone manually updates the Snapend or a configuration of a Snap, you are no longer going to have the latest Snapend representation in the `applied_configuration`. This is how Snapser prevents you from stomping over someone elses changes.
|
|
624
|
+
|
|
625
|
+
You can optionally pass a `--force` flag telling Snapser to ignore any diffs it may find in the current state of the Snapend and the one in the `applied_configuration` field of your manifest. Essentially, this flag allows you to stomp over any changes and tell Snapser to force apply.
|
|
626
|
+
|
|
627
|
+
Separately, you can pass a blocking flag to make your CLI wait for the Snapend update to complete.
|
|
628
|
+
|
|
625
629
|
|
|
626
630
|
```bash
|
|
627
631
|
# Help for the apply command
|
|
@@ -629,10 +633,12 @@ snapctl snapend apply --help
|
|
|
629
633
|
|
|
630
634
|
# Apply changes to a snapend via manifest
|
|
631
635
|
# $path_to_manifest = Path to the manifest file; should include the file name
|
|
636
|
+
# --force = Optional flag to tell Snapser that you do not want it to check the diff between the Snapend states and just force apply the changes
|
|
632
637
|
# Example:
|
|
633
|
-
# snapctl snapend apply --manifest-path-filename "C:\Users\name\Downloads\snapser-ox1bcyim-manifest.json" --blocking
|
|
638
|
+
# snapctl snapend apply --manifest-path-filename "C:\Users\name\Downloads\snapser-ox1bcyim-manifest.json" --force --blocking
|
|
634
639
|
snapctl snapend apply --manifest-path-filename "$path_to_manifest"
|
|
635
640
|
snapctl snapend apply --manifest-path-filename "$path_to_manifest" --blocking
|
|
641
|
+
snapctl snapend apply --manifest-path-filename "$path_to_manifest" --force --blocking
|
|
636
642
|
```
|
|
637
643
|
|
|
638
644
|
#### 5. Update Snapend BYOSnap or BYOGs versions
|
|
@@ -18,7 +18,8 @@ from snapctl.config.constants import SERVER_CALL_TIMEOUT, SNAPCTL_INPUT_ERROR, \
|
|
|
18
18
|
SNAPCTL_SNAPEND_APPLY_ERROR, SNAPCTL_SNAPEND_PROMOTE_SERVER_ERROR, \
|
|
19
19
|
SNAPCTL_SNAPEND_PROMOTE_TIMEOUT_ERROR, SNAPCTL_SNAPEND_PROMOTE_ERROR, \
|
|
20
20
|
SNAPCTL_SNAPEND_DOWNLOAD_ERROR, SNAPCTL_SNAPEND_UPDATE_TIMEOUT_ERROR, \
|
|
21
|
-
SNAPCTL_SNAPEND_UPDATE_ERROR, SNAPCTL_SNAPEND_STATE_ERROR
|
|
21
|
+
SNAPCTL_SNAPEND_UPDATE_ERROR, SNAPCTL_SNAPEND_STATE_ERROR, HTTP_ERROR_SNAPEND_MANIFEST_MISMATCH, \
|
|
22
|
+
SNAPCTL_SNAPEND_APPLY_MANIFEST_MISMATCH_ERROR
|
|
22
23
|
from snapctl.config.hashes import PROTOS_TYPES, CLIENT_SDK_TYPES, SERVER_SDK_TYPES, \
|
|
23
24
|
SNAPEND_MANIFEST_TYPES, SDK_TYPES, SDK_ACCESS_AUTH_TYPE_LOOKUP
|
|
24
25
|
from snapctl.utils.echo import error, success, info
|
|
@@ -57,6 +58,7 @@ class Snapend:
|
|
|
57
58
|
env: Union[str, None] = None,
|
|
58
59
|
# Clone, Apply, Promote
|
|
59
60
|
manifest_path_filename: Union[str, None] = None,
|
|
61
|
+
force: bool = False,
|
|
60
62
|
# Download
|
|
61
63
|
category: Union[str, None] = None,
|
|
62
64
|
category_format: Union[str, None] = None,
|
|
@@ -78,6 +80,7 @@ class Snapend:
|
|
|
78
80
|
self.name: str = name
|
|
79
81
|
self.env: str = env
|
|
80
82
|
self.manifest_path_filename: Union[str, None] = manifest_path_filename
|
|
83
|
+
self.force: bool = force
|
|
81
84
|
self.category: str = category
|
|
82
85
|
self.portal_category: Union[str, None] = Snapend._make_portal_category(
|
|
83
86
|
category_format)
|
|
@@ -598,14 +601,17 @@ class Snapend:
|
|
|
598
601
|
payload = {
|
|
599
602
|
'ext': self.manifest_file_name.split('.')[-1]
|
|
600
603
|
}
|
|
604
|
+
if self.force is True:
|
|
605
|
+
info('Force flag is set. Ignoring manifest diff.')
|
|
606
|
+
payload['ignore_diff'] = 'true'
|
|
601
607
|
url = f"{self.base_url}/v1/snapser-api/snapends/snapend-manifest"
|
|
602
608
|
res = requests.put(
|
|
603
609
|
url, headers={'api-key': self.api_key},
|
|
604
610
|
files=files, data=payload, timeout=SERVER_CALL_TIMEOUT
|
|
605
611
|
)
|
|
612
|
+
response = res.json()
|
|
606
613
|
if res.ok:
|
|
607
614
|
# extract the cluster ID
|
|
608
|
-
response = res.json()
|
|
609
615
|
if 'cluster' not in response or 'id' not in response['cluster']:
|
|
610
616
|
snapctl_error(
|
|
611
617
|
message='Server Error. Unable to get a Snapend ID. '
|
|
@@ -643,6 +649,13 @@ class Snapend:
|
|
|
643
649
|
f"{response['cluster']['id']}`",
|
|
644
650
|
progress=progress
|
|
645
651
|
)
|
|
652
|
+
else:
|
|
653
|
+
if "api_error_code" in response and "message" in response:
|
|
654
|
+
if response['api_error_code'] == HTTP_ERROR_SNAPEND_MANIFEST_MISMATCH:
|
|
655
|
+
snapctl_error(
|
|
656
|
+
message='Remote manifest does not match the manifest in the applied_configuration field.',
|
|
657
|
+
code=SNAPCTL_SNAPEND_APPLY_MANIFEST_MISMATCH_ERROR, progress=progress
|
|
658
|
+
)
|
|
646
659
|
except RequestException as e:
|
|
647
660
|
snapctl_error(
|
|
648
661
|
message=f"Unable to apply the manifest snapend. {e}",
|
|
@@ -3,7 +3,7 @@ Constants used by snapctl
|
|
|
3
3
|
"""
|
|
4
4
|
COMPANY_NAME = 'Snapser'
|
|
5
5
|
VERSION_PREFIX = 'beta-'
|
|
6
|
-
VERSION = '0.48.
|
|
6
|
+
VERSION = '0.48.1'
|
|
7
7
|
CONFIG_FILE_MAC = '~/.snapser/config'
|
|
8
8
|
CONFIG_FILE_WIN = '%homepath%\\.snapser\\config'
|
|
9
9
|
|
|
@@ -27,6 +27,7 @@ HTTP_ERROR_SERVICE_VERSION_EXISTS = 542
|
|
|
27
27
|
HTTP_ERROR_SERVICE_IN_USE = 543
|
|
28
28
|
HTTP_ERROR_TAG_NOT_AVAILABLE = 544
|
|
29
29
|
HTTP_ERROR_ADD_ON_NOT_ENABLED = 547
|
|
30
|
+
HTTP_ERROR_SNAPEND_MANIFEST_MISMATCH = 594
|
|
30
31
|
|
|
31
32
|
# CLI Return Codes
|
|
32
33
|
SNAPCTL_SUCCESS = 0
|
|
@@ -102,6 +103,7 @@ SNAPCTL_SNAPEND_UPDATE_ERROR = 72
|
|
|
102
103
|
SNAPCTL_SNAPEND_UPDATE_SERVER_ERROR = 73
|
|
103
104
|
SNAPCTL_SNAPEND_UPDATE_TIMEOUT_ERROR = 74
|
|
104
105
|
SNAPCTL_SNAPEND_STATE_ERROR = 75
|
|
106
|
+
SNAPCTL_SNAPEND_APPLY_MANIFEST_MISMATCH_ERROR = 76
|
|
105
107
|
|
|
106
108
|
# Generate Errors - 80 - 85
|
|
107
109
|
SNAPCTL_GENERATE_GENERIC_ERROR = 80
|
|
@@ -546,6 +546,10 @@ def snapend(
|
|
|
546
546
|
None, "--manifest-path-filename",
|
|
547
547
|
help="(req: apply|clone) Full Path to the manifest file including the filename."
|
|
548
548
|
),
|
|
549
|
+
force: bool = typer.Option(
|
|
550
|
+
False, "--force",
|
|
551
|
+
help="(optional: apply) If true, Snapser will ignore the configuration diff validation and allow to force apply the manifest."
|
|
552
|
+
),
|
|
549
553
|
# download
|
|
550
554
|
category: str = typer.Option(
|
|
551
555
|
None, "--category",
|
|
@@ -646,6 +650,7 @@ def snapend(
|
|
|
646
650
|
name=name, env=env,
|
|
647
651
|
# Apply, Clone
|
|
648
652
|
manifest_path_filename=manifest_path_filename,
|
|
653
|
+
force=force,
|
|
649
654
|
# Download
|
|
650
655
|
category=category,
|
|
651
656
|
category_format=category_format,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|