Skip to main content

Crate vultr

Crate vultr 

Source
Expand description

Client library for the https://www.vultr.com/ API which is documented at https://www.vultr.com/api/

§Example blocking

It needs to have the feature “blocking” enabled.

vultr = { version = "*", features = ["blocking"] }
use vultr::VultrApi;
use vultr::VultrError;

fn main() -> Result<(), VultrError> {
    let api = VultrApi::new("<KEY>");
    let account = api.get_account_info()?;
    println!("ACCOUNT: {:?}", account);

    let regions = api.get_regions()?;
    println!("REGIONS: {:?}", regions);
         
    let plans = api.get_plans()?;
    println!("PLANS: {:?}", plans);
     
    let os = api.get_os_list()?;
    println!("OS: {:?}", os);
    Ok(())
}

§Example async

vultr = { version = "*" }
use vultr::VultrApi;
use vultr::VultrError;

#[async_std::main]
async fn main() -> Result<(), VultrError> {
    let api = VultrApi::new("<KEY>");
    let account = api.get_account_info_async().await?;
    println!("ACCOUNT: {:?}", account);
    Ok(())
}

§Features

  • “blocking” - enable blocking api
  • “gzip” - enable gzip in reqwest
  • “brotli” - enable brotli in reqwest
  • “deflate” - enable deflate in reqwest

Structs§

CreateInstanceBuilder
Builder struct for creating instances.
VultrAccount
Billing and profile information for a Vultr account.
VultrApi
Main entry point for interacting with the Vultr API.
VultrDomain
A DNS domain managed by Vultr.
VultrDomainRecord
A DNS record within a Vultr-managed domain.
VultrFirewallGroup
A Vultr firewall group that contains inbound and outbound traffic rules.
VultrFirewallGroupRule
A single traffic rule within a Vultr firewall group.
VultrInstance
A deployed Vultr compute instance.
VultrOS
An operating system image available for Vultr instances.
VultrPlan
A Vultr instance plan defining hardware configuration and pricing.
VultrRegion
A Vultr data center region where instances can be deployed.
VultrSSHKey
An SSH public key stored in a Vultr account.
VultrUpdateDnsRecordBuilder
Builder for updating an existing DNS record within a domain.

Enums§

LinuxUserScheme
The Linux user scheme used for logging into a new instance.
VultrError
Error type returned by all Vultr API operations.
VultrFirewallGroupRuleIpType
IP version for a firewall rule.
VultrFirewallGroupRuleProtocol
Network protocol matched by a firewall rule.
VultrInstanceType
Specifies the boot source for a new Vultr instance.