vantage-sdkpy 0.1.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 (54) hide show
  1. vantage_sdkpy-0.1.1/.gitignore +68 -0
  2. vantage_sdkpy-0.1.1/PKG-INFO +129 -0
  3. vantage_sdkpy-0.1.1/README.md +95 -0
  4. vantage_sdkpy-0.1.1/pyproject.toml +112 -0
  5. vantage_sdkpy-0.1.1/vantage_sdk/__init__.py +44 -0
  6. vantage_sdkpy-0.1.1/vantage_sdk/admin/__init__.py +16 -0
  7. vantage_sdkpy-0.1.1/vantage_sdk/admin/management/__init__.py +16 -0
  8. vantage_sdkpy-0.1.1/vantage_sdk/admin/management/organizations.py +60 -0
  9. vantage_sdkpy-0.1.1/vantage_sdk/auth.py +517 -0
  10. vantage_sdkpy-0.1.1/vantage_sdk/base/__init__.py +21 -0
  11. vantage_sdkpy-0.1.1/vantage_sdk/base/crud.py +475 -0
  12. vantage_sdkpy-0.1.1/vantage_sdk/client.py +82 -0
  13. vantage_sdkpy-0.1.1/vantage_sdk/cloud/__init__.py +46 -0
  14. vantage_sdkpy-0.1.1/vantage_sdk/cloud/cloud_account_crud.py +433 -0
  15. vantage_sdkpy-0.1.1/vantage_sdk/cloud/cloud_account_schema.py +177 -0
  16. vantage_sdkpy-0.1.1/vantage_sdk/cloud/crud.py +174 -0
  17. vantage_sdkpy-0.1.1/vantage_sdk/cloud/lxd_utils.py +85 -0
  18. vantage_sdkpy-0.1.1/vantage_sdk/cloud/schema.py +149 -0
  19. vantage_sdkpy-0.1.1/vantage_sdk/cluster/__init__.py +24 -0
  20. vantage_sdkpy-0.1.1/vantage_sdk/cluster/application/__init__.py +15 -0
  21. vantage_sdkpy-0.1.1/vantage_sdk/cluster/application/kubeflow.py +121 -0
  22. vantage_sdkpy-0.1.1/vantage_sdk/cluster/application/service_workflow.py +280 -0
  23. vantage_sdkpy-0.1.1/vantage_sdk/cluster/crud.py +1064 -0
  24. vantage_sdkpy-0.1.1/vantage_sdk/cluster/schema.py +92 -0
  25. vantage_sdkpy-0.1.1/vantage_sdk/config.py +100 -0
  26. vantage_sdkpy-0.1.1/vantage_sdk/constants.py +56 -0
  27. vantage_sdkpy-0.1.1/vantage_sdk/exceptions.py +74 -0
  28. vantage_sdkpy-0.1.1/vantage_sdk/gql_client.py +709 -0
  29. vantage_sdkpy-0.1.1/vantage_sdk/job/__init__.py +27 -0
  30. vantage_sdkpy-0.1.1/vantage_sdk/job/crud.py +61 -0
  31. vantage_sdkpy-0.1.1/vantage_sdk/job/schema.py +84 -0
  32. vantage_sdkpy-0.1.1/vantage_sdk/jupyterhub_client.py +211 -0
  33. vantage_sdkpy-0.1.1/vantage_sdk/jupyterhub_sdk.py +208 -0
  34. vantage_sdkpy-0.1.1/vantage_sdk/license/__init__.py +44 -0
  35. vantage_sdkpy-0.1.1/vantage_sdk/license/crud.py +81 -0
  36. vantage_sdkpy-0.1.1/vantage_sdk/license/schema.py +112 -0
  37. vantage_sdkpy-0.1.1/vantage_sdk/schemas.py +113 -0
  38. vantage_sdkpy-0.1.1/vantage_sdk/support_ticket/__init__.py +23 -0
  39. vantage_sdkpy-0.1.1/vantage_sdk/support_ticket/crud.py +745 -0
  40. vantage_sdkpy-0.1.1/vantage_sdk/support_ticket/schema.py +113 -0
  41. vantage_sdkpy-0.1.1/vantage_sdk/team/__init__.py +16 -0
  42. vantage_sdkpy-0.1.1/vantage_sdk/team/crud.py +341 -0
  43. vantage_sdkpy-0.1.1/vantage_sdk/vantage_rest_api_client.py +220 -0
  44. vantage_sdkpy-0.1.1/vantage_sdk/workbench/__init__.py +27 -0
  45. vantage_sdkpy-0.1.1/vantage_sdk/workbench/_vdeployer.py +110 -0
  46. vantage_sdkpy-0.1.1/vantage_sdk/workbench/compute_pool.py +97 -0
  47. vantage_sdkpy-0.1.1/vantage_sdk/workbench/inference_endpoint.py +196 -0
  48. vantage_sdkpy-0.1.1/vantage_sdk/workbench/inference_preset.py +86 -0
  49. vantage_sdkpy-0.1.1/vantage_sdk/workbench/model_registry.py +185 -0
  50. vantage_sdkpy-0.1.1/vantage_sdk/workbench/namespace.py +72 -0
  51. vantage_sdkpy-0.1.1/vantage_sdk/workbench/secret.py +110 -0
  52. vantage_sdkpy-0.1.1/vantage_sdk/workbench/slurm.py +300 -0
  53. vantage_sdkpy-0.1.1/vantage_sdk/workbench/user_service.py +137 -0
  54. vantage_sdkpy-0.1.1/vantage_sdk/workbench/workspace_preset.py +82 -0
