# cloudcoil-models-prometheus-operator
Versioned prometheus-operator models for cloudcoil.
## 🔧 Installation
Using [uv](https://github.com/astral-sh/uv) (recommended):
```bash
# Install with Prometheus Operator support
uv add cloudcoil.models.prometheus-operator
```
Using pip:
```bash
pip install cloudcoil.models.prometheus-operator
```
## 💡 Examples
### Using Prometheus Operator Models
```python
from cloudcoil import apimachinery
import cloudcoil.models.prometheus_operator.v1 as prometheus_operator
# Create a Prometheus instance
prometheus = prometheus_operator.Prometheus(
metadata=apimachinery.ObjectMeta(name="main"),
spec=prometheus_operator.PrometheusSpec(
external_url="http://monitoring.my.systems/prometheus",
resources=apimachinery.ResourceRequirements(
requests={
"memory": "400Mi"
}
)
)
).create()
# Create an Alertmanager instance
alert_manager = prometheus_operator.Alertmanager(
metadata=apimachinery.ObjectMeta(name="main"),
spec=prometheus_operator.AlertmanagerSpec(
replicas=3,
external_url="http://monitoring.my.systems/alertmanager",
resources=apimachinery.ResourceRequirements(
requests={
"memory": "400Mi"
}
)
)
).create()
# List Prometheus instances
for prom in prometheus_operator.Prometheus.list():
print(f"Found Prometheus: {prom.metadata.name}")
```
### Using the Fluent Builder API
Cloudcoil provides a powerful fluent builder API for Prometheus Operator resources:
```python
from cloudcoil.models.prometheus_operator.v1 import Prometheus, Alertmanager
# Create a Prometheus using the builder
prometheus = (
Prometheus.builder()
.metadata(lambda m: m
.name("main")
)
.spec(lambda s: s
.external_url("http://monitoring.my.systems/prometheus")
.resources(lambda r: r
.requests({
"memory": "400Mi"
})
)
)
.build()
)
# Create an Alertmanager using the builder
alert_manager = (
Alertmanager.builder()
.metadata(lambda m: m
.name("main")
)
.spec(lambda s: s
.replicas(3)
.external_url("http://monitoring.my.systems/alertmanager")
.resources(lambda r: r
.requests({
"memory": "400Mi"
})
)
)
.build()
)
```
### Using the Context Manager Builder API
For complex monitoring configurations, you can use the context manager-based builder:
```python
from cloudcoil.models.prometheus_operator.v1 import Prometheus
# Create a Prometheus instance using context managers
with Prometheus.new() as prometheus:
with prometheus.metadata() as metadata:
metadata.name("main")
with prometheus.spec() as spec:
spec.external_url("http://monitoring.my.systems/prometheus")
with spec.resources() as resources:
resources.requests({
"memory": "400Mi"
})
final_prometheus = prometheus.build()
```
### Mixing Builder Styles
You can mix different builder styles based on your needs:
```python
from cloudcoil.models.prometheus_operator.v1 import Alertmanager
from cloudcoil import apimachinery
# Create an Alertmanager using mixed styles
with Alertmanager.new() as alert_manager:
# Direct object initialization
alert_manager.metadata(apimachinery.ObjectMeta(
name="main"
))
# Fluent style for spec
alert_manager.spec(lambda s: s
.replicas(3)
.external_url("http://monitoring.my.systems/alertmanager")
.resources(lambda r: r
.requests({
"memory": "400Mi"
})
)
)
final_alert_manager = alert_manager.build()
```
## 📚 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.prometheus-operator",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Sambhav Kothari <sambhavs.email@gmail.com>",
"keywords": "async, cloud-native, cloudcoil, cloudcoil-models, kubernetes, prometheus-operator, pydantic, python",
"author": null,
"author_email": "Sambhav Kothari <sambhavs.email@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c7/a2/22123891dd71a7f2d49fa3e6189e28b1294d1e542faa4e395fa13fa72fc6/cloudcoil_models_prometheus_operator-0.79.2.0.tar.gz",
"platform": null,
"description": "# cloudcoil-models-prometheus-operator\n\nVersioned prometheus-operator models for cloudcoil.\n## \ud83d\udd27 Installation\n\nUsing [uv](https://github.com/astral-sh/uv) (recommended):\n\n```bash\n# Install with Prometheus Operator support\nuv add cloudcoil.models.prometheus-operator\n```\n\nUsing pip:\n\n```bash\npip install cloudcoil.models.prometheus-operator\n```\n\n## \ud83d\udca1 Examples\n\n### Using Prometheus Operator Models\n\n```python\nfrom cloudcoil import apimachinery\nimport cloudcoil.models.prometheus_operator.v1 as prometheus_operator\n\n# Create a Prometheus instance\nprometheus = prometheus_operator.Prometheus(\n metadata=apimachinery.ObjectMeta(name=\"main\"),\n spec=prometheus_operator.PrometheusSpec(\n external_url=\"http://monitoring.my.systems/prometheus\",\n resources=apimachinery.ResourceRequirements(\n requests={\n \"memory\": \"400Mi\"\n }\n )\n )\n).create()\n\n# Create an Alertmanager instance\nalert_manager = prometheus_operator.Alertmanager(\n metadata=apimachinery.ObjectMeta(name=\"main\"),\n spec=prometheus_operator.AlertmanagerSpec(\n replicas=3,\n external_url=\"http://monitoring.my.systems/alertmanager\",\n resources=apimachinery.ResourceRequirements(\n requests={\n \"memory\": \"400Mi\"\n }\n )\n )\n).create()\n\n# List Prometheus instances\nfor prom in prometheus_operator.Prometheus.list():\n print(f\"Found Prometheus: {prom.metadata.name}\")\n```\n\n### Using the Fluent Builder API\n\nCloudcoil provides a powerful fluent builder API for Prometheus Operator resources:\n\n```python\nfrom cloudcoil.models.prometheus_operator.v1 import Prometheus, Alertmanager\n\n# Create a Prometheus using the builder\nprometheus = (\n Prometheus.builder()\n .metadata(lambda m: m\n .name(\"main\")\n )\n .spec(lambda s: s\n .external_url(\"http://monitoring.my.systems/prometheus\")\n .resources(lambda r: r\n .requests({\n \"memory\": \"400Mi\"\n })\n )\n )\n .build()\n)\n\n# Create an Alertmanager using the builder\nalert_manager = (\n Alertmanager.builder()\n .metadata(lambda m: m\n .name(\"main\")\n )\n .spec(lambda s: s\n .replicas(3)\n .external_url(\"http://monitoring.my.systems/alertmanager\")\n .resources(lambda r: r\n .requests({\n \"memory\": \"400Mi\"\n })\n )\n )\n .build()\n)\n```\n\n### Using the Context Manager Builder API\n\nFor complex monitoring configurations, you can use the context manager-based builder:\n\n```python\nfrom cloudcoil.models.prometheus_operator.v1 import Prometheus\n\n# Create a Prometheus instance using context managers\nwith Prometheus.new() as prometheus:\n with prometheus.metadata() as metadata:\n metadata.name(\"main\")\n \n with prometheus.spec() as spec:\n spec.external_url(\"http://monitoring.my.systems/prometheus\")\n with spec.resources() as resources:\n resources.requests({\n \"memory\": \"400Mi\"\n })\n\nfinal_prometheus = prometheus.build()\n```\n\n### Mixing Builder Styles\n\nYou can mix different builder styles based on your needs:\n\n```python\nfrom cloudcoil.models.prometheus_operator.v1 import Alertmanager\nfrom cloudcoil import apimachinery\n\n# Create an Alertmanager using mixed styles\nwith Alertmanager.new() as alert_manager:\n # Direct object initialization\n alert_manager.metadata(apimachinery.ObjectMeta(\n name=\"main\"\n ))\n \n # Fluent style for spec\n alert_manager.spec(lambda s: s\n .replicas(3)\n .external_url(\"http://monitoring.my.systems/alertmanager\")\n .resources(lambda r: r\n .requests({\n \"memory\": \"400Mi\"\n })\n )\n )\n\nfinal_alert_manager = alert_manager.build()\n```\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)\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Versioned prometheus-operator models for cloudcoil",
"version": "0.79.2.0",
"project_urls": {
"Changelog": "https://github.com/cloudcoil/models-prometheus-operator/releases",
"Documentation": "https://cloudcoil.github.io/cloudcoil",
"Homepage": "https://github.com/cloudcoil/cloudcoil",
"Issues": "https://github.com/cloudcoil/models-prometheus-operator/issues",
"Repository": "https://github.com/cloudcoil/models-prometheus-operator"
},
"split_keywords": [
"async",
" cloud-native",
" cloudcoil",
" cloudcoil-models",
" kubernetes",
" prometheus-operator",
" pydantic",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "703be29d59c6fa047ceb48b8b186004e5a5272085a75e6a890537bc209559e5d",
"md5": "a25c8243073d57e29d543031fbd31b02",
"sha256": "a40cca1adad11e4a051227661247fc27b5c35b69b50b8b4d9766f213a7ff6b87"
},
"downloads": -1,
"filename": "cloudcoil_models_prometheus_operator-0.79.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a25c8243073d57e29d543031fbd31b02",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 389453,
"upload_time": "2025-01-28T21:52:48",
"upload_time_iso_8601": "2025-01-28T21:52:48.903010Z",
"url": "https://files.pythonhosted.org/packages/70/3b/e29d59c6fa047ceb48b8b186004e5a5272085a75e6a890537bc209559e5d/cloudcoil_models_prometheus_operator-0.79.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c7a222123891dd71a7f2d49fa3e6189e28b1294d1e542faa4e395fa13fa72fc6",
"md5": "21581bd151f5be9ba60729c469ff6431",
"sha256": "f0b495140b105875b3b8093f08ae453106ea90eea4f9115b8167b5fdf06ec294"
},
"downloads": -1,
"filename": "cloudcoil_models_prometheus_operator-0.79.2.0.tar.gz",
"has_sig": false,
"md5_digest": "21581bd151f5be9ba60729c469ff6431",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 445631,
"upload_time": "2025-01-28T21:52:51",
"upload_time_iso_8601": "2025-01-28T21:52:51.573536Z",
"url": "https://files.pythonhosted.org/packages/c7/a2/22123891dd71a7f2d49fa3e6189e28b1294d1e542faa4e395fa13fa72fc6/cloudcoil_models_prometheus_operator-0.79.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-28 21:52:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cloudcoil",
"github_project": "models-prometheus-operator",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cloudcoil.models.prometheus-operator"
}