QueryProperties

class oci.usage_api.models.QueryProperties(**kwargs)

Bases: object

The query properties.

Attributes

GRANULARITY_DAILY A constant which can be used with the granularity property of a QueryProperties.
GRANULARITY_MONTHLY A constant which can be used with the granularity property of a QueryProperties.
QUERY_TYPE_COST A constant which can be used with the query_type property of a QueryProperties.
QUERY_TYPE_USAGE A constant which can be used with the query_type property of a QueryProperties.
QUERY_TYPE_USAGE_AND_COST A constant which can be used with the query_type property of a QueryProperties.
compartment_depth Gets the compartment_depth of this QueryProperties.
date_range [Required] Gets the date_range of this QueryProperties.
filter Gets the filter of this QueryProperties.
granularity [Required] Gets the granularity of this QueryProperties.
group_by Gets the group_by of this QueryProperties.
group_by_tag Gets the group_by_tag of this QueryProperties.
is_aggregate_by_time Gets the is_aggregate_by_time of this QueryProperties.
query_type Gets the query_type of this QueryProperties.

Methods

__init__(**kwargs) Initializes a new QueryProperties object with values from keyword arguments.
GRANULARITY_DAILY = 'DAILY'

A constant which can be used with the granularity property of a QueryProperties. This constant has a value of “DAILY”

GRANULARITY_MONTHLY = 'MONTHLY'

A constant which can be used with the granularity property of a QueryProperties. This constant has a value of “MONTHLY”

QUERY_TYPE_COST = 'COST'

A constant which can be used with the query_type property of a QueryProperties. This constant has a value of “COST”

QUERY_TYPE_USAGE = 'USAGE'

A constant which can be used with the query_type property of a QueryProperties. This constant has a value of “USAGE”

QUERY_TYPE_USAGE_AND_COST = 'USAGE_AND_COST'

A constant which can be used with the query_type property of a QueryProperties. This constant has a value of “USAGE_AND_COST”

__init__(**kwargs)

Initializes a new QueryProperties object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • group_by (list[str]) – The value to assign to the group_by property of this QueryProperties.
  • group_by_tag (list[oci.usage_api.models.Tag]) – The value to assign to the group_by_tag property of this QueryProperties.
  • filter (oci.usage_api.models.Filter) – The value to assign to the filter property of this QueryProperties.
  • compartment_depth (float) – The value to assign to the compartment_depth property of this QueryProperties.
  • granularity (str) – The value to assign to the granularity property of this QueryProperties. Allowed values for this property are: “DAILY”, “MONTHLY”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • query_type (str) – The value to assign to the query_type property of this QueryProperties. Allowed values for this property are: “USAGE”, “COST”, “USAGE_AND_COST”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
  • is_aggregate_by_time (bool) – The value to assign to the is_aggregate_by_time property of this QueryProperties.
  • date_range (oci.usage_api.models.DateRange) – The value to assign to the date_range property of this QueryProperties.
compartment_depth

Gets the compartment_depth of this QueryProperties. The depth level of the compartment.

Returns:The compartment_depth of this QueryProperties.
Return type:float
date_range

[Required] Gets the date_range of this QueryProperties.

Returns:The date_range of this QueryProperties.
Return type:oci.usage_api.models.DateRange
filter

Gets the filter of this QueryProperties.

Returns:The filter of this QueryProperties.
Return type:oci.usage_api.models.Filter
granularity

[Required] Gets the granularity of this QueryProperties. The usage granularity. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. Allowed values are:

DAILY MONTHLY

Allowed values for this property are: “DAILY”, “MONTHLY”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The granularity of this QueryProperties.
Return type:str
group_by

Gets the group_by of this QueryProperties. Aggregate the result by. For example: [ “tagNamespace”, “tagKey”, “tagValue”, “service”, “skuName”, “skuPartNumber”, “unit”, “compartmentName”, “compartmentPath”, “compartmentId”, “platform”, “region”, “logicalAd”, “resourceId”, “tenantId”, “tenantName” ]

Returns:The group_by of this QueryProperties.
Return type:list[str]
group_by_tag

Gets the group_by_tag of this QueryProperties. GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [ { “namespace”: “oracle”, “key”: “createdBy” ]

Returns:The group_by_tag of this QueryProperties.
Return type:list[oci.usage_api.models.Tag]
is_aggregate_by_time

Gets the is_aggregate_by_time of this QueryProperties. Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.

Returns:The is_aggregate_by_time of this QueryProperties.
Return type:bool
query_type

Gets the query_type of this QueryProperties. The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Allowed values are:

USAGE COST USAGE_AND_COST

Allowed values for this property are: “USAGE”, “COST”, “USAGE_AND_COST”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The query_type of this QueryProperties.
Return type:str