snapctl 0.48.1__py3-none-any.whl → 0.49.1__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.

Potentially problematic release.


This version of snapctl might be problematic. Click here for more details.

@@ -0,0 +1,6 @@
1
+ ## beta-0.49.1
2
+ ##### May 9, 2025
3
+
4
+ ### Features
5
+ 1. Bring your own workstation (BYOW) support - You can now connect your BYOSnap to a Snapend. Allowing you to debug and test your BYOSnap code locally.
6
+
snapctl/main.py CHANGED
@@ -14,11 +14,12 @@ from snapctl.commands.byogs import ByoGs
14
14
  from snapctl.commands.game import Game
15
15
  from snapctl.commands.generate import Generate
16
16
  from snapctl.commands.snapend import Snapend
17
+ from snapctl.commands.byows import Byows
17
18
  from snapctl.commands.release_notes import ReleaseNotes
18
19
  from snapctl.config.constants import COMPANY_NAME, API_KEY, URL_KEY, CONFIG_FILE_MAC, \
19
20
  CONFIG_FILE_WIN, DEFAULT_PROFILE, VERSION, SNAPCTL_SUCCESS, CONFIG_PATH_KEY, \
20
21
  SNAPCTL_CONFIGURATION_INCORRECT, VERSION_PREFIX
21
- from snapctl.config.endpoints import END_POINTS
22
+ from snapctl.config.endpoints import END_POINTS, GATEWAY_END_POINTS
22
23
  from snapctl.config.hashes import PROTOS_TYPES, SERVICE_IDS, \
23
24
  SNAPEND_MANIFEST_TYPES, SDK_TYPES
24
25
  from snapctl.utils.echo import error, success, info
@@ -109,6 +110,19 @@ def get_base_url(api_key: Union[str, None]) -> str:
109
110
  return END_POINTS['PLAYTEST']
110
111
  return END_POINTS['PROD']
111
112
 
113
+ def get_base_snapend_url(api_key: Union[str, None]) -> str:
114
+ """
115
+ Returns the base url for snapend based on the api_key
116
+ """
117
+ if api_key is None:
118
+ return ''
119
+ if api_key.startswith('dev_'):
120
+ return GATEWAY_END_POINTS['SANDBOX']
121
+ if api_key.startswith('devtwo_'):
122
+ return GATEWAY_END_POINTS['SANDBOX']
123
+ if api_key.startswith('playtest_'):
124
+ return GATEWAY_END_POINTS['SANDBOX']
125
+ return GATEWAY_END_POINTS['LIVE']
112
126
 
