1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. MeteringComputation
  5. UsageCarbonEmissionsQuery
Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi

oci.MeteringComputation.UsageCarbonEmissionsQuery

Explore with Pulumi AI

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

Returns the created usage carbon emissions query.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testUsageCarbonEmissionsQuery = new oci.meteringcomputation.UsageCarbonEmissionsQuery("test_usage_carbon_emissions_query", {
    compartmentId: compartmentId,
    queryDefinition: {
        costAnalysisUi: {
            graph: usageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiGraph,
            isCumulativeGraph: usageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiIsCumulativeGraph,
        },
        displayName: usageCarbonEmissionsQueryQueryDefinitionDisplayName,
        reportQuery: {
            tenantId: testTenant.id,
            compartmentDepth: usageCarbonEmissionsQueryQueryDefinitionReportQueryCompartmentDepth,
            dateRangeName: usageCarbonEmissionsQueryQueryDefinitionReportQueryDateRangeName,
            groupBies: usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupBy,
            groupByTags: [{
                key: usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagKey,
                namespace: usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagNamespace,
                value: usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagValue,
            }],
            isAggregateByTime: usageCarbonEmissionsQueryQueryDefinitionReportQueryIsAggregateByTime,
            timeUsageEnded: usageCarbonEmissionsQueryQueryDefinitionReportQueryTimeUsageEnded,
            timeUsageStarted: usageCarbonEmissionsQueryQueryDefinitionReportQueryTimeUsageStarted,
            usageCarbonEmissionsQueryFilter: usageCarbonEmissionsQueryQueryDefinitionReportQueryUsageCarbonEmissionsQueryFilter,
        },
        version: usageCarbonEmissionsQueryQueryDefinitionVersion,
    },
});
Copy
import pulumi
import pulumi_oci as oci

test_usage_carbon_emissions_query = oci.metering_computation.UsageCarbonEmissionsQuery("test_usage_carbon_emissions_query",
    compartment_id=compartment_id,
    query_definition={
        "cost_analysis_ui": {
            "graph": usage_carbon_emissions_query_query_definition_cost_analysis_ui_graph,
            "is_cumulative_graph": usage_carbon_emissions_query_query_definition_cost_analysis_ui_is_cumulative_graph,
        },
        "display_name": usage_carbon_emissions_query_query_definition_display_name,
        "report_query": {
            "tenant_id": test_tenant["id"],
            "compartment_depth": usage_carbon_emissions_query_query_definition_report_query_compartment_depth,
            "date_range_name": usage_carbon_emissions_query_query_definition_report_query_date_range_name,
            "group_bies": usage_carbon_emissions_query_query_definition_report_query_group_by,
            "group_by_tags": [{
                "key": usage_carbon_emissions_query_query_definition_report_query_group_by_tag_key,
                "namespace": usage_carbon_emissions_query_query_definition_report_query_group_by_tag_namespace,
                "value": usage_carbon_emissions_query_query_definition_report_query_group_by_tag_value,
            }],
            "is_aggregate_by_time": usage_carbon_emissions_query_query_definition_report_query_is_aggregate_by_time,
            "time_usage_ended": usage_carbon_emissions_query_query_definition_report_query_time_usage_ended,
            "time_usage_started": usage_carbon_emissions_query_query_definition_report_query_time_usage_started,
            "usage_carbon_emissions_query_filter": usage_carbon_emissions_query_query_definition_report_query_usage_carbon_emissions_query_filter,
        },
        "version": usage_carbon_emissions_query_query_definition_version,
    })
