Versioned keda models for cloudcoil
Project description
cloudcoil-models-keda
Versioned keda models for cloudcoil.
[!WARNING]
This repository is auto-generated from the cloudcoil repository. 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.
Using uv (recommended):
# Install with KEDA support
uv add cloudcoil.models.keda
Using pip:
pip install cloudcoil.models.keda
💡 Examples
Using KEDA Models
from cloudcoil import apimachinery
import cloudcoil.models.keda.v1alpha1 as keda
# Create a ScaledObject
scaled_object = keda.ScaledObject(
metadata=apimachinery.ObjectMeta(name="rabbitmq-scaler"),
spec=keda.ScaledObjectSpec(
scale_target_ref=keda.ScaleTargetRef(
name="my-deployment",
kind="Deployment",
api_version="apps/v1"
),
triggers=[
keda.TriggerModel(
type="rabbitmq",
metadata={
"queue_name": "hello",
"host": "amqp://guest:guest@rabbitmq:5672"
}
)
],
min_replica_count=1,
max_replica_count=10
)
).create()
# List ScaledObjects
for scaler in keda.ScaledObject.list():
print(f"Found scaler: {scaler.metadata.name}")
# Update a ScaledObject
scaled_object.spec.max_replica_count = 20
scaled_object.save()
# Delete resources
keda.ScaledObject.delete("rabbitmq-scaler")
Using the Fluent Builder API
from cloudcoil.models.keda.v1alpha1 import ScaledObject
# Create a ScaledObject using the fluent builder
scaled_object = (
ScaledObject.builder()
.metadata(lambda metadata: metadata
.name("prometheus-scaler")
.namespace("default")
)
.spec(lambda spec: spec
.scale_target_ref(lambda target: target
.name("my-deployment")
.kind("Deployment")
.api_version("apps/v1")
)
.min_replica_count(1)
.max_replica_count(10)
.triggers(lambda triggers: triggers.add(
lambda trigger: trigger.type("prometheus").metadata({
"server_address": "http://prometheus.monitoring.svc",
"metric_name": "http_requests_total",
"threshold": "100"
})
))
)
.build()
)
Using the Context Manager Builder API
from cloudcoil.models.keda.v1alpha1 import ScaledObject
# Create a ScaledObject using context managers
with ScaledObject.new() as cpu_scaler:
with cpu_scaler.metadata() as metadata:
metadata.name("cpu-scaler")
metadata.namespace("default")
with cpu_scaler.spec() as spec:
with spec.scale_target_ref() as target:
target.name("my-deployment")
target.kind("Deployment")
target.api_version("apps/v1")
spec.min_replica_count(1)
spec.max_replica_count(10)
with spec.triggers() as trigger_list:
with trigger_list.add() as trigger:
trigger.type("cpu")
trigger.metadata({
"type": "Utilization",
"value": "50"
})
final_scaler = cpu_scaler.build()
📚 Documentation
For complete documentation, visit cloudcoil.github.io/cloudcoil
📜 License
Apache License, Version 2.0 - see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cloudcoil_models_keda-2.16.1.0.tar.gz.
File metadata
- Download URL: cloudcoil_models_keda-2.16.1.0.tar.gz
- Upload date:
- Size: 169.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ca2511fc84e2511e3245fd689af329e0a7b666a5c83e1679e2c3b580204d9fe
|
|
| MD5 |
b78e993ad4efba2fed088747cddb59a0
|
|
| BLAKE2b-256 |
8267908a0472e4cf2b2e2fe864287970f202cfc9f87035549ca78e80626f4beb
|
Provenance
The following attestation bundles were made for cloudcoil_models_keda-2.16.1.0.tar.gz:
Publisher:
pypi_publish.yml on cloudcoil/models-keda
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudcoil_models_keda-2.16.1.0.tar.gz -
Subject digest:
9ca2511fc84e2511e3245fd689af329e0a7b666a5c83e1679e2c3b580204d9fe - Sigstore transparency entry: 167330814
- Sigstore integration time:
-
Permalink:
cloudcoil/models-keda@8b64c1551e00c03770530280e309c17b6ed1c2a9 -
Branch / Tag:
refs/tags/2.16.1.0 - Owner: https://github.com/cloudcoil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_publish.yml@8b64c1551e00c03770530280e309c17b6ed1c2a9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cloudcoil_models_keda-2.16.1.0-py3-none-any.whl.
File metadata
- Download URL: cloudcoil_models_keda-2.16.1.0-py3-none-any.whl
- Upload date:
- Size: 109.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ec4a118def872b68216d9057ef386701b32fcb0ec2173f49c6214d309176b46
|
|
| MD5 |
9aad7b6e7caaffabe53e159aefbef602
|
|
| BLAKE2b-256 |
916f7319b0687f96fd4cbe489d03b29c0058a0e485bc4e67687f94795ecf3d48
|
Provenance
The following attestation bundles were made for cloudcoil_models_keda-2.16.1.0-py3-none-any.whl:
Publisher:
pypi_publish.yml on cloudcoil/models-keda
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudcoil_models_keda-2.16.1.0-py3-none-any.whl -
Subject digest:
9ec4a118def872b68216d9057ef386701b32fcb0ec2173f49c6214d309176b46 - Sigstore transparency entry: 167330815
- Sigstore integration time:
-
Permalink:
cloudcoil/models-keda@8b64c1551e00c03770530280e309c17b6ed1c2a9 -
Branch / Tag:
refs/tags/2.16.1.0 - Owner: https://github.com/cloudcoil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_publish.yml@8b64c1551e00c03770530280e309c17b6ed1c2a9 -
Trigger Event:
release
-
Statement type: