pub struct TemplateUpdateInput {
pub container_disk_in_gb: Option<i32>,
pub container_registry_auth_id: Option<String>,
pub docker_entrypoint: Option<Vec<String>>,
pub docker_start_cmd: Option<Vec<String>>,
pub env: Option<EnvVars>,
pub image_name: Option<String>,
pub is_public: Option<bool>,
pub name: Option<String>,
pub ports: Option<Vec<String>>,
pub readme: Option<String>,
pub volume_in_gb: Option<i32>,
pub volume_mount_path: Option<String>,
}Expand description
Input parameters for updating existing templates.
Use this struct to modify template configuration. Template updates automatically trigger rolling releases for any associated Serverless endpoints, ensuring deployed instances use the latest configuration.
§Rolling Release Behavior
When a template is updated:
- New instances are created with the updated configuration
- Traffic is gradually shifted to new instances
- Old instances are gracefully terminated
- The process ensures zero-downtime updates for Serverless endpoints
§Partial Updates
All fields are optional, allowing for partial updates. Only specified fields will be changed; unspecified fields retain their current values.
§Examples
use runpod_sdk::model::TemplateUpdateInput;
// Update only the Docker image
let image_update = TemplateUpdateInput {
image_name: Some("myapp:v2.0.0".to_string()),
..Default::default()
};
// Update storage allocation and environment variables
let config_update = TemplateUpdateInput {
container_disk_in_gb: Some(100),
volume_in_gb: Some(50),
env: Some({
let mut env = std::collections::HashMap::new();
env.insert("MODEL_VERSION".to_string(), "v2.0".to_string());
env.insert("BATCH_SIZE".to_string(), "32".to_string());
env
}),
..Default::default()
};Fields§
§container_disk_in_gb: Option<i32>Update the amount of disk space in GB for the container disk. Container disk provides fast local storage but data is wiped on restart.
container_registry_auth_id: Option<String>Update the container registry authentication ID. Use when changing to a private image that requires different credentials.
docker_entrypoint: Option<Vec<String>>Update the Docker image ENTRYPOINT override. Specify new entrypoint commands or set to empty to use image default.
docker_start_cmd: Option<Vec<String>>Update the Docker image start command override. Specify new start commands or set to empty to use image default.
env: Option<EnvVars>Update environment variables for the template. Completely replaces existing environment variables with the provided set.
image_name: Option<String>Update the Docker image tag for the template. This is commonly updated to deploy new versions of applications. Triggers rolling release for associated Serverless endpoints.
is_public: Option<bool>Update the template’s public visibility.
true: Make template public (enables revenue sharing)false: Make template private (restricts access to creator)
name: Option<String>Update the template name. New name must be unique within your account.
ports: Option<Vec<String>>Update the list of exposed ports.
Each port is formatted as [port]/[protocol] (e.g., “8000/http”).
Completely replaces existing port configuration.
readme: Option<String>Update the template documentation. Provide new markdown-formatted description, usage instructions, and configuration details for the template.
volume_in_gb: Option<i32>Update the amount of disk space in GB for the Pod volume. Pod volume provides persistent storage that survives instance restarts.
volume_mount_path: Option<String>Update the Pod volume mount path. The absolute path where persistent storage will be accessible within containers deployed from this template.
Trait Implementations§
Source§impl Clone for TemplateUpdateInput
impl Clone for TemplateUpdateInput
Source§fn clone(&self) -> TemplateUpdateInput
fn clone(&self) -> TemplateUpdateInput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more