1. Packages
  2. Datadog
  3. API Docs
  4. getServiceLevelObjective
Datadog v4.27.0 published on Thursday, Mar 14, 2024 by Pulumi

datadog.getServiceLevelObjective

Explore with Pulumi AI

datadog logo
Datadog v4.27.0 published on Thursday, Mar 14, 2024 by Pulumi

    Use this data source to retrieve information about an existing SLO for use in other resources.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    const test = datadog.getServiceLevelObjective({
        nameQuery: "My test SLO",
        tagsQuery: "foo:bar",
    });
    const apiSlo = datadog.getServiceLevelObjective({
        id: data.terraform_remote_state.api.outputs.slo,
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    test = datadog.get_service_level_objective(name_query="My test SLO",
        tags_query="foo:bar")
    api_slo = datadog.get_service_level_objective(id=data["terraform_remote_state"]["api"]["outputs"]["slo"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := datadog.LookupServiceLevelObjective(ctx, &datadog.LookupServiceLevelObjectiveArgs{
    			NameQuery: pulumi.StringRef("My test SLO"),
    			TagsQuery: pulumi.StringRef("foo:bar"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = datadog.LookupServiceLevelObjective(ctx, &datadog.LookupServiceLevelObjectiveArgs{
    			Id: pulumi.StringRef(data.Terraform_remote_state.Api.Outputs.Slo),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        var test = Datadog.GetServiceLevelObjective.Invoke(new()
        {
            NameQuery = "My test SLO",
            TagsQuery = "foo:bar",
        });
    
        var apiSlo = Datadog.GetServiceLevelObjective.Invoke(new()
        {
            Id = data.Terraform_remote_state.Api.Outputs.Slo,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.DatadogFunctions;
    import com.pulumi.datadog.inputs.GetServiceLevelObjectiveArgs;
    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 test = DatadogFunctions.getServiceLevelObjective(GetServiceLevelObjectiveArgs.builder()
                .nameQuery("My test SLO")
                .tagsQuery("foo:bar")
                .build());
    
            final var apiSlo = DatadogFunctions.getServiceLevelObjective(GetServiceLevelObjectiveArgs.builder()
                .id(data.terraform_remote_state().api().outputs().slo())
                .build());
    
        }
    }
    
    variables:
      test:
        fn::invoke:
          Function: datadog:getServiceLevelObjective
          Arguments:
            nameQuery: My test SLO
            tagsQuery: foo:bar
      apiSlo:
        fn::invoke:
          Function: datadog:getServiceLevelObjective
          Arguments:
            id: ${data.terraform_remote_state.api.outputs.slo}
    

    Using getServiceLevelObjective

    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 getServiceLevelObjective(args: GetServiceLevelObjectiveArgs, opts?: InvokeOptions): Promise<GetServiceLevelObjectiveResult>
    function getServiceLevelObjectiveOutput(args: GetServiceLevelObjectiveOutputArgs, opts?: InvokeOptions): Output<GetServiceLevelObjectiveResult>
    def get_service_level_objective(id: Optional[str] = None,
                                    metrics_query: Optional[str] = None,
                                    name_query: Optional[str] = None,
                                    tags_query: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetServiceLevelObjectiveResult
    def get_service_level_objective_output(id: Optional[pulumi.Input[str]] = None,
                                    metrics_query: Optional[pulumi.Input[str]] = None,
                                    name_query: Optional[pulumi.Input[str]] = None,
                                    tags_query: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetServiceLevelObjectiveResult]
    func LookupServiceLevelObjective(ctx *Context, args *LookupServiceLevelObjectiveArgs, opts ...InvokeOption) (*LookupServiceLevelObjectiveResult, error)
    func LookupServiceLevelObjectiveOutput(ctx *Context, args *LookupServiceLevelObjectiveOutputArgs, opts ...InvokeOption) LookupServiceLevelObjectiveResultOutput

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

    public static class GetServiceLevelObjective 
    {
        public static Task<GetServiceLevelObjectiveResult> InvokeAsync(GetServiceLevelObjectiveArgs args, InvokeOptions? opts = null)
        public static Output<GetServiceLevelObjectiveResult> Invoke(GetServiceLevelObjectiveInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServiceLevelObjectiveResult> getServiceLevelObjective(GetServiceLevelObjectiveArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: datadog:index/getServiceLevelObjective:getServiceLevelObjective
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    A SLO ID to limit the search.
    MetricsQuery string
    Filter results based on SLO numerator and denominator.
    NameQuery string
    Filter results based on SLO names.
    TagsQuery string
    Filter results based on a single SLO tag.
    Id string
    A SLO ID to limit the search.
    MetricsQuery string
    Filter results based on SLO numerator and denominator.
    NameQuery string
    Filter results based on SLO names.
    TagsQuery string
    Filter results based on a single SLO tag.
    id String
    A SLO ID to limit the search.
    metricsQuery String
    Filter results based on SLO numerator and denominator.
    nameQuery String
    Filter results based on SLO names.
    tagsQuery String
    Filter results based on a single SLO tag.
    id string
    A SLO ID to limit the search.
    metricsQuery string
    Filter results based on SLO numerator and denominator.
    nameQuery string
    Filter results based on SLO names.
    tagsQuery string
    Filter results based on a single SLO tag.
    id str
    A SLO ID to limit the search.
    metrics_query str
    Filter results based on SLO numerator and denominator.
    name_query str
    Filter results based on SLO names.
    tags_query str
    Filter results based on a single SLO tag.
    id String
    A SLO ID to limit the search.
    metricsQuery String
    Filter results based on SLO numerator and denominator.
    nameQuery String
    Filter results based on SLO names.
    tagsQuery String
    Filter results based on a single SLO tag.

    getServiceLevelObjective Result

    The following output properties are available:

    Description string
    The description of the service level objective.
    Name string
    Name of the Datadog service level objective
    Queries List<GetServiceLevelObjectiveQuery>
    The metric query of good / total events
    TargetThreshold double
    The primary target threshold of the service level objective.
    Timeframe string
    The primary timeframe of the service level objective.
    Type string
    The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available values are: metric and monitor.
    WarningThreshold double
    The primary warning threshold of the service level objective.
    Id string
    A SLO ID to limit the search.
    MetricsQuery string
    Filter results based on SLO numerator and denominator.
    NameQuery string
    Filter results based on SLO names.
    TagsQuery string
    Filter results based on a single SLO tag.
    Description string
    The description of the service level objective.
    Name string
    Name of the Datadog service level objective
    Queries []GetServiceLevelObjectiveQuery
    The metric query of good / total events
    TargetThreshold float64
    The primary target threshold of the service level objective.
    Timeframe string
    The primary timeframe of the service level objective.
    Type string
    The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available values are: metric and monitor.
    WarningThreshold float64
    The primary warning threshold of the service level objective.
    Id string
    A SLO ID to limit the search.
    MetricsQuery string
    Filter results based on SLO numerator and denominator.
    NameQuery string
    Filter results based on SLO names.
    TagsQuery string
    Filter results based on a single SLO tag.
    description String
    The description of the service level objective.
    name String
    Name of the Datadog service level objective
    queries List<GetServiceLevelObjectiveQuery>
    The metric query of good / total events
    targetThreshold Double
    The primary target threshold of the service level objective.
    timeframe String
    The primary timeframe of the service level objective.
    type String
    The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available values are: metric and monitor.
    warningThreshold Double
    The primary warning threshold of the service level objective.
    id String
    A SLO ID to limit the search.
    metricsQuery String
    Filter results based on SLO numerator and denominator.
    nameQuery String
    Filter results based on SLO names.
    tagsQuery String
    Filter results based on a single SLO tag.
    description string
    The description of the service level objective.
    name string
    Name of the Datadog service level objective
    queries GetServiceLevelObjectiveQuery[]
    The metric query of good / total events
    targetThreshold number
    The primary target threshold of the service level objective.
    timeframe string
    The primary timeframe of the service level objective.
    type string
    The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available values are: metric and monitor.
    warningThreshold number
    The primary warning threshold of the service level objective.
    id string
    A SLO ID to limit the search.
    metricsQuery string
    Filter results based on SLO numerator and denominator.
    nameQuery string
    Filter results based on SLO names.
    tagsQuery string
    Filter results based on a single SLO tag.
    description str
    The description of the service level objective.
    name str
    Name of the Datadog service level objective
    queries Sequence[GetServiceLevelObjectiveQuery]
    The metric query of good / total events
    target_threshold float
    The primary target threshold of the service level objective.
    timeframe str
    The primary timeframe of the service level objective.
    type str
    The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available values are: metric and monitor.
    warning_threshold float
    The primary warning threshold of the service level objective.
    id str
    A SLO ID to limit the search.
    metrics_query str
    Filter results based on SLO numerator and denominator.
    name_query str
    Filter results based on SLO names.
    tags_query str
    Filter results based on a single SLO tag.
    description String
    The description of the service level objective.
    name String
    Name of the Datadog service level objective
    queries List<Property Map>
    The metric query of good / total events
    targetThreshold Number
    The primary target threshold of the service level objective.
    timeframe String
    The primary timeframe of the service level objective.
    type String
    The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Available values are: metric and monitor.
    warningThreshold Number
    The primary warning threshold of the service level objective.
    id String
    A SLO ID to limit the search.
    metricsQuery String
    Filter results based on SLO numerator and denominator.
    nameQuery String
    Filter results based on SLO names.
    tagsQuery String
    Filter results based on a single SLO tag.

    Supporting Types

    GetServiceLevelObjectiveQuery

    Denominator string
    The sum of the total events.
    Numerator string
    The sum of all the good events.
    Denominator string
    The sum of the total events.
    Numerator string
    The sum of all the good events.
    denominator String
    The sum of the total events.
    numerator String
    The sum of all the good events.
    denominator string
    The sum of the total events.
    numerator string
    The sum of all the good events.
    denominator str
    The sum of the total events.
    numerator str
    The sum of all the good events.
    denominator String
    The sum of the total events.
    numerator String
    The sum of all the good events.

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the datadog Terraform Provider.
    datadog logo
    Datadog v4.27.0 published on Thursday, Mar 14, 2024 by Pulumi