1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. MeteringComputation
  5. getUsageCarbonEmissionsConfig
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.MeteringComputation.getUsageCarbonEmissionsConfig

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

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

    Returns the configuration list for the UI drop-down list of carbon emission console.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testUsageCarbonEmissionsConfig = oci.MeteringComputation.getUsageCarbonEmissionsConfig({
        tenantId: testTenant.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_usage_carbon_emissions_config = oci.MeteringComputation.get_usage_carbon_emissions_config(tenant_id=test_tenant["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.GetUsageCarbonEmissionsConfig(ctx, &meteringcomputation.GetUsageCarbonEmissionsConfigArgs{
    			TenantId: testTenant.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 testUsageCarbonEmissionsConfig = Oci.MeteringComputation.GetUsageCarbonEmissionsConfig.Invoke(new()
        {
            TenantId = testTenant.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.GetUsageCarbonEmissionsConfigArgs;
    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 testUsageCarbonEmissionsConfig = MeteringComputationFunctions.getUsageCarbonEmissionsConfig(GetUsageCarbonEmissionsConfigArgs.builder()
                .tenantId(testTenant.id())
                .build());
    
        }
    }
    
    variables:
      testUsageCarbonEmissionsConfig:
        fn::invoke:
          Function: oci:MeteringComputation:getUsageCarbonEmissionsConfig
          Arguments:
            tenantId: ${testTenant.id}
    

    Using getUsageCarbonEmissionsConfig

    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 getUsageCarbonEmissionsConfig(args: GetUsageCarbonEmissionsConfigArgs, opts?: InvokeOptions): Promise<GetUsageCarbonEmissionsConfigResult>
    function getUsageCarbonEmissionsConfigOutput(args: GetUsageCarbonEmissionsConfigOutputArgs, opts?: InvokeOptions): Output<GetUsageCarbonEmissionsConfigResult>
    def get_usage_carbon_emissions_config(tenant_id: Optional[str] = None,
                                          opts: Optional[InvokeOptions] = None) -> GetUsageCarbonEmissionsConfigResult
    def get_usage_carbon_emissions_config_output(tenant_id: Optional[pulumi.Input[str]] = None,
                                          opts: Optional[InvokeOptions] = None) -> Output[GetUsageCarbonEmissionsConfigResult]
    func GetUsageCarbonEmissionsConfig(ctx *Context, args *GetUsageCarbonEmissionsConfigArgs, opts ...InvokeOption) (*GetUsageCarbonEmissionsConfigResult, error)
    func GetUsageCarbonEmissionsConfigOutput(ctx *Context, args *GetUsageCarbonEmissionsConfigOutputArgs, opts ...InvokeOption) GetUsageCarbonEmissionsConfigResultOutput

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

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

    The following arguments are supported:

    TenantId string
    tenant id
    TenantId string
    tenant id
    tenantId String
    tenant id
    tenantId string
    tenant id
    tenant_id str
    tenant id
    tenantId String
    tenant id

    getUsageCarbonEmissionsConfig Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Items List<GetUsageCarbonEmissionsConfigItem>
    The list of available configurations.
    TenantId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Items []GetUsageCarbonEmissionsConfigItem
    The list of available configurations.
    TenantId string
    id String
    The provider-assigned unique ID for this managed resource.
    items List<GetUsageCarbonEmissionsConfigItem>
    The list of available configurations.
    tenantId String
    id string
    The provider-assigned unique ID for this managed resource.
    items GetUsageCarbonEmissionsConfigItem[]
    The list of available configurations.
    tenantId string
    id str
    The provider-assigned unique ID for this managed resource.
    items Sequence[meteringcomputation.GetUsageCarbonEmissionsConfigItem]
    The list of available configurations.
    tenant_id str
    id String
    The provider-assigned unique ID for this managed resource.
    items List<Property Map>
    The list of available configurations.
    tenantId String

    Supporting Types

    GetUsageCarbonEmissionsConfigItem

    Key string
    The configuration key.
    Values List<string>
    The configuration value.
    Key string
    The configuration key.
    Values []string
    The configuration value.
    key String
    The configuration key.
    values List<String>
    The configuration value.
    key string
    The configuration key.
    values string[]
    The configuration value.
    key str
    The configuration key.
    values Sequence[str]
    The configuration value.
    key String
    The configuration key.
    values List<String>
    The configuration 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.17.0 published on Friday, Nov 15, 2024 by Pulumi