1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. MeteringComputation
  5. Query
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

oci.MeteringComputation.Query

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 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("test_query", {
        compartmentId: compartmentId,
        queryDefinition: {
            costAnalysisUi: {
                graph: queryQueryDefinitionCostAnalysisUiGraph,
                isCumulativeGraph: queryQueryDefinitionCostAnalysisUiIsCumulativeGraph,
            },
            displayName: queryQueryDefinitionDisplayName,
            reportQuery: {
                granularity: queryQueryDefinitionReportQueryGranularity,
                tenantId: testTenant.id,
                compartmentDepth: queryQueryDefinitionReportQueryCompartmentDepth,
                dateRangeName: queryQueryDefinitionReportQueryDateRangeName,
                filter: queryQueryDefinitionReportQueryFilter,
                forecast: {
                    timeForecastEnded: queryQueryDefinitionReportQueryForecastTimeForecastEnded,
                    forecastType: queryQueryDefinitionReportQueryForecastForecastType,
                    timeForecastStarted: queryQueryDefinitionReportQueryForecastTimeForecastStarted,
                },
                groupBies: queryQueryDefinitionReportQueryGroupBy,
                groupByTags: [{
                    key: queryQueryDefinitionReportQueryGroupByTagKey,
                    namespace: queryQueryDefinitionReportQueryGroupByTagNamespace,
                    value: queryQueryDefinitionReportQueryGroupByTagValue,
                }],
                isAggregateByTime: queryQueryDefinitionReportQueryIsAggregateByTime,
                queryType: queryQueryDefinitionReportQueryQueryType,
                timeUsageEnded: queryQueryDefinitionReportQueryTimeUsageEnded,
                timeUsageStarted: queryQueryDefinitionReportQueryTimeUsageStarted,
            },
            version: queryQueryDefinitionVersion,
        },
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_query = oci.metering_computation.Query("test_query",
        compartment_id=compartment_id,
        query_definition={
            "cost_analysis_ui": {
                "graph": query_query_definition_cost_analysis_ui_graph,
                "is_cumulative_graph": query_query_definition_cost_analysis_ui_is_cumulative_graph,
            },
            "display_name": query_query_definition_display_name,
            "report_query": {
                "granularity": query_query_definition_report_query_granularity,
                "tenant_id": test_tenant["id"],
                "compartment_depth": query_query_definition_report_query_compartment_depth,
                "date_range_name": query_query_definition_report_query_date_range_name,
                "filter": query_query_definition_report_query_filter,
                "forecast": {
                    "time_forecast_ended": query_query_definition_report_query_forecast_time_forecast_ended,
                    "forecast_type": query_query_definition_report_query_forecast_forecast_type,
                    "time_forecast_started": query_query_definition_report_query_forecast_time_forecast_started,
                },
                "group_bies": query_query_definition_report_query_group_by,
                "group_by_tags": [{
                    "key": query_query_definition_report_query_group_by_tag_key,
                    "namespace": query_query_definition_report_query_group_by_tag_namespace,
                    "value": query_query_definition_report_query_group_by_tag_value,
                }],
                "is_aggregate_by_time": query_query_definition_report_query_is_aggregate_by_time,
                "query_type": query_query_definition_report_query_query_type,
                "time_usage_ended": query_query_definition_report_query_time_usage_ended,
                "time_usage_started": query_query_definition_report_query_time_usage_started,
            },
            "version": query_query_definition_version,
        })
    
    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.NewQuery(ctx, "test_query", &MeteringComputation.QueryArgs{
    			CompartmentId: pulumi.Any(compartmentId),
    			QueryDefinition: &meteringcomputation.QueryQueryDefinitionArgs{
    				CostAnalysisUi: &meteringcomputation.QueryQueryDefinitionCostAnalysisUiArgs{
    					Graph:             pulumi.Any(queryQueryDefinitionCostAnalysisUiGraph),
    					IsCumulativeGraph: pulumi.Any(queryQueryDefinitionCostAnalysisUiIsCumulativeGraph),
    				},
    				DisplayName: pulumi.Any(queryQueryDefinitionDisplayName),
    				ReportQuery: &meteringcomputation.QueryQueryDefinitionReportQueryArgs{
    					Granularity:      pulumi.Any(queryQueryDefinitionReportQueryGranularity),
    					TenantId:         pulumi.Any(testTenant.Id),
    					CompartmentDepth: pulumi.Any(queryQueryDefinitionReportQueryCompartmentDepth),
    					DateRangeName:    pulumi.Any(queryQueryDefinitionReportQueryDateRangeName),
    					Filter:           pulumi.Any(queryQueryDefinitionReportQueryFilter),
    					Forecast: &meteringcomputation.QueryQueryDefinitionReportQueryForecastArgs{
    						TimeForecastEnded:   pulumi.Any(queryQueryDefinitionReportQueryForecastTimeForecastEnded),
    						ForecastType:        pulumi.Any(queryQueryDefinitionReportQueryForecastForecastType),
    						TimeForecastStarted: pulumi.Any(queryQueryDefinitionReportQueryForecastTimeForecastStarted),
    					},
    					GroupBies: pulumi.Any(queryQueryDefinitionReportQueryGroupBy),
    					GroupByTags: meteringcomputation.QueryQueryDefinitionReportQueryGroupByTagArray{
    						&meteringcomputation.QueryQueryDefinitionReportQueryGroupByTagArgs{
    							Key:       pulumi.Any(queryQueryDefinitionReportQueryGroupByTagKey),
    							Namespace: pulumi.Any(queryQueryDefinitionReportQueryGroupByTagNamespace),
    							Value:     pulumi.Any(queryQueryDefinitionReportQueryGroupByTagValue),
    						},
    					},
    					IsAggregateByTime: pulumi.Any(queryQueryDefinitionReportQueryIsAggregateByTime),
    					QueryType:         pulumi.Any(queryQueryDefinitionReportQueryQueryType),
    					TimeUsageEnded:    pulumi.Any(queryQueryDefinitionReportQueryTimeUsageEnded),
    					TimeUsageStarted:  pulumi.Any(queryQueryDefinitionReportQueryTimeUsageStarted),
    				},
    				Version: pulumi.Any(queryQueryDefinitionVersion),
    			},
    		})
    		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("test_query", new()
        {
            CompartmentId = compartmentId,
            QueryDefinition = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionArgs
            {
                CostAnalysisUi = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionCostAnalysisUiArgs
                {
                    Graph = queryQueryDefinitionCostAnalysisUiGraph,
                    IsCumulativeGraph = queryQueryDefinitionCostAnalysisUiIsCumulativeGraph,
                },
                DisplayName = queryQueryDefinitionDisplayName,
                ReportQuery = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionReportQueryArgs
                {
                    Granularity = queryQueryDefinitionReportQueryGranularity,
                    TenantId = testTenant.Id,
                    CompartmentDepth = queryQueryDefinitionReportQueryCompartmentDepth,
                    DateRangeName = queryQueryDefinitionReportQueryDateRangeName,
                    Filter = queryQueryDefinitionReportQueryFilter,
                    Forecast = new Oci.MeteringComputation.Inputs.QueryQueryDefinitionReportQueryForecastArgs
                    {
                        TimeForecastEnded = queryQueryDefinitionReportQueryForecastTimeForecastEnded,
                        ForecastType = queryQueryDefinitionReportQueryForecastForecastType,
                        TimeForecastStarted = queryQueryDefinitionReportQueryForecastTimeForecastStarted,
                    },
                    GroupBies = queryQueryDefinitionReportQueryGroupBy,
                    GroupByTags = new[]
                    {
                        new Oci.MeteringComputation.Inputs.QueryQueryDefinitionReportQueryGroupByTagArgs
                        {
                            Key = queryQueryDefinitionReportQueryGroupByTagKey,
                            Namespace = queryQueryDefinitionReportQueryGroupByTagNamespace,
                            Value = queryQueryDefinitionReportQueryGroupByTagValue,
                        },
                    },
                    IsAggregateByTime = queryQueryDefinitionReportQueryIsAggregateByTime,
                    QueryType = queryQueryDefinitionReportQueryQueryType,
                    TimeUsageEnded = queryQueryDefinitionReportQueryTimeUsageEnded,
                    TimeUsageStarted = queryQueryDefinitionReportQueryTimeUsageStarted,
                },
                Version = queryQueryDefinitionVersion,
            },
        });
    
    });
    
    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(compartmentId)
                .queryDefinition(QueryQueryDefinitionArgs.builder()
                    .costAnalysisUi(QueryQueryDefinitionCostAnalysisUiArgs.builder()
                        .graph(queryQueryDefinitionCostAnalysisUiGraph)
                        .isCumulativeGraph(queryQueryDefinitionCostAnalysisUiIsCumulativeGraph)
                        .build())
                    .displayName(queryQueryDefinitionDisplayName)
                    .reportQuery(QueryQueryDefinitionReportQueryArgs.builder()
                        .granularity(queryQueryDefinitionReportQueryGranularity)
                        .tenantId(testTenant.id())
                        .compartmentDepth(queryQueryDefinitionReportQueryCompartmentDepth)
                        .dateRangeName(queryQueryDefinitionReportQueryDateRangeName)
                        .filter(queryQueryDefinitionReportQueryFilter)
                        .forecast(QueryQueryDefinitionReportQueryForecastArgs.builder()
                            .timeForecastEnded(queryQueryDefinitionReportQueryForecastTimeForecastEnded)
                            .forecastType(queryQueryDefinitionReportQueryForecastForecastType)
                            .timeForecastStarted(queryQueryDefinitionReportQueryForecastTimeForecastStarted)
                            .build())
                        .groupBies(queryQueryDefinitionReportQueryGroupBy)
                        .groupByTags(QueryQueryDefinitionReportQueryGroupByTagArgs.builder()
                            .key(queryQueryDefinitionReportQueryGroupByTagKey)
                            .namespace(queryQueryDefinitionReportQueryGroupByTagNamespace)
                            .value(queryQueryDefinitionReportQueryGroupByTagValue)
                            .build())
                        .isAggregateByTime(queryQueryDefinitionReportQueryIsAggregateByTime)
                        .queryType(queryQueryDefinitionReportQueryQueryType)
                        .timeUsageEnded(queryQueryDefinitionReportQueryTimeUsageEnded)
                        .timeUsageStarted(queryQueryDefinitionReportQueryTimeUsageStarted)
                        .build())
                    .version(queryQueryDefinitionVersion)
                    .build())
                .build());
    
        }
    }
    
    resources:
      testQuery:
        type: oci:MeteringComputation:Query
        name: test_query
        properties:
          compartmentId: ${compartmentId}
          queryDefinition:
            costAnalysisUi:
              graph: ${queryQueryDefinitionCostAnalysisUiGraph}
              isCumulativeGraph: ${queryQueryDefinitionCostAnalysisUiIsCumulativeGraph}
            displayName: ${queryQueryDefinitionDisplayName}
            reportQuery:
              granularity: ${queryQueryDefinitionReportQueryGranularity}
              tenantId: ${testTenant.id}
              compartmentDepth: ${queryQueryDefinitionReportQueryCompartmentDepth}
              dateRangeName: ${queryQueryDefinitionReportQueryDateRangeName}
              filter: ${queryQueryDefinitionReportQueryFilter}
              forecast:
                timeForecastEnded: ${queryQueryDefinitionReportQueryForecastTimeForecastEnded}
                forecastType: ${queryQueryDefinitionReportQueryForecastForecastType}
                timeForecastStarted: ${queryQueryDefinitionReportQueryForecastTimeForecastStarted}
              groupBies: ${queryQueryDefinitionReportQueryGroupBy}
              groupByTags:
                - key: ${queryQueryDefinitionReportQueryGroupByTagKey}
                  namespace: ${queryQueryDefinitionReportQueryGroupByTagNamespace}
                  value: ${queryQueryDefinitionReportQueryGroupByTagValue}
              isAggregateByTime: ${queryQueryDefinitionReportQueryIsAggregateByTime}
              queryType: ${queryQueryDefinitionReportQueryQueryType}
              timeUsageEnded: ${queryQueryDefinitionReportQueryTimeUsageEnded}
              timeUsageStarted: ${queryQueryDefinitionReportQueryTimeUsageStarted}
            version: ${queryQueryDefinitionVersion}
    

    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.

    Constructor 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 v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi