pub struct CreateInstanceBuilder { /* private fields */ }
Expand description

Builder struct for creating instances.

A detailed documentation can be found at https://www.vultr.com/api/#tag/instances/operation/create-instance

Implementations§

source§

impl CreateInstanceBuilder

source

pub fn new<S1, S2>( api: VultrApi, region_id: S1, plan_id: S2, instance_type: VultrInstanceType ) -> Self
where S1: Into<String>, S2: Into<String>,

source

pub fn enable_ipv6(self, enable_ipv6: bool) -> Self

source

pub fn label<S>(self, label: S) -> Self
where S: Into<String>,

A user-supplied label for this instance.

source

pub fn sshkey_id<S>(self, sshkey_id: S) -> Self
where S: Into<String>,

The SSH Key id to install on this instance.

source

pub fn backups(self, backups: bool) -> Self

Enable automatic backups for the instance.

source

pub fn ddos_protection(self, ddos_protection: bool) -> Self

Enable DDoS protection (there is an additional charge for this).

source

pub fn activation_email(self, activation_email: bool) -> Self

Notify by email after deployment.

source

pub fn hostname<S>(self, hostname: S) -> Self
where S: Into<String>,

The hostname to use when deploying this instance.

source

pub fn ipxe_chain_url<S>(self, ipxe_chain_url: S) -> Self
where S: Into<String>,

The URL location of the iPXE chainloader.

source

pub fn script_id<S>(self, script_id: S) -> Self
where S: Into<String>,

source

pub fn disable_public_ipv4(self, disable_public_ipv4: bool) -> Self

Don’t set up a public IPv4 address when IPv6 is enabled. Will not do anything unless enable_ipv6 is also true.

source

pub fn attach_vpc(self, attach_vpc: Vec<String>) -> Self

An array of VPC IDs to attach to this Instance. This parameter takes precedence over enable_vpc. Please choose one parameter.

source

pub fn attach_vpc2(self, attach_vpc2: Vec<String>) -> Self

An array of VPC IDs to attach to this Instance. This parameter takes precedence over enable_vpc2. Please choose one parameter.

source

pub fn user_data<S>(self, user_data: S) -> Self
where S: Into<String>,

The user-supplied, base64 encoded user data to attach to this instance.

source

pub fn firewall_group_id<S>(self, firewall_group_id: S) -> Self
where S: Into<String>,

The Firewall Group id to attach to this Instance.

source

pub fn reserved_ipv4<S>(self, reserved_ipv4: S) -> Self
where S: Into<String>,

ID of the floating IP to use as the main IP of this server.

source

pub fn enable_vpc(self, enable_vpc: bool) -> Self

If true, VPC support will be added to the new server.

This parameter attaches a single VPC. When no VPC exists in the region, it will be automatically created.

If there are multiple VPCs in the instance’s region, use attach_vpc instead to specify a network.

source

pub fn enable_vpc2(self, enable_vpc2: bool) -> Self

If true, VPC 2.0 support will be added to the new server.

This parameter attaches a single VPC 2.0 network. When no VPC 2.0 network exists in the region, it will be automatically created.

If there are multiple VPC 2.0 networks in the instance’s region, use attach_vpc2 instead to specify a network.

source

pub fn user_scheme<S>(self, user_scheme: LinuxUserScheme) -> Self

Linux-only: The user scheme used for logging into this instance. By default, the “root” user is configured. Alternatively, a limited user with sudo permissions can be selected.

source

pub fn tags(self, tags: Vec<String>) -> Self

Tags to apply to the instance

source

pub async fn run_async(self) -> Result<VultrInstance, VultrError>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more