[][src]Struct digitalocean::request::Request

pub struct Request<A: Method, R> { /* fields omitted */ }

A consuming builder which can be used to build up API calls.

In general consumers of the crate should not need to use this type directly. Instead, build up requests from what is found in api::*.

Implementations

impl Request<M, V>[src]

pub fn certificate_chain<S: AsRef<str> + Serialize + Display>(
    self,
    val: S
) -> Self
[src]

The full PEM-formatted trust chain between the certificate authority's certificate and your domain's SSL certificate.

Digital Ocean Documentation.

impl Request<M, V>[src]

impl Request<M, V>[src]

impl Request<M, V>[src]

pub fn priority(self, val: Option<usize>) -> Self[src]

The priority for SRV and MX records.

Digital Ocean Documentation.

pub fn port(self, val: Option<usize>) -> Self[src]

The port for SRV records.

Digital Ocean Documentation.

pub fn ttl(self, val: usize) -> Self[src]

This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.

Digital Ocean Documentation.

pub fn weight(self, val: Option<usize>) -> Self[src]

The weight for SRV records.

Digital Ocean Documentation.

impl Request<M, V>[src]

pub fn kind<S: AsRef<str> + Display + Serialize>(self, val: S) -> Self[src]

The record type (A, MX, CNAME, etc).

Digital Ocean Documentation.

pub fn name<S: AsRef<str> + Display + Serialize>(self, val: S) -> Self[src]

The host name, alias, or service being defined by the record.

Digital Ocean Documentation.

pub fn data<S: AsRef<str> + Display + Serialize>(self, val: S) -> Self[src]

Variable data depending on record type. See the Domain Records section for more detail on each record type.

Digital Ocean Documentation.

pub fn priority(self, val: Option<usize>) -> Self[src]

The priority for SRV and MX records.

Digital Ocean Documentation.

pub fn port(self, val: Option<usize>) -> Self[src]

The port for SRV records.

Digital Ocean Documentation.

pub fn ttl(self, val: usize) -> Self[src]

This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.

Digital Ocean Documentation.

pub fn weight(self, val: Option<usize>) -> Self[src]

The weight for SRV records.

Digital Ocean Documentation.

impl Request<M, V>[src]

pub fn ssh_keys<D>(self, val: Vec<D>) -> Self where
    D: Display + Serialize
[src]

An array containing the IDs or fingerprints of the SSH keys that you wish to embed in the Droplet's root account upon creation.

Digital Ocean Documentation.

pub fn backups(self, val: bool) -> Self[src]

A boolean indicating whether automated backups should be enabled for the Droplet. Automated backups can only be enabled when the Droplet is created.

Digital Ocean Documentation.

pub fn ipv6(self, val: bool) -> Self[src]

A boolean indicating whether IPv6 is enabled on the Droplet.

Digital Ocean Documentation.

pub fn private_networking(self, val: bool) -> Self[src]

A boolean indicating whether private networking is enabled for the Droplet. Private networking is currently only available in certain regions.

Digital Ocean Documentation.

pub fn user_data(self, val: bool) -> Self[src]

A string containing 'user data' which may be used to configure the Droplet on first boot, often a 'cloud-config' file or Bash script. It must be plain text and may not exceed 64 KiB in size.

Digital Ocean Documentation.

pub fn monitoring(self, val: bool) -> Self[src]

A boolean indicating whether to install the DigitalOcean agent for monitoring.

Digital Ocean Documentation.

pub fn volumes(self, val: Vec<String>) -> Self[src]

A flat array including the unique string identifier for each Block Storage volume to be attached to the Droplet. At the moment a volume can only be attached to a single Droplet.

Digital Ocean Documentation.

pub fn tags(self, val: Vec<String>) -> Self[src]

A flat array of tag names as strings to apply to the Droplet after it is created. Tag names can either be existing or new tags.

Digital Ocean Documentation.

impl Request<M, V>[src]

pub fn ssh_keys<D>(self, val: Vec<D>) -> Self where
    D: Display + Serialize
[src]

An array containing the IDs or fingerprints of the SSH keys that you wish to embed in the Droplet's root account upon creation.

Digital Ocean Documentation.

pub fn backups(self, val: bool) -> Self[src]

A boolean indicating whether automated backups should be enabled for the Droplet. Automated backups can only be enabled when the Droplet is created.

Digital Ocean Documentation.

