@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class Expression extends Object implements Serializable, Cloneable, StructuredPojo
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 INSTANCE_TYPE==m4.xlarge OR INSTANCE_TYPE==c4.large. The
Expression for that looks like this:
{ "Dimensions": { "Key": "INSTANCE_TYPE", "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
((INSTANCE_TYPE == m4.large OR INSTANCE_TYPE == m3.large) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)
. The Expression for that looks like this:
{ "And": [ {"Or": [ {"Dimensions": { "Key": "INSTANCE_TYPE", "Values": [ "m4.x.large", "c4.large" ] }}, {"Tag": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"dimensions": { "Key": "USAGE_TYPE", "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" ] } }
| Constructor and Description |
|---|
Expression() |
| Modifier and Type | Method and Description |
|---|---|
Expression |
clone() |
boolean |
equals(Object obj) |
List<Expression> |
getAnd()
Return results that match both
Dimension objects. |
DimensionValues |
getDimensions()
The specific
Dimension to use for Expression. |
Expression |
getNot()
Return results that don't match a
Dimension object. |
List<Expression> |
getOr()
Return results that match either
Dimension object. |
TagValues |
getTags()
The specific
Tag to use for Expression. |
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller) |
void |
setAnd(Collection<Expression> and)
Return results that match both
Dimension objects. |
void |
setDimensions(DimensionValues dimensions)
The specific
Dimension to use for Expression. |
void |
setNot(Expression not)
Return results that don't match a
Dimension object. |
void |
setOr(Collection<Expression> or)
Return results that match either
Dimension object. |
void |
setTags(TagValues tags)
The specific
Tag to use for Expression. |
String |
toString()
Returns a string representation of this object; useful for testing and debugging.
|
Expression |
withAnd(Collection<Expression> and)
Return results that match both
Dimension objects. |
Expression |
withAnd(Expression... and)
Return results that match both
Dimension objects. |
Expression |
withDimensions(DimensionValues dimensions)
The specific
Dimension to use for Expression. |
Expression |
withNot(Expression not)
Return results that don't match a
Dimension object. |
Expression |
withOr(Collection<Expression> or)
Return results that match either
Dimension object. |
Expression |
withOr(Expression... or)
Return results that match either
Dimension object. |
Expression |
withTags(TagValues tags)
The specific
Tag to use for Expression. |
public List<Expression> getOr()
Return results that match either Dimension object.
Dimension object.public void setOr(Collection<Expression> or)
Return results that match either Dimension object.
or - Return results that match either Dimension object.public Expression withOr(Expression... or)
Return results that match either Dimension object.
NOTE: This method appends the values to the existing list (if any). Use
setOr(java.util.Collection) or withOr(java.util.Collection) if you want to override the
existing values.
or - Return results that match either Dimension object.public Expression withOr(Collection<Expression> or)
Return results that match either Dimension object.
or - Return results that match either Dimension object.public List<Expression> getAnd()
Return results that match both Dimension objects.
Dimension objects.public void setAnd(Collection<Expression> and)
Return results that match both Dimension objects.
and - Return results that match both Dimension objects.public Expression withAnd(Expression... and)
Return results that match both Dimension objects.
NOTE: This method appends the values to the existing list (if any). Use
setAnd(java.util.Collection) or withAnd(java.util.Collection) if you want to override the
existing values.
and - Return results that match both Dimension objects.public Expression withAnd(Collection<Expression> and)
Return results that match both Dimension objects.
and - Return results that match both Dimension objects.public void setNot(Expression not)
Return results that don't match a Dimension object.
not - Return results that don't match a Dimension object.public Expression getNot()
Return results that don't match a Dimension object.
Dimension object.public Expression withNot(Expression not)
Return results that don't match a Dimension object.
not - Return results that don't match a Dimension object.public void setDimensions(DimensionValues dimensions)
The specific Dimension to use for Expression.
dimensions - The specific Dimension to use for Expression.public DimensionValues getDimensions()
The specific Dimension to use for Expression.
Dimension to use for Expression.public Expression withDimensions(DimensionValues dimensions)
The specific Dimension to use for Expression.
dimensions - The specific Dimension to use for Expression.public void setTags(TagValues tags)
The specific Tag to use for Expression.
tags - The specific Tag to use for Expression.public TagValues getTags()
The specific Tag to use for Expression.
Tag to use for Expression.public Expression withTags(TagValues tags)
The specific Tag to use for Expression.
tags - The specific Tag to use for Expression.public String toString()
toString in class ObjectObject.toString()public Expression clone()
public void marshall(ProtocolMarshaller protocolMarshaller)
marshall in interface StructuredPojoCopyright © 2018. All rights reserved.