Expand description
Shell command execution attribute
This module provides the CommandBlockExpectedState type for executing arbitrary
shell commands on managed hosts.
Compatible OS:
- All POSIX systems (Linux, macOS, FreeBSD) - uses
run_command - Windows (when
windowsfeature is enabled) - usesrun_windows_command
§Examples
§Rust API
use regent_sdk::state::attribute::shell::command::CommandBlockExpectedState;
use regent_sdk::{Attribute, ExpectedState, Privilege};
// Execute a simple command
let echo = CommandBlockExpectedState::builder("echo 'Hello, World!'")
.build()
.unwrap();
let expected_state = ExpectedState::new()
.with_attribute(Attribute::command(echo, Privilege::None, None))
.build();§YAML API
Attributes:
- Name: Hello world must be printed
Privilege: !None
Detail: !Command
Cmd: "echo 'Hello, World!'"Structs§
- Command
ApiCall - Command
Block Expected State - Configuration for a shell command to execute