cgcsdk 1.0.16__py3-none-any.whl → 1.0.17__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.
cgc/.env CHANGED
@@ -6,4 +6,4 @@ CONFIG_FILE_NAME = cfg.json
6
6
  TMP_DIR = .tmp
7
7
  RELEASE = 1
8
8
  MAJOR_VERSION = 0
9
- MINOR_VERSION = 16
9
+ MINOR_VERSION = 17
cgc/CHANGELOG.md CHANGED
@@ -1,8 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.0.17
4
+
5
+ Release on Aug 19, 2024
6
+
7
+ * `cgc port list` now shows which ports are ingress (`cgc resource ingress app_name`)
8
+ * fix bug for the `cgc keys ssh create` command
9
+ * `cgc context list` now shows which context is active
10
+ * `cgc context list` now shows context server address
11
+
3
12
  ## 1.0.16
4
13
 
5
- Release on Aug XX, 2024
14
+ Release on Aug 02, 2024
6
15
 
7
16
  * dynamic storage classes for volumes
8
17
  * dynamic templates available for compute
@@ -1,12 +1,18 @@
1
1
  from typing import List
2
2
  from cgc.utils import quick_sort
3
- from cgc.utils.config_utils import read_from_cfg
3
+ from cgc.utils.config_utils import get_config_file_name, read_from_cfg
4
4
  from tabulate import tabulate
5
5
 
6
6
 
7
+ def _is_main_context_file(file: str) -> bool:
8
+ if get_config_file_name() == file:
9
+ return True
10
+ return None
11
+
12
+
7
13
  def table_of_user_context_files(config_files: List[str]):
8
14
  # print tabulate of: [context NR | namespace | user_id]
9
- headers = ["Context No.", "Namespace", "User ID"]
15
+ headers = ["Context No.", "Namespace", "User ID", "URL", "Is active"]
10
16
  contexts = []
11
17
  contexts_nrs = []
12
18
  for file in config_files:
@@ -16,13 +22,17 @@ def table_of_user_context_files(config_files: List[str]):
16
22
  ) # should never throw exception with good config_file list
17
23
  contexts_nrs.append(file_context[0])
18
24
  file_data = read_from_cfg(None, file)
19
- values_to_read = ["namespace", "user_id"]
25
+ values_to_read = ["namespace", "user_id", "cgc_api_url"]
20
26
  for k in values_to_read:
21
27
  try:
22
28
  value = file_data[k]
23
29
  except KeyError:
24
30
  value = None
31
+ if k == "cgc_api_url":
32
+ value = "https://cgc-api.comtegra.cloud:443"
25
33
  file_context.append(value)
34
+
35
+ file_context.append(_is_main_context_file(file))
26
36
  contexts.append(file_context)
27
37
 
28
38
  contexts_nrs_sorted = quick_sort(contexts_nrs)
@@ -9,12 +9,16 @@ from cgc.utils.response_utils import (
9
9
  tabulate_a_response,
10
10
  fill_missing_values_in_a_response,
11
11
  )
12
- from cgc.utils.message_utils import prepare_warning_message
13
12
 
14
13
 
15
14
  @key_error_decorator_for_helpers
16
15
  def get_compute_port_list(data: dict) -> list:
17
- return data["details"]["ports"]["ports"]
16
+ resource_ports_data = data["details"]["ports"]["ports"]
17
+ ingress_data = data["details"]["ingress"]
18
+ ingress_port_names = [port["port_name"] for port in ingress_data]
19
+ for port in resource_ports_data:
20
+ port["ingress"] = True if port["name"] in ingress_port_names else False
21
+ return resource_ports_data
18
22
 
19
23
 
20
24
  @key_error_decorator_for_helpers
@@ -14,3 +14,18 @@ class SSHKeyTypes(CGCEntityList):
14
14
  ECDSA_P384 = "ecdsa-sha2-nistp384"
15
15
  ECDSA_P521 = "ecdsa-sha2-nistp521"
16
16
  ED25519 = "ssh-ed25519"
17
+
18
+ def load_data() -> list:
19
+ """Return list of supported SSH key types
20
+
21
+ :return: list of supported SSH key types
22
+ :rtype: list
23
+ """
24
+ return [
25
+ SSHKeyTypes.RSA,
26
+ SSHKeyTypes.DSS,
27
+ SSHKeyTypes.ECDSA_P256,
28
+ SSHKeyTypes.ECDSA_P384,
29
+ SSHKeyTypes.ECDSA_P521,
30
+ SSHKeyTypes.ED25519,
31
+ ]
@@ -1,23 +1,20 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cgcsdk
3
- Version: 1.0.16
4
- Summary: Comtegra GPU Cloud REST API client
5
- Home-page: https://git.comtegra.pl/
3
+ Version: 1.0.17
4
+ Summary: CGC Core REST API client
5
+ Home-page: https://cgc.comtegra.cloud/
6
6
  Author: Comtegra AI Team
