snapctl 0.32.0__tar.gz → 0.32.2__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.

Files changed (30) hide show
  1. {snapctl-0.32.0 → snapctl-0.32.2}/PKG-INFO +120 -8
  2. {snapctl-0.32.0 → snapctl-0.32.2}/README.md +116 -6
  3. {snapctl-0.32.0 → snapctl-0.32.2}/pyproject.toml +4 -2
  4. snapctl-0.32.2/snapctl/commands/byogs.py +319 -0
  5. snapctl-0.32.2/snapctl/commands/byosnap.py +653 -0
  6. snapctl-0.32.2/snapctl/commands/game.py +113 -0
  7. snapctl-0.32.2/snapctl/commands/generate.py +93 -0
  8. snapctl-0.32.2/snapctl/commands/snapend.py +691 -0
  9. snapctl-0.32.2/snapctl/config/constants.py +91 -0
  10. {snapctl-0.32.0 → snapctl-0.32.2}/snapctl/main.py +100 -135
  11. snapctl-0.32.2/snapctl/types/definitions.py +28 -0
  12. {snapctl-0.32.0 → snapctl-0.32.2}/snapctl/utils/echo.py +10 -2
  13. snapctl-0.32.2/snapctl/utils/helper.py +95 -0
  14. snapctl-0.32.0/snapctl/commands/byogs.py +0 -325
  15. snapctl-0.32.0/snapctl/commands/byosnap.py +0 -646
  16. snapctl-0.32.0/snapctl/commands/game.py +0 -107
  17. snapctl-0.32.0/snapctl/commands/generate.py +0 -77
  18. snapctl-0.32.0/snapctl/commands/snapend.py +0 -611
  19. snapctl-0.32.0/snapctl/config/constants.py +0 -27
  20. snapctl-0.32.0/snapctl/types/definitions.py +0 -12
  21. snapctl-0.32.0/snapctl/utils/helper.py +0 -38
  22. {snapctl-0.32.0 → snapctl-0.32.2}/LICENSE +0 -0
  23. {snapctl-0.32.0 → snapctl-0.32.2}/snapctl/__init__.py +0 -0
  24. {snapctl-0.32.0 → snapctl-0.32.2}/snapctl/__main__.py +0 -0
  25. {snapctl-0.32.0 → snapctl-0.32.2}/snapctl/commands/__init__.py +0 -0
  26. {snapctl-0.32.0 → snapctl-0.32.2}/snapctl/config/__init__.py +0 -0
  27. {snapctl-0.32.0 → snapctl-0.32.2}/snapctl/config/endpoints.py +0 -0
  28. {snapctl-0.32.0 → snapctl-0.32.2}/snapctl/config/hashes.py +0 -0
  29. {snapctl-0.32.0 → snapctl-0.32.2}/snapctl/types/__init__.py +0 -0
  30. {snapctl-0.32.0 → snapctl-0.32.2}/snapctl/utils/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: snapctl
3
- Version: 0.32.0
3
+ Version: 0.32.2
4
4
  Summary: Snapser CLI Tool
5
5
  Author: Ajinkya Apte
6
6
  Author-email: aj@snapser.com
@@ -11,8 +11,10 @@ Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: Programming Language :: Python :: 3.12
12
12
  Requires-Dist: configparser (>=6.0.0,<7.0.0)
13
13
  Requires-Dist: pyfiglet (>=1.0.2,<2.0.0)
14
+ Requires-Dist: pytest (>=8.2.2,<9.0.0)
15
+ Requires-Dist: pytest-mock (>=3.14.0,<4.0.0)
14
16
  Requires-Dist: requests (>=2.28.2,<3.0.0)
15
- Requires-Dist: typer[all] (>=0.7.0,<0.8.0)
17
+ Requires-Dist: typer[all] (>=0.12.3,<0.13.0)
16
18
  Description-Content-Type: text/markdown
17
19
 
18
20
  # Snapser CLI Tool
