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 all_tenants(self) -> Self
pub fn all_tenants(self) -> Self
Add all tenants 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.