pub fn ipv6(self, val: bool) -> Self[src]

A boolean indicating whether IPv6 is enabled on the Droplet.

Digital Ocean Documentation.

pub fn private_networking(self, val: bool) -> Self[src]

A boolean indicating whether private networking is enabled for the Droplet. Private networking is currently only available in certain regions.

Digital Ocean Documentation.

pub fn user_data(self, val: bool) -> Self[src]

A string containing 'user data' which may be used to configure the Droplet on first boot, often a 'cloud-config' file or Bash script. It must be plain text and may not exceed 64 KiB in size.

Digital Ocean Documentation.

pub fn monitoring(self, val: bool) -> Self[src]

A boolean indicating whether to install the DigitalOcean agent for monitoring.

Digital Ocean Documentation.

pub fn volumes(self, val: Vec<String>) -> Self[src]

A flat array including the unique string identifier for each Block Storage volume to be attached to the Droplet. At the moment a volume can only be attached to a single Droplet.

Digital Ocean Documentation.

pub fn tags(self, val: Vec<String>) -> Self[src]

A flat array of tag names as strings to apply to the Droplet after it is created. Tag names can either be existing or new tags.

Digital Ocean Documentation.

impl Request<M, V>[src]

impl Request<M, V>[src]

pub fn actions(self) -> DropletActionRequest<List, Vec<Action>>[src]

pub fn enable_backups(self) -> DropletActionRequest<Create, Action>[src]

pub fn disable_backups(self) -> DropletActionRequest<Create, Action>[src]

pub fn reboot(self) -> DropletActionRequest<Create, Action>[src]

pub fn power_cycle(self) -> DropletActionRequest<Create, Action>[src]

pub fn shutdown(self) -> DropletActionRequest<Create, Action>[src]

pub fn power(self, val: bool) -> DropletActionRequest<Create, Action>[src]

pub fn restore<D: Display>(
    self,
    image: D
) -> DropletActionRequest<Create, Action>
[src]

pub fn password_reset(self) -> DropletActionRequest<Create, Action>[src]

pub fn resize<S>(
    self,
    size: S,
    disk: bool
) -> DropletActionRequest<Create, Action> where
    S: AsRef<str> + Serialize + Display
[src]

pub fn rebuild<S>(self, image: S) -> DropletActionRequest<Create, Action> where
    S: AsRef<str> + Serialize + Display
[src]

pub fn rename<S>(self, name: S) -> DropletActionRequest<Create, Action> where
    S: AsRef<str> + Serialize + Display
[src]

pub fn kernel(self, kernel: usize) -> DropletActionRequest<Create, Action>[src]

pub fn enable_ipv6(self) -> DropletActionRequest<Create, Action>[src]

pub fn enable_private_networking(self) -> DropletActionRequest<Create, Action>[src]

pub fn snapshot<S>(self, name: S) -> DropletActionRequest<Create, Action> where
    S: AsRef<str> + Serialize + Display
[src]

pub fn action(self, id: usize) -> DropletActionRequest<Get, Action>[src]

impl Request<M, V>[src]

impl Request<M, V>[src]

pub fn name<S: Display + Serialize>(self, val: S) -> ImageRequest<Update, Image>[src]

The new name that you would like to use for the image.

Digital Ocean Documentation.

impl Request<M, V>[src]

impl Request<M, V>[src]

pub fn algorithm<S>(self, val: S) -> LoadBalancerRequest<Create, LoadBalancer> where
    S: Display + Serialize
[src]

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either "round_robin" or "least_connections". The default value is "round_robin".

Digital Ocean Documentation.

pub fn forwarding_rule<T>(
    self,
    val: T
) -> LoadBalancerRequest<Create, LoadBalancer> where
    T: Into<ForwardingRule>, 
[src]

An array of objects specifying the forwarding rules for a Load Balancer. At least one forwarding rule is required when creating a new Load Balancer instance.

Digital Ocean Documentation.

pub fn health_check<S: AsRef<str> + Display + Serialize>(
    self,
    protocol: S,
    port: usize,
    path: Option<S>,
    check_interval_seconds: Option<usize>,
    response_timeout_seconds: Option<usize>,
    unhealthy_threshold: Option<usize>,
    healthy_threshold: Option<usize>
) -> LoadBalancerRequest<Create, LoadBalancer>
[src]

The (optional) health check settings.

Digital Ocean Documentation.