Copy
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.NewUsageCarbonEmissionsQuery(ctx, "test_usage_carbon_emissions_query", &meteringcomputation.UsageCarbonEmissionsQueryArgs{
			CompartmentId: pulumi.Any(compartmentId),
			QueryDefinition: &meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionArgs{
				CostAnalysisUi: &meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiArgs{
					Graph:             pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiGraph),
					IsCumulativeGraph: pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiIsCumulativeGraph),
				},
				DisplayName: pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionDisplayName),
				ReportQuery: &meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionReportQueryArgs{
					TenantId:         pulumi.Any(testTenant.Id),
					CompartmentDepth: pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionReportQueryCompartmentDepth),
					DateRangeName:    pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionReportQueryDateRangeName),
					GroupBies:        pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupBy),
					GroupByTags: meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagArray{
						&meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagArgs{
							Key:       pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagKey),
							Namespace: pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagNamespace),
							Value:     pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagValue),
						},
					},
					IsAggregateByTime:               pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionReportQueryIsAggregateByTime),
					TimeUsageEnded:                  pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionReportQueryTimeUsageEnded),
					TimeUsageStarted:                pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionReportQueryTimeUsageStarted),
					UsageCarbonEmissionsQueryFilter: pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionReportQueryUsageCarbonEmissionsQueryFilter),
				},
				Version: pulumi.Any(usageCarbonEmissionsQueryQueryDefinitionVersion),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testUsageCarbonEmissionsQuery = new Oci.MeteringComputation.UsageCarbonEmissionsQuery("test_usage_carbon_emissions_query", new()
    {
        CompartmentId = compartmentId,
        QueryDefinition = new Oci.MeteringComputation.Inputs.UsageCarbonEmissionsQueryQueryDefinitionArgs
        {
            CostAnalysisUi = new Oci.MeteringComputation.Inputs.UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiArgs
            {
                Graph = usageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiGraph,
                IsCumulativeGraph = usageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiIsCumulativeGraph,
            },
            DisplayName = usageCarbonEmissionsQueryQueryDefinitionDisplayName,
            ReportQuery = new Oci.MeteringComputation.Inputs.UsageCarbonEmissionsQueryQueryDefinitionReportQueryArgs
            {
                TenantId = testTenant.Id,
                CompartmentDepth = usageCarbonEmissionsQueryQueryDefinitionReportQueryCompartmentDepth,
                DateRangeName = usageCarbonEmissionsQueryQueryDefinitionReportQueryDateRangeName,
                GroupBies = usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupBy,
                GroupByTags = new[]
                {
                    new Oci.MeteringComputation.Inputs.UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagArgs
                    {
                        Key = usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagKey,
                        Namespace = usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagNamespace,
                        Value = usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagValue,
                    },
                },
                IsAggregateByTime = usageCarbonEmissionsQueryQueryDefinitionReportQueryIsAggregateByTime,
                TimeUsageEnded = usageCarbonEmissionsQueryQueryDefinitionReportQueryTimeUsageEnded,
                TimeUsageStarted = usageCarbonEmissionsQueryQueryDefinitionReportQueryTimeUsageStarted,
                UsageCarbonEmissionsQueryFilter = usageCarbonEmissionsQueryQueryDefinitionReportQueryUsageCarbonEmissionsQueryFilter,
            },
            Version = usageCarbonEmissionsQueryQueryDefinitionVersion,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.MeteringComputation.UsageCarbonEmissionsQuery;
import com.pulumi.oci.MeteringComputation.UsageCarbonEmissionsQueryArgs;
import com.pulumi.oci.MeteringComputation.inputs.UsageCarbonEmissionsQueryQueryDefinitionArgs;
import com.pulumi.oci.MeteringComputation.inputs.UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiArgs;
import com.pulumi.oci.MeteringComputation.inputs.UsageCarbonEmissionsQueryQueryDefinitionReportQueryArgs;
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 testUsageCarbonEmissionsQuery = new UsageCarbonEmissionsQuery("testUsageCarbonEmissionsQuery", UsageCarbonEmissionsQueryArgs.builder()
            .compartmentId(compartmentId)
            .queryDefinition(UsageCarbonEmissionsQueryQueryDefinitionArgs.builder()
                .costAnalysisUi(UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiArgs.builder()
                    .graph(usageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiGraph)
                    .isCumulativeGraph(usageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiIsCumulativeGraph)
                    .build())
                .displayName(usageCarbonEmissionsQueryQueryDefinitionDisplayName)
                .reportQuery(UsageCarbonEmissionsQueryQueryDefinitionReportQueryArgs.builder()
                    .tenantId(testTenant.id())
                    .compartmentDepth(usageCarbonEmissionsQueryQueryDefinitionReportQueryCompartmentDepth)
                    .dateRangeName(usageCarbonEmissionsQueryQueryDefinitionReportQueryDateRangeName)
                    .groupBies(usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupBy)
                    .groupByTags(UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagArgs.builder()
                        .key(usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagKey)
                        .namespace(usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagNamespace)
                        .value(usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagValue)
                        .build())
                    .isAggregateByTime(usageCarbonEmissionsQueryQueryDefinitionReportQueryIsAggregateByTime)
                    .timeUsageEnded(usageCarbonEmissionsQueryQueryDefinitionReportQueryTimeUsageEnded)
                    .timeUsageStarted(usageCarbonEmissionsQueryQueryDefinitionReportQueryTimeUsageStarted)
                    .usageCarbonEmissionsQueryFilter(usageCarbonEmissionsQueryQueryDefinitionReportQueryUsageCarbonEmissionsQueryFilter)
                    .build())
                .version(usageCarbonEmissionsQueryQueryDefinitionVersion)
                .build())
            .build());

    }
}
Copy
resources:
  testUsageCarbonEmissionsQuery:
    type: oci:MeteringComputation:UsageCarbonEmissionsQuery
    name: test_usage_carbon_emissions_query
    properties:
      compartmentId: ${compartmentId}
      queryDefinition:
        costAnalysisUi:
          graph: ${usageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiGraph}
          isCumulativeGraph: ${usageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiIsCumulativeGraph}
        displayName: ${usageCarbonEmissionsQueryQueryDefinitionDisplayName}
        reportQuery:
          tenantId: ${testTenant.id}
          compartmentDepth: ${usageCarbonEmissionsQueryQueryDefinitionReportQueryCompartmentDepth}
          dateRangeName: ${usageCarbonEmissionsQueryQueryDefinitionReportQueryDateRangeName}
          groupBies: ${usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupBy}
          groupByTags:
            - key: ${usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagKey}
              namespace: ${usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagNamespace}
              value: ${usageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagValue}
          isAggregateByTime: ${usageCarbonEmissionsQueryQueryDefinitionReportQueryIsAggregateByTime}
          timeUsageEnded: ${usageCarbonEmissionsQueryQueryDefinitionReportQueryTimeUsageEnded}
          timeUsageStarted: ${usageCarbonEmissionsQueryQueryDefinitionReportQueryTimeUsageStarted}
          usageCarbonEmissionsQueryFilter: ${usageCarbonEmissionsQueryQueryDefinitionReportQueryUsageCarbonEmissionsQueryFilter}
        version: ${usageCarbonEmissionsQueryQueryDefinitionVersion}
Copy

Create UsageCarbonEmissionsQuery Resource

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

Constructor syntax

new UsageCarbonEmissionsQuery(name: string, args: UsageCarbonEmissionsQueryArgs, opts?: CustomResourceOptions);
@overload
def UsageCarbonEmissionsQuery(resource_name: str,
                              args: UsageCarbonEmissionsQueryArgs,
                              opts: Optional[ResourceOptions] = None)

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

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. UsageCarbonEmissionsQueryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. UsageCarbonEmissionsQueryArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. UsageCarbonEmissionsQueryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. UsageCarbonEmissionsQueryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. UsageCarbonEmissionsQueryArgs
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 usageCarbonEmissionsQueryResource = new Oci.MeteringComputation.UsageCarbonEmissionsQuery("usageCarbonEmissionsQueryResource", new()
{
    CompartmentId = "string",
    QueryDefinition = new Oci.MeteringComputation.Inputs.UsageCarbonEmissionsQueryQueryDefinitionArgs
    {
        CostAnalysisUi = new Oci.MeteringComputation.Inputs.UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiArgs
        {
            Graph = "string",
            IsCumulativeGraph = false,
        },
        DisplayName = "string",
        ReportQuery = new Oci.MeteringComputation.Inputs.UsageCarbonEmissionsQueryQueryDefinitionReportQueryArgs
        {
            TenantId = "string",
            CompartmentDepth = 0,
            DateRangeName = "string",
            GroupBies = new[]
            {
                "string",
            },
            GroupByTags = new[]
            {
                new Oci.MeteringComputation.Inputs.UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagArgs
                {
                    Key = "string",
                    Namespace = "string",
                    Value = "string",
                },
            },
            IsAggregateByTime = false,
            TimeUsageEnded = "string",
            TimeUsageStarted = "string",
            UsageCarbonEmissionsQueryFilter = "string",
        },
        Version = 0,
    },
});
Copy
example, err := meteringcomputation.NewUsageCarbonEmissionsQuery(ctx, "usageCarbonEmissionsQueryResource", &meteringcomputation.UsageCarbonEmissionsQueryArgs{
	CompartmentId: pulumi.String("string"),
	QueryDefinition: &meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionArgs{
		CostAnalysisUi: &meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiArgs{
			Graph:             pulumi.String("string"),
			IsCumulativeGraph: pulumi.Bool(false),
		},
		DisplayName: pulumi.String("string"),
		ReportQuery: &meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionReportQueryArgs{
			TenantId:         pulumi.String("string"),
			CompartmentDepth: pulumi.Int(0),
			DateRangeName:    pulumi.String("string"),
			GroupBies: pulumi.StringArray{
				pulumi.String("string"),
			},
			GroupByTags: meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagArray{
				&meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagArgs{
					Key:       pulumi.String("string"),
					Namespace: pulumi.String("string"),
					Value:     pulumi.String("string"),
				},
			},
			IsAggregateByTime:               pulumi.Bool(false),
			TimeUsageEnded:                  pulumi.String("string"),
			TimeUsageStarted:                pulumi.String("string"),
			UsageCarbonEmissionsQueryFilter: pulumi.String("string"),
		},
		Version: pulumi.Int(0),
	},
})
Copy
var usageCarbonEmissionsQueryResource = new UsageCarbonEmissionsQuery("usageCarbonEmissionsQueryResource", UsageCarbonEmissionsQueryArgs.builder()
    .compartmentId("string")
    .queryDefinition(UsageCarbonEmissionsQueryQueryDefinitionArgs.builder()
        .costAnalysisUi(UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiArgs.builder()
            .graph("string")
            .isCumulativeGraph(false)
            .build())
        .displayName("string")
        .reportQuery(UsageCarbonEmissionsQueryQueryDefinitionReportQueryArgs.builder()
            .tenantId("string")
            .compartmentDepth(0)
            .dateRangeName("string")
            .groupBies("string")
            .groupByTags(UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagArgs.builder()
                .key("string")
                .namespace("string")
                .value("string")
                .build())
            .isAggregateByTime(false)
            .timeUsageEnded("string")
            .timeUsageStarted("string")
            .usageCarbonEmissionsQueryFilter("string")
            .build())
        .version(0)
        .build())
    .build());
Copy
usage_carbon_emissions_query_resource = oci.metering_computation.UsageCarbonEmissionsQuery("usageCarbonEmissionsQueryResource",
    compartment_id="string",
    query_definition={
        "cost_analysis_ui": {
            "graph": "string",
            "is_cumulative_graph": False,
        },
        "display_name": "string",
        "report_query": {
            "tenant_id": "string",
            "compartment_depth": 0,
            "date_range_name": "string",
            "group_bies": ["string"],
            "group_by_tags": [{
                "key": "string",
                "namespace": "string",
                "value": "string",
            }],
            "is_aggregate_by_time": False,
            "time_usage_ended": "string",
            "time_usage_started": "string",
            "usage_carbon_emissions_query_filter": "string",
        },
        "version": 0,
    })
Copy
const usageCarbonEmissionsQueryResource = new oci.meteringcomputation.UsageCarbonEmissionsQuery("usageCarbonEmissionsQueryResource", {
    compartmentId: "string",
    queryDefinition: {
        costAnalysisUi: {
            graph: "string",
            isCumulativeGraph: false,
        },
        displayName: "string",
        reportQuery: {
            tenantId: "string",
            compartmentDepth: 0,
            dateRangeName: "string",
            groupBies: ["string"],
            groupByTags: [{
                key: "string",
                namespace: "string",
                value: "string",
            }],
            isAggregateByTime: false,
            timeUsageEnded: "string",
            timeUsageStarted: "string",
            usageCarbonEmissionsQueryFilter: "string",
        },
        version: 0,
    },
});
Copy
type: oci:MeteringComputation:UsageCarbonEmissionsQuery
properties:
    compartmentId: string
    queryDefinition:
        costAnalysisUi:
            graph: string
            isCumulativeGraph: false
        displayName: string
        reportQuery:
            compartmentDepth: 0
            dateRangeName: string
            groupBies:
                - string
            groupByTags:
                - key: string
                  namespace: string
                  value: string
            isAggregateByTime: false
            tenantId: string
            timeUsageEnded: string
            timeUsageStarted: string
            usageCarbonEmissionsQueryFilter: string
        version: 0
Copy

UsageCarbonEmissionsQuery Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The UsageCarbonEmissionsQuery resource accepts the following input properties:

CompartmentId
This property is required.
Changes to this property will trigger replacement.
string
The compartment OCID.
QueryDefinition This property is required. UsageCarbonEmissionsQueryQueryDefinition
(Updatable) The common fields for queries.
CompartmentId
This property is required.
Changes to this property will trigger replacement.
string
The compartment OCID.
QueryDefinition This property is required. UsageCarbonEmissionsQueryQueryDefinitionArgs
(Updatable) The common fields for queries.
compartmentId
This property is required.
Changes to this property will trigger replacement.
String
The compartment OCID.
queryDefinition This property is required. UsageCarbonEmissionsQueryQueryDefinition
(Updatable) The common fields for queries.
compartmentId
This property is required.
Changes to this property will trigger replacement.
string
The compartment OCID.
queryDefinition This property is required. UsageCarbonEmissionsQueryQueryDefinition
(Updatable) The common fields for queries.
compartment_id
This property is required.
Changes to this property will trigger replacement.
str
The compartment OCID.
query_definition This property is required. meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionArgs
(Updatable) The common fields for queries.
compartmentId
This property is required.
Changes to this property will trigger replacement.
String
The compartment OCID.
queryDefinition This property is required. Property Map
(Updatable) The common fields for queries.

Outputs

All input properties are implicitly available as output properties. Additionally, the UsageCarbonEmissionsQuery 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 UsageCarbonEmissionsQuery Resource

Get an existing UsageCarbonEmissionsQuery 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?: UsageCarbonEmissionsQueryState, opts?: CustomResourceOptions): UsageCarbonEmissionsQuery
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compartment_id: Optional[str] = None,
        query_definition: Optional[_meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionArgs] = None) -> UsageCarbonEmissionsQuery
