Class ReportQuery.Builder

  • Enclosing class:
    ReportQuery

    public static class ReportQuery.Builder
    extends Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • tenantId

        public ReportQuery.Builder tenantId​(String tenantId)
        Tenant ID.
        Parameters:
        tenantId - the value to set
        Returns:
        this builder
      • timeUsageStarted

        public ReportQuery.Builder timeUsageStarted​(Date timeUsageStarted)
        The usage start time.
        Parameters:
        timeUsageStarted - the value to set
        Returns:
        this builder
      • timeUsageEnded

        public ReportQuery.Builder timeUsageEnded​(Date timeUsageEnded)
        The usage end time.
        Parameters:
        timeUsageEnded - the value to set
        Returns:
        this builder
      • granularity

        public ReportQuery.Builder granularity​(ReportQuery.Granularity granularity)
        The usage granularity.

        HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.

        Parameters:
        granularity - the value to set
        Returns:
        this builder
      • isAggregateByTime

        public ReportQuery.Builder isAggregateByTime​(Boolean isAggregateByTime)
        Whether aggregated by time.

        If isAggregateByTime is true, all usage/cost over the query time period will be added up.

        Parameters:
        isAggregateByTime - the value to set
        Returns:
        this builder
      • queryType

        public ReportQuery.Builder queryType​(ReportQuery.QueryType queryType)
        The query usage type.

        COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data AllCredit - Query the credit adjustments and expired credit

        Parameters:
        queryType - the value to set
        Returns:
        this builder
      • groupBy

        public ReportQuery.Builder groupBy​(List<String> groupBy)
        Aggregate the result by.

        example: [“tagNamespace”, “tagKey”, “tagValue”, “service”, “skuName”, “skuPartNumber”, “unit”, “compartmentName”, “compartmentPath”, “compartmentId”, “platform”, “region”, “logicalAd”, “resourceId”, “tenantId”, “tenantName”]

        Parameters:
        groupBy - the value to set
        Returns:
        this builder
      • groupByTag

        public ReportQuery.Builder groupByTag​(List<Tag> groupByTag)
        GroupBy a specific tagKey.

        Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: {@code [{“namespace”:“oracle”, “key”:“createdBy”]}

        Parameters:
        groupByTag - the value to set
        Returns:
        this builder
      • compartmentDepth

        public ReportQuery.Builder compartmentDepth​(BigDecimal compartmentDepth)
        The compartment depth level.
        Parameters:
        compartmentDepth - the value to set
        Returns:
        this builder
      • dateRangeName

        public ReportQuery.Builder dateRangeName​(ReportQuery.DateRangeName dateRangeName)
        The UI date range, for example, LAST_THREE_MONTHS.

        Conflicts with timeUsageStarted and timeUsageEnded.

        Parameters:
        dateRangeName - the value to set
        Returns:
        this builder