[−][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
INSTANCETYPE==m4.xlarge OR INSTANCETYPE==c4.large. TheExpressionfor that looks like this:{ "Dimensions": { "Key": "INSTANCETYPE", "Values": [ "m4.xlarge", “c4.large” ] } }The list of dimension values are OR'd together to retrieve cost or usage data. You can create
ExpressionandDimensionValuesobjects using eitherwithmethods orsetmethods in multiple lines. -
Compound dimension values with logical operations - You can use multiple
Expressiontypes and the logical operatorsAND/OR/NOTto create a list of one or moreExpressionobjects. This allows you to filter on more advanced options. For example, you can filter on((INSTANCETYPE == m4.large OR INSTANCETYPE == m3.large) OR (TAG.Type == Type1)) AND (USAGETYPE != DataTransfer). TheExpressionfor that looks like this:{ "And": [ {"Or": [ {"Dimensions": { "Key": "INSTANCETYPE", "Values": [ "m4.x.large", "c4.large" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGETYPE", "Values": ["DataTransfer"] }}} ] }Because each
Expressioncan have only one operator, the service returns an error if more than one is specified. The following example shows anExpressionobject that creates an error.{ "And": [ ... ], "DimensionValues": { "Dimension": "USAGE_TYPE", "Values": [ "DataTransfer" ] } }
Fields
and: Option<Vec<Expression>>Return results that match both Dimension objects.
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 PartialEq<Expression> for Expression[src]
fn eq(&self, other: &Expression) -> bool[src]
fn ne(&self, other: &Expression) -> bool[src]
impl Default for Expression[src]
fn default() -> Expression[src]
impl Clone for Expression[src]
fn clone(&self) -> Expression[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for Expression[src]
impl Serialize for Expression[src]
Auto Trait Implementations
impl Send for Expression
impl Sync for Expression
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>, [src]
T: From<U>,
type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId[src]
impl<T> Erased for T
impl<T> Same for T
type Output = T
Should always be Self