1. Packages
  2. Dynatrace
  3. API Docs
  4. getGenericSetting
Dynatrace v0.21.0 published on Sunday, Nov 17, 2024 by Pulumiverse

dynatrace.getGenericSetting

Explore with Pulumi AI

dynatrace logo
Dynatrace v0.21.0 published on Sunday, Nov 17, 2024 by Pulumiverse

    The generic setting data source allows a single Settings 2.0 object to be retrieved by its schema ID, scope, and/or filter.

    If multiple objects match the given criteria, the first result will be retrieved.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dynatrace from "@pulumi/dynatrace";
    
    const example = dynatrace.getGenericSetting({
        schema: "builtin:alerting.maintenance-window",
        filter: "value.generalProperties.name = 'Terraform Example'",
    });
    export const genericSetting = example;
    
    import pulumi
    import pulumi_dynatrace as dynatrace
    
    example = dynatrace.get_generic_setting(schema="builtin:alerting.maintenance-window",
        filter="value.generalProperties.name = 'Terraform Example'")
    pulumi.export("genericSetting", example)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-dynatrace/sdk/go/dynatrace"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := dynatrace.LookupGenericSetting(ctx, &dynatrace.LookupGenericSettingArgs{
    			Schema: pulumi.StringRef("builtin:alerting.maintenance-window"),
    			Filter: pulumi.StringRef("value.generalProperties.name = 'Terraform Example'"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("genericSetting", example)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Dynatrace = Pulumi.Dynatrace;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Dynatrace.GetGenericSetting.Invoke(new()
        {
            Schema = "builtin:alerting.maintenance-window",
            Filter = "value.generalProperties.name = 'Terraform Example'",
        });
    
        return new Dictionary<string, object?>
        {
            ["genericSetting"] = example,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dynatrace.DynatraceFunctions;
    import com.pulumi.dynatrace.inputs.GetGenericSettingArgs;
    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 example = DynatraceFunctions.getGenericSetting(GetGenericSettingArgs.builder()
                .schema("builtin:alerting.maintenance-window")
                .filter("value.generalProperties.name = 'Terraform Example'")
                .build());
    
            ctx.export("genericSetting", example.applyValue(getGenericSettingResult -> getGenericSettingResult));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: dynatrace:getGenericSetting
          Arguments:
            schema: builtin:alerting.maintenance-window
            filter: value.generalProperties.name = 'Terraform Example'
    outputs:
      genericSetting: ${example}
    

    Using getGenericSetting

    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 getGenericSetting(args: GetGenericSettingArgs, opts?: InvokeOptions): Promise<GetGenericSettingResult>
    function getGenericSettingOutput(args: GetGenericSettingOutputArgs, opts?: InvokeOptions): Output<GetGenericSettingResult>
    def get_generic_setting(filter: Optional[str] = None,
                            schema: Optional[str] = None,
                            scope: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetGenericSettingResult
    def get_generic_setting_output(filter: Optional[pulumi.Input[str]] = None,
                            schema: Optional[pulumi.Input[str]] = None,
                            scope: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetGenericSettingResult]
    func LookupGenericSetting(ctx *Context, args *LookupGenericSettingArgs, opts ...InvokeOption) (*LookupGenericSettingResult, error)
    func LookupGenericSettingOutput(ctx *Context, args *LookupGenericSettingOutputArgs, opts ...InvokeOption) LookupGenericSettingResultOutput

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

    public static class GetGenericSetting 
    {
        public static Task<GetGenericSettingResult> InvokeAsync(GetGenericSettingArgs args, InvokeOptions? opts = null)
        public static Output<GetGenericSettingResult> Invoke(GetGenericSettingInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGenericSettingResult> getGenericSetting(GetGenericSettingArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: dynatrace:index/getGenericSetting:getGenericSetting
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filter string
    Filter of the requested objects
    Schema string
    Schema IDs to which the requested objects belong
    Scope string
    Scope that the requested objects target
    Filter string
    Filter of the requested objects
    Schema string
    Schema IDs to which the requested objects belong
    Scope string
    Scope that the requested objects target
    filter String
    Filter of the requested objects
    schema String
    Schema IDs to which the requested objects belong
    scope String
    Scope that the requested objects target
    filter string
    Filter of the requested objects
    schema string
    Schema IDs to which the requested objects belong
    scope string
    Scope that the requested objects target
    filter str
    Filter of the requested objects
    schema str
    Schema IDs to which the requested objects belong
    scope str
    Scope that the requested objects target
    filter String
    Filter of the requested objects
    schema String
    Schema IDs to which the requested objects belong
    scope String
    Scope that the requested objects target

    getGenericSetting Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Schema string
    Schema IDs to which the requested objects belong
    Scope string
    Scope that the requested objects target
    Value string
    Filter string
    Filter of the requested objects
    Id string
    The provider-assigned unique ID for this managed resource.
    Schema string
    Schema IDs to which the requested objects belong
    Scope string
    Scope that the requested objects target
    Value string
    Filter string
    Filter of the requested objects
    id String
    The provider-assigned unique ID for this managed resource.
    schema String
    Schema IDs to which the requested objects belong
    scope String
    Scope that the requested objects target
    value String
    filter String
    Filter of the requested objects
    id string
    The provider-assigned unique ID for this managed resource.
    schema string
    Schema IDs to which the requested objects belong
    scope string
    Scope that the requested objects target
    value string
    filter string
    Filter of the requested objects
    id str
    The provider-assigned unique ID for this managed resource.
    schema str
    Schema IDs to which the requested objects belong
    scope str
    Scope that the requested objects target
    value str
    filter str
    Filter of the requested objects
    id String
    The provider-assigned unique ID for this managed resource.
    schema String
    Schema IDs to which the requested objects belong
    scope String
    Scope that the requested objects target
    value String
    filter String
    Filter of the requested objects

    Package Details

    Repository
    dynatrace pulumiverse/pulumi-dynatrace
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dynatrace Terraform Provider.
    dynatrace logo
    Dynatrace v0.21.0 published on Sunday, Nov 17, 2024 by Pulumiverse