datacrunch 1.11.0__tar.gz → 1.12.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.
Files changed (75) hide show
  1. {datacrunch-1.11.0 → datacrunch-1.12.1}/PKG-INFO +1 -1
  2. datacrunch-1.12.1/datacrunch/__version__.py +1 -0
  3. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/containers/containers.py +52 -0
  4. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch.egg-info/PKG-INFO +1 -1
  5. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/containers/test_containers.py +2 -1
  6. datacrunch-1.11.0/datacrunch/__version__.py +0 -1
  7. {datacrunch-1.11.0 → datacrunch-1.12.1}/LICENSE +0 -0
  8. {datacrunch-1.11.0 → datacrunch-1.12.1}/README.md +0 -0
  9. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/InferenceClient/__init__.py +0 -0
  10. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/InferenceClient/inference_client.py +0 -0
  11. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/__init__.py +0 -0
  12. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/authentication/__init__.py +0 -0
  13. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/authentication/authentication.py +0 -0
  14. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/balance/__init__.py +0 -0
  15. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/balance/balance.py +0 -0
  16. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/constants.py +0 -0
  17. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/containers/__init__.py +0 -0
  18. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/datacrunch.py +0 -0
  19. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/exceptions.py +0 -0
  20. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/helpers.py +0 -0
  21. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/http_client/__init__.py +0 -0
  22. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/http_client/http_client.py +0 -0
  23. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/images/__init__.py +0 -0
  24. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/images/images.py +0 -0
  25. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/instance_types/__init__.py +0 -0
  26. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/instance_types/instance_types.py +0 -0
  27. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/instances/__init__.py +0 -0
  28. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/instances/instances.py +0 -0
  29. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/locations/__init__.py +0 -0
  30. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/locations/locations.py +0 -0
  31. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/ssh_keys/__init__.py +0 -0
  32. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/ssh_keys/ssh_keys.py +0 -0
  33. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/startup_scripts/__init__.py +0 -0
  34. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/startup_scripts/startup_scripts.py +0 -0
  35. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/volume_types/__init__.py +0 -0
  36. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/volume_types/volume_types.py +0 -0
  37. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/volumes/__init__.py +0 -0
  38. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch/volumes/volumes.py +0 -0
  39. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch.egg-info/SOURCES.txt +0 -0
  40. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch.egg-info/dependency_links.txt +0 -0
  41. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch.egg-info/requires.txt +0 -0
  42. {datacrunch-1.11.0 → datacrunch-1.12.1}/datacrunch.egg-info/top_level.txt +0 -0
  43. {datacrunch-1.11.0 → datacrunch-1.12.1}/setup.cfg +0 -0
  44. {datacrunch-1.11.0 → datacrunch-1.12.1}/setup.py +0 -0
  45. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/__init__.py +0 -0
  46. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/integration_tests/__init__.py +0 -0
  47. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/integration_tests/conftest.py +0 -0
  48. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/integration_tests/test_instances.py +0 -0
  49. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/integration_tests/test_locations.py +0 -0
  50. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/integration_tests/test_volumes.py +0 -0
  51. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/__init__.py +0 -0
  52. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/authentication/__init__.py +0 -0
  53. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/authentication/test_authentication.py +0 -0
  54. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/balance/__init__.py +0 -0
  55. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/balance/test_balance.py +0 -0
  56. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/conftest.py +0 -0
  57. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/containers/__init__.py +0 -0
  58. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/http_client/__init__.py +0 -0
  59. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/http_client/test_http_client.py +0 -0
  60. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/images/__init__.py +0 -0
  61. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/images/test_images.py +0 -0
  62. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/instance_types/__init__.py +0 -0
  63. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/instance_types/test_instance_types.py +0 -0
  64. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/instances/__init__.py +0 -0
  65. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/instances/test_instances.py +0 -0
  66. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/ssh_keys/__init__.py +0 -0
  67. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/ssh_keys/test_ssh_keys.py +0 -0
  68. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/startup_scripts/__init__.py +0 -0
  69. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/startup_scripts/test_startup_scripts.py +0 -0
  70. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/test_datacrunch.py +0 -0
  71. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/test_exceptions.py +0 -0
  72. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/volume_types/__init__.py +0 -0
  73. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/volume_types/test_volume_types.py +0 -0
  74. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/volumes/__init__.py +0 -0
  75. {datacrunch-1.11.0 → datacrunch-1.12.1}/tests/unit_tests/volumes/test_volumes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datacrunch
3
- Version: 1.11.0
3
+ Version: 1.12.1
4
4
  Summary: Official Python SDK for DataCrunch Public API
5
5
  Home-page: https://github.com/DataCrunch-io
6
6
  Author: DataCrunch Oy
@@ -0,0 +1 @@
1
+ VERSION = '1.12.1'
@@ -4,6 +4,8 @@ This module provides functionality for managing container deployments, including
4
4
  creation, updates, deletion, and monitoring of containerized applications.
