1. Packages
  2. Pagerduty Provider
  3. API Docs
  4. getTeams
PagerDuty v4.22.1 published on Friday, Mar 21, 2025 by Pulumi

pagerduty.getTeams

Explore with Pulumi AI

PagerDuty v4.22.1 published on Friday, Mar 21, 2025 by Pulumi

Use this data source to list teams in your PagerDuty account.

Example Usage

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

const allTeams = pagerduty.getTeams({});
// Fetch only teams whose name matches "devops"
const devops = pagerduty.getTeams({
    query: "devops",
});
Copy
import pulumi
import pulumi_pagerduty as pagerduty

all_teams = pagerduty.get_teams()
# Fetch only teams whose name matches "devops"
devops = pagerduty.get_teams(query="devops")
Copy
package main

import (
	"github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := pagerduty.GetTeams(ctx, &pagerduty.GetTeamsArgs{}, nil)
		if err != nil {
			return err
		}
		// Fetch only teams whose name matches "devops"
		_, err = pagerduty.GetTeams(ctx, &pagerduty.GetTeamsArgs{
			Query: pulumi.StringRef("devops"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;

return await Deployment.RunAsync(() => 
{
    var allTeams = Pagerduty.GetTeams.Invoke();

    // Fetch only teams whose name matches "devops"
    var devops = Pagerduty.GetTeams.Invoke(new()
    {
        Query = "devops",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.pagerduty.PagerdutyFunctions;
import com.pulumi.pagerduty.inputs.GetTeamsArgs;
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 allTeams = PagerdutyFunctions.getTeams();

        // Fetch only teams whose name matches "devops"
        final var devops = PagerdutyFunctions.getTeams(GetTeamsArgs.builder()
            .query("devops")
            .build());

    }
}
Copy
variables:
  allTeams:
    fn::invoke:
      function: pagerduty:getTeams
      arguments: {}
  # Fetch only teams whose name matches "devops"
  devops:
    fn::invoke:
      function: pagerduty:getTeams
      arguments:
        query: devops
Copy

Using getTeams

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 getTeams(args: GetTeamsArgs, opts?: InvokeOptions): Promise<GetTeamsResult>
function getTeamsOutput(args: GetTeamsOutputArgs, opts?: InvokeOptions): Output<GetTeamsResult>
Copy
def get_teams(query: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetTeamsResult
def get_teams_output(query: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetTeamsResult]
Copy
func GetTeams(ctx *Context, args *GetTeamsArgs, opts ...InvokeOption) (*GetTeamsResult, error)
func GetTeamsOutput(ctx *Context, args *GetTeamsOutputArgs, opts ...InvokeOption) GetTeamsResultOutput
Copy

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

public static class GetTeams 
{
    public static Task<GetTeamsResult> InvokeAsync(GetTeamsArgs args, InvokeOptions? opts = null)
    public static Output<GetTeamsResult> Invoke(GetTeamsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTeamsResult> getTeams(GetTeamsArgs args, InvokeOptions options)
public static Output<GetTeamsResult> getTeams(GetTeamsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: pagerduty:index/getTeams:getTeams
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Query string
Filters the result, showing only the records whose name matches the query.
Query string
Filters the result, showing only the records whose name matches the query.
query String
Filters the result, showing only the records whose name matches the query.
query string
Filters the result, showing only the records whose name matches the query.
query str
Filters the result, showing only the records whose name matches the query.
query String
Filters the result, showing only the records whose name matches the query.

getTeams Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Teams List<GetTeamsTeam>
The teams found.
Query string
Id string
The provider-assigned unique ID for this managed resource.
Teams []GetTeamsTeam
The teams found.
Query string
id String
The provider-assigned unique ID for this managed resource.
teams List<GetTeamsTeam>
The teams found.
query String
id string
The provider-assigned unique ID for this managed resource.
teams GetTeamsTeam[]
The teams found.
query string
id str
The provider-assigned unique ID for this managed resource.
teams Sequence[GetTeamsTeam]
The teams found.
query str
id String
The provider-assigned unique ID for this managed resource.
teams List<Property Map>
The teams found.
query String

Supporting Types

GetTeamsTeam

Description This property is required. string
The description of the team.
Id This property is required. string
The ID of the team.
Name This property is required. string
The name of the team.
Summary This property is required. string
A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name, though it is not intended to be an identifier.
Description This property is required. string
The description of the team.
Id This property is required. string
The ID of the team.
Name This property is required. string
The name of the team.
Summary This property is required. string
A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name, though it is not intended to be an identifier.
description This property is required. String
The description of the team.
id This property is required. String
The ID of the team.
name This property is required. String
The name of the team.
summary This property is required. String
A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name, though it is not intended to be an identifier.
description This property is required. string
The description of the team.
id This property is required. string
The ID of the team.
name This property is required. string
The name of the team.
summary This property is required. string
A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name, though it is not intended to be an identifier.
description This property is required. str
The description of the team.
id This property is required. str
The ID of the team.
name This property is required. str
The name of the team.
summary This property is required. str
A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name, though it is not intended to be an identifier.
description This property is required. String
The description of the team.
id This property is required. String
The ID of the team.
name This property is required. String
The name of the team.
summary This property is required. String
A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name, though it is not intended to be an identifier.

Package Details

Repository
PagerDuty pulumi/pulumi-pagerduty
License
Apache-2.0
Notes
This Pulumi package is based on the pagerduty Terraform Provider.
PagerDuty v4.22.1 published on Friday, Mar 21, 2025 by Pulumi