Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.MeteringComputation.getQuery
Explore with Pulumi AI
This data source provides details about a specific Query resource in Oracle Cloud Infrastructure Metering Computation service.
Returns the saved query.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testQuery = oci.MeteringComputation.getQuery({
    queryId: testQueryOciMeteringComputationQuery.id,
});
import pulumi
import pulumi_oci as oci
test_query = oci.MeteringComputation.get_query(query_id=test_query_oci_metering_computation_query["id"])
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/meteringcomputation"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := meteringcomputation.GetQuery(ctx, &meteringcomputation.GetQueryArgs{
			QueryId: testQueryOciMeteringComputationQuery.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testQuery = Oci.MeteringComputation.GetQuery.Invoke(new()
    {
        QueryId = testQueryOciMeteringComputationQuery.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.MeteringComputation.MeteringComputationFunctions;
import com.pulumi.oci.MeteringComputation.inputs.GetQueryArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var testQuery = MeteringComputationFunctions.getQuery(GetQueryArgs.builder()
            .queryId(testQueryOciMeteringComputationQuery.id())
            .build());
    }
}
variables:
  testQuery:
    fn::invoke:
      function: oci:MeteringComputation:getQuery
      arguments:
        queryId: ${testQueryOciMeteringComputationQuery.id}