@@ -175,6 +177,7 @@ snapctl --help
175
177
  ```
176
178
 
177
179
  ### BYO Snap - Bring your own Snap
180
+ Snapctl commands for your custom code
178
181
 
179
182
  #### 1. byosnap help
180
183
 
@@ -206,7 +209,7 @@ snapctl byosnap create --help
206
209
  snapctl byosnap create $byosnap_sid --name "$name" --desc "$desc" --platform "$platform" --language "$language"
207
210
  ```
208
211
 
209
- ### 3. byosnap build
212
+ #### 3. byosnap build
210
213
 
211
214
  Build your snap image
212
215
 
@@ -223,7 +226,7 @@ snapctl byosnap build --help
223
226
  snapctl byosnap build $byosnap_sid --tag $image_tag --path $code_root_path
224
227
  ```
225
228
 
226
- ### 4. byosnap push
229
+ #### 4. byosnap push
227
230
 
228
231
  Push your snap image to Snapser
229
232
 
@@ -289,12 +292,14 @@ snapctl byosnap publish-version --help
289
292
  # $prefix = Prefix for your snap Eg: /v1
290
293
  # $version = Semantic version for your snap Eg: v0.0.1
291
294
  # $ingress_port = Ingress port for your snap Eg: 5003
295
+ # $byosnap_profile = BYOSnap profile to configure dev, stage and prod settings for this snap. You can generate a base version of this file using the `snapctl generate byosnap` command
292
296
  # Example:
293
- # snapctl byosnap publish-image byosnap-jinks-flask --tag my-first-image --prefix /v1 --version v0.0.1 --http-port 5003
294
- snapctl byosnap publish-version $byosnap_sid --tag $image_tag --prefix $prefix --version $version --http-port $ingress_port
297
+ # snapctl byosnap publish-image byosnap-jinks-flask --tag my-first-image --prefix /v1 --version v0.0.1 --http-port 5003 --byosnap-profile /Users/DevName/Development/SnapserEngine/jinks_flask/snapser-byosnap-profile.json
298
+ snapctl byosnap publish-version $byosnap_sid --tag $image_tag --prefix $prefix --version $version --http-port $ingress_port --byosnap-profile $byosnap_profile
295
299
  ```
296
300
 
297
301
  ### BYO Game Server - Bring your own Game Server
302
+ Snapctl commands for your custom game server
298
303
 
299
304
  #### 1. byogs help
300
305
 
@@ -355,14 +360,15 @@ snapctl byogs publish --tag $image_tag --path $code_root_path
355
360
 
356
361
 
357
362
  ### Game
363
+ Snapctl commands for your game
358
364
 
359
- #### 1. snapend help
365
+ #### 1. game help
360
366
 
361
367
  See all the supported commands
362
368
 
363
369
  ```
364
370
  # Help for the byogs command
365
- snapctl snapend --help
371
+ snapctl game --help
366
372
  ```
367
373
 
368
374
  #### 2. Create a game
@@ -377,8 +383,26 @@ List all the games
377
383
  snapctl game enumerate
378
384
  ```
379
385
 
386
+ ### Generate
387
+ Generator tool to help generate base files to be used in other commands
388
+
389
+ #### 1. generate help
390
+ See all the supported commands
391
+ ```
392
+ # Help for the generate command
393
+ snapctl generate --help
394
+ ```
395
+
396
+ #### 2. BYOSnap Profile
397
+ Generate the base file for BYOSnap profile to be used in the `snapctl byosnap publish-version` command
398
+
399
+ ```
400
+ snapctl generate byosnap-profile --out-path $output_path
401
+
402
+ ```
380
403
 
381
404
  ### Snapend
405
+ Snapctl commands for your snapend
382
406
 
383
407
  #### 1. snapend help
384
408
 
@@ -486,3 +510,91 @@ snapctl snapend state --help
486
510
  snapctl snapend state $snapend_id
487
511
  ```
488
512
 