pub fn sticky_sessions<S: AsRef<str> + Display + Serialize>(
    self,
    kind: S,
    cookie_name: Option<S>,
    cookie_ttl_seconds: Option<usize>
) -> LoadBalancerRequest<Create, LoadBalancer>
[src]

The (optional) sticky sessions settings. kind must be cookies or none. If kind is cookies then cookie_name and cookie_ttl_seconds should be set as well.

Digital Ocean Documentation.

pub fn redirect_http_to_https(
    self,
    setting: bool
) -> LoadBalancerRequest<Create, LoadBalancer>
[src]

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

Digital Ocean Documentation.

pub fn droplets(
    self,
    ids: Vec<usize>
) -> LoadBalancerRequest<Create, LoadBalancer>
[src]

The IDs of the Droplets to be assigned to the Load Balancer.

Note: Not intended to be used alongside the tag function.

Digital Ocean Documentation.

pub fn tag<S>(self, tag: S) -> LoadBalancerRequest<Create, LoadBalancer> where
    S: AsRef<str> + Display + Serialize
[src]

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

Note: Not intended to be used alongside the droplets function.

Digital Ocean Documentation.

impl Request<M, V>[src]

pub fn name<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer> where
    S: Display + Serialize
[src]

A human-readable name for a Load Balancer instance.

Digital Ocean Documentation.

pub fn region<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer> where
    S: Display + Serialize
[src]

The region where the Load Balancer instance will be located.

Digital Ocean Documentation.

pub fn algorithm<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer> where
    S: Display + Serialize
[src]

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either "round_robin" or "least_connections". The default value is "round_robin".

Digital Ocean Documentation.

pub fn forwarding_rule<T>(
    self,
    val: T
) -> LoadBalancerRequest<Update, LoadBalancer> where
    T: Into<ForwardingRule>, 
[src]

An array of objects specifying the forwarding rules for a Load Balancer. At least one forwarding rule is required when creating a new Load Balancer instance.

Digital Ocean Documentation.

pub fn health_check<S: AsRef<str> + Display + Serialize>(
    self,
    protocol: S,
    port: usize,
    path: Option<S>,
    check_interval_seconds: Option<usize>,
    response_timeout_seconds: Option<usize>,
    unhealthy_threshold: Option<usize>,
    healthy_threshold: Option<usize>
) -> LoadBalancerRequest<Update, LoadBalancer>
[src]

The (optional) health check settings.

Digital Ocean Documentation.

pub fn sticky_sessions<S: AsRef<str> + Display + Serialize>(
    self,
    kind: S,
    cookie_name: Option<S>,
    cookie_ttl_seconds: Option<usize>
) -> LoadBalancerRequest<Update, LoadBalancer>
[src]

The (optional) sticky sessions settings. kind must be cookies or none. If kind is cookies then cookie_name and cookie_ttl_seconds should be set as well.

Digital Ocean Documentation.

pub fn redirect_http_to_https(
    self,
    setting: bool
) -> LoadBalancerRequest<Update, LoadBalancer>
[src]

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

Digital Ocean Documentation.

pub fn droplets(
    self,
    ids: Vec<usize>
) -> LoadBalancerRequest<Update, LoadBalancer>
[src]

The IDs of the Droplets to be assigned to the Load Balancer.

Note: Not intended to be used alongside the tag function.

Digital Ocean Documentation.

pub fn tag<S>(self, tag: S) -> LoadBalancerRequest<Update, LoadBalancer> where
    S: AsRef<str> + Display + Serialize
[src]

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

Note: Not intended to be used alongside the droplets function.

Digital Ocean Documentation.

impl Request<M, V>[src]

pub fn add_droplets(self, ids: Vec<usize>) -> LoadBalancerRequest<Create, ()>[src]

Add droplets (by id) to the load balancer.

Digital Ocean Documentation.

pub fn remove_droplets(self, ids: Vec<usize>) -> LoadBalancerRequest<Delete, ()>[src]

Remove droplets (by id) from the load balancer.

Digital Ocean Documentation.

pub fn add_forwarding_rules<T>(
    self,
    items: Vec<T>
) -> LoadBalancerRequest<Create, ()> where
    T: Into<ForwardingRule>, 
[src]

Add a forwarding rule to the Load Balancer.

Digital Ocean Documentation.

