[−][src]Struct rusoto_ce::Expression
Use Expression
to filter by cost or by usage. There are two patterns:
-
Simple dimension values - You can set the dimension name and values for the filters that you plan to use. For example, you can filter for
REGION==us-east-1 OR REGION==us-west-1
. ForGetRightsizingRecommendation
, the Region is a full name (for example,REGION==US East (N. Virginia)
. TheExpression
example looks like:{ "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", “us-west-1” ] } }
The list of dimension values are OR'd together to retrieve cost or usage data. You can create
Expression
andDimensionValues
objects using eitherwith
methods orset
methods in multiple lines. -
Compound dimension values with logical operations - You can use multiple
Expression
types and the logical operatorsAND/OR/NOT
to create a list of one or moreExpression
objects. This allows you to filter on more advanced options. For example, you can filter on((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGETYPE != DataTransfer)
. TheExpression
for that looks like this:{ "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGETYPE", "Values": ["DataTransfer"] }}} ] }
Because each
Expression
can have only one operator, the service returns an error if more than one is specified. The following example shows anExpression
object that creates an error.{ "And": [ ... ], "DimensionValues": { "Dimension": "USAGETYPE", "Values": [ "DataTransfer" ] } }
For GetRightsizingRecommendation
action, a combination of OR and NOT is not supported. OR is not supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to LINKEDACCOUNT
, REGION
, or RIGHTSIZING_TYPE
.
Fields
and: Option<Vec<Expression>>
Return results that match both Dimension
objects.
cost_categories: Option<CostCategoryValues>
The filter based on CostCategory
values.
dimensions: Option<DimensionValues>
The specific Dimension
to use for Expression
.
not: Box<Option<Expression>>
Return results that don't match a Dimension
object.
or: Option<Vec<Expression>>
Return results that match either Dimension
object.
The specific Tag
to use for Expression
.
Trait Implementations
impl Clone for Expression
[src]
pub fn clone(&self) -> Expression
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Expression
[src]
impl Default for Expression
[src]
pub fn default() -> Expression
[src]
impl<'de> Deserialize<'de> for Expression
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Expression> for Expression
[src]
pub fn eq(&self, other: &Expression) -> bool
[src]
pub fn ne(&self, other: &Expression) -> bool
[src]
impl Serialize for Expression
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Expression
[src]
Auto Trait Implementations
impl RefUnwindSafe for Expression
[src]
impl Send for Expression
[src]
impl Sync for Expression
[src]
impl Unpin for Expression
[src]
impl UnwindSafe for Expression
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,