@@ -0,0 +1,68 @@
1
+ __pycache__/
2
+ **/__pycache__/
3
+ **/**/__pycache__/
4
+
5
+ # Docusaurus
6
+ docs/node_modules
7
+ docs/yarn-global
8
+ docs/yarn-cache
9
+ docs/.docusaurus
10
+ docs/build
11
+ docs/.yarn
12
+ docs/yarn-error.log
13
+ docs/npm-debug.log*
14
+ docs/yarn-debug.log*
15
+
16
+
17
+ # Python virtual environments
18
+ .venv
19
+ venv/
20
+ env/
21
+ .env
22
+ **/.env
23
+
24
+ # Coverage reports
25
+ .coverage
26
+ cover_unit
27
+ cover_integration
28
+ cover_combined
29
+ .coverage.*
30
+ coverage
31
+ cover/
32
+ htmlcov/
33
+
34
+ # Testing and linting
35
+ .tox/
36
+ .nox/
37
+ .pytest_cache/
38
+ .pytest_cache/**
39
+ .pytest_cache/**/*
40
+ .pytest_cache/**/*
41
+ .ruff_cache/
42
+ .mypy_cache/
43
+ .dmypy.json
44
+ .dmypy.json/**
45
+ .pyre/
46
+ .pyre/**
47
+ .pyre/**/*
48
+
49
+ # Jupyter
50
+ .ipynb_checkpoints
51
+
52
+ # IDE and editor files
53
+ .vscode/
54
+ .idea/
55
+ *.swp
56
+ *.swo
57
+ *~
58
+
59
+ # OS generated files
60
+ .DS_Store
61
+ .DS_Store?
62
+ ._*
63
+ .Spotlight-V100
64
+ .Trashes
65
+ ehthumbs.db
66
+ Thumbs.db
67
+ *.tar.gz
68
+ *.tgz
@@ -0,0 +1,129 @@
1
+ Metadata-Version: 2.4
2
+ Name: vantage-sdkpy
3
+ Version: 0.1.1
4
+ Summary: Python SDK for interacting with the Vantage platform.
5
+ Author-email: Vantage Compute <engineering@vantagecompute.ai>
6
+ License: GPL-3.0
7
+ Requires-Python: >=3.14
8
+ Requires-Dist: aiohttp>=3.13.3
9
+ Requires-Dist: anyio>=4.12.1
10
+ Requires-Dist: gql>=4.0.0
11
+ Requires-Dist: httpx>=0.28.1
12
+ Requires-Dist: loguru>=0.7.3
13
+ Requires-Dist: pendulum>=3.2.0
14
+ Requires-Dist: py-buzz>=8.0.0
15
+ Requires-Dist: pydantic>=2.12.5
16
+ Requires-Dist: python-jose[cryptography]>=3.5.0
17
+ Requires-Dist: pyyaml>=6.0.3
18
+ Requires-Dist: requests-toolbelt>=1.0.0
19
+ Requires-Dist: rich>=14.3.2
20
+ Requires-Dist: ruamel-yaml>=0.19.1
21
+ Requires-Dist: snick>=3.0.0
22
+ Requires-Dist: typer>=0.21.1
23
+ Provides-Extra: dev
24
+ Requires-Dist: black>=26.1.0; extra == 'dev'
25
+ Requires-Dist: codespell>=2.4.1; extra == 'dev'
26
+ Requires-Dist: pyright>=1.1.408; extra == 'dev'
27
+ Requires-Dist: pytest-asyncio>=1.3.0; extra == 'dev'
28
+ Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
29
+ Requires-Dist: pytest>=9.0.2; extra == 'dev'
30
+ Requires-Dist: respx>=0.22.0; extra == 'dev'
31
+ Requires-Dist: ruff>=0.15.0; extra == 'dev'
32
+ Requires-Dist: types-pyyaml>=6.0.12.20250915; extra == 'dev'
33
+ Description-Content-Type: text/markdown
34
+
35
+ <div align="center">
36
+ <a href="https://www.vantagecompute.ai/">
37
+ <img src="https://vantage-compute-public-assets.s3.us-east-1.amazonaws.com/branding/vantage-logo-text-black-horz.png" alt="Vantage Compute Logo" width="100" style="margin-bottom: 0.5em;"/>
38
+ </a>
39
+ </div>
40
+ <div align="center">
41
+
42
+ # Vantage SDKPY
43
+ A standalone Python SDK for interacting with Vantage platform resources.
44
+
45
+ [![License](https://img.shields.io/badge/license-GPLv3-green.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
46
+ [![Python](https://img.shields.io/badge/python-3.14+-blue.svg)](https://python.org)
47
+ [![PyPI](https://img.shields.io/pypi/v/vantage-sdkpy.svg)](https://pypi.org/project/vantage-sdkpy/)
48
+
49
+ ![GitHub Issues](https://img.shields.io/github/issues/vantagecompute/vantage-sdkpy?label=issues&logo=github&style=plastic)
50
+ ![Pull Requests](https://img.shields.io/github/issues-pr/vantagecompute/vantage-sdkpy?label=pull-requests&logo=github&style=plastic)
51
+ ![GitHub Contributors](https://img.shields.io/github/contributors/vantagecompute/vantage-sdkpy?logo=github&style=plastic)
52
+
53
+ </br>
54
+
55
+ ## Quick Start
56
+
57
+ </div>
58
+
59
+ ### Install from PyPI
60
+
61
+ ```bash
62
+ pip install vantage-sdkpy
63
+ ```
64
+
65
+ ### Install from Source
66
+
67
+ ```bash
68
+ git clone https://github.com/vantagecompute/vantage-sdkpy.git
69
+ cd vantage-sdkpy
70
+ uv sync
71
+ ```
72
+
73
+ ### Example Usage
74
+
75
+ ```python
76
+ import asyncio
77
+ from types import SimpleNamespace
78
+
79
+ from vantage_sdk import cluster_sdk
80
+ from vantage_sdk.config import Settings
81
+ from vantage_sdk.schemas import SDKContext
82
+
83
+
84
+ async def main() -> None:
85
+ ctx = SDKContext.from_token(
86
+ settings=Settings(vantage_url="https://app.vantagecompute.ai"),
87
+ access_token="<access-token>",
88
+ refresh_token="<refresh-token>",
89
+ )
90
+ typer_ctx = SimpleNamespace(obj=ctx)
91
+ clusters = await cluster_sdk.list(typer_ctx)
92
+ print([cluster.name for cluster in clusters])
93
+
94
+
95
+ asyncio.run(main())
96
+ ```
97
+
98
+ ## Design Goals
99
+
100
+ - No terminal rendering responsibilities.
101
+ - No filesystem-backed profile or token management.
102
+ - Explicit in-memory authentication and settings passed in by the caller.
103
+ - Reusable by `vantage-cli` and by external Python consumers.
104
+
105
+ ## Documentation
106
+
107
+ Visit the documentation site:
108
+ **[vantagecompute.github.io/vantage-sdkpy](https://vantagecompute.github.io/vantage-sdkpy)**
109
+
110
+ - **[Installation Guide](https://vantagecompute.github.io/vantage-sdkpy/installation/)**: Set up the SDK locally or from source.
111
+ - **[Usage Guide](https://vantagecompute.github.io/vantage-sdkpy/usage/)**: Build authenticated SDK contexts and query resources.
112
+ - **[API Reference](https://vantagecompute.github.io/vantage-sdkpy/api/)**: Auto-generated Python module reference.
113
+ - **[Architecture](https://vantagecompute.github.io/vantage-sdkpy/architecture/)**: Understand the standalone SDK boundary.
114
+
115
+ ## Support
116
+
117
+ - **Issues**: [GitHub Issues](https://github.com/vantagecompute/vantage-sdkpy/issues)
118
+ - **Discussions**: [GitHub Discussions](https://github.com/vantagecompute/vantage-sdkpy/discussions)
119
+ - **Email**: [james@vantagecompute.ai](mailto:james@vantagecompute.ai)
120
+
121
+ ## License
122
+
123
+ Copyright &copy; 2025 Vantage Compute Corporation
124
+
125
+ This project is licensed under the GPLv3 License.
126
+
127
+ ---
128
+
129
+ Built by [Vantage Compute](https://vantagecompute.ai)
@@ -0,0 +1,95 @@
1
+ <div align="center">
2
+ <a href="https://www.vantagecompute.ai/">
3
+ <img src="https://vantage-compute-public-assets.s3.us-east-1.amazonaws.com/branding/vantage-logo-text-black-horz.png" alt="Vantage Compute Logo" width="100" style="margin-bottom: 0.5em;"/>
4
+ </a>
5
+ </div>
6
+ <div align="center">
7
+
8
+ # Vantage SDKPY
9
+ A standalone Python SDK for interacting with Vantage platform resources.
10
+
11
+ [![License](https://img.shields.io/badge/license-GPLv3-green.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
12
+ [![Python](https://img.shields.io/badge/python-3.14+-blue.svg)](https://python.org)
13
+ [![PyPI](https://img.shields.io/pypi/v/vantage-sdkpy.svg)](https://pypi.org/project/vantage-sdkpy/)
14
+
15
+ ![GitHub Issues](https://img.shields.io/github/issues/vantagecompute/vantage-sdkpy?label=issues&logo=github&style=plastic)
16
+ ![Pull Requests](https://img.shields.io/github/issues-pr/vantagecompute/vantage-sdkpy?label=pull-requests&logo=github&style=plastic)
17
+ ![GitHub Contributors](https://img.shields.io/github/contributors/vantagecompute/vantage-sdkpy?logo=github&style=plastic)
18
+
19
+ </br>
20
+
21
+ ## Quick Start
22
+
23
+ </div>
24
+
25
+ ### Install from PyPI
26
+
27
+ ```bash
28
+ pip install vantage-sdkpy
29
+ ```
30
+
31
+ ### Install from Source
32
+
33
+ ```bash
34
+ git clone https://github.com/vantagecompute/vantage-sdkpy.git
35
+ cd vantage-sdkpy
36
+ uv sync
37
+ ```
38
+
39
+ ### Example Usage
40
+
41
+ ```python
42
+ import asyncio
43
+ from types import SimpleNamespace
44
+
45
+ from vantage_sdk import cluster_sdk
46
+ from vantage_sdk.config import Settings
47
+ from vantage_sdk.schemas import SDKContext
48
+
49
+
50
+ async def main() -> None:
51
+ ctx = SDKContext.from_token(
52
+ settings=Settings(vantage_url="https://app.vantagecompute.ai"),
53
+ access_token="<access-token>",
54
+ refresh_token="<refresh-token>",
55
+ )
56
+ typer_ctx = SimpleNamespace(obj=ctx)
57
+ clusters = await cluster_sdk.list(typer_ctx)
58
+ print([cluster.name for cluster in clusters])
59
+
60
+
61
+ asyncio.run(main())
62
+ ```
63
+
64
+ ## Design Goals
65
+
66
+ - No terminal rendering responsibilities.
67
+ - No filesystem-backed profile or token management.
68
+ - Explicit in-memory authentication and settings passed in by the caller.
69
+ - Reusable by `vantage-cli` and by external Python consumers.
70
+
71
+ ## Documentation
72
+
73
+ Visit the documentation site:
74
+ **[vantagecompute.github.io/vantage-sdkpy](https://vantagecompute.github.io/vantage-sdkpy)**
75
+
76
+ - **[Installation Guide](https://vantagecompute.github.io/vantage-sdkpy/installation/)**: Set up the SDK locally or from source.
77
+ - **[Usage Guide](https://vantagecompute.github.io/vantage-sdkpy/usage/)**: Build authenticated SDK contexts and query resources.
78
+ - **[API Reference](https://vantagecompute.github.io/vantage-sdkpy/api/)**: Auto-generated Python module reference.
79
+ - **[Architecture](https://vantagecompute.github.io/vantage-sdkpy/architecture/)**: Understand the standalone SDK boundary.
80
+
81
+ ## Support
82
+
83
+ - **Issues**: [GitHub Issues](https://github.com/vantagecompute/vantage-sdkpy/issues)
84
+ - **Discussions**: [GitHub Discussions](https://github.com/vantagecompute/vantage-sdkpy/discussions)
85
+ - **Email**: [james@vantagecompute.ai](mailto:james@vantagecompute.ai)
86
+
87
+ ## License
88
+
89
+ Copyright &copy; 2025 Vantage Compute Corporation
90
+
91
+ This project is licensed under the GPLv3 License.
92
+
93
+ ---
94
+
95
+ Built by [Vantage Compute](https://vantagecompute.ai)
@@ -0,0 +1,112 @@
1
+ [project]
2
+ name = "vantage-sdkpy"
3
+ version = "0.1.1"
4
+ description = "Python SDK for interacting with the Vantage platform."
5
+ authors = [
6
+ { name = "Vantage Compute", email = "engineering@vantagecompute.ai" },
7
+ ]
8
+ readme = "README.md"
9
+ license = { text = "GPL-3.0" }
10
+ requires-python = ">=3.14"
11
+ dependencies = [
12
+ "aiohttp>=3.13.3",
13
+ "anyio>=4.12.1",
14
+ "gql>=4.0.0",
15
+ "httpx>=0.28.1",
16
+ "loguru>=0.7.3",
17
+ "pendulum>=3.2.0",
18
+ "pydantic>=2.12.5",
19
+ "py-buzz>=8.0.0",
20
+ "python-jose[cryptography]>=3.5.0",
21
+ "pyyaml>=6.0.3",
22
+ "requests-toolbelt>=1.0.0",
23
+ "rich>=14.3.2",
24
+ "ruamel.yaml>=0.19.1",
25
+ "snick>=3.0.0",
26
+ "typer>=0.21.1",
27
+ ]
28
+
29
+ [project.optional-dependencies]
30
+ dev = [
31
+ "black>=26.1.0",
32
+ "codespell>=2.4.1",
33
+ "pyright>=1.1.408",
34
+ "pytest>=9.0.2",
35
+ "pytest-asyncio>=1.3.0",
36
+ "pytest-cov>=7.0.0",
37
+ "respx>=0.22.0",
38
+ "ruff>=0.15.0",
39
+ "types-pyyaml>=6.0.12.20250915",
40
+ ]
41
+
42
+ [tool.hatch.build.targets.wheel]
43
+ packages = ["vantage_sdk"]
44
+
45
+ [tool.hatch.build.targets.sdist]
46
+ include = [
47
+ "/vantage_sdk",
48
+ "/README.md",
49
+ ]
50
+
51
+ [tool.coverage.run]
52
+ branch = true
53
+
54
+ [tool.coverage.report]
55
+ show_missing = true
56
+
57
+ [tool.coverage.paths]
58
+ source = ["vantage_sdk"]
59
+
60
+ [tool.pytest.ini_options]
61
+ minversion = "6.0"
62
+ log_cli_level = "INFO"
63
+ filterwarnings = [
64
+ "ignore::DeprecationWarning:websockets.legacy",
65
+ ]
66
+
67
+ [tool.codespell]
68
+ skip = ".venv,venv,icon.svg,.tox,.git,.mypy_cache,.ruff_cache,.pytest_cache,.vscode,.coverage,cover"
69
+ ignore-words-list = "aks"
70
+
71
+ [tool.black]
72
+ line-length = 99
73
+ target-version = ["py312"]
74
+
75
+ [tool.ruff]
76
+ line-length = 99
77
+ lint.select = ["E", "W", "F", "C", "N", "D", "I001"]
78
+ lint.extend-ignore = [
79
+ "D203",
80
+ "D204",
81
+ "D213",
82
+ "D215",
83
+ "D400",
84
+ "D404",
85
+ "D406",
86
+ "D407",
87
+ "D408",
88
+ "D409",
89
+ "D413",
90
+ ]
91
+ lint.ignore = ["E501", "D107"]
92
+ lint.per-file-ignores = { "**/tests/*" = [
93
+ "D100",
94
+ "D101",
95
+ "D102",
96
+ "D103",
97
+ "D104",
98
+ ] }
99
+ extend-exclude = ["__pycache__", "*.egg_info"]
100
+
101
+ [tool.ruff.lint.mccabe]
102
+ max-complexity = 15
103
+
104
+ [build-system]
105
+ requires = ["hatchling"]
106
+ build-backend = "hatchling.build"
107
+
108
+ [dependency-groups]
109
+ dev = [
110
+ "pytest-cov>=7.0.0",
111
+ "types-pyyaml>=6.0.12.20250915",
112
+ ]
@@ -0,0 +1,44 @@
1
+ # Copyright (C) 2025 Vantage Compute Corporation
2
+ # This program is free software: you can redistribute it and/or modify it under
3
+ # the terms of the GNU General Public License as published by the Free Software
4
+ # Foundation, version 3.
5
+ #
6
+ # This program is distributed in the hope that it will be useful, but WITHOUT
7
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8
+ # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9
+ #
10
+ # You should have received a copy of the GNU General Public License along with
11
+ # this program. If not, see <https://www.gnu.org/licenses/>.
12
+ """Standalone Vantage SDK public exports."""
13
+
14
+ # Import base classes
15
+ from .base import BaseCRUDSDK, BaseGraphQLResourceSDK
16
+ from .cloud.cloud_account_crud import cloud_account_sdk
17
+
18
+ from .cluster.crud import cluster_sdk
19
+ from .job import JobScript, JobScriptFile, JobSubmission, JobTemplate
20
+ from .job import job_script_sdk, job_submission_sdk, job_template_sdk
21
+ from .schemas import CliContext, SDKContext
22
+ from .support_ticket.crud import support_ticket_sdk
23
+ from .team.crud import team_sdk
24
+ from .vantage_rest_api_client import VantageRestApiClient, create_vantage_rest_client
25
+
26
+ __all__ = [
27
+ "BaseCRUDSDK",
28
+ "BaseGraphQLResourceSDK",
29
+ "SDKContext",
30
+ "CliContext",
31
+ "cluster_sdk",
32
+ "cloud_account_sdk",
33
+ "team_sdk",
34
+ "support_ticket_sdk",
35
+ "job_script_sdk",
36
+ "job_template_sdk",
37
+ "job_submission_sdk",
38
+ "JobScript",
39
+ "JobScriptFile",
40
+ "JobSubmission",
41
+ "JobTemplate",
42
+ "VantageRestApiClient",
43
+ "create_vantage_rest_client",
44
+ ]
@@ -0,0 +1,16 @@
1
+ # Copyright (C) 2025 Vantage Compute Corporation
2
+ # This program is free software: you can redistribute it and/or modify it under
3
+ # the terms of the GNU General Public License as published by the Free Software
4
+ # Foundation, version 3.
5
+ #
6
+ # This program is distributed in the hope that it will be useful, but WITHOUT
7
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8
+ # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9
+ #
10
+ # You should have received a copy of the GNU General Public License along with
11
+ # this program. If not, see <https://www.gnu.org/licenses/>.
12
+ """Admin SDK package for administrative operations."""
13
+
14
+ from .management import get_extra_attributes
15
+
16
+ __all__ = ["get_extra_attributes"]
@@ -0,0 +1,16 @@
1
+ # Copyright (C) 2025 Vantage Compute Corporation
2
+ # This program is free software: you can redistribute it and/or modify it under
3
+ # the terms of the GNU General Public License as published by the Free Software
4
+ # Foundation, version 3.
5
+ #
6
+ # This program is distributed in the hope that it will be useful, but WITHOUT
7
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8
+ # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9
+ #
10
+ # You should have received a copy of the GNU General Public License along with
11
+ # this program. If not, see <https://www.gnu.org/licenses/>.
12
+ """Management SDK module for administrative operations."""
13
+
14
+ from .organizations import get_extra_attributes
15
+
16
+ __all__ = ["get_extra_attributes"]
@@ -0,0 +1,60 @@
1
+ # Copyright (C) 2025 Vantage Compute Corporation
2
+ # This program is free software: you can redistribute it and/or modify it under
3
+ # the terms of the GNU General Public License as published by the Free Software
4
+ # Foundation, version 3.
5
+ #
6
+ # This program is distributed in the hope that it will be useful, but WITHOUT
7
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8
+ # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9
+ #
10
+ # You should have received a copy of the GNU General Public License along with
11
+ # this program. If not, see <https://www.gnu.org/licenses/>.
12
+ """Organizations management SDK functions.
13
+
14
+ This module provides SDK functions for organization-level administrative operations
15
+ such as managing extra attributes and other organization configurations.
16
+ """
17
+
18
+ import logging
19
+ from typing import Any, Dict, Optional
20
+
21
+ import typer
22
+
23
+ logger = logging.getLogger(__name__)
24
+
25
+
26
+ async def get_extra_attributes(ctx: typer.Context) -> Optional[Dict[Any, Any]]:
27
+ """Get organization extra attributes.
28
+
29
+ This function retrieves the list of extra attributes configured for the organization.
30
+ Extra attributes are custom fields that can be added to various entities.
31
+
32
+ The REST client is automatically initialized and attached to ctx.obj.rest_client
33
+ by the @attach_vantage_rest_client decorator.
34
+
35
+ Args:
36
+ ctx: Typer context with rest_client, settings, and persona already attached
37
+
38
+ Returns:
39
+ Dict of extra attribute data containing the organization's extra attributes,
40
+ or None if the request fails
41
+
42
+ Raises:
43
+ httpx.HTTPStatusError: If the API request fails
44
+ Exception: For other request failures
45
+
46
+ Example:
47
+ >>> import typer
48
+ >>> ctx = typer.Context(...) # Context with settings and persona
49
+ >>> attributes = await get_extra_attributes(ctx)
50
+ >>> print(attributes)
51
+ """
52
+ path = "/admin/management/organizations/extra-attributes"
53
+ try:
54
+ # The VantageRestApiClient.get() method returns the JSON data directly
55
+ # (not a response object), so we can return it as-is
56
+ data = await ctx.obj.rest_client.get(path)
57
+ return data
58
+ except Exception as e:
59
+ logger.warning("Failed to retrieve extra attributes: %s", e)
60
+ return None