Using getQuery
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getQuery(args: GetQueryArgs, opts?: InvokeOptions): Promise<GetQueryResult>
function getQueryOutput(args: GetQueryOutputArgs, opts?: InvokeOptions): Output<GetQueryResult>def get_query(query_id: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetQueryResult
def get_query_output(query_id: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetQueryResult]func LookupQuery(ctx *Context, args *LookupQueryArgs, opts ...InvokeOption) (*LookupQueryResult, error)
func LookupQueryOutput(ctx *Context, args *LookupQueryOutputArgs, opts ...InvokeOption) LookupQueryResultOutput> Note: This function is named LookupQuery in the Go SDK.
public static class GetQuery 
{
    public static Task<GetQueryResult> InvokeAsync(GetQueryArgs args, InvokeOptions? opts = null)
    public static Output<GetQueryResult> Invoke(GetQueryInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetQueryResult> getQuery(GetQueryArgs args, InvokeOptions options)
public static Output<GetQueryResult> getQuery(GetQueryArgs args, InvokeOptions options)
fn::invoke:
  function: oci:MeteringComputation/getQuery:getQuery
  arguments:
    # arguments dictionaryThe following arguments are supported:
- QueryId string
- The query unique OCID.
- QueryId string
- The query unique OCID.
- queryId String
- The query unique OCID.
- queryId string
- The query unique OCID.
- query_id str
- The query unique OCID.
- queryId String
- The query unique OCID.
getQuery Result
The following output properties are available:
- CompartmentId string
- The compartment OCID.
- Id string
- The query OCID.
- QueryDefinitions List<GetQuery Query Definition> 
- The common fields for queries.
- QueryId string
- CompartmentId string
- The compartment OCID.
- Id string
- The query OCID.
- QueryDefinitions []GetQuery Query Definition 
- The common fields for queries.
- QueryId string
- compartmentId String
- The compartment OCID.
- id String
- The query OCID.
- queryDefinitions List<GetQuery Query Definition> 
- The common fields for queries.
- queryId String
- compartmentId string
- The compartment OCID.
- id string
- The query OCID.
- queryDefinitions GetQuery Query Definition[] 
- The common fields for queries.
- queryId string
- compartment_id str
- The compartment OCID.
- id str
- The query OCID.
- query_definitions Sequence[GetQuery Query Definition] 
- The common fields for queries.
- query_id str
- compartmentId String
- The compartment OCID.
- id String
- The query OCID.
- queryDefinitions List<Property Map>
- The common fields for queries.
- queryId String
Supporting Types
GetQueryQueryDefinition   
- CostAnalysis List<GetUis Query Query Definition Cost Analysis Ui> 
- The common fields for Cost Analysis UI rendering.
- DisplayName string
- The query display name. Avoid entering confidential information.
- ReportQueries List<GetQuery Query Definition Report Query> 
- The request of the generated Cost Analysis report.
- Version double
- The saved query version.
- CostAnalysis []GetUis Query Query Definition Cost Analysis Ui 
- The common fields for Cost Analysis UI rendering.
- DisplayName string
- The query display name. Avoid entering confidential information.
- ReportQueries []GetQuery Query Definition Report Query 
- The request of the generated Cost Analysis report.
- Version float64
- The saved query version.
- costAnalysis List<GetUis Query Query Definition Cost Analysis Ui> 
- The common fields for Cost Analysis UI rendering.
- displayName String
- The query display name. Avoid entering confidential information.
- reportQueries List<GetQuery Query Definition Report Query> 
- The request of the generated Cost Analysis report.
- version Double
- The saved query version.
- costAnalysis GetUis Query Query Definition Cost Analysis Ui[] 
- The common fields for Cost Analysis UI rendering.
- displayName string
- The query display name. Avoid entering confidential information.
- reportQueries GetQuery Query Definition Report Query[] 
- The request of the generated Cost Analysis report.
- version number
- The saved query version.
- cost_analysis_ Sequence[Getuis Query Query Definition Cost Analysis Ui] 
- The common fields for Cost Analysis UI rendering.
- display_name str
- The query display name. Avoid entering confidential information.
- report_queries Sequence[GetQuery Query Definition Report Query] 
- The request of the generated Cost Analysis report.
- version float
- The saved query version.
- costAnalysis List<Property Map>Uis 
- The common fields for Cost Analysis UI rendering.
- displayName String
- The query display name. Avoid entering confidential information.
- reportQueries List<Property Map>
- The request of the generated Cost Analysis report.
- version Number
- The saved query version.
GetQueryQueryDefinitionCostAnalysisUi      
- Graph string
- The graph type.
- IsCumulative boolGraph 
- A cumulative graph.
- Graph string
- The graph type.
- IsCumulative boolGraph 
- A cumulative graph.
- graph String
- The graph type.
- isCumulative BooleanGraph 
- A cumulative graph.
- graph string
- The graph type.
- isCumulative booleanGraph 
- A cumulative graph.
- graph str
- The graph type.
- is_cumulative_ boolgraph 
- A cumulative graph.
- graph String
- The graph type.
- isCumulative BooleanGraph 
- A cumulative graph.
GetQueryQueryDefinitionReportQuery     
- CompartmentDepth double
- The compartment depth level.
- DateRange stringName 
- The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
- Filter string
- The filter object for query usage.
- Forecasts
List<GetQuery Query Definition Report Query Forecast> 
- Forecast configuration of usage/cost.
- Granularity string
- The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
- GroupBies List<string>
- Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
- 
List<GetQuery Query Definition Report Query Group By Tag> 
- 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"]
- IsAggregate boolBy Time 
- Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
- QueryType string
- 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
- TenantId string
- Tenant ID.
- TimeUsage stringEnded 
- The usage end time.
- TimeUsage stringStarted 
- The usage start time.
- CompartmentDepth float64
- The compartment depth level.
- DateRange stringName 
- The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
- Filter string
- The filter object for query usage.
- Forecasts
[]GetQuery Query Definition Report Query Forecast 
- Forecast configuration of usage/cost.
- Granularity string
- The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
- GroupBies []string
- Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
- 
[]GetQuery Query Definition Report Query Group By Tag 
- 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"]
- IsAggregate boolBy Time 
- Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
- QueryType string
- 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
- TenantId string
- Tenant ID.
- TimeUsage stringEnded 
- The usage end time.
- TimeUsage stringStarted 
- The usage start time.
- compartmentDepth Double
- The compartment depth level.
- dateRange StringName 
- The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
- filter String
- The filter object for query usage.
- forecasts
List<GetQuery Query Definition Report Query Forecast> 
- Forecast configuration of usage/cost.
- granularity String
- The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
- groupBies List<String>
- Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
- 
List<GetQuery Query Definition Report Query Group By Tag> 
- 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"]
- isAggregate BooleanBy Time 
- Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
- queryType String
- 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
- tenantId String
- Tenant ID.
- timeUsage StringEnded 
- The usage end time.
- timeUsage StringStarted 
- The usage start time.
- compartmentDepth number
- The compartment depth level.
- dateRange stringName 
- The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
- filter string
- The filter object for query usage.
- forecasts
GetQuery Query Definition Report Query Forecast[] 
- Forecast configuration of usage/cost.
- granularity string
- The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
- groupBies string[]
- Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
- 
GetQuery Query Definition Report Query Group By Tag[] 
- 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"]
- isAggregate booleanBy Time 
- Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
- queryType string
- 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
- tenantId string
- Tenant ID.
- timeUsage stringEnded 
- The usage end time.
- timeUsage stringStarted 
- The usage start time.
- compartment_depth float
- The compartment depth level.
- date_range_ strname 
- The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
- filter str
- The filter object for query usage.
- forecasts
Sequence[GetQuery Query Definition Report Query Forecast] 
- Forecast configuration of usage/cost.
- granularity str
- The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
- group_bies Sequence[str]
- Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
- 
Sequence[GetQuery Query Definition Report Query Group By Tag] 
- 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"]
- is_aggregate_ boolby_ time 
- Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
- query_type str
- 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
- tenant_id str
- Tenant ID.
- time_usage_ strended 
- The usage end time.
- time_usage_ strstarted 
- The usage start time.
- compartmentDepth Number
- The compartment depth level.
- dateRange StringName 
- The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
- filter String
- The filter object for query usage.
- forecasts List<Property Map>
- Forecast configuration of usage/cost.
- granularity String
- The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
- groupBies List<String>
- Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
- List<Property Map>
- 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"]
- isAggregate BooleanBy Time 
- Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
- queryType String
- 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
- tenantId String
- Tenant ID.
- timeUsage StringEnded 
- The usage end time.
- timeUsage StringStarted 
- The usage start time.
GetQueryQueryDefinitionReportQueryForecast      
- ForecastType string
- BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
- TimeForecast stringEnded 
- The forecast end time.
- TimeForecast stringStarted 
- The forecast start time. Defaults to UTC-1 if not specified.
- ForecastType string
- BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
- TimeForecast stringEnded 
- The forecast end time.
- TimeForecast stringStarted 
- The forecast start time. Defaults to UTC-1 if not specified.
- forecastType String
- BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
- timeForecast StringEnded 
- The forecast end time.
- timeForecast StringStarted 
- The forecast start time. Defaults to UTC-1 if not specified.
- forecastType string
- BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
- timeForecast stringEnded 
- The forecast end time.
- timeForecast stringStarted 
- The forecast start time. Defaults to UTC-1 if not specified.
- forecast_type str
- BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
- time_forecast_ strended 
- The forecast end time.
- time_forecast_ strstarted 
- The forecast start time. Defaults to UTC-1 if not specified.
- forecastType String
- BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
- timeForecast StringEnded 
- The forecast end time.
- timeForecast StringStarted 
- The forecast start time. Defaults to UTC-1 if not specified.
GetQueryQueryDefinitionReportQueryGroupByTag        
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.