snapctl 0.39.3__py3-none-any.whl → 0.41.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.
- snapctl/commands/byogs.py +135 -56
- snapctl/commands/byosnap.py +450 -225
- snapctl/commands/game.py +49 -25
- snapctl/commands/generate.py +48 -40
- snapctl/commands/snapend.py +225 -142
- snapctl/config/constants.py +16 -4
- snapctl/config/hashes.py +5 -3
- snapctl/main.py +106 -34
- snapctl/utils/helper.py +2 -4
- {snapctl-0.39.3.dist-info → snapctl-0.41.1.dist-info}/METADATA +66 -15
- snapctl-0.41.1.dist-info/RECORD +23 -0
- snapctl-0.39.3.dist-info/RECORD +0 -23
- {snapctl-0.39.3.dist-info → snapctl-0.41.1.dist-info}/LICENSE +0 -0
- {snapctl-0.39.3.dist-info → snapctl-0.41.1.dist-info}/WHEEL +0 -0
- {snapctl-0.39.3.dist-info → snapctl-0.41.1.dist-info}/entry_points.txt +0 -0
snapctl/config/constants.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Constants used by snapctl
|
|
3
3
|
"""
|
|
4
4
|
COMPANY_NAME = 'Snapser'
|
|
5
|
-
VERSION = '0.
|
|
5
|
+
VERSION = '0.41.1'
|
|
6
6
|
CONFIG_FILE_MAC = '~/.snapser/config'
|
|
7
7
|
CONFIG_FILE_WIN = '%homepath%\\.snapser\\config'
|
|
8
8
|
|
|
@@ -19,15 +19,19 @@ HTTP_NOT_FOUND = 404
|
|
|
19
19
|
HTTP_CONFLICT = 409
|
|
20
20
|
|
|
21
21
|
# HTTP Error codes
|
|
22
|
+
HTTP_ERROR_GAME_LIMIT_REACHED = 520
|
|
23
|
+
HTTP_ERROR_DUPLICATE_GAME_NAME = 523
|
|
24
|
+
HTTP_ERROR_RESOURCE_NOT_FOUND = 541
|
|
22
25
|
HTTP_ERROR_SERVICE_VERSION_EXISTS = 542
|
|
26
|
+
HTTP_ERROR_SERVICE_IN_USE = 543
|
|
23
27
|
HTTP_ERROR_TAG_NOT_AVAILABLE = 544
|
|
24
28
|
HTTP_ERROR_ADD_ON_NOT_ENABLED = 547
|
|
25
|
-
HTTP_ERROR_DUPLICATE_GAME_NAME = 2
|
|
26
29
|
|
|
27
30
|
# CLI Return Codes
|
|
28
31
|
SNAPCTL_SUCCESS = 0
|
|
29
32
|
SNAPCTL_ERROR = 1
|
|
30
33
|
SNAPCTL_INPUT_ERROR = 2
|
|
34
|
+
SNAPCTL_RESOURCE_NOT_FOUND = 3
|
|
31
35
|
|
|
32
36
|
# Configuration Errors
|
|
33
37
|
SNAPCTL_CONFIGURATION_INCORRECT = 10
|
|
@@ -45,6 +49,7 @@ SNAPCTL_BYOGS_PUBLISH_PERMISSION_ERROR = 26
|
|
|
45
49
|
SNAPCTL_BYOGS_PUBLISH_DUPLICATE_TAG_ERROR = 27
|
|
46
50
|
|
|
47
51
|
# BYOSNAP Errors
|
|
52
|
+
SNAPCTL_BYOSNAP_NOT_FOUND = SNAPCTL_RESOURCE_NOT_FOUND
|
|
48
53
|
SNAPCTL_BYOSNAP_GENERIC_ERROR = 30
|
|
49
54
|
SNAPCTL_BYOSNAP_DEPENDENCY_MISSING = 31
|
|
50
55
|
SNAPCTL_BYOSNAP_ECR_LOGIN_ERROR = 32
|
|
@@ -60,15 +65,22 @@ SNAPCTL_BYOSNAP_PUBLISH_VERSION_ERROR = 41
|
|
|
60
65
|
SNAPCTL_BYOSNAP_PUBLISH_VERSION_PERMISSION_ERROR = 42
|
|
61
66
|
SNAPCTL_BYOSNAP_PUBLISH_VERSION_DUPLICATE_VERSION_ERROR = 43
|
|
62
67
|
SNAPCTL_BYOSNAP_PUBLISH_VERSION_DUPLICATE_TAG_ERROR = 44
|
|
68
|
+
SNAPCTL_BYOSNAP_UPDATE_VERSION_ERROR = 45
|
|
69
|
+
SNAPCTL_BYOSNAP_UPDATE_VERSION_SERVICE_IN_USE_ERROR = 46
|
|
70
|
+
SNAPCTL_BYOSNAP_UPDATE_VERSION_TAG_ERROR = 47
|
|
71
|
+
SNAPCTL_BYOSNAP_UPDATE_VERSION_INVALID_VERSION_ERROR = 48
|
|
63
72
|
|
|
64
73
|
# Game Errors
|
|
74
|
+
SNAPCTL_GAME_NOT_FOUND = SNAPCTL_RESOURCE_NOT_FOUND
|
|
65
75
|
SNAPCTL_GAME_GENERIC_ERROR = 50
|
|
66
76
|
SNAPCTL_GAME_CREATE_ERROR = 51
|
|
67
77
|
SNAPCTL_GAME_CREATE_PERMISSION_ERROR = 52
|
|
68
|
-
|
|
69
|
-
|
|
78
|
+
SNAPCTL_GAME_CREATE_LIMIT_ERROR = 53
|
|
79
|
+
SNAPCTL_GAME_CREATE_DUPLICATE_NAME_ERROR = 54
|
|
80
|
+
SNAPCTL_GAME_ENUMERATE_ERROR = 55
|
|
70
81
|
|
|
71
82
|
# Snapend Errors
|
|
83
|
+
SNAPCTL_SNAPEND_NOT_FOUND = SNAPCTL_RESOURCE_NOT_FOUND
|
|
72
84
|
SNAPCTL_SNAPEND_GENERIC_ERROR = 60
|
|
73
85
|
SNAPCTL_SNAPEND_ENUMERATE_ERROR = 61
|
|
74
86
|
SNAPCTL_SNAPEND_CLONE_ERROR = 62
|
snapctl/config/hashes.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
'''
|
|
2
|
+
This file contains the hashes / list constants
|
|
3
|
+
'''
|
|
1
4
|
from typing import Dict, List
|
|
2
5
|
|
|
3
|
-
"""
|
|
4
|
-
This file contains the hashes / list constants
|
|
5
|
-
"""
|
|
6
6
|
CLIENT_SDK_TYPES: Dict[str, Dict[str, str]] = {
|
|
7
7
|
'unity': {
|
|
8
8
|
'type': 'csharp',
|
|
@@ -121,6 +121,8 @@ SERVER_SDK_TYPES: Dict[str, Dict[str, str]] = {
|
|
|
121
121
|
},
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
SDK_TYPES: Dict[str, Dict[str, str]] = {**CLIENT_SDK_TYPES, **SERVER_SDK_TYPES}
|
|
125
|
+
|
|
124
126
|
PROTOS_TYPES: Dict[str, Dict[str, str]] = {
|
|
125
127
|
'cpp': {
|
|
126
128
|
'type': 'cpp',
|
snapctl/main.py
CHANGED
|
@@ -17,8 +17,8 @@ from snapctl.config.constants import COMPANY_NAME, API_KEY, URL_KEY, CONFIG_FILE
|
|
|
17
17
|
CONFIG_FILE_WIN, DEFAULT_PROFILE, VERSION, SNAPCTL_SUCCESS, CONFIG_PATH_KEY, \
|
|
18
18
|
SNAPCTL_CONFIGURATION_INCORRECT
|
|
19
19
|
from snapctl.config.endpoints import END_POINTS
|
|
20
|
-
from snapctl.config.hashes import
|
|
21
|
-
SNAPEND_MANIFEST_TYPES
|
|
20
|
+
from snapctl.config.hashes import PROTOS_TYPES, SERVICE_IDS, \
|
|
21
|
+
SNAPEND_MANIFEST_TYPES, SDK_TYPES
|
|
22
22
|
from snapctl.utils.echo import error, success, info
|
|
23
23
|
from snapctl.utils.helper import validate_api_key
|
|
24
24
|
|
|
@@ -264,6 +264,21 @@ def byogs(
|
|
|
264
264
|
skip_build: bool = typer.Option(
|
|
265
265
|
False, "--skip-build", help="(optional: publish) Skip the build step. You have to pass the image tag you used during the build step."
|
|
266
266
|
),
|
|
267
|
+
snapend_id: str = typer.Option(
|
|
268
|
+
None, "--snapend-id",
|
|
269
|
+
help=("(req: sync) Snapend Id. NOTE: Development Snapends only.")
|
|
270
|
+
),
|
|
271
|
+
fleet_name: str = typer.Option(
|
|
272
|
+
None, "--fleet-name",
|
|
273
|
+
help=("(req: sync) Snapend Id. NOTE: Development Snapend fleets only. ")
|
|
274
|
+
),
|
|
275
|
+
blocking: bool = typer.Option(
|
|
276
|
+
False, "--blocking",
|
|
277
|
+
help=(
|
|
278
|
+
"(optional: update) Set to true if you want to wait for the update to complete "
|
|
279
|
+
"before returning."
|
|
280
|
+
)
|
|
281
|
+
),
|
|
267
282
|
# overrides
|
|
268
283
|
api_key: Union[str, None] = typer.Option(
|
|
269
284
|
None, "--api-key", help="API Key override.", callback=api_key_context_callback
|
|
@@ -277,8 +292,17 @@ def byogs(
|
|
|
277
292
|
"""
|
|
278
293
|
validate_command_context(ctx)
|
|
279
294
|
byogs_obj: ByoGs = ByoGs(
|
|
280
|
-
subcommand,
|
|
281
|
-
|
|
295
|
+
subcommand=subcommand,
|
|
296
|
+
base_url=ctx.obj['base_url'],
|
|
297
|
+
api_key=ctx.obj['api_key'],
|
|
298
|
+
tag=tag,
|
|
299
|
+
path=path,
|
|
300
|
+
resources_path=resources_path,
|
|
301
|
+
dockerfile=docker_file,
|
|
302
|
+
skip_build=skip_build,
|
|
303
|
+
snapend_id=snapend_id,
|
|
304
|
+
fleet_name=fleet_name,
|
|
305
|
+
blocking=blocking
|
|
282
306
|
)
|
|
283
307
|
getattr(byogs_obj, subcommand.replace('-', '_'))()
|
|
284
308
|
success(f"BYOGs {subcommand} complete")
|
|
@@ -313,15 +337,15 @@ def byosnap(
|
|
|
313
337
|
# publish-image and publish-version
|
|
314
338
|
tag: str = typer.Option(
|
|
315
339
|
None, "--tag", help=(
|
|
316
|
-
"(req: publish-image
|
|
340
|
+
"(req: publish-image, publish-version, sync) Tag for your snap"
|
|
317
341
|
)
|
|
318
342
|
),
|
|
319
343
|
# publish-image
|
|
320
344
|
path: Union[str, None] = typer.Option(
|
|
321
|
-
None, "--path", help="(req: publish-image) Path to your snap code"
|
|
345
|
+
None, "--path", help="(req: publish-image, sync) Path to your snap code"
|
|
322
346
|
),
|
|
323
347
|
resources_path: Union[str, None] = typer.Option(
|
|
324
|
-
None, "--resources-path", help="(optional: publish-image, req: upload-docs) Path to resources such as your Dockerfile, swagger.json or README.md"
|
|
348
|
+
None, "--resources-path", help="(optional: publish-image, sync; req: upload-docs) Path to resources such as your Dockerfile, swagger.json or README.md"
|
|
325
349
|
),
|
|
326
350
|
docker_file: str = typer.Option(
|
|
327
351
|
"Dockerfile", help="(optional: publish) Dockerfile name to use"
|
|
@@ -343,7 +367,7 @@ def byosnap(
|
|
|
343
367
|
)
|
|
344
368
|
),
|
|
345
369
|
skip_build: bool = typer.Option(
|
|
346
|
-
False, "--skip-build", help="(optional: publish-image) Skip the build step. You have to pass the image tag you used during the build step."
|
|
370
|
+
False, "--skip-build", help="(optional: publish-image, sync) Skip the build step. You have to pass the image tag you used during the build step."
|
|
347
371
|
),
|
|
348
372
|
readiness_path: str = typer.Option(
|
|
349
373
|
None, "--readiness-path", help="(req: publish-version) Readiness path for your snap"
|
|
@@ -351,6 +375,18 @@ def byosnap(
|
|
|
351
375
|
readiness_delay: int = typer.Option(
|
|
352
376
|
None, "--readiness-delay", help="(req: publish-version) Delay before readiness check"
|
|
353
377
|
),
|
|
378
|
+
# sync
|
|
379
|
+
snapend_id: str = typer.Option(
|
|
380
|
+
None, "--snapend-id",
|
|
381
|
+
help=("(req: sync) Snapend Id. NOTE: Development Snapends only.")
|
|
382
|
+
),
|
|
383
|
+
blocking: bool = typer.Option(
|
|
384
|
+
False, "--blocking",
|
|
385
|
+
help=(
|
|
386
|
+
"(optional: sync) Set to true if you want to wait for the update to complete "
|
|
387
|
+
"before returning."
|
|
388
|
+
)
|
|
389
|
+
),
|
|
354
390
|
# overrides
|
|
355
391
|
api_key: Union[str, None] = typer.Option(
|
|
356
392
|
None, "--api-key", help="API Key override.", callback=api_key_context_callback
|
|
@@ -364,10 +400,27 @@ def byosnap(
|
|
|
364
400
|
"""
|
|
365
401
|
validate_command_context(ctx)
|
|
366
402
|
byosnap_obj: ByoSnap = ByoSnap(
|
|
367
|
-
subcommand,
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
403
|
+
subcommand=subcommand,
|
|
404
|
+
base_url=ctx.obj['base_url'],
|
|
405
|
+
api_key=ctx.obj['api_key'],
|
|
406
|
+
sid=sid,
|
|
407
|
+
name=name,
|
|
408
|
+
desc=desc,
|
|
409
|
+
platform_type=platform_type,
|
|
410
|
+
language=language,
|
|
411
|
+
tag=tag,
|
|
412
|
+
path=path,
|
|
413
|
+
resources_path=resources_path,
|
|
414
|
+
dockerfile=docker_file,
|
|
415
|
+
prefix=prefix,
|
|
416
|
+
version=version,
|
|
417
|
+
http_port=http_port,
|
|
418
|
+
byosnap_profile=byosnap_profile,
|
|
419
|
+
skip_build=skip_build,
|
|
420
|
+
readiness_path=readiness_path,
|
|
421
|
+
readiness_delay=readiness_delay,
|
|
422
|
+
snapend_id=snapend_id,
|
|
423
|
+
blocking=blocking
|
|
371
424
|
)
|
|
372
425
|
getattr(byosnap_obj, subcommand.replace('-', '_'))()
|
|
373
426
|
success(f"BYOSnap {subcommand} complete")
|
|
@@ -399,7 +452,11 @@ def game(
|
|
|
399
452
|
"""
|
|
400
453
|
validate_command_context(ctx)
|
|
401
454
|
game_obj: Game = Game(
|
|
402
|
-
subcommand,
|
|
455
|
+
subcommand=subcommand,
|
|
456
|
+
base_url=ctx.obj['base_url'],
|
|
457
|
+
api_key=ctx.obj['api_key'],
|
|
458
|
+
name=name
|
|
459
|
+
)
|
|
403
460
|
getattr(game_obj, subcommand.replace('-', '_'))()
|
|
404
461
|
success(f"Game {subcommand} complete")
|
|
405
462
|
raise typer.Exit(code=SNAPCTL_SUCCESS)
|
|
@@ -446,8 +503,11 @@ def generate(
|
|
|
446
503
|
"""
|
|
447
504
|
validate_command_context(ctx)
|
|
448
505
|
generate_obj: Generate = Generate(
|
|
449
|
-
subcommand,
|
|
450
|
-
|
|
506
|
+
subcommand=subcommand,
|
|
507
|
+
base_url=ctx.obj['base_url'],
|
|
508
|
+
api_key=ctx.obj['api_key'],
|
|
509
|
+
category=category,
|
|
510
|
+
out_path=out_path
|
|
451
511
|
)
|
|
452
512
|
getattr(generate_obj, subcommand.replace('-', '_'))()
|
|
453
513
|
success(f"Generate {subcommand} complete")
|
|
@@ -484,12 +544,25 @@ def snapend(
|
|
|
484
544
|
", ".join(Snapend.DOWNLOAD_CATEGORY) + "."
|
|
485
545
|
)
|
|
486
546
|
),
|
|
547
|
+
sdk_access_type: str = typer.Option(
|
|
548
|
+
'external', "--sdk-access-type",
|
|
549
|
+
help=(
|
|
550
|
+
"(optional: download) Access type of the Download: " +
|
|
551
|
+
"external, internal."
|
|
552
|
+
)
|
|
553
|
+
),
|
|
554
|
+
sdk_auth_type: str = typer.Option(
|
|
555
|
+
None, "--sdk-auth-type",
|
|
556
|
+
help=(
|
|
557
|
+
"(optional: download) Only applicable for --category sdk --sdk-access-type external "
|
|
558
|
+
"Auth-Types: (" + ", ".join(Snapend.AUTH_TYPES) + ")"
|
|
559
|
+
)
|
|
560
|
+
),
|
|
487
561
|
platform_type: str = typer.Option(
|
|
488
562
|
None, "--type",
|
|
489
563
|
help=(
|
|
490
|
-
"(req: --category
|
|
491
|
-
"SDK Types:
|
|
492
|
-
") server-sdk(" + ", ".join(SERVER_SDK_TYPES.keys()) +
|
|
564
|
+
"(req: --category sdk|protos|snapend-manifest --type ) "
|
|
565
|
+
"SDK Types: sdk(" + ", ".join(SDK_TYPES.keys()) +
|
|
493
566
|
") protos(" + ", ".join(PROTOS_TYPES.keys()) + ")" +
|
|
494
567
|
") snapend-manifest(" + \
|
|
495
568
|
", ".join(SNAPEND_MANIFEST_TYPES.keys()) + ")"
|
|
@@ -502,13 +575,6 @@ def snapend(
|
|
|
502
575
|
"Protos-Category: (" + ", ".join(Snapend.PROTOS_CATEGORY) + ")"
|
|
503
576
|
)
|
|
504
577
|
),
|
|
505
|
-
auth_type: str = typer.Option(
|
|
506
|
-
'user', "--auth-type",
|
|
507
|
-
help=(
|
|
508
|
-
"(optional: download) Only applicable for --category server-sdk --auth-type"
|
|
509
|
-
"Auth-Types: (" + ", ".join(Snapend.AUTH_TYPES) + ")"
|
|
510
|
-
)
|
|
511
|
-
),
|
|
512
578
|
snaps: Union[str, None] = typer.Option(
|
|
513
579
|
None, "--snaps",
|
|
514
580
|
help=(
|
|
@@ -529,14 +595,14 @@ def snapend(
|
|
|
529
595
|
out_path: Union[str, None] = typer.Option(
|
|
530
596
|
None, "--out-path", help="(optional: download|apply|clone) Path to save the output file"),
|
|
531
597
|
# update
|
|
532
|
-
|
|
598
|
+
byosnaps_list: str = typer.Option(
|
|
533
599
|
None, "--byosnaps",
|
|
534
600
|
help=(
|
|
535
601
|
"(optional: update) Comma separated list of BYOSnap ids and versions. "
|
|
536
602
|
"Eg: service-1:v1.0.0,service-2:v1.0.0"
|
|
537
603
|
)
|
|
538
604
|
),
|
|
539
|
-
|
|
605
|
+
byogs_list: str = typer.Option(
|
|
540
606
|
None, "--byogs",
|
|
541
607
|
help=(
|
|
542
608
|
"(optional: update) Comma separated list of BYOGs fleet name:tags. "
|
|
@@ -564,19 +630,25 @@ def snapend(
|
|
|
564
630
|
"""
|
|
565
631
|
validate_command_context(ctx)
|
|
566
632
|
snapend_obj: Snapend = Snapend(
|
|
567
|
-
subcommand,
|
|
633
|
+
subcommand=subcommand,
|
|
634
|
+
base_url=ctx.obj['base_url'],
|
|
635
|
+
api_key=ctx.obj['api_key'],
|
|
636
|
+
snapend_id=snapend_id,
|
|
568
637
|
# Enumerate, Clone
|
|
569
|
-
game_id,
|
|
638
|
+
game_id=game_id,
|
|
570
639
|
# Clone
|
|
571
|
-
name, env,
|
|
640
|
+
name=name, env=env,
|
|
572
641
|
# Apply, Clone
|
|
573
|
-
manifest_path,
|
|
642
|
+
manifest_path=manifest_path,
|
|
574
643
|
# Download
|
|
575
|
-
category,
|
|
644
|
+
category=category, sdk_access_type=sdk_access_type,
|
|
645
|
+
sdk_auth_type=sdk_auth_type, platform_type=platform_type,
|
|
646
|
+
protos_category=protos_category,
|
|
647
|
+
snaps=snaps,
|
|
576
648
|
# Download, Apply and Clone
|
|
577
|
-
out_path,
|
|
649
|
+
out_path=out_path,
|
|
578
650
|
# Update
|
|
579
|
-
byosnaps, byogs, blocking
|
|
651
|
+
byosnaps=byosnaps_list, byogs=byogs_list, blocking=blocking
|
|
580
652
|
)
|
|
581
653
|
getattr(snapend_obj, subcommand.replace('-', '_'))()
|
|
582
654
|
success(f"Snapend {subcommand} complete")
|
snapctl/utils/helper.py
CHANGED
|
@@ -18,7 +18,7 @@ def validate_api_key(base_url: str, api_key: Union[str, None]) -> bool:
|
|
|
18
18
|
This function validates the API Key
|
|
19
19
|
"""
|
|
20
20
|
try:
|
|
21
|
-
url = f"{base_url}/v1/snapser-api/
|
|
21
|
+
url = f"{base_url}/v1/snapser-api/validate"
|
|
22
22
|
res = requests.get(
|
|
23
23
|
url, headers={'api-key': api_key},
|
|
24
24
|
timeout=SERVER_CALL_TIMEOUT
|
|
@@ -26,9 +26,7 @@ def validate_api_key(base_url: str, api_key: Union[str, None]) -> bool:
|
|
|
26
26
|
if res.ok:
|
|
27
27
|
success('API Key validated')
|
|
28
28
|
return True
|
|
29
|
-
if res.status_code ==
|
|
30
|
-
error('Service ID is invalid.', SNAPCTL_CONFIGURATION_ERROR)
|
|
31
|
-
elif res.status_code == HTTP_UNAUTHORIZED:
|
|
29
|
+
if res.status_code == HTTP_UNAUTHORIZED:
|
|
32
30
|
error(
|
|
33
31
|
'API Key verification failed. Your API Key is either invalid or may have expired. ',
|
|
34
32
|
SNAPCTL_CONFIGURATION_ERROR
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: snapctl
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.41.1
|
|
4
4
|
Summary: Snapser CLI Tool
|
|
5
5
|
Author: Ajinkya Apte
|
|
6
6
|
Author-email: aj@snapser.com
|
|
@@ -310,6 +310,33 @@ snapctl byosnap publish-version --help
|
|
|
310
310
|
snapctl byosnap publish-version $byosnap_sid --tag $image_tag --prefix $prefix --version $version --http-port $ingress_port --byosnap-profile $byosnap_profile
|
|
311
311
|
```
|
|
312
312
|
|
|
313
|
+
#### 8. byosnap sync
|
|
314
|
+
|
|
315
|
+
This command is for development purposes. It allows developers to rapidly build, update and push their
|
|
316
|
+
BYOSnap to a dev Snapend. Simply, make changes to your code locally, and then run this command to deploy
|
|
317
|
+
your BYOSnap straight to your development Snapend.
|
|
318
|
+
|
|
319
|
+
IMPORTANT: This command will only work for Dev Snapends. Additionally if the tag you are using in this
|
|
320
|
+
command happens to be used by a staging or a production snapend then `sync` will not work. We do this to
|
|
321
|
+
ensure that your staging and production BYOSnap images do not get impacted.
|
|
322
|
+
|
|
323
|
+
```
|
|
324
|
+
# Help for the byosnap command
|
|
325
|
+
snapctl byosnap sync --help
|
|
326
|
+
|
|
327
|
+
# Publish a new image
|
|
328
|
+
# $byosnap_sid = Snap ID for your snap
|
|
329
|
+
# $code_root_path = Local code path where your Dockerfile is present
|
|
330
|
+
# $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.
|
|
331
|
+
# $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.
|
|
332
|
+
# $image_tag = An image tag for your snap. Note snapctl adds a timestamp, allowing you to use the same command.
|
|
333
|
+
# $version = Semantic version for your snap Eg: v0.0.1
|
|
334
|
+
# $snapend_id = Dev Snapend Id
|
|
335
|
+
# Example:
|
|
336
|
+
snapctl byosnap sync byosnap-jinks-flask --path /Users/DevName/Development/SnapserEngine/jinks_flask --tag my-first-image --version "v0.0.11" --snapend-id "jxmmfryo"
|
|
337
|
+
snapctl byosnap sync $byosnap_sid --path $code_root_path --tag $image_tag --version $version --snapend-id $snapend_id
|
|
338
|
+
```
|
|
339
|
+
|
|
313
340
|
### BYO Game Server - Bring your own Game Server
|
|
314
341
|
Snapctl commands for your custom game server
|
|
315
342
|
|
|
@@ -378,6 +405,25 @@ snapctl byogs publish --tag $image_tag --path $code_root_path --resources-path $
|
|
|
378
405
|
snapctl byogs publish --tag $image_tag --skip-build
|
|
379
406
|
```
|
|
380
407
|
|
|
408
|
+
#### 5. byogs sync
|
|
409
|
+
|
|
410
|
+
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.
|
|
411
|
+
|
|
412
|
+
```
|
|
413
|
+
# Help for the byogs command
|
|
414
|
+
snapctl byogs sync --help
|
|
415
|
+
|
|
416
|
+
# Publish a new image
|
|
417
|
+
# $code_root_path = Local code path where your Dockerfile is present
|
|
418
|
+
# $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.
|
|
419
|
+
# $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.
|
|
420
|
+
# $image_tag = An image tag for your snap. Note snapctl adds a timestamp, allowing you to use the same command.
|
|
421
|
+
# $snapend_id = Snapend Id
|
|
422
|
+
# $fleet_name = Fleet Name
|
|
423
|
+
# Example:
|
|
424
|
+
snapctl byogs sync --path /Users/DevName/Development/SnapserEngine/game_server --tag my-first-image --snapend-id "jxmmfryo" --fleet-name "my-fleet"
|
|
425
|
+
snapctl byosnap sync --path $code_root_path --tag $image_tag --snapend-id $snapend_id --fleet-name $fleet_name
|
|
426
|
+
```
|
|
381
427
|
|
|
382
428
|
### Game
|
|
383
429
|
Snapctl commands for your game
|
|
@@ -460,11 +506,12 @@ snapctl snapend download --help
|
|
|
460
506
|
# $protos-category = messages or services (only with --type protos)
|
|
461
507
|
# $auth-type = user or app (only with --type server-sdk)
|
|
462
508
|
# Example:
|
|
463
|
-
# snapctl snapend download gx5x6bc0 --category snapend-manifest --type yaml
|
|
464
|
-
# snapctl snapend download gx5x6bc0 --category
|
|
465
|
-
# snapctl snapend download gx5x6bc0 --category
|
|
466
|
-
# snapctl snapend download gx5x6bc0 --category protos --type raw --protos-category messages
|
|
467
|
-
snapctl snapend download $snapend_id --category $category --type $type
|
|
509
|
+
# snapctl snapend download --snapend-id gx5x6bc0 --category snapend-manifest --type yaml --out-path .
|
|
510
|
+
# snapctl snapend download --snapend-id gx5x6bc0 --category sdk --type unity --sdk-access-type external --sdk-auth-type user --out-path .
|
|
511
|
+
# snapctl snapend download --snapend-id gx5x6bc0 --category sdk --type cpp --sdk-access-type internal --out-path .
|
|
512
|
+
# snapctl snapend download --snapend-id gx5x6bc0 --category protos --type raw --protos-category messages --out-path .
|
|
513
|
+
snapctl snapend download $snapend_id --category $category --type $type --sdk-access-type $sdk_access_type --sdk-auth-type $sdk_auth_type --out-path $out_path
|
|
514
|
+
|
|
468
515
|
```
|
|
469
516
|
|
|
470
517
|
#### 3. Clone Snapend
|
|
@@ -540,15 +587,14 @@ snapctl snapend state $snapend_id
|
|
|
540
587
|
|
|
541
588
|
## Error codes
|
|
542
589
|
### CLI Return Codes
|
|
543
|
-
|
|
544
590
|
| Error Code | Description |
|
|
545
591
|
|------------|----------------------------------------------------------|
|
|
546
592
|
| 0 | Operation completed successfully |
|
|
547
593
|
| 1 | General error |
|
|
548
594
|
| 2 | Input error |
|
|
595
|
+
| 3 | Resource not found |
|
|
549
596
|
|
|
550
597
|
### Configuration Errors
|
|
551
|
-
|
|
552
598
|
| Error Code | Description |
|
|
553
599
|
|------------|----------------------------------------------------------|
|
|
554
600
|
| 10 | Configuration incorrect |
|
|
@@ -556,9 +602,9 @@ snapctl snapend state $snapend_id
|
|
|
556
602
|
| 12 | Dependency missing |
|
|
557
603
|
|
|
558
604
|
### BYOGS Errors
|
|
559
|
-
|
|
560
605
|
| Error Code | Description |
|
|
561
606
|
|------------|----------------------------------------------------------|
|
|
607
|
+
| 3 | BYOGs resource not found |
|
|
562
608
|
| 20 | Generic BYOGS error |
|
|
563
609
|
| 21 | BYOGS dependency missing |
|
|
564
610
|
| 22 | BYOGS ECR login error |
|
|
@@ -569,9 +615,9 @@ snapctl snapend state $snapend_id
|
|
|
569
615
|
| 27 | BYOGS publish duplicate tag error |
|
|
570
616
|
|
|
571
617
|
### BYOSNAP Errors
|
|
572
|
-
|
|
573
618
|
| Error Code | Description |
|
|
574
619
|
|------------|----------------------------------------------------------|
|
|
620
|
+
| 3 | BYOSnap resource not found |
|
|
575
621
|
| 30 | Generic BYOSNAP error |
|
|
576
622
|
| 31 | BYOSNAP dependency missing |
|
|
577
623
|
| 32 | BYOSNAP ECR login error |
|
|
@@ -587,21 +633,27 @@ snapctl snapend state $snapend_id
|
|
|
587
633
|
| 42 | BYOSNAP publish version permission error |
|
|
588
634
|
| 43 | BYOSNAP publish version duplicate version error |
|
|
589
635
|
| 44 | BYOSNAP publish version duplicate tag error |
|
|
636
|
+
| 45 | BYOSNAP update version error |
|
|
637
|
+
| 46 | BYOSNAP update version service in use |
|
|
638
|
+
| 47 | BYOSNAP update version tag error |
|
|
639
|
+
| 48 | BYOSNAP update version invalid version error |
|
|
590
640
|
|
|
591
|
-
### Game Errors
|
|
592
641
|
|
|
642
|
+
### Game Errors
|
|
593
643
|
| Error Code | Description |
|
|
594
644
|
|------------|----------------------------------------------------------|
|
|
645
|
+
| 3 | Game resource not found |
|
|
595
646
|
| 50 | Generic game error |
|
|
596
647
|
| 51 | Game create error |
|
|
597
648
|
| 52 | Game create permission error |
|
|
598
|
-
| 53 | Game create
|
|
599
|
-
| 54 | Game
|
|
649
|
+
| 53 | Game create limit error |
|
|
650
|
+
| 54 | Game create duplicate name error |
|
|
651
|
+
| 55 | Game enumerate error |
|
|
600
652
|
|
|
601
653
|
### Snapend Errors
|
|
602
|
-
|
|
603
654
|
| Error Code | Description |
|
|
604
655
|
|------------|----------------------------------------------------------|
|
|
656
|
+
| 3 | Snapend resource not found |
|
|
605
657
|
| 60 | Generic snapend error |
|
|
606
658
|
| 61 | Snapend enumerate error |
|
|
607
659
|
| 62 | Snapend clone error |
|
|
@@ -620,7 +672,6 @@ snapctl snapend state $snapend_id
|
|
|
620
672
|
| 75 | Snapend state error |
|
|
621
673
|
|
|
622
674
|
### Generate Errors
|
|
623
|
-
|
|
624
675
|
| Error Code | Description |
|
|
625
676
|
|------------|----------------------------------------------------------|
|
|
626
677
|
| 80 | Generic generate error |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
snapctl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
snapctl/__main__.py,sha256=43jKoTk8b85hk_MT6499N3ruHdEfM8WBImd_-3VzjI8,116
|
|
3
|
+
snapctl/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
snapctl/commands/byogs.py,sha256=5zY-ASJI_nqjp1p9p1ODJX7HmzShCCTDR_iazDZwnDE,18034
|
|
5
|
+
snapctl/commands/byosnap.py,sha256=h9O8Tz9Fx19xcGVREw-Q5PK8bNqHmTI8EaG-7q38jpI,43354
|
|
6
|
+
snapctl/commands/game.py,sha256=nCXtEXAJkvOw26c_OBGr7Pz4hwu-5FXHyBR2kkXhLCM,5247
|
|
7
|
+
snapctl/commands/generate.py,sha256=isiTl3SE1G7wqEWjdYPKDtlBR-HE2-iNdZK_pKgiKvY,8398
|
|
8
|
+
snapctl/commands/snapend.py,sha256=8r6bSy4BG_IIHh-xfvpL7NCdGAySB942Vzr0VcHK2TY,34677
|
|
9
|
+
snapctl/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
snapctl/config/constants.py,sha256=Mf7WhmAwB_AjNw8L36p2l6__4s-jmHXd_Egew5qELjM,3274
|
|
11
|
+
snapctl/config/endpoints.py,sha256=VAeOmx3k3ukB-9XuGI65KtCJwFK-KFgzor-UWE8JU0g,297
|
|
12
|
+
snapctl/config/hashes.py,sha256=V5nvBB4beDFIRjhfcPu6eoljNj4JwNKCPku5dJWfF_Q,4220
|
|
13
|
+
snapctl/main.py,sha256=GNnXlBBssT7_2pwebQk_q4H7i3STpz5oemUFFMuv5pg,22107
|
|
14
|
+
snapctl/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
+
snapctl/types/definitions.py,sha256=EQzLeiXkJ8ISRlCqHMviNVsWWpmhWjpKaOBLdlvOTmY,644
|
|
16
|
+
snapctl/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
snapctl/utils/echo.py,sha256=V0qgjqqGXRiueMkq31enmNmdqciC8S90qGRcK8UupXA,1090
|
|
18
|
+
snapctl/utils/helper.py,sha256=Mnxpaw2a6IHHv3_l5tfQhGJTICv-MbdnnroI8cCA9ZI,5404
|
|
19
|
+
snapctl-0.41.1.dist-info/LICENSE,sha256=6AcXm54KFSpmUI1ji9NIBd4Xl-DtjTqiyjBzfVb_CEk,2804
|
|
20
|
+
snapctl-0.41.1.dist-info/METADATA,sha256=PJGBo30Fg5MlZPy7XFXI72Qe8pUO-muLaqEYb-tZu2I,26742
|
|
21
|
+
snapctl-0.41.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
22
|
+
snapctl-0.41.1.dist-info/entry_points.txt,sha256=tkKW9MzmFdRs6Bgkv29G78i9WEBK4WIOWunPfe3t2Wg,44
|
|
23
|
+
snapctl-0.41.1.dist-info/RECORD,,
|
snapctl-0.39.3.dist-info/RECORD
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
snapctl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
snapctl/__main__.py,sha256=43jKoTk8b85hk_MT6499N3ruHdEfM8WBImd_-3VzjI8,116
|
|
3
|
-
snapctl/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
snapctl/commands/byogs.py,sha256=spEQvIIrKXhkUvR1OqKlr7r0MK3FEl7raw1qcKjbAjg,15196
|
|
5
|
-
snapctl/commands/byosnap.py,sha256=tCPRbF6EsHjB4Jv9f8dwCUIcd8vdwhYJv-3FmpJ1u1U,33061
|
|
6
|
-
snapctl/commands/game.py,sha256=icAPD8derxtgXHZQvziHd1O8fwD5Kw7HFMA8yXOUSRQ,4344
|
|
7
|
-
snapctl/commands/generate.py,sha256=7z4nyqDuAieFmIg-XVIri2xkXPpDJd0E3uKYIfQtBqE,7891
|
|
8
|
-
snapctl/commands/snapend.py,sha256=aYKeBZNwDMGWPsYl4qOCkVsrotkE2vzUobfg8AkRetw,30741
|
|
9
|
-
snapctl/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
snapctl/config/constants.py,sha256=fX-SVFpra8uNay0Qj63t8PHEy6KtA5u6Y8SEDMMehTA,2735
|
|
11
|
-
snapctl/config/endpoints.py,sha256=VAeOmx3k3ukB-9XuGI65KtCJwFK-KFgzor-UWE8JU0g,297
|
|
12
|
-
snapctl/config/hashes.py,sha256=7jkMYfMAcgdque5PN10-B3QqwoXvtsuJKJr9dKZUvJ8,4139
|
|
13
|
-
snapctl/main.py,sha256=XEpJSIkp3_ymemykN0Xevyu2B8xSDZuLgZU4RmEjUEg,20094
|
|
14
|
-
snapctl/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
-
snapctl/types/definitions.py,sha256=EQzLeiXkJ8ISRlCqHMviNVsWWpmhWjpKaOBLdlvOTmY,644
|
|
16
|
-
snapctl/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
-
snapctl/utils/echo.py,sha256=V0qgjqqGXRiueMkq31enmNmdqciC8S90qGRcK8UupXA,1090
|
|
18
|
-
snapctl/utils/helper.py,sha256=XSn0x46mED86kQU1UlmuvJY9GsXO3Ncoba18Lb6FE8k,5522
|
|
19
|
-
snapctl-0.39.3.dist-info/LICENSE,sha256=6AcXm54KFSpmUI1ji9NIBd4Xl-DtjTqiyjBzfVb_CEk,2804
|
|
20
|
-
snapctl-0.39.3.dist-info/METADATA,sha256=YUr408Kn3_92rmL5JvX7WPQAp-u-OJT3b6h04nSAUoI,22833
|
|
21
|
-
snapctl-0.39.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
22
|
-
snapctl-0.39.3.dist-info/entry_points.txt,sha256=tkKW9MzmFdRs6Bgkv29G78i9WEBK4WIOWunPfe3t2Wg,44
|
|
23
|
-
snapctl-0.39.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|