1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. MeteringComputation
  5. Query
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

oci.MeteringComputation.Query

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

    This resource provides the Query resource in Oracle Cloud Infrastructure Metering Computation service.

    Returns the created query.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testQuery = new oci.meteringcomputation.Query("testQuery", {
        compartmentId: _var.compartment_id,
        queryDefinition: {
            costAnalysisUi: {
                graph: _var.query_query_definition_cost_analysis_ui_graph,
                isCumulativeGraph: _var.query_query_definition_cost_analysis_ui_is_cumulative_graph,
            },
            displayName: _var.query_query_definition_display_name,
            reportQuery: {
                granularity: _var.query_query_definition_report_query_granularity,
                tenantId: oci_metering_computation_tenant.test_tenant.id,
                compartmentDepth: _var.query_query_definition_report_query_compartment_depth,
                dateRangeName: _var.query_query_definition_report_query_date_range_name,
                filter: _var.query_query_definition_report_query_filter,
                forecast: {
                    timeForecastEnded: _var.query_query_definition_report_query_forecast_time_forecast_ended,
                    forecastType: _var.query_query_definition_report_query_forecast_forecast_type,
                    timeForecastStarted: _var.query_query_definition_report_query_forecast_time_forecast_started,
                },
                groupBies: _var.query_query_definition_report_query_group_by,
                groupByTags: [{
                    key: _var.query_query_definition_report_query_group_by_tag_key,
                    namespace: _var.query_query_definition_report_query_group_by_tag_namespace,
                    value: _var.query_query_definition_report_query_group_by_tag_value,
                }],
                isAggregateByTime: _var.query_query_definition_report_query_is_aggregate_by_time,
                queryType: _var.query_query_definition_report_query_query_type,
                timeUsageEnded: _var.query_query_definition_report_query_time_usage_ended,
                timeUsageStarted: _var.query_query_definition_report_query_time_usage_started,
            },
            version: _var.query_query_definition_version,
        },
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_query = oci.metering_computation.Query("testQuery",
        compartment_id=var["compartment_id"],
        query_definition=oci.metering_computation.QueryQueryDefinitionArgs(
            cost_analysis_ui=oci.metering_computation.QueryQueryDefinitionCostAnalysisUiArgs(
                graph=var["query_query_definition_cost_analysis_ui_graph"],
                is_cumulative_graph=var["query_query_definition_cost_analysis_ui_is_cumulative_graph"],
            ),
            display_name=var["query_query_definition_display_name"],
            report_query=oci.metering_computation.QueryQueryDefinitionReportQueryArgs(
                granularity=var["query_query_definition_report_query_granularity"],
                tenant_id=oci_metering_computation_tenant["test_tenant"]["id"],
                compartment_depth=var["query_query_definition_report_query_compartment_depth"],
                date_range_name=var["query_query_definition_report_query_date_range_name"],
                filter=var["query_query_definition_report_query_filter"],
                forecast=oci.metering_computation.QueryQueryDefinitionReportQueryForecastArgs(
                    time_forecast_ended=var["query_query_definition_report_query_forecast_time_forecast_ended"],
                    forecast_type=var["query_query_definition_report_query_forecast_forecast_type"],
                    time_forecast_started=var["query_query_definition_report_query_forecast_time_forecast_started"],
                ),
                group_bies=var["query_query_definition_report_query_group_by"],
                group_by_tags=[oci.metering_computation.QueryQueryDefinitionReportQueryGroupByTagArgs(
                    key=var["query_query_definition_report_query_group_by_tag_key"],
                    namespace=var["query_query_definition_report_query_group_by_tag_namespace"],
                    value=var["query_query_definition_report_query_group_by_tag_value"],
                )],
                is_aggregate_by_time=var["query_query_definition_report_query_is_aggregate_by_time"],
                query_type=var["query_query_definition_report_query_query_type"],
                time_usage_ended=var["query_query_definition_report_query_time_usage_ended"],
                time_usage_started=var["query_query_definition_report_query_time_usage_started"],
            ),
            version=var["query_query_definition_version"],
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/MeteringComputation"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := MeteringComputation.NewQuery(ctx, "testQuery", &MeteringComputation.QueryArgs{
    			CompartmentId: pulumi.Any(_var.Compartment_id),
    			QueryDefinition: &meteringcomputation.QueryQueryDefinitionArgs{
    				CostAnalysisUi: &meteringcomputation.QueryQueryDefinitionCostAnalysisUiArgs{
    					Graph:             pulumi.Any(_var.Query_query_definition_cost_analysis_ui_graph),
    					IsCumulativeGraph: pulumi.Any(_var.Query_query_definition_cost_analysis_ui_is_cumulative_graph),
    				},
    				DisplayName: pulumi.Any(_var.Query_query_definition_display_name),
    				ReportQuery: &meteringcomputation.QueryQueryDefinitionReportQueryArgs{
    					Granularity:      pulumi.Any(_var.Query_query_definition_report_query_granularity),
    					TenantId:         pulumi.Any(oci_metering_computation_tenant.Test_tenant.Id),
    					CompartmentDepth: pulumi.Any(_var.Query_query_definition_report_query_compartment_depth),
    					DateRangeName:    pulumi.Any(_var.Query_query_definition_report_query_date_range_name),
    					Filter:           pulumi.Any(_var.Query_query_definition_report_query_filter),
    					Forecast: &meteringcomputation.QueryQueryDefinitionReportQueryForecastArgs{
    						TimeForecastEnded:   pulumi.Any(_var.Query_query_definition_report_query_forecast_time_forecast_ended),
    						ForecastType:        pulumi.Any(_var.Query_query_definition_report_query_forecast_forecast_type),
    						TimeForecastStarted: pulumi.Any(_var.Query_query_definition_report_query_forecast_time_forecast_started),
    					},
    					GroupBies: pulumi.Any(_var.Query_query_definition_report_query_group_by),
    					GroupByTags: meteringcomputation.QueryQueryDefinitionReportQueryGroupByTagArray{
    						&meteringcomputation.QueryQueryDefinitionReportQueryGroupByTagArgs{
    							Key:       pulumi.Any(_var.Query_query_definition_report_query_group_by_tag_key),
    							Namespace: pulumi.Any(_var.Query_query_definition_report_query_group_by_tag_namespace),
    							Value:     pulumi.Any(_var.Query_query_definition_report_query_group_by_tag_value),
    						},
    					},
    					IsAggregateByTime: pulumi.Any(_var.Query_query_definition_report_query_is_aggregate_by_time),
    					QueryType:         pulumi.Any(_var.Query_query_definition_report_query_query_type),
    					TimeUsageEnded:    pulumi.Any(_var.Query_query_definition_report_query_time_usage_ended),
    					TimeUsageStarted:  pulumi.Any(_var.Query_query_definition_report_query_time_usage_started),
    				},
    				Version: pulumi.Any(_var.Query_query_definition_version),
    			},
    		})
    		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 = new Oci.MeteringComputation.Query("testQuery", new()
        {
            CompartmentId = @var.Compartment_id,
            QueryDefinition = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionArgs
            {
                CostAnalysisUi = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionCostAnalysisUiArgs
                {
                    Graph = @var.Query_query_definition_cost_analysis_ui_graph,
                    IsCumulativeGraph = @var.Query_query_definition_cost_analysis_ui_is_cumulative_graph,
                },
                DisplayName = @var.Query_query_definition_display_name,
                ReportQuery = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionReportQueryArgs
                {
                    Granularity = @var.Query_query_definition_report_query_granularity,
                    TenantId = oci_metering_computation_tenant.Test_tenant.Id,
                    CompartmentDepth = @var.Query_query_definition_report_query_compartment_depth,
                    DateRangeName = @var.Query_query_definition_report_query_date_range_name,
                    Filter = @var.Query_query_definition_report_query_filter,
                    Forecast = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionReportQueryForecastArgs
                    {
                        TimeForecastEnded = @var.Query_query_definition_report_query_forecast_time_forecast_ended,
                        ForecastType = @var.Query_query_definition_report_query_forecast_forecast_type,
                        TimeForecastStarted = @var.Query_query_definition_report_query_forecast_time_forecast_started,
                    },
                    GroupBies = @var.Query_query_definition_report_query_group_by,
                    GroupByTags = new[]
                    {
                        new Oci.MeteringComputation.Inputs.QueryQueryDefinitionReportQueryGroupByTagArgs
                        {
                            Key = @var.Query_query_definition_report_query_group_by_tag_key,
                            Namespace = @var.Query_query_definition_report_query_group_by_tag_namespace,
                            Value = @var.Query_query_definition_report_query_group_by_tag_value,
                        },
                    },
                    IsAggregateByTime = @var.Query_query_definition_report_query_is_aggregate_by_time,
                    QueryType = @var.Query_query_definition_report_query_query_type,
                    TimeUsageEnded = @var.Query_query_definition_report_query_time_usage_ended,
                    TimeUsageStarted = @var.Query_query_definition_report_query_time_usage_started,
                },
                Version = @var.Query_query_definition_version,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.MeteringComputation.Query;
    import com.pulumi.oci.MeteringComputation.QueryArgs;
    import com.pulumi.oci.MeteringComputation.inputs.QueryQueryDefinitionArgs;
    import com.pulumi.oci.MeteringComputation.inputs.QueryQueryDefinitionCostAnalysisUiArgs;
    import com.pulumi.oci.MeteringComputation.inputs.QueryQueryDefinitionReportQueryArgs;
    import com.pulumi.oci.MeteringComputation.inputs.QueryQueryDefinitionReportQueryForecastArgs;
    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) {
            var testQuery = new Query("testQuery", QueryArgs.builder()        
                .compartmentId(var_.compartment_id())
                .queryDefinition(QueryQueryDefinitionArgs.builder()
                    .costAnalysisUi(QueryQueryDefinitionCostAnalysisUiArgs.builder()
                        .graph(var_.query_query_definition_cost_analysis_ui_graph())
                        .isCumulativeGraph(var_.query_query_definition_cost_analysis_ui_is_cumulative_graph())
                        .build())
                    .displayName(var_.query_query_definition_display_name())
                    .reportQuery(QueryQueryDefinitionReportQueryArgs.builder()
                        .granularity(var_.query_query_definition_report_query_granularity())
                        .tenantId(oci_metering_computation_tenant.test_tenant().id())
                        .compartmentDepth(var_.query_query_definition_report_query_compartment_depth())
                        .dateRangeName(var_.query_query_definition_report_query_date_range_name())
                        .filter(var_.query_query_definition_report_query_filter())
                        .forecast(QueryQueryDefinitionReportQueryForecastArgs.builder()
                            .timeForecastEnded(var_.query_query_definition_report_query_forecast_time_forecast_ended())
                            .forecastType(var_.query_query_definition_report_query_forecast_forecast_type())
                            .timeForecastStarted(var_.query_query_definition_report_query_forecast_time_forecast_started())
                            .build())
                        .groupBies(var_.query_query_definition_report_query_group_by())
                        .groupByTags(QueryQueryDefinitionReportQueryGroupByTagArgs.builder()
                            .key(var_.query_query_definition_report_query_group_by_tag_key())
                            .namespace(var_.query_query_definition_report_query_group_by_tag_namespace())
                            .value(var_.query_query_definition_report_query_group_by_tag_value())
                            .build())
                        .isAggregateByTime(var_.query_query_definition_report_query_is_aggregate_by_time())
                        .queryType(var_.query_query_definition_report_query_query_type())
                        .timeUsageEnded(var_.query_query_definition_report_query_time_usage_ended())
                        .timeUsageStarted(var_.query_query_definition_report_query_time_usage_started())
                        .build())
                    .version(var_.query_query_definition_version())
                    .build())
                .build());
    
        }
    }
    
    resources:
      testQuery:
        type: oci:MeteringComputation:Query
        properties:
          #Required
          compartmentId: ${var.compartment_id}
          queryDefinition:
            costAnalysisUi:
              graph: ${var.query_query_definition_cost_analysis_ui_graph}
              isCumulativeGraph: ${var.query_query_definition_cost_analysis_ui_is_cumulative_graph}
            displayName: ${var.query_query_definition_display_name}
            reportQuery:
              granularity: ${var.query_query_definition_report_query_granularity}
              tenantId: ${oci_metering_computation_tenant.test_tenant.id}
              compartmentDepth: ${var.query_query_definition_report_query_compartment_depth}
              dateRangeName: ${var.query_query_definition_report_query_date_range_name}
              filter: ${var.query_query_definition_report_query_filter}
              forecast:
                timeForecastEnded: ${var.query_query_definition_report_query_forecast_time_forecast_ended}
                forecastType: ${var.query_query_definition_report_query_forecast_forecast_type}
                timeForecastStarted: ${var.query_query_definition_report_query_forecast_time_forecast_started}
              groupBies: ${var.query_query_definition_report_query_group_by}
              groupByTags:
                - key: ${var.query_query_definition_report_query_group_by_tag_key}
                  namespace: ${var.query_query_definition_report_query_group_by_tag_namespace}
                  value: ${var.query_query_definition_report_query_group_by_tag_value}
              isAggregateByTime: ${var.query_query_definition_report_query_is_aggregate_by_time}
              queryType: ${var.query_query_definition_report_query_query_type}
              timeUsageEnded: ${var.query_query_definition_report_query_time_usage_ended}
              timeUsageStarted: ${var.query_query_definition_report_query_time_usage_started}
            version: ${var.query_query_definition_version}
    

    Create Query Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Query(name: string, args: QueryArgs, opts?: CustomResourceOptions);
    @overload
    def Query(resource_name: str,
              args: QueryArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Query(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              compartment_id: Optional[str] = None,
              query_definition: Optional[_meteringcomputation.QueryQueryDefinitionArgs] = None)
    func NewQuery(ctx *Context, name string, args QueryArgs, opts ...ResourceOption) (*Query, error)
    public Query(string name, QueryArgs args, CustomResourceOptions? opts = null)
    public Query(String name, QueryArgs args)
    public Query(String name, QueryArgs args, CustomResourceOptions options)
    
    type: oci:MeteringComputation:Query
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args QueryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args QueryArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args QueryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args QueryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args QueryArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var queryResource = new Oci.MeteringComputation.Query("queryResource", new()
    {
        CompartmentId = "string",
        QueryDefinition = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionArgs
        {
            CostAnalysisUi = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionCostAnalysisUiArgs
            {
                Graph = "string",
                IsCumulativeGraph = false,
            },
            DisplayName = "string",
            ReportQuery = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionReportQueryArgs
            {
                Granularity = "string",
                TenantId = "string",
                CompartmentDepth = 0,
                DateRangeName = "string",
                Filter = "string",
                Forecast = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionReportQueryForecastArgs
                {
                    TimeForecastEnded = "string",
                    ForecastType = "string",
                    TimeForecastStarted = "string",
                },
                GroupBies = new[]
                {
                    "string",
                },
                GroupByTags = new[]
                {
                    new Oci.MeteringComputation.Inputs.QueryQueryDefinitionReportQueryGroupByTagArgs
                    {
                        Key = "string",
                        Namespace = "string",
                        Value = "string",
                    },
                },
                IsAggregateByTime = false,
                QueryType = "string",
                TimeUsageEnded = "string",
                TimeUsageStarted = "string",
            },
            Version = 0,
        },
    });
    
    example, err := MeteringComputation.NewQuery(ctx, "queryResource", &MeteringComputation.QueryArgs{
    	CompartmentId: pulumi.String("string"),
    	QueryDefinition: &meteringcomputation.QueryQueryDefinitionArgs{
    		CostAnalysisUi: &meteringcomputation.QueryQueryDefinitionCostAnalysisUiArgs{
    			Graph:             pulumi.String("string"),
    			IsCumulativeGraph: pulumi.Bool(false),
    		},
    		DisplayName: pulumi.String("string"),
    		ReportQuery: &meteringcomputation.QueryQueryDefinitionReportQueryArgs{
    			Granularity:      pulumi.String("string"),
    			TenantId:         pulumi.String("string"),
    			CompartmentDepth: pulumi.Float64(0),
    			DateRangeName:    pulumi.String("string"),
    			Filter:           pulumi.String("string"),
    			Forecast: &meteringcomputation.QueryQueryDefinitionReportQueryForecastArgs{
    				TimeForecastEnded:   pulumi.String("string"),
    				ForecastType:        pulumi.String("string"),
    				TimeForecastStarted: pulumi.String("string"),
    			},
    			GroupBies: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			GroupByTags: meteringcomputation.QueryQueryDefinitionReportQueryGroupByTagArray{
    				&meteringcomputation.QueryQueryDefinitionReportQueryGroupByTagArgs{
    					Key:       pulumi.String("string"),
    					Namespace: pulumi.String("string"),
    					Value:     pulumi.String("string"),
    				},
    			},
    			IsAggregateByTime: pulumi.Bool(false),
    			QueryType:         pulumi.String("string"),
    			TimeUsageEnded:    pulumi.String("string"),
    			TimeUsageStarted:  pulumi.String("string"),
    		},
    		Version: pulumi.Float64(0),
    	},
    })
    
    var queryResource = new Query("queryResource", QueryArgs.builder()        
        .compartmentId("string")
        .queryDefinition(QueryQueryDefinitionArgs.builder()
            .costAnalysisUi(QueryQueryDefinitionCostAnalysisUiArgs.builder()
                .graph("string")
                .isCumulativeGraph(false)
                .build())
            .displayName("string")
            .reportQuery(QueryQueryDefinitionReportQueryArgs.builder()
                .granularity("string")
                .tenantId("string")
                .compartmentDepth(0)
                .dateRangeName("string")
                .filter("string")
                .forecast(QueryQueryDefinitionReportQueryForecastArgs.builder()
                    .timeForecastEnded("string")
                    .forecastType("string")
                    .timeForecastStarted("string")
                    .build())
                .groupBies("string")
                .groupByTags(QueryQueryDefinitionReportQueryGroupByTagArgs.builder()
                    .key("string")
                    .namespace("string")
                    .value("string")
                    .build())
                .isAggregateByTime(false)
                .queryType("string")
                .timeUsageEnded("string")
                .timeUsageStarted("string")
                .build())
            .version(0)
            .build())
        .build());
    
    query_resource = oci.metering_computation.Query("queryResource",
        compartment_id="string",
        query_definition=oci.metering_computation.QueryQueryDefinitionArgs(
            cost_analysis_ui=oci.metering_computation.QueryQueryDefinitionCostAnalysisUiArgs(
                graph="string",
                is_cumulative_graph=False,
            ),
            display_name="string",
            report_query=oci.metering_computation.QueryQueryDefinitionReportQueryArgs(
                granularity="string",
                tenant_id="string",
                compartment_depth=0,
                date_range_name="string",
                filter="string",
                forecast=oci.metering_computation.QueryQueryDefinitionReportQueryForecastArgs(
                    time_forecast_ended="string",
                    forecast_type="string",
                    time_forecast_started="string",
                ),
                group_bies=["string"],
                group_by_tags=[oci.metering_computation.QueryQueryDefinitionReportQueryGroupByTagArgs(
                    key="string",
                    namespace="string",
                    value="string",
                )],
                is_aggregate_by_time=False,
                query_type="string",
                time_usage_ended="string",
                time_usage_started="string",
            ),
            version=0,
        ))
    
    const queryResource = new oci.meteringcomputation.Query("queryResource", {
        compartmentId: "string",
        queryDefinition: {
            costAnalysisUi: {
                graph: "string",
                isCumulativeGraph: false,
            },
            displayName: "string",
            reportQuery: {
                granularity: "string",
                tenantId: "string",
                compartmentDepth: 0,
                dateRangeName: "string",
                filter: "string",
                forecast: {
                    timeForecastEnded: "string",
                    forecastType: "string",
                    timeForecastStarted: "string",
                },
                groupBies: ["string"],
                groupByTags: [{
                    key: "string",
                    namespace: "string",
                    value: "string",
                }],
                isAggregateByTime: false,
                queryType: "string",
                timeUsageEnded: "string",
                timeUsageStarted: "string",
            },
            version: 0,
        },
    });
    
    type: oci:MeteringComputation:Query
    properties:
        compartmentId: string
        queryDefinition:
            costAnalysisUi:
                graph: string
                isCumulativeGraph: false
            displayName: string
            reportQuery:
                compartmentDepth: 0
                dateRangeName: string
                filter: string
                forecast:
                    forecastType: string
                    timeForecastEnded: string
                    timeForecastStarted: string
                granularity: string
                groupBies:
                    - string
                groupByTags:
                    - key: string
                      namespace: string
                      value: string
                isAggregateByTime: false
                queryType: string
                tenantId: string
                timeUsageEnded: string
                timeUsageStarted: string
            version: 0
    

    Query Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Query resource accepts the following input properties:

    CompartmentId string
    The compartment OCID.
    QueryDefinition QueryQueryDefinition
    (Updatable) The common fields for queries.
    CompartmentId string
    The compartment OCID.
    QueryDefinition QueryQueryDefinitionArgs
    (Updatable) The common fields for queries.
    compartmentId String
    The compartment OCID.
    queryDefinition QueryQueryDefinition
    (Updatable) The common fields for queries.
    compartmentId string
    The compartment OCID.
    queryDefinition QueryQueryDefinition
    (Updatable) The common fields for queries.
    compartment_id str
    The compartment OCID.
    query_definition meteringcomputation.QueryQueryDefinitionArgs
    (Updatable) The common fields for queries.
    compartmentId String
    The compartment OCID.
    queryDefinition Property Map
    (Updatable) The common fields for queries.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Query resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Query Resource

    Get an existing Query resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: QueryState, opts?: CustomResourceOptions): Query
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            compartment_id: Optional[str] = None,
            query_definition: Optional[_meteringcomputation.QueryQueryDefinitionArgs] = None) -> Query
    func GetQuery(ctx *Context, name string, id IDInput, state *QueryState, opts ...ResourceOption) (*Query, error)
    public static Query Get(string name, Input<string> id, QueryState? state, CustomResourceOptions? opts = null)
    public static Query get(String name, Output<String> id, QueryState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CompartmentId string
    The compartment OCID.
    QueryDefinition QueryQueryDefinition
    (Updatable) The common fields for queries.
    CompartmentId string
    The compartment OCID.
    QueryDefinition QueryQueryDefinitionArgs
    (Updatable) The common fields for queries.
    compartmentId String
    The compartment OCID.
    queryDefinition QueryQueryDefinition
    (Updatable) The common fields for queries.
    compartmentId string
    The compartment OCID.
    queryDefinition QueryQueryDefinition
    (Updatable) The common fields for queries.
    compartment_id str
    The compartment OCID.
    query_definition meteringcomputation.QueryQueryDefinitionArgs
    (Updatable) The common fields for queries.
    compartmentId String
    The compartment OCID.
    queryDefinition Property Map
    (Updatable) The common fields for queries.

    Supporting Types

    QueryQueryDefinition, QueryQueryDefinitionArgs

    CostAnalysisUi QueryQueryDefinitionCostAnalysisUi
    (Updatable) The common fields for Cost Analysis UI rendering.
    DisplayName string
    (Updatable) The query display name. Avoid entering confidential information.
    ReportQuery QueryQueryDefinitionReportQuery
    (Updatable) The request of the generated Cost Analysis report.
    Version double

    (Updatable) The saved query version.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CostAnalysisUi QueryQueryDefinitionCostAnalysisUi
    (Updatable) The common fields for Cost Analysis UI rendering.
    DisplayName string
    (Updatable) The query display name. Avoid entering confidential information.
    ReportQuery QueryQueryDefinitionReportQuery
    (Updatable) The request of the generated Cost Analysis report.
    Version float64

    (Updatable) The saved query version.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    costAnalysisUi QueryQueryDefinitionCostAnalysisUi
    (Updatable) The common fields for Cost Analysis UI rendering.
    displayName String
    (Updatable) The query display name. Avoid entering confidential information.
    reportQuery QueryQueryDefinitionReportQuery
    (Updatable) The request of the generated Cost Analysis report.
    version Double

    (Updatable) The saved query version.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    costAnalysisUi QueryQueryDefinitionCostAnalysisUi
    (Updatable) The common fields for Cost Analysis UI rendering.
    displayName string
    (Updatable) The query display name. Avoid entering confidential information.
    reportQuery QueryQueryDefinitionReportQuery
    (Updatable) The request of the generated Cost Analysis report.
    version number

    (Updatable) The saved query version.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    cost_analysis_ui meteringcomputation.QueryQueryDefinitionCostAnalysisUi
    (Updatable) The common fields for Cost Analysis UI rendering.
    display_name str
    (Updatable) The query display name. Avoid entering confidential information.
    report_query meteringcomputation.QueryQueryDefinitionReportQuery
    (Updatable) The request of the generated Cost Analysis report.
    version float

    (Updatable) The saved query version.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    costAnalysisUi Property Map
    (Updatable) The common fields for Cost Analysis UI rendering.
    displayName String
    (Updatable) The query display name. Avoid entering confidential information.
    reportQuery Property Map
    (Updatable) The request of the generated Cost Analysis report.
    version Number

    (Updatable) The saved query version.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    QueryQueryDefinitionCostAnalysisUi, QueryQueryDefinitionCostAnalysisUiArgs

    Graph string
    (Updatable) The graph type.
    IsCumulativeGraph bool
    (Updatable) A cumulative graph.
    Graph string
    (Updatable) The graph type.
    IsCumulativeGraph bool
    (Updatable) A cumulative graph.
    graph String
    (Updatable) The graph type.
    isCumulativeGraph Boolean
    (Updatable) A cumulative graph.
    graph string
    (Updatable) The graph type.
    isCumulativeGraph boolean
    (Updatable) A cumulative graph.
    graph str
    (Updatable) The graph type.
    is_cumulative_graph bool
    (Updatable) A cumulative graph.
    graph String
    (Updatable) The graph type.
    isCumulativeGraph Boolean
    (Updatable) A cumulative graph.

    QueryQueryDefinitionReportQuery, QueryQueryDefinitionReportQueryArgs

    Granularity string
    (Updatable) The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    TenantId string
    (Updatable) Tenant ID.
    CompartmentDepth double
    (Updatable) The compartment depth level.
    DateRangeName string
    (Updatable) The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
    Filter string
    (Updatable) The filter object for query usage.
    Forecast QueryQueryDefinitionReportQueryForecast
    (Updatable) Forecast configuration of usage/cost.
    GroupBies List<string>
    (Updatable) Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    GroupByTags List<QueryQueryDefinitionReportQueryGroupByTag>
    (Updatable) 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"]
    IsAggregateByTime bool
    (Updatable) Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    QueryType string
    (Updatable) 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
    TimeUsageEnded string
    (Updatable) The usage end time.
    TimeUsageStarted string
    (Updatable) The usage start time.
    Granularity string
    (Updatable) The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    TenantId string
    (Updatable) Tenant ID.
    CompartmentDepth float64
    (Updatable) The compartment depth level.
    DateRangeName string
    (Updatable) The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
    Filter string
    (Updatable) The filter object for query usage.
    Forecast QueryQueryDefinitionReportQueryForecast
    (Updatable) Forecast configuration of usage/cost.
    GroupBies []string
    (Updatable) Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    GroupByTags []QueryQueryDefinitionReportQueryGroupByTag
    (Updatable) 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"]
    IsAggregateByTime bool
    (Updatable) Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    QueryType string
    (Updatable) 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
    TimeUsageEnded string
    (Updatable) The usage end time.
    TimeUsageStarted string
    (Updatable) The usage start time.
    granularity String
    (Updatable) The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    tenantId String
    (Updatable) Tenant ID.
    compartmentDepth Double
    (Updatable) The compartment depth level.
    dateRangeName String
    (Updatable) The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
    filter String
    (Updatable) The filter object for query usage.
    forecast QueryQueryDefinitionReportQueryForecast
    (Updatable) Forecast configuration of usage/cost.
    groupBies List<String>
    (Updatable) Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    groupByTags List<QueryQueryDefinitionReportQueryGroupByTag>
    (Updatable) 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"]
    isAggregateByTime Boolean
    (Updatable) Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    queryType String
    (Updatable) 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
    timeUsageEnded String
    (Updatable) The usage end time.
    timeUsageStarted String
    (Updatable) The usage start time.
    granularity string
    (Updatable) The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    tenantId string
    (Updatable) Tenant ID.
    compartmentDepth number
    (Updatable) The compartment depth level.
    dateRangeName string
    (Updatable) The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
    filter string
    (Updatable) The filter object for query usage.
    forecast QueryQueryDefinitionReportQueryForecast
    (Updatable) Forecast configuration of usage/cost.
    groupBies string[]
    (Updatable) Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    groupByTags QueryQueryDefinitionReportQueryGroupByTag[]
    (Updatable) 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"]
    isAggregateByTime boolean
    (Updatable) Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    queryType string
    (Updatable) 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
    timeUsageEnded string
    (Updatable) The usage end time.
    timeUsageStarted string
    (Updatable) The usage start time.
    granularity str
    (Updatable) The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    tenant_id str
    (Updatable) Tenant ID.
    compartment_depth float
    (Updatable) The compartment depth level.
    date_range_name str
    (Updatable) The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
    filter str
    (Updatable) The filter object for query usage.
    forecast meteringcomputation.QueryQueryDefinitionReportQueryForecast
    (Updatable) Forecast configuration of usage/cost.
    group_bies Sequence[str]
    (Updatable) Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    group_by_tags Sequence[meteringcomputation.QueryQueryDefinitionReportQueryGroupByTag]
    (Updatable) 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_by_time bool
    (Updatable) Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    query_type str
    (Updatable) 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
    time_usage_ended str
    (Updatable) The usage end time.
    time_usage_started str
    (Updatable) The usage start time.
    granularity String
    (Updatable) The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    tenantId String
    (Updatable) Tenant ID.
    compartmentDepth Number
    (Updatable) The compartment depth level.
    dateRangeName String
    (Updatable) The UI date range, for example, LAST_THREE_MONTHS. Conflicts with timeUsageStarted and timeUsageEnded.
    filter String
    (Updatable) The filter object for query usage.
    forecast Property Map
    (Updatable) Forecast configuration of usage/cost.
    groupBies List<String>
    (Updatable) Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    groupByTags List<Property Map>
    (Updatable) 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"]
    isAggregateByTime Boolean
    (Updatable) Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    queryType String
    (Updatable) 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
    timeUsageEnded String
    (Updatable) The usage end time.
    timeUsageStarted String
    (Updatable) The usage start time.

    QueryQueryDefinitionReportQueryForecast, QueryQueryDefinitionReportQueryForecastArgs

    TimeForecastEnded string
    (Updatable) The forecast end time.
    ForecastType string
    (Updatable) 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.
    TimeForecastStarted string
    (Updatable) The forecast start time. Defaults to UTC-1 if not specified.
    TimeForecastEnded string
    (Updatable) The forecast end time.
    ForecastType string
    (Updatable) 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.
    TimeForecastStarted string
    (Updatable) The forecast start time. Defaults to UTC-1 if not specified.
    timeForecastEnded String
    (Updatable) The forecast end time.
    forecastType String
    (Updatable) 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.
    timeForecastStarted String
    (Updatable) The forecast start time. Defaults to UTC-1 if not specified.
    timeForecastEnded string
    (Updatable) The forecast end time.
    forecastType string
    (Updatable) 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.
    timeForecastStarted string
    (Updatable) The forecast start time. Defaults to UTC-1 if not specified.
    time_forecast_ended str
    (Updatable) The forecast end time.
    forecast_type str
    (Updatable) 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_started str
    (Updatable) The forecast start time. Defaults to UTC-1 if not specified.
    timeForecastEnded String
    (Updatable) The forecast end time.
    forecastType String
    (Updatable) 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.
    timeForecastStarted String
    (Updatable) The forecast start time. Defaults to UTC-1 if not specified.

    QueryQueryDefinitionReportQueryGroupByTag, QueryQueryDefinitionReportQueryGroupByTagArgs

    Key string
    (Updatable) The tag key.
    Namespace string
    (Updatable) The tag namespace.
    Value string
    (Updatable) The tag value.
    Key string
    (Updatable) The tag key.
    Namespace string
    (Updatable) The tag namespace.
    Value string
    (Updatable) The tag value.
    key String
    (Updatable) The tag key.
    namespace String
    (Updatable) The tag namespace.
    value String
    (Updatable) The tag value.
    key string
    (Updatable) The tag key.
    namespace string
    (Updatable) The tag namespace.
    value string
    (Updatable) The tag value.
    key str
    (Updatable) The tag key.
    namespace str
    (Updatable) The tag namespace.
    value str
    (Updatable) The tag value.
    key String
    (Updatable) The tag key.
    namespace String
    (Updatable) The tag namespace.
    value String
    (Updatable) The tag value.

    Import

    Queries can be imported using the id, e.g.

    $ pulumi import oci:MeteringComputation/query:Query test_query "id"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi