Struct digitalocean::request::Request
source · pub struct Request<A, R>where
A: Method,{ /* private fields */ }
Expand description
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§
source§impl Request<M, V>
impl Request<M, V>
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn records(self) -> DomainRecordRequest<List, Vec<DomainRecord>>
pub fn records(self) -> DomainRecordRequest<List, Vec<DomainRecord>>
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn create<S>(
self,
kind: S,
name: S,
data: S
) -> DomainRecordRequest<Create, DomainRecord>where
S: AsRef<str> + Display + Serialize,
pub fn create<S>(
self,
kind: S,
name: S,
data: S
) -> DomainRecordRequest<Create, DomainRecord>where
S: AsRef<str> + Display + Serialize,
sourcepub fn get(self, id: usize) -> DomainRecordRequest<Get, DomainRecord>
pub fn get(self, id: usize) -> DomainRecordRequest<Get, DomainRecord>
sourcepub fn update(self, id: usize) -> DomainRecordRequest<Update, DomainRecord>
pub fn update(self, id: usize) -> DomainRecordRequest<Update, DomainRecord>
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn ttl(self, val: usize) -> Self
pub fn ttl(self, val: usize) -> Self
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.
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn kind<S>(self, val: S) -> Selfwhere
S: AsRef<str> + Display + Serialize,
pub fn kind<S>(self, val: S) -> Selfwhere
S: AsRef<str> + Display + Serialize,
The record type (A, MX, CNAME, etc).
sourcepub fn name<S>(self, val: S) -> Selfwhere
S: AsRef<str> + Display + Serialize,
pub fn name<S>(self, val: S) -> Selfwhere
S: AsRef<str> + Display + Serialize,
The host name, alias, or service being defined by the record.
sourcepub fn data<S>(self, val: S) -> Selfwhere
S: AsRef<str> + Display + Serialize,
pub fn data<S>(self, val: S) -> Selfwhere
S: AsRef<str> + Display + Serialize,
Variable data depending on record type. See the Domain Records section for more detail on each record type.
sourcepub fn ttl(self, val: usize) -> Self
pub fn ttl(self, val: usize) -> Self
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.
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn ssh_keys<D>(self, val: Vec<D>) -> Selfwhere
D: Display + Serialize,
pub fn ssh_keys<D>(self, val: Vec<D>) -> Selfwhere
D: Display + Serialize,
An array containing the IDs or fingerprints of the SSH keys that you wish to embed in the Droplet’s root account upon creation.
sourcepub fn backups(self, val: bool) -> Self
pub fn backups(self, val: bool) -> Self
A boolean indicating whether automated backups should be enabled for the Droplet. Automated backups can only be enabled when the Droplet is created.
sourcepub fn ipv6(self, val: bool) -> Self
pub fn ipv6(self, val: bool) -> Self
A boolean indicating whether IPv6 is enabled on the Droplet.
sourcepub fn private_networking(self, val: bool) -> Self
pub fn private_networking(self, val: bool) -> Self
A boolean indicating whether private networking is enabled for the Droplet. Private networking is currently only available in certain regions.
sourcepub fn user_data(self, val: bool) -> Self
pub fn user_data(self, val: bool) -> Self
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.
sourcepub fn monitoring(self, val: bool) -> Self
pub fn monitoring(self, val: bool) -> Self
A boolean indicating whether to install the DigitalOcean agent for monitoring.
sourcepub fn volumes(self, val: Vec<String>) -> Self
pub fn volumes(self, val: Vec<String>) -> Self
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.
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.
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn ssh_keys<D>(self, val: Vec<D>) -> Selfwhere
D: Display + Serialize,
pub fn ssh_keys<D>(self, val: Vec<D>) -> Selfwhere
D: Display + Serialize,
An array containing the IDs or fingerprints of the SSH keys that you wish to embed in the Droplet’s root account upon creation.
sourcepub fn backups(self, val: bool) -> Self
pub fn backups(self, val: bool) -> Self
A boolean indicating whether automated backups should be enabled for the Droplet. Automated backups can only be enabled when the Droplet is created.
sourcepub fn ipv6(self, val: bool) -> Self
pub fn ipv6(self, val: bool) -> Self
A boolean indicating whether IPv6 is enabled on the Droplet.
sourcepub fn private_networking(self, val: bool) -> Self
pub fn private_networking(self, val: bool) -> Self
A boolean indicating whether private networking is enabled for the Droplet. Private networking is currently only available in certain regions.
sourcepub fn user_data(self, val: bool) -> Self
pub fn user_data(self, val: bool) -> Self
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.
sourcepub fn monitoring(self, val: bool) -> Self
pub fn monitoring(self, val: bool) -> Self
A boolean indicating whether to install the DigitalOcean agent for monitoring.
sourcepub fn volumes(self, val: Vec<String>) -> Self
pub fn volumes(self, val: Vec<String>) -> Self
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.
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.
source§impl Request<M, V>
impl Request<M, V>
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn enable_backups(self) -> DropletActionRequest<Create, Action>
pub fn enable_backups(self) -> DropletActionRequest<Create, Action>
sourcepub fn disable_backups(self) -> DropletActionRequest<Create, Action>
pub fn disable_backups(self) -> DropletActionRequest<Create, Action>
sourcepub fn reboot(self) -> DropletActionRequest<Create, Action>
pub fn reboot(self) -> DropletActionRequest<Create, Action>
sourcepub fn power_cycle(self) -> DropletActionRequest<Create, Action>
pub fn power_cycle(self) -> DropletActionRequest<Create, Action>
sourcepub fn shutdown(self) -> DropletActionRequest<Create, Action>
pub fn shutdown(self) -> DropletActionRequest<Create, Action>
sourcepub fn password_reset(self) -> DropletActionRequest<Create, Action>
pub fn password_reset(self) -> DropletActionRequest<Create, Action>
sourcepub fn resize<S>(
self,
size: S,
disk: bool
) -> DropletActionRequest<Create, Action>where
S: AsRef<str> + Serialize + Display,
pub fn resize<S>(
self,
size: S,
disk: bool
) -> DropletActionRequest<Create, Action>where
S: AsRef<str> + Serialize + Display,
sourcepub fn rebuild<S>(self, image: S) -> DropletActionRequest<Create, Action>where
S: AsRef<str> + Serialize + Display,
pub fn rebuild<S>(self, image: S) -> DropletActionRequest<Create, Action>where
S: AsRef<str> + Serialize + Display,
sourcepub fn rename<S>(self, name: S) -> DropletActionRequest<Create, Action>where
S: AsRef<str> + Serialize + Display,
pub fn rename<S>(self, name: S) -> DropletActionRequest<Create, Action>where
S: AsRef<str> + Serialize + Display,
sourcepub fn enable_ipv6(self) -> DropletActionRequest<Create, Action>
pub fn enable_ipv6(self) -> DropletActionRequest<Create, Action>
sourcepub fn enable_private_networking(self) -> DropletActionRequest<Create, Action>
pub fn enable_private_networking(self) -> DropletActionRequest<Create, Action>
sourcepub fn snapshot<S>(self, name: S) -> DropletActionRequest<Create, Action>where
S: AsRef<str> + Serialize + Display,
pub fn snapshot<S>(self, name: S) -> DropletActionRequest<Create, Action>where
S: AsRef<str> + Serialize + Display,
source§impl Request<M, V>
impl Request<M, V>
source§impl Request<M, V>
impl Request<M, V>
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn transfer<S>(self, region: S) -> ImageActionRequest<Create, Action>where
S: AsRef<str> + Display + Serialize,
pub fn transfer<S>(self, region: S) -> ImageActionRequest<Create, Action>where
S: AsRef<str> + Display + Serialize,
sourcepub fn convert(self) -> ImageActionRequest<Create, Action>
pub fn convert(self) -> ImageActionRequest<Create, Action>
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn algorithm<S>(self, val: S) -> LoadBalancerRequest<Create, LoadBalancer>where
S: Display + Serialize,
pub fn algorithm<S>(self, val: S) -> LoadBalancerRequest<Create, LoadBalancer>where
S: Display + Serialize,
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”.
sourcepub fn forwarding_rule<T>(
self,
val: T
) -> LoadBalancerRequest<Create, LoadBalancer>where
T: Into<ForwardingRule>,
pub fn forwarding_rule<T>(
self,
val: T
) -> LoadBalancerRequest<Create, LoadBalancer>where
T: Into<ForwardingRule>,
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.
sourcepub fn health_check<S>(
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>where
S: AsRef<str> + Display + Serialize,
pub fn health_check<S>(
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>where
S: AsRef<str> + Display + Serialize,
The (optional) health check settings.
sourcepub fn sticky_sessions<S>(
self,
kind: S,
cookie_name: Option<S>,
cookie_ttl_seconds: Option<usize>
) -> LoadBalancerRequest<Create, LoadBalancer>where
S: AsRef<str> + Display + Serialize,
pub fn sticky_sessions<S>(
self,
kind: S,
cookie_name: Option<S>,
cookie_ttl_seconds: Option<usize>
) -> LoadBalancerRequest<Create, LoadBalancer>where
S: AsRef<str> + Display + Serialize,
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.
sourcepub fn redirect_http_to_https(
self,
setting: bool
) -> LoadBalancerRequest<Create, LoadBalancer>
pub fn redirect_http_to_https(
self,
setting: bool
) -> LoadBalancerRequest<Create, LoadBalancer>
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.
sourcepub fn droplets(
self,
ids: Vec<usize>
) -> LoadBalancerRequest<Create, LoadBalancer>
pub fn droplets(
self,
ids: Vec<usize>
) -> LoadBalancerRequest<Create, LoadBalancer>
The IDs of the Droplets to be assigned to the Load Balancer.
Note: Not intended to be used alongside the tag
function.
sourcepub fn tag<S>(self, tag: S) -> LoadBalancerRequest<Create, LoadBalancer>where
S: AsRef<str> + Display + Serialize,
pub fn tag<S>(self, tag: S) -> LoadBalancerRequest<Create, LoadBalancer>where
S: AsRef<str> + Display + Serialize,
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.
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn name<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer>where
S: Display + Serialize,
pub fn name<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer>where
S: Display + Serialize,
A human-readable name for a Load Balancer instance.
sourcepub fn region<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer>where
S: Display + Serialize,
pub fn region<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer>where
S: Display + Serialize,
The region where the Load Balancer instance will be located.
sourcepub fn algorithm<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer>where
S: Display + Serialize,
pub fn algorithm<S>(self, val: S) -> LoadBalancerRequest<Update, LoadBalancer>where
S: Display + Serialize,
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”.
sourcepub fn forwarding_rule<T>(
self,
val: T
) -> LoadBalancerRequest<Update, LoadBalancer>where
T: Into<ForwardingRule>,
pub fn forwarding_rule<T>(
self,
val: T
) -> LoadBalancerRequest<Update, LoadBalancer>where
T: Into<ForwardingRule>,
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.
sourcepub fn health_check<S>(
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>where
S: AsRef<str> + Display + Serialize,
pub fn health_check<S>(
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>where
S: AsRef<str> + Display + Serialize,
The (optional) health check settings.
sourcepub fn sticky_sessions<S>(
self,
kind: S,
cookie_name: Option<S>,
cookie_ttl_seconds: Option<usize>
) -> LoadBalancerRequest<Update, LoadBalancer>where
S: AsRef<str> + Display + Serialize,
pub fn sticky_sessions<S>(
self,
kind: S,
cookie_name: Option<S>,
cookie_ttl_seconds: Option<usize>
) -> LoadBalancerRequest<Update, LoadBalancer>where
S: AsRef<str> + Display + Serialize,
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.
sourcepub fn redirect_http_to_https(
self,
setting: bool
) -> LoadBalancerRequest<Update, LoadBalancer>
pub fn redirect_http_to_https(
self,
setting: bool
) -> LoadBalancerRequest<Update, LoadBalancer>
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.
sourcepub fn droplets(
self,
ids: Vec<usize>
) -> LoadBalancerRequest<Update, LoadBalancer>
pub fn droplets(
self,
ids: Vec<usize>
) -> LoadBalancerRequest<Update, LoadBalancer>
The IDs of the Droplets to be assigned to the Load Balancer.
Note: Not intended to be used alongside the tag
function.
sourcepub fn tag<S>(self, tag: S) -> LoadBalancerRequest<Update, LoadBalancer>where
S: AsRef<str> + Display + Serialize,
pub fn tag<S>(self, tag: S) -> LoadBalancerRequest<Update, LoadBalancer>where
S: AsRef<str> + Display + Serialize,
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.
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn add_droplets(self, ids: Vec<usize>) -> LoadBalancerRequest<Create, ()>
pub fn add_droplets(self, ids: Vec<usize>) -> LoadBalancerRequest<Create, ()>
Add droplets (by id) to the load balancer.
sourcepub fn remove_droplets(self, ids: Vec<usize>) -> LoadBalancerRequest<Delete, ()>
pub fn remove_droplets(self, ids: Vec<usize>) -> LoadBalancerRequest<Delete, ()>
Remove droplets (by id) from the load balancer.
sourcepub fn add_forwarding_rules<T>(
self,
items: Vec<T>
) -> LoadBalancerRequest<Create, ()>where
T: Into<ForwardingRule>,
pub fn add_forwarding_rules<T>(
self,
items: Vec<T>
) -> LoadBalancerRequest<Create, ()>where
T: Into<ForwardingRule>,
Add a forwarding rule to the Load Balancer.
sourcepub fn remove_forwarding_rules<T>(
self,
items: Vec<T>
) -> LoadBalancerRequest<Delete, ()>where
T: Into<ForwardingRule>,
pub fn remove_forwarding_rules<T>(
self,
items: Vec<T>
) -> LoadBalancerRequest<Delete, ()>where
T: Into<ForwardingRule>,
Remove a forwarding rule to the Load Balancer.
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn add_resources<S>(self, resources: Vec<(S, S)>) -> TagRequest<Create, ()>where
S: AsRef<str> + Serialize + Display,
pub fn add_resources<S>(self, resources: Vec<(S, S)>) -> TagRequest<Create, ()>where
S: AsRef<str> + Serialize + Display,
Accepts tuples matching (id, type)
. Currently the only type
is "droplet"
.
source§impl Request<M, V>
impl Request<M, V>
source§impl Request<M, V>
impl Request<M, V>
sourcepub fn description<S>(self, val: S) -> Selfwhere
S: AsRef<str> + Serialize + Display,
pub fn description<S>(self, val: S) -> Selfwhere
S: AsRef<str> + Serialize + Display,
An optional free-form text field to describe a Block Storage volume.
sourcepub fn region<S>(self, val: S) -> Selfwhere
S: AsRef<str> + Serialize + Display,
pub fn region<S>(self, val: S) -> Selfwhere
S: AsRef<str> + Serialize + Display,
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
.