7
7
  Author-email: ai@comtegra.pl
8
8
  License: BSD 2-clause
9
9
  Project-URL: Documentation, https://docs.cgc.comtegra.cloud/
10
- Project-URL: GitHub, https://git.comtegra.pl/
11
- Project-URL: Changelog, https://git.comtegra.pl/foobar/foobar/blob/master/CHANGELOG.md
12
- Keywords: cloud,sdk,orchestrator,kubernetes,jupyter-notebook
13
- Classifier: Development Status :: 1 - Planning
10
+ Project-URL: GitHub, https://git.comtegra.pl/k8s/cgc-client-k8s-cloud
11
+ Project-URL: Changelog, https://git.comtegra.pl/k8s/cgc-client-k8s-cloud/-/blob/main/cgc/CHANGELOG.md
12
+ Keywords: cloud,sdk,orchestrator,kubernetes,jupyter-notebook,cgc-core
13
+ Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Intended Audience :: Science/Research
15
15
  Classifier: License :: OSI Approved :: BSD License
16
16
  Classifier: Operating System :: POSIX :: Linux
17
17
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
- Classifier: Programming Language :: Python :: 3.9
20
- Classifier: Programming Language :: Python :: 3.10
21
18
  Classifier: Programming Language :: Python :: 3.11
22
19
  Classifier: Programming Language :: Python :: 3.12
23
20
  Description-Content-Type: text/markdown
@@ -1,12 +1,12 @@
1
- cgc/.env,sha256=VMwTqev7-Fa9XaP3Ofy8Th-Dl2GurIWONmQgSLCUl2A,210
2
- cgc/CHANGELOG.md,sha256=gbcedsO6U2gjiefnjcOYV4czqaG0-QmtsSnykXZ_iL4,9625
1
+ cgc/.env,sha256=Re91I-x2HkLXGiieZbGPUmTXuYxjYGiqkmM5QR5Xf7g,210
2
+ cgc/CHANGELOG.md,sha256=tMdiR1vQVf5S3wuA0zGVHRgj_ng1lcVmfy3Gu-YN2ME,9905
3
3
  cgc/__init__.py,sha256=d03Xv8Pw4ktNyUHfmicP6XfxYPXnVYLaCZPyUlg_RNQ,326
4
4
  cgc/cgc.py,sha256=3I_Ef0ggX9caaJKJkhfGYSe8XwkHzSWxwGAClMHDnUs,1663
5
5
  cgc/config.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  cgc/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  cgc/commands/cgc_cmd.py,sha256=xuRoMtO7VG0sZbOFrEGxPWRg94SBrgyRJDQif4el7UM,5031
8
8
  cgc/commands/cgc_cmd_responses.py,sha256=0bkRIxfd7EiVdShOubxhDiUSlGj6yEZQL_NOHtu334k,3525
9
- cgc/commands/cgc_helpers.py,sha256=ngArFjVw-8P_2g7J8k3b9xgDxfJw7JeaOtkhTySMSGU,1174
9
+ cgc/commands/cgc_helpers.py,sha256=-RduMrEDknGx-bxLRUX413JY9nuqWxBIGcwbwWrnDb4,1516
10
10
  cgc/commands/cgc_models.py,sha256=ThYrflL6gfiu3u3cWCbiisY7vfkKbo9JGqd5Jqr2jXc,352
11
11
  cgc/commands/exceptions.py,sha256=kVCWEdcqmkLO5QVIINdEXQw29_glyX2C11ZMFgT7b8E,155
12
12
  cgc/commands/auth/__init__.py,sha256=JnqNezSEUEVVPQIymya4llXr8LIug2vymQSAGBr4Ovg,397
@@ -17,7 +17,7 @@ cgc/commands/auth/auth_utils.py,sha256=8NZQQuR0JDCxRkNOHy8nRLDpeT3W87iNyaBI1owj7
17
17
  cgc/commands/compute/__init__.py,sha256=lCdLfZ0ECSHtXEUSwq5YRHH85yXHchSsz8ZJvmClPtI,239
18
18
  cgc/commands/compute/compute_cmd.py,sha256=YZYR0milioX8aShLUC5NSKWcJSimQx6d4WmweAgdCrw,16131
19
19
  cgc/commands/compute/compute_models.py,sha256=MNwxG94fFJfaQ3kGlVXSJh1H5qPHLSU_6BnoiuWS7UA,860