pub fn remove_forwarding_rules<T>(
    self,
    items: Vec<T>
) -> LoadBalancerRequest<Delete, ()> where
    T: Into<ForwardingRule>, 
[src]

Remove a forwarding rule to the Load Balancer.

Digital Ocean Documentation.

impl Request<M, V>[src]

pub fn name<S: AsRef<str> + Display + Serialize>(self, val: S) -> Self[src]

The name to give the new SSH key in your account.

Digital Ocean Documentation.

impl Request<M, V>[src]

pub fn add_resources<S>(self, resources: Vec<(S, S)>) -> TagRequest<Create, ()> where
    S: AsRef<str> + Serialize + Display
[src]

Accepts tuples matching (id, type). Currently the only type is "droplet".

Digital Ocean Documentation.

pub fn remove_resources<S>(
    self,
    resources: Vec<(S, S)>
) -> TagRequest<Delete, ()> where
    S: AsRef<str> + Serialize + Display
[src]

Accepts tuples matching (id, type). Currently the only type is "droplet".

Digital Ocean Documentation.

impl Request<M, V>[src]

pub fn region<S: AsRef<str> + Serialize + Display>(self, region: S) -> Self[src]

impl Request<M, V>[src]

impl Request<M, V>[src]

pub fn description<S: AsRef<str> + Serialize + Display>(self, val: S) -> Self[src]

An optional free-form text field to describe a Block Storage volume.

Digital Ocean Documentation.

pub fn region<S: AsRef<str> + Serialize + Display>(self, val: S) -> Self[src]

The region where the Block Storage volume will be created. When setting a region, the value should be the slug identifier for the region. When you query a Block Storage volume, the entire region object will be returned.

Note: Should not be specified with a snapshot_id.

Digital Ocean Documentation.

pub fn snapshot_id<S: AsRef<str> + Serialize + Display>(self, val: S) -> Self[src]

The unique identifier for the volume snapshot from which to create the volume.

Note: Should not be specified with a region_id.

Digital Ocean Documentation.

impl Request<M, V>[src]

impl<A: Method, R> Request<A, R>[src]

pub fn url_mut(&mut self) -> &mut Url[src]

pub fn body_mut(&mut self) -> &mut Value[src]

The JSON body of the request.

impl<A: Method, R> Request<A, R>[src]

pub fn url(&self) -> &Url[src]

pub fn body(&self) -> &Value[src]

The JSON body of the request.

pub fn method(&self) -> &A[src]

impl<A: Method, R> Request<A, R>[src]

pub fn set_url(&mut self, val: Url) -> &mut Self[src]

pub fn set_body(&mut self, val: Value) -> &mut Self[src]

The JSON body of the request.

impl<A: Method, V> Request<A, V>[src]

pub fn new(url: Url) -> Self[src]

Create a request pointing at the given url. V is the value ultimately returned when the call is executed.

impl<V> Request<List, V>[src]

pub fn limit(self, limit: Option<usize>) -> Self[src]

Impose a limit on the number of values which may be retrieved from a request.

Trait Implementations

impl<A: Clone + Method, R: Clone> Clone for Request<A, R>[src]

impl<A: Debug + Method, R: Debug> Debug for Request<A, R>[src]

impl<'de, A: Method, R> Deserialize<'de> for Request<A, R> where
    A: Deserialize<'de>, 
[src]

impl Executable<()> for Request<Delete, ()>[src]

impl<V: HasResponse> Executable<V> for Request<Create, V>[src]

impl<V: HasResponse> Executable<V> for Request<Update, V>[src]

impl<V: HasResponse> Executable<V> for Request<Get, V>[src]

impl<V> Executable<Vec<V>> for Request<List, Vec<V>> where
    Vec<V>: HasResponse,
    <Vec<V> as HasResponse>::Response: HasPagination
[src]

impl<A: Method, R> Serialize for Request<A, R> where
    A: Serialize
[src]

Auto Trait Implementations

impl<A, R> RefUnwindSafe for Request<A, R> where
    A: RefUnwindSafe,
    R: RefUnwindSafe

impl<A, R> Send for Request<A, R> where
    A: Send,
    R: Send

impl<A, R> Sync for Request<A, R> where
    A: Sync,
    R: Sync

impl<A, R> Unpin for Request<A, R> where
    A: Unpin,
    R: Unpin

impl<A, R> UnwindSafe for Request<A, R> where
    A: UnwindSafe,
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

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