Struct openstack::compute::ServerQuery
source · pub struct ServerQuery { /* private fields */ }
Expand description
A query to server list.
Implementations§
source§impl ServerQuery
impl ServerQuery
sourcepub fn with_marker<T: Into<String>>(self, marker: T) -> Self
pub fn with_marker<T: Into<String>>(self, marker: T) -> Self
Add marker to the request.
Using this disables automatic pagination.
sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Add limit to the request.
Using this disables automatic pagination.
sourcepub fn sort_by(self, sort: Sort<ServerSortKey>) -> Self
pub fn sort_by(self, sort: Sort<ServerSortKey>) -> Self
Add sorting to the request.
sourcepub fn set_access_ip_v4<T: Into<Ipv4Addr>>(&mut self, value: T)
pub fn set_access_ip_v4<T: Into<Ipv4Addr>>(&mut self, value: T)
Filter by IPv4 address that should be used to access the server.
sourcepub fn with_access_ip_v4<T: Into<Ipv4Addr>>(self, value: T) -> Self
pub fn with_access_ip_v4<T: Into<Ipv4Addr>>(self, value: T) -> Self
Filter by IPv4 address that should be used to access the server.
sourcepub fn set_access_ip_v6<T: Into<Ipv6Addr>>(&mut self, value: T)
pub fn set_access_ip_v6<T: Into<Ipv6Addr>>(&mut self, value: T)
Filter by IPv6 address that should be used to access the server.
sourcepub fn with_access_ip_v6<T: Into<Ipv6Addr>>(self, value: T) -> Self
pub fn with_access_ip_v6<T: Into<Ipv6Addr>>(self, value: T) -> Self
Filter by IPv6 address that should be used to access the server.
sourcepub fn set_availability_zone<T: Into<String>>(&mut self, value: T)
pub fn set_availability_zone<T: Into<String>>(&mut self, value: T)
Filter by availability zone.
sourcepub fn with_availability_zone<T: Into<String>>(self, value: T) -> Self
pub fn with_availability_zone<T: Into<String>>(self, value: T) -> Self
Filter by availability zone.
sourcepub fn set_flavor<T: Into<FlavorRef>>(&mut self, value: T)
pub fn set_flavor<T: Into<FlavorRef>>(&mut self, value: T)
Filter by flavor.
sourcepub fn with_flavor<T: Into<FlavorRef>>(self, value: T) -> Self
pub fn with_flavor<T: Into<FlavorRef>>(self, value: T) -> Self
Filter by flavor.
sourcepub fn set_hostname<T: Into<String>>(&mut self, value: T)
pub fn set_hostname<T: Into<String>>(&mut self, value: T)
Filter by host name.
sourcepub fn with_hostname<T: Into<String>>(self, value: T) -> Self
pub fn with_hostname<T: Into<String>>(self, value: T) -> Self
Filter by host name.
sourcepub fn set_image<T: Into<ImageRef>>(&mut self, value: T)
pub fn set_image<T: Into<ImageRef>>(&mut self, value: T)
Filter by image used to build the server.
sourcepub fn with_image<T: Into<ImageRef>>(self, value: T) -> Self
pub fn with_image<T: Into<ImageRef>>(self, value: T) -> Self
Filter by image used to build the server.
sourcepub fn with_ip_v4<T: Into<Ipv4Addr>>(self, value: T) -> Self
pub fn with_ip_v4<T: Into<Ipv4Addr>>(self, value: T) -> Self
Filter by an IPv4 address.
sourcepub fn with_ip_v6<T: Into<Ipv6Addr>>(self, value: T) -> Self
pub fn with_ip_v6<T: Into<Ipv6Addr>>(self, value: T) -> Self
Filter by an IPv6 address.
sourcepub fn set_project<T: Into<ProjectRef>>(&mut self, value: T)
pub fn set_project<T: Into<ProjectRef>>(&mut self, value: T)
Filter by project (also commonly known as tenant).
sourcepub fn with_project<T: Into<ProjectRef>>(self, value: T) -> Self
pub fn with_project<T: Into<ProjectRef>>(self, value: T) -> Self
Filter by project (also commonly known as tenant).
sourcepub fn set_status<T: Into<ServerStatus>>(&mut self, value: T)
pub fn set_status<T: Into<ServerStatus>>(&mut self, value: T)
Filter by server status.
sourcepub fn with_status<T: Into<ServerStatus>>(self, value: T) -> Self
pub fn with_status<T: Into<ServerStatus>>(self, value: T) -> Self
Filter by server status.
sourcepub fn detailed(self) -> DetailedServerQuery
pub fn detailed(self) -> DetailedServerQuery
Convert this query into a detailed query.
Detailed queries return full Server
objects instead of just ServerSummary
.
sourcepub fn into_stream(self) -> impl Stream<Item = Result<ServerSummary>>
pub fn into_stream(self) -> impl Stream<Item = Result<ServerSummary>>
Convert this query into a stream executing the request.
This stream yields only ServerSummary
objects, containing
IDs and names. Use detailed().into_stream()
for full Server
objects.
Returns a TryStream
, which is a stream with each next
call returning a Result
.
Note that no requests are done until you start iterating.
sourcepub async fn all(self) -> Result<Vec<ServerSummary>>
pub async fn all(self) -> Result<Vec<ServerSummary>>
Execute this request and return all results.
A convenience shortcut for self.into_stream().try_collect().await
.
sourcepub async fn one(self) -> Result<ServerSummary>
pub async fn one(self) -> Result<ServerSummary>
Return one and exactly one result.
Fails with ResourceNotFound
if the query produces no results and
with TooManyItems
if the query produces more than one result.
Trait Implementations§
source§impl Clone for ServerQuery
impl Clone for ServerQuery
source§fn clone(&self) -> ServerQuery
fn clone(&self) -> ServerQuery
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more