func GetUsageCarbonEmissionsQuery(ctx *Context, name string, id IDInput, state *UsageCarbonEmissionsQueryState, opts ...ResourceOption) (*UsageCarbonEmissionsQuery, error)
public static UsageCarbonEmissionsQuery Get(string name, Input<string> id, UsageCarbonEmissionsQueryState? state, CustomResourceOptions? opts = null)
public static UsageCarbonEmissionsQuery get(String name, Output<String> id, UsageCarbonEmissionsQueryState state, CustomResourceOptions options)
resources:  _:    type: oci:MeteringComputation:UsageCarbonEmissionsQuery    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
The compartment OCID.
QueryDefinition UsageCarbonEmissionsQueryQueryDefinition
(Updatable) The common fields for queries.
CompartmentId Changes to this property will trigger replacement. string
The compartment OCID.
QueryDefinition UsageCarbonEmissionsQueryQueryDefinitionArgs
(Updatable) The common fields for queries.
compartmentId Changes to this property will trigger replacement. String
The compartment OCID.
queryDefinition UsageCarbonEmissionsQueryQueryDefinition
(Updatable) The common fields for queries.
compartmentId Changes to this property will trigger replacement. string
The compartment OCID.
queryDefinition UsageCarbonEmissionsQueryQueryDefinition
(Updatable) The common fields for queries.
compartment_id Changes to this property will trigger replacement. str
The compartment OCID.
query_definition meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionArgs
(Updatable) The common fields for queries.
compartmentId Changes to this property will trigger replacement. String
The compartment OCID.
queryDefinition Property Map
(Updatable) The common fields for queries.