513
+ ## Error codes
514
+ ### CLI Return Codes
515
+
516
+ | Error Code | Description |
517
+ |------------|----------------------------------------------------------|
518
+ | 0 | Operation completed successfully |
519
+ | 1 | General error |
520
+ | 2 | Input error |
521
+
522
+ ### Configuration Errors
523
+
524
+ | Error Code | Description |
525
+ |------------|----------------------------------------------------------|
526
+ | 10 | Configuration incorrect |
527
+ | 11 | Configuration error |
528
+ | 12 | Dependency missing |
529
+
530
+ ### BYOGS Errors
531
+
532
+ | Error Code | Description |
533
+ |------------|----------------------------------------------------------|
534
+ | 20 | Generic BYOGS error |
535
+ | 21 | BYOGS dependency missing |
536
+ | 22 | BYOGS ECR login error |
537
+ | 23 | BYOGS build error |
538
+ | 24 | BYOGS tag error |
539
+ | 25 | BYOGS publish error |
540
+ | 26 | BYOGS publish permission error |
541
+ | 27 | BYOGS publish duplicate tag error |
542
+
543
+ ### BYOSNAP Errors
544
+
545
+ | Error Code | Description |
546
+ |------------|----------------------------------------------------------|
547
+ | 30 | Generic BYOSNAP error |
548
+ | 31 | BYOSNAP dependency missing |
549
+ | 32 | BYOSNAP ECR login error |
550
+ | 33 | BYOSNAP build error |
551
+ | 34 | BYOSNAP tag error |
552
+ | 35 | BYOSNAP publish image error |
553
+ | 36 | BYOSNAP publish image permission error |
554
+ | 37 | BYOSNAP publish image duplicate tag error |
555
+ | 38 | BYOSNAP create error |
556
+ | 39 | BYOSNAP create permission error |
557
+ | 40 | BYOSNAP create duplicate name error |
558
+ | 41 | BYOSNAP publish version error |
559
+ | 42 | BYOSNAP publish version permission error |
560
+ | 43 | BYOSNAP publish version duplicate version error |
561
+ | 44 | BYOSNAP publish version duplicate tag error |
562
+
563
+ ### Game Errors
564
+
565
+ | Error Code | Description |
566
+ |------------|----------------------------------------------------------|
567
+ | 50 | Generic game error |
568
+ | 51 | Game create error |
569
+ | 52 | Game create permission error |
570
+ | 53 | Game create duplicate name error |
571
+ | 54 | Game enumerate error |
572
+
573
+ ### Snapend Errors
574
+
575
+ | Error Code | Description |
576
+ |------------|----------------------------------------------------------|
577
+ | 60 | Generic snapend error |
578
+ | 61 | Snapend enumerate error |
579
+ | 62 | Snapend clone error |
580
+ | 63 | Snapend clone server error |
581
+ | 64 | Snapend clone timeout error |
582
+ | 65 | Snapend apply error |
583
+ | 66 | Snapend apply server error |
584
+ | 67 | Snapend apply timeout error |
585
+ | 68 | Snapend promote error |
586
+ | 69 | Snapend promote server error |
587
+ | 70 | Snapend promote timeout error |
588
+ | 71 | Snapend download error |
589
+ | 72 | Snapend update error |
590
+ | 73 | Snapend update server error |
591
+ | 74 | Snapend update timeout error |
592
+ | 75 | Snapend state error |
593
+
594
+ ### Generate Errors
595
+
596
+ | Error Code | Description |
597
+ |------------|----------------------------------------------------------|
598
+ | 80 | Generic generate error |
599
+ | 81 | Generate BYOSNAP profile error |
600
+
@@ -158,6 +158,7 @@ snapctl --help
158
158
  ```
159
159
 
160
160
  ### BYO Snap - Bring your own Snap
161
+ Snapctl commands for your custom code
161
162
 
162
163
  #### 1. byosnap help
163
164
 
@@ -189,7 +190,7 @@ snapctl byosnap create --help
189
190
  snapctl byosnap create $byosnap_sid --name "$name" --desc "$desc" --platform "$platform" --language "$language"
190
191
  ```