20
- cgc/commands/compute/compute_responses.py,sha256=DnRIZC_F1ZE887fMOXXYGYuYmB9n5x63sf8Ga_TL4Ww,5806
20
+ cgc/commands/compute/compute_responses.py,sha256=vBZtb8ieHUi8wbRBozMn0wYGhjFTMGBbIxSPMD2hG1Q,6025
21
21
  cgc/commands/compute/compute_utils.py,sha256=Pj4xa-C8-MzXF-CCnnHNXn0sXjHy_t-N7c-eig-vF1Y,9182
22
22
  cgc/commands/compute/billing/__init__.py,sha256=ccjz-AzBCROjuR11qZRM4_62slI9ErmLi27xPUoRPHM,752
23
23
  cgc/commands/compute/billing/billing_cmd.py,sha256=8lGf2GPyr09ZmqkRshmgfSPQgXa9o_IDSfwZgMfBE4k,4156
@@ -37,7 +37,7 @@ cgc/commands/resource/resource_cmd.py,sha256=y2R6ZF0jFhTppD9JUpwLIcEdFRXg82Xw_5y
37
37
  cgc/commands/resource/resource_responses.py,sha256=sES7mAi_Cv5B6Z3I_6eUOqVwOr2HgMO45cz8MiNZetQ,197
38
38
  cgc/commands/user/__init__.py,sha256=Rhaa2SDXQsJVJnTX0oFyZ90tAuiAUBeRy3Bd415S4os,382
39
39
  cgc/commands/user/keys_cmd.py,sha256=dfHnhHmEwRH1xl_wRNQcpCT-THJTBYPHMTJSI2AsDXE,4509
40
- cgc/commands/user/keys_models.py,sha256=IYojnAu3aTGJ7qHIYvZy-0YFzXRmueZNplS4RqdfJfw,378
40
+ cgc/commands/user/keys_models.py,sha256=FhpVZ--AUQf-Q8cvnSD2Gysrh38awqXSc-jT3yKnk2s,767
41
41
  cgc/commands/user/keys_responses.py,sha256=TBHFWAVN1kEgP6sudbMwfpiZOcfTr0a0SD-f-Wn-ed8,1389
42
42
  cgc/commands/user/keys_utils.py,sha256=w1TcMTlKJNxXjnj-XsiUU8N__-l1TsWqfPPjGpRqtI0,2285
43
43
  cgc/commands/user/secret_cmd.py,sha256=_b9ewJlEE4gMCrgdyycpO5MOdJvibeHObAiPE-mWIgA,4165
@@ -85,9 +85,9 @@ cgc/utils/cryptography/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
85
85
  cgc/utils/cryptography/aes_crypto.py,sha256=S0rKg38oy7rM5lTrP6DDpjLA-XRxuZggAXyxMFHtyzY,3333
86
86
  cgc/utils/cryptography/encryption_module.py,sha256=rbblBBorHYPGl-iKblyZX3_NuPEvUTpnH1l_RgNGCbA,1958
87
87
  cgc/utils/cryptography/rsa_crypto.py,sha256=h3jU5qPpj9uVjP1rTqZJTdYB5yjhD9HZpr_nD439h9Q,4180
88
- cgcsdk-1.0.16.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
- cgcsdk-1.0.16.dist-info/METADATA,sha256=omC-JocyzpOolm58Rv7yP2lYEqvBDwAfl8EPP_OsGSw,3091
90
- cgcsdk-1.0.16.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
91
- cgcsdk-1.0.16.dist-info/entry_points.txt,sha256=bdfIHeJ6Y-BBr5yupCVoK7SUrJj1yNdew8OtIOg_3No,36
92
- cgcsdk-1.0.16.dist-info/top_level.txt,sha256=nqW9tqcIcCXFigQT69AuOk7XHKc4pCuv4HGJQGXb6iA,12
93
- cgcsdk-1.0.16.dist-info/RECORD,,
88
+ cgcsdk-1.0.17.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
+ cgcsdk-1.0.17.dist-info/METADATA,sha256=3cWZFg06Ft1oFBGe-AbyHYVrLeKn2NT8Mino5qnDmqA,2987
90
+ cgcsdk-1.0.17.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
91
+ cgcsdk-1.0.17.dist-info/entry_points.txt,sha256=bdfIHeJ6Y-BBr5yupCVoK7SUrJj1yNdew8OtIOg_3No,36
92
+ cgcsdk-1.0.17.dist-info/top_level.txt,sha256=nqW9tqcIcCXFigQT69AuOk7XHKc4pCuv4HGJQGXb6iA,12
93
+ cgcsdk-1.0.17.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.1.0)
2
+ Generator: setuptools (72.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5