[][src]Struct rusoto_ce::Expression

pub struct Expression {
    pub and: Option<Vec<Expression>>,
    pub dimensions: Option<DimensionValues>,
    pub not: Box<Option<Expression>>,
    pub or: Option<Vec<Expression>>,
    pub tags: Option<TagValues>,
}

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. The Expression for 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 Expression and DimensionValues objects using either with methods or set methods in multiple lines.

  • Compound dimension values with logical operations - You can use multiple Expression types and the logical operators AND/OR/NOT to create a list of one or more Expression objects. 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). The Expression for 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 Expression can have only one operator, the service returns an error if more than one is specified. The following example shows an Expression object 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.

tags: Option<TagValues>

The specific Tag to use for Expression.

Trait Implementations

impl PartialEq<Expression> for Expression[src]

impl Default for Expression[src]

impl Clone for 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, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> Same for T

type Output = T

Should always be Self