191
192
 
192
- ### 3. byosnap build
193
+ #### 3. byosnap build
193
194
 
194
195
  Build your snap image
195
196
 
@@ -206,7 +207,7 @@ snapctl byosnap build --help
206
207
  snapctl byosnap build $byosnap_sid --tag $image_tag --path $code_root_path
207
208
  ```
208
209
 
209
- ### 4. byosnap push
210
+ #### 4. byosnap push
210
211
 
211
212
  Push your snap image to Snapser
212
213
 
@@ -272,12 +273,14 @@ snapctl byosnap publish-version --help
272
273
  # $prefix = Prefix for your snap Eg: /v1
273
274
  # $version = Semantic version for your snap Eg: v0.0.1
274
275
  # $ingress_port = Ingress port for your snap Eg: 5003
276
+ # $byosnap_profile = BYOSnap profile to configure dev, stage and prod settings for this snap. You can generate a base version of this file using the `snapctl generate byosnap` command
275
277
  # Example:
276
- # snapctl byosnap publish-image byosnap-jinks-flask --tag my-first-image --prefix /v1 --version v0.0.1 --http-port 5003
277
- snapctl byosnap publish-version $byosnap_sid --tag $image_tag --prefix $prefix --version $version --http-port $ingress_port
278
+ # snapctl byosnap publish-image byosnap-jinks-flask --tag my-first-image --prefix /v1 --version v0.0.1 --http-port 5003 --byosnap-profile /Users/DevName/Development/SnapserEngine/jinks_flask/snapser-byosnap-profile.json
279
+ snapctl byosnap publish-version $byosnap_sid --tag $image_tag --prefix $prefix --version $version --http-port $ingress_port --byosnap-profile $byosnap_profile
278
280
  ```
279
281
 
280
282
  ### BYO Game Server - Bring your own Game Server
283
+ Snapctl commands for your custom game server
281
284
 
282
285
  #### 1. byogs help
283
286
 
@@ -338,14 +341,15 @@ snapctl byogs publish --tag $image_tag --path $code_root_path
338
341
 
339
342
 
340
343
  ### Game
344
+ Snapctl commands for your game
341
345
 
342
- #### 1. snapend help
346
+ #### 1. game help
343
347
 
344
348
  See all the supported commands
345
349
 
346
350
  ```
347
351
  # Help for the byogs command
348
- snapctl snapend --help
352
+ snapctl game --help
349
353
  ```
350
354
 
351
355
  #### 2. Create a game
@@ -360,8 +364,26 @@ List all the games
360
364
  snapctl game enumerate
361
365
  ```
362
366
 
367
+ ### Generate
368
+ Generator tool to help generate base files to be used in other commands
369
+
370
+ #### 1. generate help
371
+ See all the supported commands
372
+ ```
373
+ # Help for the generate command
374
+ snapctl generate --help
375
+ ```
376
+
377
+ #### 2. BYOSnap Profile
378
+ Generate the base file for BYOSnap profile to be used in the `snapctl byosnap publish-version` command
379
+
380
+ ```
381
+ snapctl generate byosnap-profile --out-path $output_path
382
+
383
+ ```
363
384
 
364
385
  ### Snapend
386
+ Snapctl commands for your snapend
365
387
 
366
388
  #### 1. snapend help
367
389
 
@@ -468,3 +490,91 @@ snapctl snapend state --help
468
490
  # snapctl snapend state gx5x6bc0
469
491
  snapctl snapend state $snapend_id
470
492
  ```
