pub struct ProxmoxClient { /* private fields */ }Expand description
Proxmox API client for container and VM management
Implementations§
Source§impl ProxmoxClient
impl ProxmoxClient
Sourcepub fn new(
api_url: &str,
token_id: &str,
token_secret: &str,
node: &str,
) -> Result<Self>
pub fn new( api_url: &str, token_id: &str, token_secret: &str, node: &str, ) -> Result<Self>
Create a new Proxmox client
§Arguments
api_url- Base URL of the Proxmox API (e.g., “https://192.168.1.100:8006/api2/json”)token_id- API token ID (e.g., “root@pam!paygress”)token_secret- API token secretnode- Proxmox node name (e.g., “pve”)
Sourcepub async fn create_lxc(&self, config: &LxcConfig) -> Result<String>
pub async fn create_lxc(&self, config: &LxcConfig) -> Result<String>
Create an LXC container
Sourcepub async fn delete_lxc(&self, vmid: u32) -> Result<String>
pub async fn delete_lxc(&self, vmid: u32) -> Result<String>
Delete an LXC container
Sourcepub async fn get_lxc_status(&self, vmid: u32) -> Result<WorkloadStatus>
pub async fn get_lxc_status(&self, vmid: u32) -> Result<WorkloadStatus>
Get LXC container status
Sourcepub async fn list_lxc(&self) -> Result<Vec<WorkloadStatus>>
pub async fn list_lxc(&self) -> Result<Vec<WorkloadStatus>>
List all LXC containers on the node
Sourcepub async fn get_vm_status(&self, vmid: u32) -> Result<WorkloadStatus>
pub async fn get_vm_status(&self, vmid: u32) -> Result<WorkloadStatus>
Get VM status
Sourcepub async fn list_vm(&self) -> Result<Vec<WorkloadStatus>>
pub async fn list_vm(&self) -> Result<Vec<WorkloadStatus>>
List all VMs on the node
Sourcepub async fn get_node_status(&self) -> Result<NodeStatus>
pub async fn get_node_status(&self) -> Result<NodeStatus>
Get node status (CPU, memory, uptime)
Auto Trait Implementations§
impl Freeze for ProxmoxClient
impl !RefUnwindSafe for ProxmoxClient
impl Send for ProxmoxClient
impl Sync for ProxmoxClient
impl Unpin for ProxmoxClient
impl UnsafeUnpin for ProxmoxClient
impl !UnwindSafe for ProxmoxClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more