5
5
  """
6
6
 
7
+ import base64
8
+ import os
7
9
  from dataclasses import dataclass, field
8
10
  from dataclasses_json import dataclass_json, Undefined # type: ignore
9
11
  from typing import List, Optional, Dict, Any
@@ -18,6 +20,7 @@ CONTAINER_DEPLOYMENTS_ENDPOINT = '/container-deployments'
18
20
  SERVERLESS_COMPUTE_RESOURCES_ENDPOINT = '/serverless-compute-resources'
19
21
  CONTAINER_REGISTRY_CREDENTIALS_ENDPOINT = '/container-registry-credentials'
20
22
  SECRETS_ENDPOINT = '/secrets'
23
+ FILESET_SECRETS_ENDPOINT = '/file-secrets'
21
24
 
22
25
 
23
26
  class EnvVarType(str, Enum):
@@ -27,6 +30,13 @@ class EnvVarType(str, Enum):
27
30
  SECRET = "secret"
28
31
 
29
32
 
33
+ class SecretType(str, Enum):
34
+ """Types of secrets that can be set in containers."""
35
+
36
+ GENERIC = "generic" # Regular secret, can be used in env vars
37
+ FILESET = "file-secret" # A file secret that can be mounted into the container
38
+
39
+
30
40
  class VolumeMountType(str, Enum):
31
41
  """Types of volume mounts that can be configured for containers."""
32
42
 
@@ -446,10 +456,12 @@ class Secret:
446
456
  Attributes:
447
457
  name: Name of the secret.
448
458
  created_at: Timestamp when the secret was created.
459
+ secret_type: Type of the secret.
449
460
  """
450
461
 
451
462
  name: str
452
463
  created_at: str
464
+ secret_type: SecretType
453
465
 
454
466
 
455
467
  @dataclass_json
@@ -909,6 +921,7 @@ class ContainersService:
909
921
  List[Secret]: List of all secrets.
910
922
  """
911
923
  response = self.client.get(SECRETS_ENDPOINT)
924
+ print(response.json())
912
925
  return [Secret.from_dict(secret) for secret in response.json()]
913
926
 
914
927
  def create_secret(self, name: str, value: str) -> None:
@@ -956,3 +969,42 @@ class ContainersService:
956
969
  """
957
970
  self.client.delete(
958
971
  f"{CONTAINER_REGISTRY_CREDENTIALS_ENDPOINT}/{credentials_name}")
972
+
973
+ def get_fileset_secrets(self) -> List[Secret]:
974
+ """Retrieves all fileset secrets.
975
+
976
+ Returns:
977
+ List of all fileset secrets.
978
+ """
979
+ response = self.client.get(FILESET_SECRETS_ENDPOINT)
980
+ return [Secret.from_dict(secret) for secret in response.json()]
981
+
982
+ def delete_fileset_secret(self, secret_name: str) -> None:
983
+ """Deletes a fileset secret.
984
+
985
+ Args:
986
+ secret_name: Name of the secret to delete.
987
+ """
988
+ self.client.delete(f"{FILESET_SECRETS_ENDPOINT}/{secret_name}")
989
+
990
+ def create_fileset_secret_from_file_paths(self, secret_name: str, file_paths: List[str]) -> None:
991
+ """Creates a new fileset secret.
992
+ A fileset secret is a secret that contains several files,
993
+ and can be used to mount a directory with the files in a container.
994
+
995
+ Args:
996
+ secret_name: Name of the secret.
997
+ file_paths: List of file paths to include in the secret.
998
+ """
999
+ processed_files = []
1000
+ for file_path in file_paths:
1001
+ with open(file_path, "rb") as f:
1002
+ base64_content = base64.b64encode(f.read()).decode("utf-8")
1003
+ processed_files.append({
1004
+ "file_name": os.path.basename(file_path),
1005
+ "base64_content": base64_content
1006
+ })
1007
+ self.client.post(FILESET_SECRETS_ENDPOINT, {
1008
+ "name": secret_name,
1009
+ "files": processed_files
1010
+ })
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datacrunch
3
- Version: 1.11.0
3
+ Version: 1.12.1
4
4
  Summary: Official Python SDK for DataCrunch Public API
5
5
  Home-page: https://github.com/DataCrunch-io
6
6
  Author: DataCrunch Oy
@@ -134,7 +134,8 @@ COMPUTE_RESOURCES_DATA = [
134
134
  SECRETS_DATA = [
135
135
  {
136
136
  "name": SECRET_NAME,
137
- "created_at": "2023-01-01T00:00:00+00:00"
137
+ "created_at": "2023-01-01T00:00:00+00:00",
138
+ "secret_type": "generic"
138
139
  }
139
140
  ]
140
141
 
@@ -1 +0,0 @@
1
- VERSION = '1.11.0'
File without changes
File without changes
File without changes
File without changes