1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. MeteringComputation
  5. getUsageCarbonEmissionsQuery
Oracle Cloud Infrastructure v2.2.0 published on Friday, Jul 12, 2024 by Pulumi

oci.MeteringComputation.getUsageCarbonEmissionsQuery

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.2.0 published on Friday, Jul 12, 2024 by Pulumi

    This data source provides details about a specific Usage Carbon Emissions Query resource in Oracle Cloud Infrastructure Metering Computation service.

    Returns the usage carbon emissions saved query.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testUsageCarbonEmissionsQuery = oci.MeteringComputation.getUsageCarbonEmissionsQuery({
        usageCarbonEmissionsQueryId: testUsageCarbonEmissionsQueryOciMeteringComputationUsageCarbonEmissionsQuery.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_usage_carbon_emissions_query = oci.MeteringComputation.get_usage_carbon_emissions_query(usage_carbon_emissions_query_id=test_usage_carbon_emissions_query_oci_metering_computation_usage_carbon_emissions_query["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/MeteringComputation"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := MeteringComputation.GetUsageCarbonEmissionsQuery(ctx, &meteringcomputation.GetUsageCarbonEmissionsQueryArgs{
    			UsageCarbonEmissionsQueryId: testUsageCarbonEmissionsQueryOciMeteringComputationUsageCarbonEmissionsQuery.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testUsageCarbonEmissionsQuery = Oci.MeteringComputation.GetUsageCarbonEmissionsQuery.Invoke(new()
        {
            UsageCarbonEmissionsQueryId = testUsageCarbonEmissionsQueryOciMeteringComputationUsageCarbonEmissionsQuery.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.MeteringComputation.MeteringComputationFunctions;
    import com.pulumi.oci.MeteringComputation.inputs.GetUsageCarbonEmissionsQueryArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var testUsageCarbonEmissionsQuery = MeteringComputationFunctions.getUsageCarbonEmissionsQuery(GetUsageCarbonEmissionsQueryArgs.builder()
                .usageCarbonEmissionsQueryId(testUsageCarbonEmissionsQueryOciMeteringComputationUsageCarbonEmissionsQuery.id())
                .build());
    
        }
    }
    
    variables:
      testUsageCarbonEmissionsQuery:
        fn::invoke:
          Function: oci:MeteringComputation:getUsageCarbonEmissionsQuery
          Arguments:
            usageCarbonEmissionsQueryId: ${testUsageCarbonEmissionsQueryOciMeteringComputationUsageCarbonEmissionsQuery.id}
    

    Using getUsageCarbonEmissionsQuery

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getUsageCarbonEmissionsQuery(args: GetUsageCarbonEmissionsQueryArgs, opts?: InvokeOptions): Promise<GetUsageCarbonEmissionsQueryResult>
    function getUsageCarbonEmissionsQueryOutput(args: GetUsageCarbonEmissionsQueryOutputArgs, opts?: InvokeOptions): Output<GetUsageCarbonEmissionsQueryResult>
    def get_usage_carbon_emissions_query(usage_carbon_emissions_query_id: Optional[str] = None,
                                         opts: Optional[InvokeOptions] = None) -> GetUsageCarbonEmissionsQueryResult
    def get_usage_carbon_emissions_query_output(usage_carbon_emissions_query_id: Optional[pulumi.Input[str]] = None,
                                         opts: Optional[InvokeOptions] = None) -> Output[GetUsageCarbonEmissionsQueryResult]
    func GetUsageCarbonEmissionsQuery(ctx *Context, args *GetUsageCarbonEmissionsQueryArgs, opts ...InvokeOption) (*GetUsageCarbonEmissionsQueryResult, error)
    func GetUsageCarbonEmissionsQueryOutput(ctx *Context, args *GetUsageCarbonEmissionsQueryOutputArgs, opts ...InvokeOption) GetUsageCarbonEmissionsQueryResultOutput

    > Note: This function is named GetUsageCarbonEmissionsQuery in the Go SDK.

    public static class GetUsageCarbonEmissionsQuery 
    {
        public static Task<GetUsageCarbonEmissionsQueryResult> InvokeAsync(GetUsageCarbonEmissionsQueryArgs args, InvokeOptions? opts = null)
        public static Output<GetUsageCarbonEmissionsQueryResult> Invoke(GetUsageCarbonEmissionsQueryInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUsageCarbonEmissionsQueryResult> getUsageCarbonEmissionsQuery(GetUsageCarbonEmissionsQueryArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:MeteringComputation/getUsageCarbonEmissionsQuery:getUsageCarbonEmissionsQuery
      arguments:
        # arguments dictionary

    The following arguments are supported:

    UsageCarbonEmissionsQueryId string
    The query unique OCID.
    UsageCarbonEmissionsQueryId string
    The query unique OCID.
    usageCarbonEmissionsQueryId String
    The query unique OCID.
    usageCarbonEmissionsQueryId string
    The query unique OCID.
    usage_carbon_emissions_query_id str
    The query unique OCID.
    usageCarbonEmissionsQueryId String
    The query unique OCID.

    getUsageCarbonEmissionsQuery Result

    The following output properties are available:

    CompartmentId string
    The compartment OCID.
    Id string
    The query OCID.
    QueryDefinitions List<GetUsageCarbonEmissionsQueryQueryDefinition>
    The common fields for queries.
    UsageCarbonEmissionsQueryId string
    CompartmentId string
    The compartment OCID.
    Id string
    The query OCID.
    QueryDefinitions []GetUsageCarbonEmissionsQueryQueryDefinition
    The common fields for queries.
    UsageCarbonEmissionsQueryId string
    compartmentId String
    The compartment OCID.
    id String
    The query OCID.
    queryDefinitions List<GetUsageCarbonEmissionsQueryQueryDefinition>
    The common fields for queries.
    usageCarbonEmissionsQueryId String
    compartmentId string
    The compartment OCID.
    id string
    The query OCID.
    queryDefinitions GetUsageCarbonEmissionsQueryQueryDefinition[]
    The common fields for queries.
    usageCarbonEmissionsQueryId string
    compartmentId String
    The compartment OCID.
    id String
    The query OCID.
    queryDefinitions List<Property Map>
    The common fields for queries.
    usageCarbonEmissionsQueryId String

    Supporting Types

    GetUsageCarbonEmissionsQueryQueryDefinition

    CostAnalysisUis List<GetUsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi>
    The common fields for Cost Analysis UI rendering.
    DisplayName string
    The query display name. Avoid entering confidential information.
    ReportQueries List<GetUsageCarbonEmissionsQueryQueryDefinitionReportQuery>
    The request of the generated usage carbon emissions report.
    Version int
    The saved query version.
    CostAnalysisUis []GetUsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi
    The common fields for Cost Analysis UI rendering.
    DisplayName string
    The query display name. Avoid entering confidential information.
    ReportQueries []GetUsageCarbonEmissionsQueryQueryDefinitionReportQuery
    The request of the generated usage carbon emissions report.
    Version int
    The saved query version.
    costAnalysisUis List<GetUsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi>
    The common fields for Cost Analysis UI rendering.
    displayName String
    The query display name. Avoid entering confidential information.
    reportQueries List<GetUsageCarbonEmissionsQueryQueryDefinitionReportQuery>
    The request of the generated usage carbon emissions report.
    version Integer
    The saved query version.
    costAnalysisUis GetUsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi[]
    The common fields for Cost Analysis UI rendering.
    displayName string
    The query display name. Avoid entering confidential information.
    reportQueries GetUsageCarbonEmissionsQueryQueryDefinitionReportQuery[]
    The request of the generated usage carbon emissions report.
    version number
    The saved query version.
    cost_analysis_uis Sequence[meteringcomputation.GetUsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi]
    The common fields for Cost Analysis UI rendering.
    display_name str
    The query display name. Avoid entering confidential information.
    report_queries Sequence[meteringcomputation.GetUsageCarbonEmissionsQueryQueryDefinitionReportQuery]
    The request of the generated usage carbon emissions report.
    version int
    The saved query version.
    costAnalysisUis List<Property Map>
    The common fields for Cost Analysis UI rendering.
    displayName String
    The query display name. Avoid entering confidential information.
    reportQueries List<Property Map>
    The request of the generated usage carbon emissions report.
    version Number
    The saved query version.

    GetUsageCarbonEmissionsQueryQueryDefinitionCostAnalysisUi

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

    GetUsageCarbonEmissionsQueryQueryDefinitionReportQuery

    CompartmentDepth int
    The compartment depth level.
    DateRangeName string
    The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
    GroupBies List<string>
    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<GetUsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag>
    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
    Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
    TenantId string
    Tenant ID.
    TimeUsageEnded string
    The usage end time.
    TimeUsageStarted string
    The usage start time.
    UsageCarbonEmissionsQueryFilter string
    The filter object for query usage.
    CompartmentDepth int
    The compartment depth level.
    DateRangeName string
    The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
    GroupBies []string
    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 []GetUsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag
    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
    Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
    TenantId string
    Tenant ID.
    TimeUsageEnded string
    The usage end time.
    TimeUsageStarted string
    The usage start time.
    UsageCarbonEmissionsQueryFilter string
    The filter object for query usage.
    compartmentDepth Integer
    The compartment depth level.
    dateRangeName String
    The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
    groupBies List<String>
    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<GetUsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag>
    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
    Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
    tenantId String
    Tenant ID.
    timeUsageEnded String
    The usage end time.
    timeUsageStarted String
    The usage start time.
    usageCarbonEmissionsQueryFilter String
    The filter object for query usage.
    compartmentDepth number
    The compartment depth level.
    dateRangeName string
    The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
    groupBies string[]
    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 GetUsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag[]
    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
    Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
    tenantId string
    Tenant ID.
    timeUsageEnded string
    The usage end time.
    timeUsageStarted string
    The usage start time.
    usageCarbonEmissionsQueryFilter string
    The filter object for query usage.
    compartment_depth int
    The compartment depth level.
    date_range_name str
    The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
    group_bies Sequence[str]
    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.GetUsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag]
    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
    Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
    tenant_id str
    Tenant ID.
    time_usage_ended str
    The usage end time.
    time_usage_started str
    The usage start time.
    usage_carbon_emissions_query_filter str
    The filter object for query usage.
    compartmentDepth Number
    The compartment depth level.
    dateRangeName String
    The UI date range, for example, LAST_THREE_MONTHS. It will override timeUsageStarted and timeUsageEnded properties.
    groupBies List<String>
    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>
    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
    Specifies whether aggregated by time. If isAggregateByTime is true, all usage or cost over the query time period will be added up.
    tenantId String
    Tenant ID.
    timeUsageEnded String
    The usage end time.
    timeUsageStarted String
    The usage start time.
    usageCarbonEmissionsQueryFilter String
    The filter object for query usage.

    GetUsageCarbonEmissionsQueryQueryDefinitionReportQueryGroupByTag

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

    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.2.0 published on Friday, Jul 12, 2024 by Pulumi