1. Packages
  2. PagerDuty
  3. API Docs
  4. getExtensionSchema
PagerDuty v4.12.3 published on Tuesday, May 21, 2024 by Pulumi

pagerduty.getExtensionSchema

Explore with Pulumi AI

pagerduty logo
PagerDuty v4.12.3 published on Tuesday, May 21, 2024 by Pulumi

    Use this data source to get information about a specific extension vendor that you can use for a service (e.g: Slack, Generic Webhook, ServiceNow).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as pagerduty from "@pulumi/pagerduty";
    
    const webhook = pagerduty.getExtensionSchema({
        name: "Generic V2 Webhook",
    });
    const example = new pagerduty.User("example", {
        name: "Howard James",
        email: "howard.james@example.domain",
        teams: [examplePagerdutyTeam.id],
    });
    const foo = new pagerduty.EscalationPolicy("foo", {
        name: "Engineering Escalation Policy",
        numLoops: 2,
        rules: [{
            escalationDelayInMinutes: 10,
            targets: [{
                type: "user",
                id: example.id,
            }],
        }],
    });
    const exampleService = new pagerduty.Service("example", {
        name: "My Web App",
        autoResolveTimeout: "14400",
        acknowledgementTimeout: "600",
        escalationPolicy: examplePagerdutyEscalationPolicy.id,
    });
    const slack = new pagerduty.Extension("slack", {
        name: "My Web App Extension",
        endpointUrl: "https://generic_webhook_url/XXXXXX/BBBBBB",
        extensionSchema: webhook.then(webhook => webhook.id),
        extensionObjects: [exampleService.id],
    });
    
    import pulumi
    import pulumi_pagerduty as pagerduty
    
    webhook = pagerduty.get_extension_schema(name="Generic V2 Webhook")
    example = pagerduty.User("example",
        name="Howard James",
        email="howard.james@example.domain",
        teams=[example_pagerduty_team["id"]])
    foo = pagerduty.EscalationPolicy("foo",
        name="Engineering Escalation Policy",
        num_loops=2,
        rules=[pagerduty.EscalationPolicyRuleArgs(
            escalation_delay_in_minutes=10,
            targets=[pagerduty.EscalationPolicyRuleTargetArgs(
                type="user",
                id=example.id,
            )],
        )])
    example_service = pagerduty.Service("example",
        name="My Web App",
        auto_resolve_timeout="14400",
        acknowledgement_timeout="600",
        escalation_policy=example_pagerduty_escalation_policy["id"])
    slack = pagerduty.Extension("slack",
        name="My Web App Extension",
        endpoint_url="https://generic_webhook_url/XXXXXX/BBBBBB",
        extension_schema=webhook.id,
        extension_objects=[example_service.id])
    
    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 {
    		webhook, err := pagerduty.GetExtensionSchema(ctx, &pagerduty.GetExtensionSchemaArgs{
    			Name: "Generic V2 Webhook",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		example, err := pagerduty.NewUser(ctx, "example", &pagerduty.UserArgs{
    			Name:  pulumi.String("Howard James"),
    			Email: pulumi.String("howard.james@example.domain"),
    			Teams: pulumi.StringArray{
    				examplePagerdutyTeam.Id,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewEscalationPolicy(ctx, "foo", &pagerduty.EscalationPolicyArgs{
    			Name:     pulumi.String("Engineering Escalation Policy"),
    			NumLoops: pulumi.Int(2),
    			Rules: pagerduty.EscalationPolicyRuleArray{
    				&pagerduty.EscalationPolicyRuleArgs{
    					EscalationDelayInMinutes: pulumi.Int(10),
    					Targets: pagerduty.EscalationPolicyRuleTargetArray{
    						&pagerduty.EscalationPolicyRuleTargetArgs{
    							Type: pulumi.String("user"),
    							Id:   example.ID(),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleService, err := pagerduty.NewService(ctx, "example", &pagerduty.ServiceArgs{
    			Name:                   pulumi.String("My Web App"),
    			AutoResolveTimeout:     pulumi.String("14400"),
    			AcknowledgementTimeout: pulumi.String("600"),
    			EscalationPolicy:       pulumi.Any(examplePagerdutyEscalationPolicy.Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewExtension(ctx, "slack", &pagerduty.ExtensionArgs{
    			Name:            pulumi.String("My Web App Extension"),
    			EndpointUrl:     pulumi.String("https://generic_webhook_url/XXXXXX/BBBBBB"),
    			ExtensionSchema: pulumi.String(webhook.Id),
    			ExtensionObjects: pulumi.StringArray{
    				exampleService.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Pagerduty = Pulumi.Pagerduty;
    
    return await Deployment.RunAsync(() => 
    {
        var webhook = Pagerduty.GetExtensionSchema.Invoke(new()
        {
            Name = "Generic V2 Webhook",
        });
    
        var example = new Pagerduty.User("example", new()
        {
            Name = "Howard James",
            Email = "howard.james@example.domain",
            Teams = new[]
            {
                examplePagerdutyTeam.Id,
            },
        });
    
        var foo = new Pagerduty.EscalationPolicy("foo", new()
        {
            Name = "Engineering Escalation Policy",
            NumLoops = 2,
            Rules = new[]
            {
                new Pagerduty.Inputs.EscalationPolicyRuleArgs
                {
                    EscalationDelayInMinutes = 10,
                    Targets = new[]
                    {
                        new Pagerduty.Inputs.EscalationPolicyRuleTargetArgs
                        {
                            Type = "user",
                            Id = example.Id,
                        },
                    },
                },
            },
        });
    
        var exampleService = new Pagerduty.Service("example", new()
        {
            Name = "My Web App",
            AutoResolveTimeout = "14400",
            AcknowledgementTimeout = "600",
            EscalationPolicy = examplePagerdutyEscalationPolicy.Id,
        });
    
        var slack = new Pagerduty.Extension("slack", new()
        {
            Name = "My Web App Extension",
            EndpointUrl = "https://generic_webhook_url/XXXXXX/BBBBBB",
            ExtensionSchema = webhook.Apply(getExtensionSchemaResult => getExtensionSchemaResult.Id),
            ExtensionObjects = new[]
            {
                exampleService.Id,
            },
        });
    
    });
    
    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.GetExtensionSchemaArgs;
    import com.pulumi.pagerduty.User;
    import com.pulumi.pagerduty.UserArgs;
    import com.pulumi.pagerduty.EscalationPolicy;
    import com.pulumi.pagerduty.EscalationPolicyArgs;
    import com.pulumi.pagerduty.inputs.EscalationPolicyRuleArgs;
    import com.pulumi.pagerduty.Service;
    import com.pulumi.pagerduty.ServiceArgs;
    import com.pulumi.pagerduty.Extension;
    import com.pulumi.pagerduty.ExtensionArgs;
    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 webhook = PagerdutyFunctions.getExtensionSchema(GetExtensionSchemaArgs.builder()
                .name("Generic V2 Webhook")
                .build());
    
            var example = new User("example", UserArgs.builder()        
                .name("Howard James")
                .email("howard.james@example.domain")
                .teams(examplePagerdutyTeam.id())
                .build());
    
            var foo = new EscalationPolicy("foo", EscalationPolicyArgs.builder()        
                .name("Engineering Escalation Policy")
                .numLoops(2)
                .rules(EscalationPolicyRuleArgs.builder()
                    .escalationDelayInMinutes(10)
                    .targets(EscalationPolicyRuleTargetArgs.builder()
                        .type("user")
                        .id(example.id())
                        .build())
                    .build())
                .build());
    
            var exampleService = new Service("exampleService", ServiceArgs.builder()        
                .name("My Web App")
                .autoResolveTimeout(14400)
                .acknowledgementTimeout(600)
                .escalationPolicy(examplePagerdutyEscalationPolicy.id())
                .build());
    
            var slack = new Extension("slack", ExtensionArgs.builder()        
                .name("My Web App Extension")
                .endpointUrl("https://generic_webhook_url/XXXXXX/BBBBBB")
                .extensionSchema(webhook.applyValue(getExtensionSchemaResult -> getExtensionSchemaResult.id()))
                .extensionObjects(exampleService.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: pagerduty:User
        properties:
          name: Howard James
          email: howard.james@example.domain
          teams:
            - ${examplePagerdutyTeam.id}
      foo:
        type: pagerduty:EscalationPolicy
        properties:
          name: Engineering Escalation Policy
          numLoops: 2
          rules:
            - escalationDelayInMinutes: 10
              targets:
                - type: user
                  id: ${example.id}
      exampleService:
        type: pagerduty:Service
        name: example
        properties:
          name: My Web App
          autoResolveTimeout: 14400
          acknowledgementTimeout: 600
          escalationPolicy: ${examplePagerdutyEscalationPolicy.id}
      slack:
        type: pagerduty:Extension
        properties:
          name: My Web App Extension
          endpointUrl: https://generic_webhook_url/XXXXXX/BBBBBB
          extensionSchema: ${webhook.id}
          extensionObjects:
            - ${exampleService.id}
    variables:
      webhook:
        fn::invoke:
          Function: pagerduty:getExtensionSchema
          Arguments:
            name: Generic V2 Webhook
    

    Using getExtensionSchema

    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 getExtensionSchema(args: GetExtensionSchemaArgs, opts?: InvokeOptions): Promise<GetExtensionSchemaResult>
    function getExtensionSchemaOutput(args: GetExtensionSchemaOutputArgs, opts?: InvokeOptions): Output<GetExtensionSchemaResult>
    def get_extension_schema(name: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetExtensionSchemaResult
    def get_extension_schema_output(name: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetExtensionSchemaResult]
    func GetExtensionSchema(ctx *Context, args *GetExtensionSchemaArgs, opts ...InvokeOption) (*GetExtensionSchemaResult, error)
    func GetExtensionSchemaOutput(ctx *Context, args *GetExtensionSchemaOutputArgs, opts ...InvokeOption) GetExtensionSchemaResultOutput

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

    public static class GetExtensionSchema 
    {
        public static Task<GetExtensionSchemaResult> InvokeAsync(GetExtensionSchemaArgs args, InvokeOptions? opts = null)
        public static Output<GetExtensionSchemaResult> Invoke(GetExtensionSchemaInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetExtensionSchemaResult> getExtensionSchema(GetExtensionSchemaArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: pagerduty:index/getExtensionSchema:getExtensionSchema
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The extension name to use to find an extension vendor in the PagerDuty API.
    Name string
    The extension name to use to find an extension vendor in the PagerDuty API.
    name String
    The extension name to use to find an extension vendor in the PagerDuty API.
    name string
    The extension name to use to find an extension vendor in the PagerDuty API.
    name str
    The extension name to use to find an extension vendor in the PagerDuty API.
    name String
    The extension name to use to find an extension vendor in the PagerDuty API.

    getExtensionSchema Result

    The following output properties are available:

    Id string
    The ID of the found extension vendor.
    Name string
    The short name of the found extension vendor.
    Type string
    The generic service type for this extension vendor.
    Id string
    The ID of the found extension vendor.
    Name string
    The short name of the found extension vendor.
    Type string
    The generic service type for this extension vendor.
    id String
    The ID of the found extension vendor.
    name String
    The short name of the found extension vendor.
    type String
    The generic service type for this extension vendor.
    id string
    The ID of the found extension vendor.
    name string
    The short name of the found extension vendor.
    type string
    The generic service type for this extension vendor.
    id str
    The ID of the found extension vendor.
    name str
    The short name of the found extension vendor.
    type str
    The generic service type for this extension vendor.
    id String
    The ID of the found extension vendor.
    name String
    The short name of the found extension vendor.
    type String
    The generic service type for this extension vendor.

    Package Details

    Repository
    PagerDuty pulumi/pulumi-pagerduty
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the pagerduty Terraform Provider.
    pagerduty logo
    PagerDuty v4.12.3 published on Tuesday, May 21, 2024 by Pulumi