113
127
  def validate_command_context(
114
128
  ctx: typer.Context,
@@ -139,6 +153,7 @@ def default_context_callback(ctx: typer.Context):
139
153
  ctx.obj['api_key_location'] = api_key_obj['location']
140
154
  ctx.obj['profile'] = DEFAULT_PROFILE
141
155
  ctx.obj['base_url'] = get_base_url(api_key_obj['value'])
156
+ ctx.obj['base_snapend_url'] = get_base_snapend_url(api_key_obj['value'])
142
157
 
143
158
 
144
159
  def api_key_context_callback(
@@ -665,3 +680,54 @@ def snapend(
665
680
  getattr(snapend_obj, subcommand.replace('-', '_'))()
666
681
  success(f"Snapend {subcommand} complete")
667
682
  raise typer.Exit(code=SNAPCTL_SUCCESS)
683
+
684
+
685
+ @app.command()
686
+ def byows(
687
+ ctx: typer.Context,
688
+ # Required fields
689
+ subcommand: str = typer.Argument(
690
+ ..., help="Byows Subcommands: " + ", ".join(Byows.SUBCOMMANDS) + "."
691
+ ),
692
+ # attach
693
+ snapend_id: str = typer.Option(
694
+ None, "--snapend-id",
695
+ help=("(req: attach) Your Snapend Id")
696
+ ),
697
+ byosnap_id: str = typer.Option(
698
+ None, "--byosnap-id",
699
+ help=("(req: attach) Your BYOSnap Id")
700
+ ),
701
+ http_port: str = typer.Option(
702
+ None, "--http-port",
703
+ help=("(oneof: attach) HTTP port of your local server. One of --http-port or --grpc-port is required.")
704
+ ),
705
+ grpc_port: str = typer.Option(
706
+ None, "--grpc-port",
707
+ help=("(oneof: attach) gRPC port of your local server. One of --http-port or --grpc-port is required.")
708
+ ),
709
+ # overrides
710
+ api_key: Union[str, None] = typer.Option(
711
+ None, "--api-key", help="API Key override.", callback=api_key_context_callback
712
+ ),
713
+ profile: Union[str, None] = typer.Option(
714
+ None, "--profile", help="Profile from the Snapser config to use.", callback=profile_context_callback
715
+ ),
716
+ ) -> None:
717
+ """
718
+ Bring your own workstation commands
719
+ """
720
+ validate_command_context(ctx)
721
+ byows_obj: Byows = Byows(
722
+ subcommand=subcommand,
723
+ base_url=ctx.obj['base_url'],
724
+ base_snapend_url=ctx.obj['base_snapend_url'],
725
+ api_key=ctx.obj['api_key'],
726
+ snapend_id=snapend_id,
727
+ byosnap_id=byosnap_id,
728
+ http_port=http_port,
729
+ grpc_port=grpc_port,
730
+ )
731
+ getattr(byows_obj, subcommand.replace('-', '_'))()
732
+ success(f"BYOWs {subcommand} complete")
733
+ raise typer.Exit(code=SNAPCTL_SUCCESS)
snapctl/utils/helper.py CHANGED
@@ -14,6 +14,7 @@ from snapctl.config.constants import HTTP_NOT_FOUND, HTTP_FORBIDDEN, HTTP_UNAUTH
14
14
  SERVER_CALL_TIMEOUT, SNAPCTL_CONFIGURATION_ERROR, SNAPCTL_SUCCESS
15
15
  from snapctl.config.hashes import ARCHITECTURE_MAPPING
16
16
  from snapctl.utils.echo import error, success
17
+ from pathlib import Path
17
18
 
18
19
 
19
20
  def validate_api_key(base_url: str, api_key: Union[str, None]) -> bool:
@@ -183,3 +184,11 @@ def check_use_containerd_snapshotter() -> bool:
183
184
  return False
184
185
  except Exception:
185
186
  return False
187
+
188
+ def get_dot_snapser_dir() -> Path:
189
+ """
190
+ Returns the .snapser configuration directory, creating it if necessary.
191
+ """
192
+ config_dir = Path.home() / ".snapser"
193
+ config_dir.mkdir(parents=True, exist_ok=True)
194
+ return config_dir
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: snapctl
3
- Version: 0.48.1
3
+ Version: 0.49.1
4
4
  Summary: Snapser CLI Tool
5
5
  Author: Ajinkya Apte
6
6
  Author-email: aj@snapser.com
@@ -18,30 +18,27 @@ Requires-Dist: requests (>=2.28.2,<3.0.0)
18
18
  Requires-Dist: typer[all] (>=0.12.3,<0.13.0)
19
19
  Description-Content-Type: text/markdown
20
20
 
21
+ export const description = 'CLI'
22
+
23
+ export const meta = {
24
+ author: 'AJ Apte',
25
+ }
26
+
21
27
  # Snapser CLI
22
28
 
23
29
  Snapser has developed a CLI tool called **snapctl** that can be used on MaxOSX, Linux and Windows machines.
24
30
  Snapctl will be the best way for game studios to integrate Snapser into their build pipelines.
25
31
 
26
32
  ## What's new in the latest version?
33
+ ### Breaking Changes
34
+ 1. Renamed SDK type `server` to `api-key` to be consistent with the Snapser Web app.
35
+
27
36
  ### Features
28
- 1. Dockerfile can now be present either at the root or the resources path. Snapctl will automatically look for the Dockerfile in both locations.
29
- 2. Snapctl now throws a better warning when the swagger for the BYOSnap is not compatible with what the Snapser backed expects. You will get a warning message:
30
- ```bash
31
- Warning Snapser enforces a strict schema for the swagger.json file. It needs to be a valid OpenAPI 3.0 spec. In addition, ever API needs an operationId. a summary and
32
- a non-empty description. This allows Snapser to generate your SDK and power the API explorer. If you do not wish to leverage this feature, just remove the
33
- swagger.json file.
34
- ```
35
- 3. You can now use the `--skip-build` flag with the snapctl sync command. This allows you to skip the build step when syncing your Snapend resources.
37
+ 1. Added support for Bring your own Workstation commands.
36
38
  ```bash
37
- byosnap sync --snapend-id $snapendId --byosnap-id $byosnapId --version $version --path $path --skip-build
39
+ snapctl byows attach --snapend-id $snapend_id --byosnap-id $byosnap_id --http-port $http_port
38
40
  ```
39
41
 
40
- ### Fixes
41
- 1. Snapctl was failing if the user passed in a tag with a `:` in it. This has been fixed. It now checks for the presence of a `:` in the tag and throws an error in the input validation step.
42
- 2. The byosnap generate command was failing. This has been fixed.
43
-
44
-
45
42
  ## Requirements
46
43
  ### Python 3.X and Pip
47
44
  The Snapser CLI tool depends on Python 3.X and Pip. MacOS comes pre installed with Python. But
@@ -59,6 +56,7 @@ cause issues with the Snapser CLI tool.
59
56
 
60
57
  ## Installation
61
58
 
59
+ ### Pip
62
60
  Installing PIP on MacOS
63
61
 
64
62
  ```
@@ -73,29 +71,48 @@ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
73
71
  python get-pip.py
74
72
  ```
75
73
 
76
- Once you have Python and Pip installed
77
-
74
+ ### Pipx
75
+ Now a days, pipx is recommended for CLI tools. Once you have Python and Pip installed, lets install `Pipx`.
76
+ ```bash
77
+ python3 -m pip install --user pipx
78
+ python3 -m pipx ensurepath
78
79
  ```
80
+
81
+ ### Install Snapctl
82
+ - If you chose to use Pip
83
+ ```bash
79
84
  pip install --user snapctl
80
85
  ```
81
86
 
82
87
  If you also have Python 2.X on your machine, you may have to run the following command instead
83
88
 
84
- ```
89
+ ```bash
85
90
  pip3 install --user snapctl
86
91
  ```
92
+ - If using, Pipx
93
+ ```bash
94
+ pipx install snapctl
95
+ ```
87
96
 
88
97
  **IMPORTANT**: After you install snapctl you may have to add the python bin folder to your
89
98
  path. For example, on MacOSX this is usually **~/Library/Python/3.9/bin**. On
90
- Windows this is usually
91
- **C:\Users\username\AppData\Roaming\Python\Python39\Scripts**.
99
+ Windows this is usually **C:\Users\username\AppData\Roaming\Python\Python39\Scripts**.
100
+ For, Windows users, after running pipx ensurepath, you may need to restart your terminal (Command Prompt, PowerShell, or Windows Terminal) for the PATH changes to take effect.
101
+
92
102
 
93
103
  ## Upgrade
94
104
 
95
105
  Upgrade your snapctl version
96
106
 
107
+ - If using Pip
108
+
109
+ ```bash
110
+ pip3 install --user snapctl --upgrade
97
111
  ```
98
- pip install --user snapctl --upgrade
112
+
113
+ - If using Pipx
114
+ ```bash
115
+ pipx upgrade snapctl
99
116
  ```
100
117
 
101
118
  ## Setup
@@ -115,7 +132,7 @@ to see it again.
115
132
  You have three ways to pass the API key to Snapctl
116
133
  1. Pass it via a command line argument with every command
117
134
  2. Pass it via an environment variable
118
- 3. Pass it via a config file
135
+ 3. Pass it via a config file (recommended)
119
136
 
120
137
  #### Command line argument
121
138
 
@@ -138,7 +155,7 @@ will look for the config file at that path.
138
155
 
139
156
  ```
140
157
  [default]
141
- snapser_access_key = $your_api_key
158
+ SNAPSER_API_KEY=$your_api_key
142
159
  ```
143
160
 
144
161
  Or you can run the following command
@@ -174,10 +191,10 @@ Snapser by default supports access to multiple accounts. You can create multiple
174
191
 
175
192
  ```
176
193
  [profile personal]
177
- snapser_access_key = <key>
194
+ nSNAPSER_API_KEY=<key>
178
195
 
179
196
  [profile professional]
180
- snapser_access_key = <key>
197
+ nSNAPSER_API_KEY=<key>
181
198
 
182
199
  ```
183
200
 
@@ -195,7 +212,7 @@ setx SNAPSER_PROFILE="my_profile_name";
195
212
 
196
213
  ```
197
214
 
198
- Or you can pass **--profile my_profile_name** with every command to tell Snapser to use a particular profile.
215
+ Or you can pass **--profile professional** with every command to tell Snapser to use a particular profile.
199
216
 
200
217
  ## Command variable name nomenclature
201
218
  All commands follow these rules with their input variables
@@ -216,15 +233,14 @@ Snapctl commands for your custom code
216
233
 
217
234
  #### 1. byosnap help
218
235
 
219
- See all the supported commands. You should mainly need the `publish` and `sync` commands.
220
- All the others are for CRUD operations.
236
+ See all the supported commands.
221
237
 
222
238
  ```bash
223
239
  # Help for the byosnap command
224
240
  snapctl byosnap --help
225
241
  ```
226
242
 
227
- ### 2. byosnap generate-profile
243
+ #### 2. byosnap generate-profile
228
244
 
229
245
  This command generates a base BYOSnap profile. You will have to update the values within this file
230
246
  and then you can use it in commands like `publish` and `sync`. It is recommended that you save this
@@ -240,11 +256,11 @@ snapctl byosnap generate-profile --help
240
256
  # are allowed. If you do not pass `--profile-filename` then Snapser choses
241
257
  # `snapser-byosnap-profile.json` as the filename.
242
258
  snapctl byosnap generate-profile --out-path $output_path --profile-filename $profile_filename
243
- snapctl byosnap generate-profile --out-path /Users/DevName/Development/SnapserEngine/jinks_flask --profile-filename=my-byosnap-profile.json
244
- snapctl byosnap generate-profile --out-path /Users/DevName/Development/SnapserEngine/jinks_flask --profile-filename=my-byosnap-profile.yaml
259
+ snapctl byosnap generate-profile --out-path /Users/DevName/Development/SnapserEngine/byosnap-python --profile-filename=my-byosnap-profile.json
260
+ snapctl byosnap generate-profile --out-path /Users/DevName/Development/SnapserEngine/byosnap-python --profile-filename=my-byosnap-profile.yaml
245
261
  ```
246
262
 
247
- ### 3. byosnap validate-profile
263
+ #### 3. byosnap validate-profile
248
264
 
249
265
  This command validates your BYOSnap profile.
250
266
 
@@ -260,8 +276,8 @@ snapctl byosnap validate-profile --help
260
276
  # Snapser choses the default `snapser-byosnap-profile.json` as the filename to validate
261
277
  snapctl byosnap validate-profile --path $path
262
278
  snapctl byosnap validate-profile --resources-path $resources_path --profile-filename $profile_filename
263
- snapctl byosnap validate-profile --path /Users/DevName/Development/SnapserEngine/jinks_flask
264
- snapctl byosnap validate-profile --path /Users/DevName/Development/SnapserEngine/jinks_flask --profile-filename my-byosnap-profile.yaml
279
+ snapctl byosnap validate-profile --path /Users/DevName/Development/SnapserEngine/byosnap-python
280
+ snapctl byosnap validate-profile --path /Users/DevName/Development/SnapserEngine/byosnap-python --profile-filename my-byosnap-profile.yaml
265
281
  ```
266
282
 
267
283
  #### 4. byosnap publish
@@ -291,7 +307,7 @@ snapctl byosnap publish --help
291
307
  # Snapser choses the default `snapser-byosnap-profile.json` as the filename to validate
292
308
  # $skip-build = true/false. Default is false. Pass this flag as true to skip the build and head straight to tag and push. Build step needs to run and tag using the --tag you pass to the publish-image command for this to work. Make sure the tag matches the version number you are passing.
293
309
  # Example:
294
- snapctl byosnap publish --byosnap-id byosnap-jinks-flask --version "v0.0.1" --path /Users/DevName/Development/SnapserEngine/jinks_flask --profile-filename $profile_filename
310
+ snapctl byosnap publish --byosnap-id byosnap-jinks-flask --version "v0.0.1" --path /Users/DevName/Development/SnapserEngine/byosnap-python --profile-filename $profile_filename
295
311
  snapctl byosnap publish --byosnap-id $byosnap_id --version $version --path $code_root_path
296
312
  byosnap publish --byosnap-id byosnap-python --version "v1.0.0" --path /Users/AJ/Development/byosnap-python --profile-filename my-byosnap-profile.yaml
297
313
  ```
@@ -318,7 +334,7 @@ snapctl byosnap sync --help
318
334
  # $version =
319
335
  # $snapend_id = Dev Snapend Id
320
336
  # Example:
321
- snapctl byosnap sync --byosnap-id byosnap-jinks-flask --path /Users/DevName/Development/SnapserEngine/jinks_flask --version "v0.0.11" --snapend-id "jxmmfryo"
337
+ snapctl byosnap sync --byosnap-id byosnap-jinks-flask --path /Users/DevName/Development/SnapserEngine/byosnap-python --version "v0.0.11" --snapend-id "jxmmfryo"
322
338
  snapctl byosnap sync --byosnap-id $byosnap_id --path $code_root_path --version $version --snapend-id $snapend_id
323
339
  ```
324
340
 
@@ -357,7 +373,7 @@ snapctl byosnap build --help
357
373
  # $code_root_path = Local code path where your Dockerfile is present
358
374
  # $resources_path = Optional path to the resources directory in your Snap. This ensures, you are not forced to put the Dockerfile, swagger.json and README.md in the root directory of your Snap.
359
375
  # Example:
360
- # snapctl byosnap build --byosnap-id byosnap-jinks-flask --tag my-first-image --path /Users/DevName/Development/SnapserEngine/jinks_flask
376
+ # snapctl byosnap build --byosnap-id byosnap-jinks-flask --tag my-first-image --path /Users/DevName/Development/SnapserEngine/byosnap-python
361
377
  snapctl byosnap build --byosnap-id $byosnap_id --tag $image_tag --path $code_root_path
362
378
  snapctl byosnap build --byosnap-id $byosnap_id --tag $image_tag --path $code_root_path --resources-path $resources_path
363
379
  ```
@@ -391,7 +407,7 @@ snapctl byosnap upload-docs --help
391
407
  # $image_tag = An image tag for your snap
392
408
  # $resources_path = Path to your swagger.json and README.md files
393
409
  # Example:
394
- # snapctl byosnap upload-docs --byosnap-id byosnap-jinks-flask --tag my-first-image --resources-path /Users/DevName/Development/SnapserEngine/jinks_flask
410
+ # snapctl byosnap upload-docs --byosnap-id byosnap-jinks-flask --tag my-first-image --resources-path /Users/DevName/Development/SnapserEngine/byosnap-python
395
411
  snapctl byosnap upload-docs --byosnap-id $byosnap_id --tag $image_tag --resources-path $resources_path
396
412
  ```
397
413
 
@@ -415,7 +431,7 @@ snapctl byosnap publish-image --help
415
431
  # $resources_path = Optional path to the resources directory in your Snap. This ensures, you are not forced to put the Dockerfile, swagger.json and README.md in the root directory of your Snap.
416
432
  # $skip-build = true/false. Default is false. Pass this flag as true to skip the build and head straight to tag and push. Build step needs to run and tagged using the --tag you pass to the publish-image command for this to work.
417
433
  # Example:
418
- # snapctl byosnap publish-image --byosnap-id byosnap-jinks-flask --tag my-first-image --path /Users/DevName/Development/SnapserEngine/jinks_flask
434
+ # snapctl byosnap publish-image --byosnap-id byosnap-jinks-flask --tag my-first-image --path /Users/DevName/Development/SnapserEngine/byosnap-python
419
435
  snapctl byosnap publish-image --byosnap-id $byosnap_id --tag $image_tag --path $code_root_path
420
436
  snapctl byosnap publish-image --byosnap-id $byosnap_id --tag $image_tag --path $code_root_path --resources-path $resources_path
421
437
  snapctl byosnap publish-image --byosnap-id $byosnap_id --tag $image_tag --skip-build
@@ -439,54 +455,54 @@ snapctl byosnap publish-version --help
439
455
  # $version = Semantic version for your snap Eg: v0.0.1
440
456
  # $byosnap_profile_path = Path to the snapser-byosnap-profile.json BYOSnap profile to configure dev, stage and prod settings for this snap. You can generate a base version of this file using the `snapctl byosnap generate-profile --out-path $outputPath --profile-filename $profileName` command
441
457
  # Example:
442
- # snapctl byosnap publish-version --byosnap-id byosnap-jinks-flask --tag my-first-image --version v0.0.1 --path /Users/DevName/Development/SnapserEngine/jinks_flask
458
+ # snapctl byosnap publish-version --byosnap-id byosnap-jinks-flask --tag my-first-image --version v0.0.1 --path /Users/DevName/Development/SnapserEngine/byosnap-python
443
459
  snapctl byosnap publish-version --byosnap-id $byosnap_id --tag $image_tag --version $version --path $byosnap_profile_path
444
460
  ```
445
461
 
446
- ### BYO Game Server - Bring your own Game Server
447
- Snapctl commands for your custom game server
448
-
449
- #### 1. byogs help
462
+ ### BYO Workstation - Bring your own Workstation
463
+ Snapctl commands for bring your own workstation. This command allows you to attach your workstation to a Snapend. This is useful for testing and debugging your BYOSnap code.
450
464
 
465
+ #### 1. byows help
451
466
  See all the supported commands
452
467
 
453
468
  ```bash
454
- # Help for the byogs command
455
- snapctl byogs --help
469
+ # Help for the byows command
470
+ snapctl byows --help
456
471
  ```
457
-
458
- #### 2. byogs build
459
-
460
- Build your custom game server image.
472
+ #### 2. byows attach
473
+ Attach your workstation to a Snapend. It should be noted, that this command outputs a file `byows_env_setup.sh|ps1` at `~/.snapser/` directory. This file contains the environment variables that the BYOWS technology will need to route internal calls to the appropriate Snaps.
461
474
 
462
475
  ```bash
463
- # Help for the byogs command
464
- snapctl byogs build --help
476
+ # Attach your workstation to a Snapend
477
+ # $snapend_id = Snapend Id
478
+ # $byosnap_id = BYOSnap Id
479
+ # $http_port = Port that your local server is running on
480
+ snapctl byows attach --snapend-id $snapend_id --byosnap-id $byosnap_id --http-port $http_port
481
+ ```
465
482
 
466
- # Publish a new image
467
- # $image_tag = An image tag for your snap
468
- # $code_root_path = Local code path where your Dockerfile is present
469
- # Example:
470
- # snapctl byogs build byosnap-jinks-gs --tag my-first-image --path /Users/DevName/Development/SnapserEngine/game_server
471
- snapctl byogs build --tag $image_tag --path $code_root_path
483
+ Then run, the following command in a separate terminal window, to setup the BYOWS environment variables.
484
+ ```bash
485
+ # MacOSX
486
+ source ~/.snapser/byows_env_setup.sh
487
+ # Windows
488
+ .\.snapser\byows_env_setup.ps1
472
489
  ```
473
490
 
474
- #### 3. byogs push
491
+ Then start your BYOSnap local server in the same tab that has the environment variables set up. This will ensure that the BYOSnap code can access the internal SDK and other Snaps in your Snapend.
475
492
 
476
- Push your custom game server image.
493
+ ### BYO Game Server - Bring your own Game Server
494
+ Snapctl commands for your custom game server
495
+
496
+ #### 1. byogs help
497
+
498
+ See all the supported commands
477
499
 
478
500
  ```bash
479
501
  # Help for the byogs command
480
- snapctl byogs push --help
481
-
482
- # Publish a new image
483
- # $image_tag = An image tag for your snap
484
- # Example:
485
- # snapctl byogs push byosnap-jinks-gs --tag my-first-image
486
- snapctl byogs push --tag $image_tag
502
+ snapctl byogs --help
487
503
  ```
488
504
 
489
- #### 4. byogs publish
505
+ #### 2. byogs publish
490
506
 
491
507
  Publish your custom game server image. This commend replaces the old way of creating, publishing image and
492
508
  then publishing the byogs. Now all you have to do is publish your image and create a fleet using the web portal.
@@ -511,7 +527,7 @@ snapctl byogs publish --tag $image_tag --path $code_root_path --resources-path $
511
527
  snapctl byogs publish --tag $image_tag --skip-build
512
528
  ```
513
529
 
514
- #### 5. byogs sync
530
+ #### 3. byogs sync
515
531
 
516
532
  This command allows developers to rapidly build, update and push their BYOGs out to a Snapend fleet. Simply, make changes to your code locally, and then run this command to deploy your BYOGs straight to your Snapend fleet.
517
533
 
@@ -531,6 +547,38 @@ snapctl byogs sync --path /Users/DevName/Development/SnapserEngine/game_server -
531
547
  snapctl byosnap sync --path $code_root_path --tag $image_tag --snapend-id $snapend_id --fleet-names $fleet_names
532
548
  ```
533
549
 
550
+ #### 4. byogs build
551
+
552
+ Build your custom game server image.
553
+
554
+ ```bash
555
+ # Help for the byogs command
556
+ snapctl byogs build --help
557
+
558
+ # Publish a new image
559
+ # $image_tag = An image tag for your snap
560
+ # $code_root_path = Local code path where your Dockerfile is present
561
+ # Example:
562
+ # snapctl byogs build byosnap-jinks-gs --tag my-first-image --path /Users/DevName/Development/SnapserEngine/game_server
563
+ snapctl byogs build --tag $image_tag --path $code_root_path
564
+ ```
565
+
566
+ #### 5. byogs push
567
+
568
+ Push your custom game server image.
569
+
570
+ ```bash
571
+ # Help for the byogs command
572
+ snapctl byogs push --help
573
+
574
+ # Publish a new image
575
+ # $image_tag = An image tag for your snap
576
+ # Example:
577
+ # snapctl byogs push byosnap-jinks-gs --tag my-first-image
578
+ snapctl byogs push --tag $image_tag
579
+ ```
580
+
581
+
534
582
  ### Game
535
583
  Snapctl commands for your game
536
584
 
@@ -543,36 +591,18 @@ See all the supported commands
543
591
  snapctl game --help
544
592
  ```
545
593
 
546
- #### 2. Create a game
594
+ #### 2. game create
547
595
  Create a game
548
596
  ```bash
549
597
  snapctl game create --name $game_name
550
598
  ```
551
599
 
552
- #### 3. Enumerate games
600
+ #### 3. game enumerate
553
601
  List all the games
554
602
  ```bash
555
603
  snapctl game enumerate
556
604
  ```
557
605
 
558
- ### Generate
559
- Generator tool to help generate credentials
560
-
561
- #### 1. generate help
562
- See all the supported commands
563
- ```bash
564
- # Help for the generate command
565
- snapctl generate --help
566
- ```
567
-
568
- #### 2. Generate ECR Credentials
569
- Generate the ECR credentials. Game studios can use these credentials to self publish their images to Snapser.
570
-
571
- ```bash
572
- snapctl generate credentials --category "ecr" --out-path $output_path
573
-
574
- ```
575
-
576
606
  ### Snapend
577
607
  Snapctl commands for your snapend
578
608
 
@@ -585,7 +615,7 @@ See all the supported commands
585
615
  snapctl snapend --help
586
616
  ```
587
617
 
588
- #### 2. Snapend Downloads
618
+ #### 2. snapend download
589
619
 
590
620
  Download Manifest, SDKs and Protos for your Snapend
591
621
 
@@ -619,7 +649,7 @@ snapctl snapend download --snapend-id $snapend_id --category $category --format
619
649
  snapctl snapend download --snapend-id $snapend_id --category $category --format $format --type $type --http-lib $http_lib --out-path $out_path
620
650
  ```
621
651
 
622
- #### 3. Clone Snapend
652
+ #### 3. snapend clone
623
653
 
624
654
  Clone a Snapend from an existing manifest. Passing the blocking flag ensures your CLI command waits till the new Snapend is up.
625
655
 
@@ -638,7 +668,7 @@ snapctl snapend clone --game-id $game_id --name $snapend_name --env $env --manif
638
668
  snapctl snapend clone --game-id $game_id --name $snapend_name --env $env --manifest-path-filename "$path_to_manifest" --blocking
639
669
  ```
640
670
 
641
- #### 4. Apply Snapend Changes
671
+ #### 4. snapend apply
642
672
 
643
673
  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
674
 
@@ -661,7 +691,7 @@ snapctl snapend apply --manifest-path-filename "$path_to_manifest" --blocking
661
691
  snapctl snapend apply --manifest-path-filename "$path_to_manifest" --force --blocking
662
692
  ```
663
693
 
664
- #### 5. Update Snapend BYOSnap or BYOGs versions
694
+ #### 5. snapend update
665
695
 
666
696
  Update your BYOSnap or BYOGs versions for the Snapend
667
697
 
@@ -681,7 +711,7 @@ snapctl snapend update --help
681
711
  snapctl snapend update --snapend-id $snapend_id --byosnaps $byosnaps --byogs $byogs --blocking
682
712
  ```
683
713
 
684
- #### 6. Get the Snapend state
714
+ #### 6. snapend state
685
715
 
686
716
  Get the Snapend state
687
717
 
@@ -696,6 +726,25 @@ snapctl snapend state --help
696
726
  snapctl snapend state $snapend_id
697
727
  ```
698
728
 
729
+ ### Generate
730
+ Generator tool to help generate credentials
731
+
732
+ #### 1. generate help
733
+ See all the supported commands
734
+ ```bash
735
+ # Help for the generate command
736
+ snapctl generate --help
737
+ ```
738
+
739
+ #### 2. Generate ECR Credentials
740
+ Generate the ECR credentials. Game studios can use these credentials to self publish their images to Snapser.
741
+
742
+ ```bash
743
+ snapctl generate credentials --category "ecr" --out-path $output_path
744
+
745
+ ```
746
+
747
+
699
748
  ## Error codes
700
749
  ### CLI Return Codes
701
750
  | Error Code | Description |
@@ -750,6 +799,7 @@ snapctl snapend state $snapend_id
750
799
  | 48 | BYOSNAP update version invalid version error |
751
800
  | 49 | BYOSNAP publish error |
752
801
  | 86 | BYOSNAP generate-profile |
802
+ | 87 | BYOSNAP swagger error |
753
803
 
754
804
 
755
805
  ### Game Errors
@@ -783,6 +833,7 @@ snapctl snapend state $snapend_id
783
833
  | 73 | Snapend update server error |
784
834
  | 74 | Snapend update timeout error |
785
835
  | 75 | Snapend state error |
836
+ | 76 | Snapend manifest mismatch error |
786
837
 
787
838
  ### Generate Errors
788
839
  | Error Code | Description |
@@ -790,3 +841,8 @@ snapctl snapend state $snapend_id
790
841
  | 80 | Generic generate error |
791
842
  | 81 | Generate credentials error |
792
843
 
844
+ ### BYOWS Errors
845
+ | Error Code | Description |
846
+ |------------|----------------------------------------------------------|
847
+ | 95 | Generic byows error |
848
+