1. Packages
  2. Datadog Provider
  3. API Docs
  4. getServiceLevelObjectives
Datadog v4.49.0 published on Thursday, Apr 17, 2025 by Pulumi

datadog.getServiceLevelObjectives

Explore with Pulumi AI

Use this data source to retrieve information about multiple SLOs for use in other resources.

Example Usage

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

const ftFooSlos = datadog.getServiceLevelObjectives({
    tagsQuery: "owner:ft-foo",
});
Copy
import pulumi
import pulumi_datadog as datadog

ft_foo_slos = datadog.get_service_level_objectives(tags_query="owner:ft-foo")
Copy
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.GetServiceLevelObjectives(ctx, &datadog.GetServiceLevelObjectivesArgs{
			TagsQuery: pulumi.StringRef("owner:ft-foo"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;

return await Deployment.RunAsync(() => 
{
    var ftFooSlos = Datadog.GetServiceLevelObjectives.Invoke(new()
    {
        TagsQuery = "owner:ft-foo",
    });

});
Copy
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.GetServiceLevelObjectivesArgs;
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 ftFooSlos = DatadogFunctions.getServiceLevelObjectives(GetServiceLevelObjectivesArgs.builder()
            .tagsQuery("owner:ft-foo")
            .build());

    }
}
Copy
variables:
  ftFooSlos:
    fn::invoke:
      function: datadog:getServiceLevelObjectives
      arguments:
        tagsQuery: owner:ft-foo
Copy

Using getServiceLevelObjectives

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 getServiceLevelObjectives(args: GetServiceLevelObjectivesArgs, opts?: InvokeOptions): Promise<GetServiceLevelObjectivesResult>
function getServiceLevelObjectivesOutput(args: GetServiceLevelObjectivesOutputArgs, opts?: InvokeOptions): Output<GetServiceLevelObjectivesResult>
Copy
def get_service_level_objectives(error_on_empty_result: Optional[bool] = None,
                                 ids: Optional[Sequence[str]] = None,
                                 metrics_query: Optional[str] = None,
                                 name_query: Optional[str] = None,
                                 query: Optional[str] = None,
                                 tags_query: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetServiceLevelObjectivesResult
def get_service_level_objectives_output(error_on_empty_result: Optional[pulumi.Input[bool]] = None,
                                 ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                 metrics_query: Optional[pulumi.Input[str]] = None,
                                 name_query: Optional[pulumi.Input[str]] = None,
                                 query: Optional[pulumi.Input[str]] = None,
                                 tags_query: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetServiceLevelObjectivesResult]
Copy
func GetServiceLevelObjectives(ctx *Context, args *GetServiceLevelObjectivesArgs, opts ...InvokeOption) (*GetServiceLevelObjectivesResult, error)
func GetServiceLevelObjectivesOutput(ctx *Context, args *GetServiceLevelObjectivesOutputArgs, opts ...InvokeOption) GetServiceLevelObjectivesResultOutput
Copy

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

public static class GetServiceLevelObjectives 
{
    public static Task<GetServiceLevelObjectivesResult> InvokeAsync(GetServiceLevelObjectivesArgs args, InvokeOptions? opts = null)
    public static Output<GetServiceLevelObjectivesResult> Invoke(GetServiceLevelObjectivesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetServiceLevelObjectivesResult> getServiceLevelObjectives(GetServiceLevelObjectivesArgs args, InvokeOptions options)
public static Output<GetServiceLevelObjectivesResult> getServiceLevelObjectives(GetServiceLevelObjectivesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: datadog:index/getServiceLevelObjectives:getServiceLevelObjectives
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ErrorOnEmptyResult bool
Throw an error if no results are found. Defaults to true.
Ids List<string>
An array of SLO IDs to limit the search.
MetricsQuery string
Filter results based on SLO numerator and denominator.
NameQuery string
Filter results based on SLO names.
Query string
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
TagsQuery string
Filter results based on a single SLO tag.
ErrorOnEmptyResult bool
Throw an error if no results are found. Defaults to true.
Ids []string
An array of SLO IDs to limit the search.
MetricsQuery string
Filter results based on SLO numerator and denominator.
NameQuery string
Filter results based on SLO names.
Query string
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
TagsQuery string
Filter results based on a single SLO tag.
errorOnEmptyResult Boolean
Throw an error if no results are found. Defaults to true.
ids List<String>
An array of SLO IDs to limit the search.
metricsQuery String
Filter results based on SLO numerator and denominator.
nameQuery String
Filter results based on SLO names.
query String
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
tagsQuery String
Filter results based on a single SLO tag.
errorOnEmptyResult boolean
Throw an error if no results are found. Defaults to true.
ids string[]
An array of SLO IDs to limit the search.
metricsQuery string
Filter results based on SLO numerator and denominator.
nameQuery string
Filter results based on SLO names.
query string
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
tagsQuery string
Filter results based on a single SLO tag.
error_on_empty_result bool
Throw an error if no results are found. Defaults to true.
ids Sequence[str]
An array of SLO IDs to limit the search.
metrics_query str
Filter results based on SLO numerator and denominator.
name_query str
Filter results based on SLO names.
query str
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
tags_query str
Filter results based on a single SLO tag.
errorOnEmptyResult Boolean
Throw an error if no results are found. Defaults to true.
ids List<String>
An array of SLO IDs to limit the search.
metricsQuery String
Filter results based on SLO numerator and denominator.
nameQuery String
Filter results based on SLO names.
query String
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
tagsQuery String
Filter results based on a single SLO tag.

getServiceLevelObjectives Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Slos List<GetServiceLevelObjectivesSlo>
List of SLOs
ErrorOnEmptyResult bool
Throw an error if no results are found. Defaults to true.
Ids List<string>
An array of SLO IDs to limit the search.
MetricsQuery string
Filter results based on SLO numerator and denominator.
NameQuery string
Filter results based on SLO names.
Query string
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
TagsQuery string
Filter results based on a single SLO tag.
Id string
The provider-assigned unique ID for this managed resource.
Slos []GetServiceLevelObjectivesSlo
List of SLOs
ErrorOnEmptyResult bool
Throw an error if no results are found. Defaults to true.
Ids []string
An array of SLO IDs to limit the search.
MetricsQuery string
Filter results based on SLO numerator and denominator.
NameQuery string
Filter results based on SLO names.
Query string
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
TagsQuery string
Filter results based on a single SLO tag.
id String
The provider-assigned unique ID for this managed resource.
slos List<GetServiceLevelObjectivesSlo>
List of SLOs
errorOnEmptyResult Boolean
Throw an error if no results are found. Defaults to true.
ids List<String>
An array of SLO IDs to limit the search.
metricsQuery String
Filter results based on SLO numerator and denominator.
nameQuery String
Filter results based on SLO names.
query String
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
tagsQuery String
Filter results based on a single SLO tag.
id string
The provider-assigned unique ID for this managed resource.
slos GetServiceLevelObjectivesSlo[]
List of SLOs
errorOnEmptyResult boolean
Throw an error if no results are found. Defaults to true.
ids string[]
An array of SLO IDs to limit the search.
metricsQuery string
Filter results based on SLO numerator and denominator.
nameQuery string
Filter results based on SLO names.
query string
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
tagsQuery string
Filter results based on a single SLO tag.
id str
The provider-assigned unique ID for this managed resource.
slos Sequence[GetServiceLevelObjectivesSlo]
List of SLOs
error_on_empty_result bool
Throw an error if no results are found. Defaults to true.
ids Sequence[str]
An array of SLO IDs to limit the search.
metrics_query str
Filter results based on SLO numerator and denominator.
name_query str
Filter results based on SLO names.
query str
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
tags_query str
Filter results based on a single SLO tag.
id String
The provider-assigned unique ID for this managed resource.
slos List<Property Map>
List of SLOs
errorOnEmptyResult Boolean
Throw an error if no results are found. Defaults to true.
ids List<String>
An array of SLO IDs to limit the search.
metricsQuery String
Filter results based on SLO numerator and denominator.
nameQuery String
Filter results based on SLO names.
query String
The query string to filter results based on SLO names. Some examples of queries include service:\n\n and \n\n.
tagsQuery String
Filter results based on a single SLO tag.

Supporting Types

GetServiceLevelObjectivesSlo

Id This property is required. string
ID of the Datadog service level objective
Name This property is required. string
Name of the Datadog service level objective
Type This property is required. 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 options to choose from are: metric and monitor.
Id This property is required. string
ID of the Datadog service level objective
Name This property is required. string
Name of the Datadog service level objective
Type This property is required. 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 options to choose from are: metric and monitor.
id This property is required. String
ID of the Datadog service level objective
name This property is required. String
Name of the Datadog service level objective
type This property is required. 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 options to choose from are: metric and monitor.
id This property is required. string
ID of the Datadog service level objective
name This property is required. string
Name of the Datadog service level objective
type This property is required. 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 options to choose from are: metric and monitor.
id This property is required. str
ID of the Datadog service level objective
name This property is required. str
Name of the Datadog service level objective
type This property is required. 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 options to choose from are: metric and monitor.
id This property is required. String
ID of the Datadog service level objective
name This property is required. String
Name of the Datadog service level objective
type This property is required. 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 options to choose from are: metric and monitor.

Package Details

Repository
Datadog pulumi/pulumi-datadog
License
Apache-2.0
Notes
This Pulumi package is based on the datadog Terraform Provider.