493
+
494
+ ## Error codes
495
+ ### CLI Return Codes
496
+
497
+ | Error Code | Description |
498
+ |------------|----------------------------------------------------------|
499
+ | 0 | Operation completed successfully |
500
+ | 1 | General error |
501
+ | 2 | Input error |
502
+
503
+ ### Configuration Errors
504
+
505
+ | Error Code | Description |
506
+ |------------|----------------------------------------------------------|
507
+ | 10 | Configuration incorrect |
508
+ | 11 | Configuration error |
509
+ | 12 | Dependency missing |
510
+
511
+ ### BYOGS Errors
512
+
513
+ | Error Code | Description |
514
+ |------------|----------------------------------------------------------|
515
+ | 20 | Generic BYOGS error |
516
+ | 21 | BYOGS dependency missing |
517
+ | 22 | BYOGS ECR login error |
518
+ | 23 | BYOGS build error |
519
+ | 24 | BYOGS tag error |
520
+ | 25 | BYOGS publish error |
521
+ | 26 | BYOGS publish permission error |
522
+ | 27 | BYOGS publish duplicate tag error |
523
+
524
+ ### BYOSNAP Errors
525
+
526
+ | Error Code | Description |
527
+ |------------|----------------------------------------------------------|
528
+ | 30 | Generic BYOSNAP error |
529
+ | 31 | BYOSNAP dependency missing |
530
+ | 32 | BYOSNAP ECR login error |
531
+ | 33 | BYOSNAP build error |
532
+ | 34 | BYOSNAP tag error |
533
+ | 35 | BYOSNAP publish image error |
534
+ | 36 | BYOSNAP publish image permission error |
535
+ | 37 | BYOSNAP publish image duplicate tag error |
536
+ | 38 | BYOSNAP create error |
537
+ | 39 | BYOSNAP create permission error |
538
+ | 40 | BYOSNAP create duplicate name error |
539
+ | 41 | BYOSNAP publish version error |
540
+ | 42 | BYOSNAP publish version permission error |
541
+ | 43 | BYOSNAP publish version duplicate version error |
542
+ | 44 | BYOSNAP publish version duplicate tag error |
543
+
544
+ ### Game Errors
545
+
546
+ | Error Code | Description |
547
+ |------------|----------------------------------------------------------|
548
+ | 50 | Generic game error |
549
+ | 51 | Game create error |
550
+ | 52 | Game create permission error |
551
+ | 53 | Game create duplicate name error |
552
+ | 54 | Game enumerate error |
553
+
554
+ ### Snapend Errors
555
+
556
+ | Error Code | Description |
557
+ |------------|----------------------------------------------------------|
558
+ | 60 | Generic snapend error |
559
+ | 61 | Snapend enumerate error |
560
+ | 62 | Snapend clone error |
561
+ | 63 | Snapend clone server error |
562
+ | 64 | Snapend clone timeout error |
563
+ | 65 | Snapend apply error |
564
+ | 66 | Snapend apply server error |
565
+ | 67 | Snapend apply timeout error |
566
+ | 68 | Snapend promote error |
567
+ | 69 | Snapend promote server error |
568
+ | 70 | Snapend promote timeout error |
569
+ | 71 | Snapend download error |
570
+ | 72 | Snapend update error |
571
+ | 73 | Snapend update server error |
572
+ | 74 | Snapend update timeout error |
573
+ | 75 | Snapend state error |
574
+
575
+ ### Generate Errors
576
+
577
+ | Error Code | Description |
578
+ |------------|----------------------------------------------------------|
579
+ | 80 | Generic generate error |
580
+ | 81 | Generate BYOSNAP profile error |
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "snapctl"
3
- version = "0.32.0"
3
+ version = "0.32.2"
4
4
  description = "Snapser CLI Tool"
5
5
  authors = ["Ajinkya Apte <aj@snapser.com>"]
6
6
  readme = "README.md"
@@ -11,10 +11,12 @@ snapctl = "snapctl.main:app"
11
11
 
12
12
  [tool.poetry.dependencies]
13
13
  python = "^3.10"
14
- typer = {extras = ["all"], version = "^0.7.0"}
14
+ typer = {extras = ["all"], version = "^0.12.3"}
15
15
  requests = "^2.28.2"
16
16
  configparser = "^6.0.0"
17
17
  pyfiglet = "^1.0.2"
18
+ pytest = "^8.2.2"
19
+ pytest-mock = "^3.14.0"
18
20
 
19
21
 
20
22
  [build-system]