Expand description
ZLayer V1 Service Specification
This crate provides types for parsing and validating ZLayer deployment specifications.
Structs§
- ApiSpec
- API server configuration (embedded in deploy/up flows)
- Command
Spec - Command override specification (Section 5.5)
- Depends
Spec - Dependency specification
- Deployment
Spec - Top-level deployment specification
- Device
Spec - Device passthrough specification
- Endpoint
Spec - Endpoint specification (proxy binding)
- Endpoint
Tunnel Config - Tunnel configuration for an endpoint
- Errors
Spec - Error handling policies
- GpuSpec
- GPU resource specification
- Health
Spec - Health check specification
- Image
Spec - Container image specification
- Init
Failure Policy - Init failure policy
- Init
Spec - Init actions specification
- Init
Step - Init action step
- Join
Policy - Join policy - controls who can join a service
- Network
Spec - Network configuration
- Node
Selector - Node selection constraints for service placement
- Overlay
Config - Overlay network configuration
- Overlay
Settings - Overlay network settings
- Panic
Policy - Panic policy
- Resources
Spec - Resource limits (upper bounds, not reservations)
- Scale
Targets - Target metrics for adaptive scaling
- Service
Spec - Per-service specification
- Stream
Endpoint Config - Stream (L4) proxy configuration for TCP/UDP endpoints
- Tunnel
Access Config - On-demand access settings for
zlayer tunnel access - Tunnel
Definition - Top-level tunnel definition (not tied to a service endpoint)
- Validation
Error - Validation errors for deployment specs
- Wasm
Http Config - Configuration for WASM HTTP services with instance pooling
Enums§
- Dependency
Condition - Dependency condition
- Expose
Type - Exposure type
- Failure
Action - Failure action for init steps
- Health
Check - Health check type
- Init
Failure Action - Init failure action
- Join
Mode - Join mode
- Join
Scope - Join scope
- Node
Mode - How service replicas are allocated to nodes
- Panic
Action - Panic action
- Protocol
- Protocol type
- Pull
Policy - Image pull policy
- Resource
Type - Resource type - determines container lifecycle
- Scale
Spec - Scaling configuration
- Service
Type - Service type - determines runtime behavior and scaling model
- Spec
Error - Errors that can occur when parsing or validating a spec
- Storage
Spec - Storage mount specification
- Storage
Tier - Storage performance tier
- Stream
Health Check - Health check types for stream (L4) endpoints
- Timeout
Action - Timeout action
- Tunnel
Protocol - Protocol for tunnel connections (tcp or udp only)
- Validation
Error Kind - The specific kind of validation error
Functions§
- from_
yaml_ file - Parse a deployment spec from YAML file
- from_
yaml_ str - Parse a deployment spec from YAML string
- validate_
cpu - Validate CPU limit
- validate_
cpu_ option_ wrapper - Wrapper for validate_cpu for use with validator crate
Note: For Option
fields, validator crate unwraps and passes the inner f64 - validate_
cron_ schedules - Validate schedule/rtype consistency for all services
- validate_
dependencies - Validate that all dependency service references exist
- validate_
deployment_ name - Validate a deployment name
- validate_
deployment_ name_ wrapper - Wrapper for validate_deployment_name for use with validator crate
- validate_
endpoint_ tunnel_ config - Validate an EndpointTunnelConfig
- validate_
env_ vars - Validate all environment variable values in a service spec
- validate_
image_ name - Validate an image name
- validate_
image_ name_ wrapper - Wrapper for validate_image_name for use with validator crate
- validate_
memory_ format - Validate memory format
- validate_
memory_ option_ wrapper - Wrapper for validate_memory_format for use with validator crate
Note: For Option
fields, validator crate unwraps and passes &String - validate_
port - Validate a port number
- validate_
port_ wrapper - Wrapper for validate_port for use with validator crate Note: validator crate passes primitive types by value for custom validators
- validate_
scale_ range - Validate scale range
- validate_
scale_ spec - Validate scale range (min <= max) for ScaleSpec
- validate_
schedule_ wrapper - Wrapper for validate_cron_schedule for use with validator crate
Note: For Option
fields, validator crate unwraps and passes &String - validate_
secret_ reference - Validate a secret reference name format
- validate_
service_ schedule - Validate schedule/rtype consistency for a single service
- validate_
storage_ name - Validate storage name format (lowercase alphanumeric with hyphens)
- validate_
storage_ name_ wrapper - Wrapper for validate_storage_name for use with validator crate
- validate_
tunnel_ access_ config - Validate a TunnelAccessConfig
- validate_
tunnel_ definition - Validate a top-level TunnelDefinition
- validate_
tunnel_ ttl - Validate tunnel TTL format (e.g., “4h”, “30m”, “1d”)
- validate_
tunnels - Validate all tunnels in a deployment spec
- validate_
unique_ endpoints - Validate that endpoint names are unique within a service
- validate_
unique_ service_ endpoints - Validate that each service has unique endpoint names
- validate_
version - Validate that the version is “v1”
- validate_
version_ wrapper - Wrapper for validate_version for use with validator crate
Type Aliases§
- Init
Params - Init action parameters