# cloudcoil-models-fluxcd
Versioned fluxcd models for cloudcoil.
> [!WARNING]
> This repository is auto-generated from the [cloudcoil repository](https://github.com/cloudcoil/cloudcoil/tree/main/models/fluxcd). Please do not submit pull requests here. Instead, submit them to the main repository at https://github.com/cloudcoil/cloudcoil.
## 🔧 Installation
> [!NOTE]
> For versioning information and compatibility, see the [Versioning Guide](https://github.com/cloudcoil/cloudcoil/blob/main/VERSIONING.md).
Using [uv](https://github.com/astral-sh/uv) (recommended):
```bash
# Install with FluxCD support
uv add cloudcoil.models.fluxcd
```
Using pip:
```bash
pip install cloudcoil.models.fluxcd
```
## 💡 Examples
### Using FluxCD Models
```python
from cloudcoil import apimachinery
import cloudcoil.models.fluxcd.source.v1 as fluxsource
import cloudcoil.models.fluxcd.kustomize.v1 as fluxkustomize
# Create a GitRepository
repo = fluxsource.GitRepository(
metadata=apimachinery.ObjectMeta(name="my-app"),
spec=fluxsource.GitRepositorySpec(
url="https://github.com/org/repo",
ref=fluxsource.Ref(
branch="main"
),
interval="1m"
)
).create()
# Create a Kustomization
kustomization = fluxkustomize.Kustomization(
metadata=apimachinery.ObjectMeta(name="my-app"),
spec=fluxkustomize.KustomizationSpec(
interval="5m",
path="./kustomize",
source_ref=fluxkustomize.SourceRef(
kind="GitRepository",
name="my-app"
),
prune=True
)
).create()
# List GitRepositories
for repo in fluxsource.GitRepository.list():
print(f"Found repository: {repo.metadata.name}")
# Update a GitRepository
repo.spec.interval = "5m"
repo.save()
# Delete resources
fluxkustomize.Kustomization.delete("my-app")
fluxsource.GitRepository.delete("my-app")
```
### Using the Fluent Builder API
Cloudcoil provides a powerful fluent builder API with full IDE support and rich autocomplete capabilities. The builder pattern ensures type safety and provides intelligent code suggestions as you type:
```python
from cloudcoil.models.fluxcd.source.v1 import GitRepository
from cloudcoil.models.fluxcd.kustomize.v1 import Kustomization
# Create a GitRepository using the builder
# Every step provides rich autocomplete and type hints
repo = (
GitRepository.builder() # IDE shows all available builder methods
.metadata(lambda m: m # IDE shows all ObjectMeta fields
.name("my-app")
.namespace("default")
)
.spec(
lambda s: s # IDE shows all GitRepositorySpec fields
.url("https://github.com/org/repo")
.interval("1m")
.ref(lambda r: r # IDE shows all Ref fields
.branch("main")
)
)
.build()
)
# The builder validates your configuration at compile time
kustomization = (
Kustomization.builder()
.metadata(lambda m: m.name("my-app").namespace("default"))
.spec(
lambda s: s.path("./kustomize")
.interval("5m")
.source_ref(lambda r: r.kind("GitRepository").name("my-app"))
.prune(True)
)
.build()
)
```
The fluent builder provides:
- ✨ Full IDE support with detailed type information
- 🔍 Rich autocomplete for all fields and nested objects
- ⚡ Compile-time validation of your configuration
- 🎯 Clear and chainable API that guides you through resource creation
### Using the Context Manager Builder API
For complex nested resources, Cloudcoil also provides a context manager-based builder pattern that can make the structure more clear:
```python
from cloudcoil.models.fluxcd.source.v1 import GitRepository
from cloudcoil.models.fluxcd.kustomize.v1 import Kustomization
# Create a GitRepository using context managers
with GitRepository.new() as repo:
with repo.metadata() as metadata:
metadata.name("my-app")
metadata.namespace("default")
metadata.labels({"env": "prod"})
with repo.spec() as spec:
spec.url("https://github.com/org/repo")
spec.interval("1m")
with spec.ref() as ref:
ref.branch("main")
final_repo = repo.build()
# Create a Kustomization using context managers
with Kustomization.new() as kustomization:
with kustomization.metadata() as metadata:
metadata.name("my-app")
metadata.namespace("default")
with kustomization.spec() as spec:
spec.path("./kustomize")
spec.interval("5m")
spec.prune(True)
with spec.source_ref() as ref:
ref.kind("GitRepository")
ref.name("my-app")
final_kustomization = kustomization.build()
```
The context manager builder provides:
- 🎭 Clear visual nesting of resource structure
- 🔒 Automatic resource cleanup
- 🎯 Familiar Python context manager pattern
- ✨ Same great IDE support as the fluent builder
### Mixing Builder Styles
CloudCoil's intelligent builder system automatically detects which style you're using and provides appropriate IDE support:
```python
from cloudcoil.models.fluxcd.source.v1 import GitRepository
from cloudcoil import apimachinery
# Mixing styles lets you choose the best approach for each part
with GitRepository.new() as repo:
# Direct object initialization with full type checking
repo.metadata(apimachinery.ObjectMeta(
name="my-app",
namespace="default",
labels={"env": "prod"}
))
with repo.spec() as spec:
# Simple fields directly
spec.url("https://github.com/org/repo")
spec.interval("1m")
# Fluent style
spec.ref(lambda r: r
.branch("main")
.tag("v1.0.0")
)
# Direct assignment
spec.timeout = "1m"
final_repo = repo.build()
```
This flexibility allows you to:
- 🔀 Choose the most appropriate style for each part of your configuration
- 📖 Maximize readability for both simple and complex structures
- 🎨 Format your code according to your team's preferences
- 🧠 Get full IDE support with automatic style detection
- ✨ Enjoy rich autocomplete in all styles
- ⚡ Benefit from type checking across mixed styles
- 🎯 Receive immediate feedback on type errors
- 🔍 See documentation for all fields regardless of style
## 📚 Documentation
For complete documentation, visit [cloudcoil.github.io/cloudcoil](https://cloudcoil.github.io/cloudcoil)
## 📜 License
Apache License, Version 2.0 - see [LICENSE](LICENSE)
Raw data
{
"_id": null,
"home_page": null,
"name": "cloudcoil.models.fluxcd",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Sambhav Kothari <sambhavs.email@gmail.com>",
"keywords": "async, cloud-native, cloudcoil, cloudcoil-models, fluxcd, kubernetes, pydantic, python",
"author": null,
"author_email": "Sambhav Kothari <sambhavs.email@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/9c/76/ffd6012319b6f3073d9826f0399547edc8a53b35e6584d10ba3137fbb26e/cloudcoil_models_fluxcd-2.4.0.2.tar.gz",
"platform": null,
"description": "# cloudcoil-models-fluxcd\n\nVersioned fluxcd models for cloudcoil.\n> [!WARNING] \n> This repository is auto-generated from the [cloudcoil repository](https://github.com/cloudcoil/cloudcoil/tree/main/models/fluxcd). Please do not submit pull requests here. Instead, submit them to the main repository at https://github.com/cloudcoil/cloudcoil.\n\n## \ud83d\udd27 Installation\n\n> [!NOTE]\n> For versioning information and compatibility, see the [Versioning Guide](https://github.com/cloudcoil/cloudcoil/blob/main/VERSIONING.md).\n\nUsing [uv](https://github.com/astral-sh/uv) (recommended):\n\n```bash\n# Install with FluxCD support\nuv add cloudcoil.models.fluxcd\n```\n\nUsing pip:\n\n```bash\npip install cloudcoil.models.fluxcd\n```\n\n## \ud83d\udca1 Examples\n\n### Using FluxCD Models\n\n```python\nfrom cloudcoil import apimachinery\nimport cloudcoil.models.fluxcd.source.v1 as fluxsource\nimport cloudcoil.models.fluxcd.kustomize.v1 as fluxkustomize\n\n# Create a GitRepository\nrepo = fluxsource.GitRepository(\n metadata=apimachinery.ObjectMeta(name=\"my-app\"),\n spec=fluxsource.GitRepositorySpec(\n url=\"https://github.com/org/repo\",\n ref=fluxsource.Ref(\n branch=\"main\"\n ),\n interval=\"1m\"\n )\n).create()\n\n# Create a Kustomization\nkustomization = fluxkustomize.Kustomization(\n metadata=apimachinery.ObjectMeta(name=\"my-app\"),\n spec=fluxkustomize.KustomizationSpec(\n interval=\"5m\",\n path=\"./kustomize\",\n source_ref=fluxkustomize.SourceRef(\n kind=\"GitRepository\",\n name=\"my-app\"\n ),\n prune=True\n )\n).create()\n\n# List GitRepositories\nfor repo in fluxsource.GitRepository.list():\n print(f\"Found repository: {repo.metadata.name}\")\n\n# Update a GitRepository\nrepo.spec.interval = \"5m\"\nrepo.save()\n\n# Delete resources\nfluxkustomize.Kustomization.delete(\"my-app\")\nfluxsource.GitRepository.delete(\"my-app\")\n```\n\n### Using the Fluent Builder API\n\nCloudcoil provides a powerful fluent builder API with full IDE support and rich autocomplete capabilities. The builder pattern ensures type safety and provides intelligent code suggestions as you type:\n\n```python\nfrom cloudcoil.models.fluxcd.source.v1 import GitRepository\nfrom cloudcoil.models.fluxcd.kustomize.v1 import Kustomization\n\n# Create a GitRepository using the builder\n# Every step provides rich autocomplete and type hints\nrepo = (\n GitRepository.builder() # IDE shows all available builder methods\n .metadata(lambda m: m # IDE shows all ObjectMeta fields\n .name(\"my-app\")\n .namespace(\"default\")\n )\n .spec(\n lambda s: s # IDE shows all GitRepositorySpec fields\n .url(\"https://github.com/org/repo\")\n .interval(\"1m\")\n .ref(lambda r: r # IDE shows all Ref fields\n .branch(\"main\")\n )\n )\n .build()\n)\n\n# The builder validates your configuration at compile time\nkustomization = (\n Kustomization.builder()\n .metadata(lambda m: m.name(\"my-app\").namespace(\"default\"))\n .spec(\n lambda s: s.path(\"./kustomize\")\n .interval(\"5m\")\n .source_ref(lambda r: r.kind(\"GitRepository\").name(\"my-app\"))\n .prune(True)\n )\n .build()\n)\n```\n\nThe fluent builder provides:\n- \u2728 Full IDE support with detailed type information\n- \ud83d\udd0d Rich autocomplete for all fields and nested objects\n- \u26a1 Compile-time validation of your configuration\n- \ud83c\udfaf Clear and chainable API that guides you through resource creation\n\n### Using the Context Manager Builder API\n\nFor complex nested resources, Cloudcoil also provides a context manager-based builder pattern that can make the structure more clear:\n\n```python\nfrom cloudcoil.models.fluxcd.source.v1 import GitRepository\nfrom cloudcoil.models.fluxcd.kustomize.v1 import Kustomization\n\n# Create a GitRepository using context managers\nwith GitRepository.new() as repo:\n with repo.metadata() as metadata:\n metadata.name(\"my-app\")\n metadata.namespace(\"default\")\n metadata.labels({\"env\": \"prod\"})\n \n with repo.spec() as spec:\n spec.url(\"https://github.com/org/repo\")\n spec.interval(\"1m\")\n \n with spec.ref() as ref:\n ref.branch(\"main\")\n\nfinal_repo = repo.build()\n\n# Create a Kustomization using context managers\nwith Kustomization.new() as kustomization:\n with kustomization.metadata() as metadata:\n metadata.name(\"my-app\")\n metadata.namespace(\"default\")\n \n with kustomization.spec() as spec:\n spec.path(\"./kustomize\")\n spec.interval(\"5m\")\n spec.prune(True)\n \n with spec.source_ref() as ref:\n ref.kind(\"GitRepository\")\n ref.name(\"my-app\")\n\nfinal_kustomization = kustomization.build()\n```\n\nThe context manager builder provides:\n- \ud83c\udfad Clear visual nesting of resource structure\n- \ud83d\udd12 Automatic resource cleanup\n- \ud83c\udfaf Familiar Python context manager pattern\n- \u2728 Same great IDE support as the fluent builder\n\n### Mixing Builder Styles\n\nCloudCoil's intelligent builder system automatically detects which style you're using and provides appropriate IDE support:\n\n```python\nfrom cloudcoil.models.fluxcd.source.v1 import GitRepository\nfrom cloudcoil import apimachinery\n\n# Mixing styles lets you choose the best approach for each part\nwith GitRepository.new() as repo:\n # Direct object initialization with full type checking\n repo.metadata(apimachinery.ObjectMeta(\n name=\"my-app\",\n namespace=\"default\",\n labels={\"env\": \"prod\"}\n ))\n \n with repo.spec() as spec:\n # Simple fields directly\n spec.url(\"https://github.com/org/repo\")\n spec.interval(\"1m\")\n # Fluent style\n spec.ref(lambda r: r\n .branch(\"main\")\n .tag(\"v1.0.0\")\n )\n # Direct assignment\n spec.timeout = \"1m\"\n\nfinal_repo = repo.build()\n```\n\nThis flexibility allows you to:\n- \ud83d\udd00 Choose the most appropriate style for each part of your configuration\n- \ud83d\udcd6 Maximize readability for both simple and complex structures\n- \ud83c\udfa8 Format your code according to your team's preferences\n- \ud83e\udde0 Get full IDE support with automatic style detection\n- \u2728 Enjoy rich autocomplete in all styles\n- \u26a1 Benefit from type checking across mixed styles\n- \ud83c\udfaf Receive immediate feedback on type errors\n- \ud83d\udd0d See documentation for all fields regardless of style\n\n## \ud83d\udcda Documentation\n\nFor complete documentation, visit [cloudcoil.github.io/cloudcoil](https://cloudcoil.github.io/cloudcoil)\n\n## \ud83d\udcdc License\n\nApache License, Version 2.0 - see [LICENSE](LICENSE)",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Versioned fluxcd models for cloudcoil",
"version": "2.4.0.2",
"project_urls": {
"Changelog": "https://github.com/cloudcoil/models-fluxcd/releases",
"Documentation": "https://cloudcoil.github.io/cloudcoil",
"Homepage": "https://github.com/cloudcoil/cloudcoil",
"Issues": "https://github.com/cloudcoil/models-fluxcd/issues",
"Repository": "https://github.com/cloudcoil/models-fluxcd"
},
"split_keywords": [
"async",
" cloud-native",
" cloudcoil",
" cloudcoil-models",
" fluxcd",
" kubernetes",
" pydantic",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "55ac3d5df77fe8007dd0d8a94a36e8419bb2a46aad7080e771d2f827d32d8893",
"md5": "788f883327db97e4e8c5a31c3f01b720",
"sha256": "7f3fa3164e908fedef8d408b8e9cef9e0775aed209fbc6788f31eccd7148bd34"
},
"downloads": -1,
"filename": "cloudcoil_models_fluxcd-2.4.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "788f883327db97e4e8c5a31c3f01b720",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 184970,
"upload_time": "2025-01-28T22:06:13",
"upload_time_iso_8601": "2025-01-28T22:06:13.202790Z",
"url": "https://files.pythonhosted.org/packages/55/ac/3d5df77fe8007dd0d8a94a36e8419bb2a46aad7080e771d2f827d32d8893/cloudcoil_models_fluxcd-2.4.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9c76ffd6012319b6f3073d9826f0399547edc8a53b35e6584d10ba3137fbb26e",
"md5": "5fbf0ea5e62d24235e9f212fd3d28a22",
"sha256": "7be1bbbdd9750ee09da5122665762039ca0da22586dd6a67d53d257e8b29d05b"
},
"downloads": -1,
"filename": "cloudcoil_models_fluxcd-2.4.0.2.tar.gz",
"has_sig": false,
"md5_digest": "5fbf0ea5e62d24235e9f212fd3d28a22",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 228768,
"upload_time": "2025-01-28T22:06:15",
"upload_time_iso_8601": "2025-01-28T22:06:15.884421Z",
"url": "https://files.pythonhosted.org/packages/9c/76/ffd6012319b6f3073d9826f0399547edc8a53b35e6584d10ba3137fbb26e/cloudcoil_models_fluxcd-2.4.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-28 22:06:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cloudcoil",
"github_project": "models-fluxcd",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cloudcoil.models.fluxcd"
}