Supporting Types

UsageCarbonEmissionsQueryQueryDefinition
, UsageCarbonEmissionsQueryQueryDefinitionArgs

CostAnalysisUi This property is required. UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi
(Updatable) The common fields for Cost Analysis UI rendering.
DisplayName This property is required. string
(Updatable) The query display name. Avoid entering confidential information.
ReportQuery This property is required. UsageCarbonEmissionsQueryQueryDefinitionReportQuery
(Updatable) The request of the generated usage carbon emissions report.
Version This property is required. int

(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 This property is required. UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi
(Updatable) The common fields for Cost Analysis UI rendering.
DisplayName This property is required. string
(Updatable) The query display name. Avoid entering confidential information.
ReportQuery This property is required. UsageCarbonEmissionsQueryQueryDefinitionReportQuery
(Updatable) The request of the generated usage carbon emissions report.
Version This property is required. int

(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 This property is required. UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi
(Updatable) The common fields for Cost Analysis UI rendering.
displayName This property is required. String
(Updatable) The query display name. Avoid entering confidential information.
reportQuery This property is required. UsageCarbonEmissionsQueryQueryDefinitionReportQuery
(Updatable) The request of the generated usage carbon emissions report.
version This property is required. Integer

(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 This property is required. UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi
(Updatable) The common fields for Cost Analysis UI rendering.
displayName This property is required. string
(Updatable) The query display name. Avoid entering confidential information.
reportQuery This property is required. UsageCarbonEmissionsQueryQueryDefinitionReportQuery
(Updatable) The request of the generated usage carbon emissions report.
version This property is required. 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 This property is required. meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi
(Updatable) The common fields for Cost Analysis UI rendering.
display_name This property is required. str
(Updatable) The query display name. Avoid entering confidential information.
report_query This property is required. meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionReportQuery
(Updatable) The request of the generated usage carbon emissions report.
version This property is required. int

(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 This property is required. Property Map
(Updatable) The common fields for Cost Analysis UI rendering.
displayName This property is required. String
(Updatable) The query display name. Avoid entering confidential information.
reportQuery This property is required. Property Map
(Updatable) The request of the generated usage carbon emissions report.
version This property is required. 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

UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi
, UsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUiArgs

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.

UsageCarbonEmissionsQueryQueryDefinitionReportQuery
, UsageCarbonEmissionsQueryQueryDefinitionReportQueryArgs

TenantId This property is required. string
(Updatable) Tenant ID.
CompartmentDepth int
(Updatable) The compartment depth level.
DateRangeName string
(Updatable) The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
GroupBies List<string>
(Updatable) Specifies what to aggregate the result by. For example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
GroupByTags List<UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag>
(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) Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
TimeUsageEnded string
(Updatable) The usage end time.
TimeUsageStarted string
(Updatable) The usage start time.
UsageCarbonEmissionsQueryFilter string
(Updatable) The filter object for query usage.
TenantId This property is required. string
(Updatable) Tenant ID.
CompartmentDepth int
(Updatable) The compartment depth level.
DateRangeName string
(Updatable) The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
GroupBies []string
(Updatable) Specifies what to aggregate the result by. For example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
GroupByTags []UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag
(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) Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
TimeUsageEnded string
(Updatable) The usage end time.
TimeUsageStarted string
(Updatable) The usage start time.
UsageCarbonEmissionsQueryFilter string
(Updatable) The filter object for query usage.
tenantId This property is required. String
(Updatable) Tenant ID.
compartmentDepth Integer
(Updatable) The compartment depth level.
dateRangeName String
(Updatable) The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
groupBies List<String>
(Updatable) Specifies what to aggregate the result by. For example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
groupByTags List<UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag>
(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) Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
timeUsageEnded String
(Updatable) The usage end time.
timeUsageStarted String
(Updatable) The usage start time.
usageCarbonEmissionsQueryFilter String
(Updatable) The filter object for query usage.
tenantId This property is required. string
(Updatable) Tenant ID.
compartmentDepth number
(Updatable) The compartment depth level.
dateRangeName string
(Updatable) The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
groupBies string[]
(Updatable) Specifies what to aggregate the result by. For example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
groupByTags UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag[]
(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) Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
timeUsageEnded string
(Updatable) The usage end time.
timeUsageStarted string
(Updatable) The usage start time.
usageCarbonEmissionsQueryFilter string
(Updatable) The filter object for query usage.
tenant_id This property is required. str
(Updatable) Tenant ID.
compartment_depth int
(Updatable) The compartment depth level.
date_range_name str
(Updatable) The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
group_bies Sequence[str]
(Updatable) Specifies what to aggregate the result by. For example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
group_by_tags Sequence[meteringcomputation.UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag]
(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) Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
time_usage_ended str
(Updatable) The usage end time.
time_usage_started str
(Updatable) The usage start time.
usage_carbon_emissions_query_filter str
(Updatable) The filter object for query usage.
tenantId This property is required. String
(Updatable) Tenant ID.
compartmentDepth Number
(Updatable) The compartment depth level.
dateRangeName String
(Updatable) The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
groupBies List<String>
(Updatable) Specifies what to aggregate the result by. For 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) Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
timeUsageEnded String
(Updatable) The usage end time.
timeUsageStarted String
(Updatable) The usage start time.
usageCarbonEmissionsQueryFilter String
(Updatable) The filter object for query usage.

UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag
, UsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTagArgs

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

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

$ pulumi import oci:MeteringComputation/usageCarbonEmissionsQuery:UsageCarbonEmissionsQuery test_usage_carbon_emissions_query "id"
Copy

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.