1. Packages
  2. PagerDuty
  3. API Docs
  4. getService
PagerDuty v4.10.1 published on Wednesday, Mar 27, 2024 by Pulumi

pagerduty.getService

Explore with Pulumi AI

pagerduty logo
PagerDuty v4.10.1 published on Wednesday, Mar 27, 2024 by Pulumi

    Use this data source to get information about a specific service.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as pagerduty from "@pulumi/pagerduty";
    
    const exampleService = pagerduty.getService({
        name: "My Service",
    });
    const datadog = pagerduty.getVendor({
        name: "Datadog",
    });
    const exampleServiceIntegration = new pagerduty.ServiceIntegration("exampleServiceIntegration", {
        vendor: datadog.then(datadog => datadog.id),
        service: exampleService.then(exampleService => exampleService.id),
        type: "generic_events_api_inbound_integration",
    });
    
    import pulumi
    import pulumi_pagerduty as pagerduty
    
    example_service = pagerduty.get_service(name="My Service")
    datadog = pagerduty.get_vendor(name="Datadog")
    example_service_integration = pagerduty.ServiceIntegration("exampleServiceIntegration",
        vendor=datadog.id,
        service=example_service.id,
        type="generic_events_api_inbound_integration")
    
    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 {
    		exampleService, err := pagerduty.LookupService(ctx, &pagerduty.LookupServiceArgs{
    			Name: "My Service",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		datadog, err := pagerduty.GetVendor(ctx, &pagerduty.GetVendorArgs{
    			Name: "Datadog",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewServiceIntegration(ctx, "exampleServiceIntegration", &pagerduty.ServiceIntegrationArgs{
    			Vendor:  pulumi.String(datadog.Id),
    			Service: pulumi.String(exampleService.Id),
    			Type:    pulumi.String("generic_events_api_inbound_integration"),
    		})
    		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 exampleService = Pagerduty.GetService.Invoke(new()
        {
            Name = "My Service",
        });
    
        var datadog = Pagerduty.GetVendor.Invoke(new()
        {
            Name = "Datadog",
        });
    
        var exampleServiceIntegration = new Pagerduty.ServiceIntegration("exampleServiceIntegration", new()
        {
            Vendor = datadog.Apply(getVendorResult => getVendorResult.Id),
            Service = exampleService.Apply(getServiceResult => getServiceResult.Id),
            Type = "generic_events_api_inbound_integration",
        });
    
    });
    
    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.GetServiceArgs;
    import com.pulumi.pagerduty.inputs.GetVendorArgs;
    import com.pulumi.pagerduty.ServiceIntegration;
    import com.pulumi.pagerduty.ServiceIntegrationArgs;
    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 exampleService = PagerdutyFunctions.getService(GetServiceArgs.builder()
                .name("My Service")
                .build());
    
            final var datadog = PagerdutyFunctions.getVendor(GetVendorArgs.builder()
                .name("Datadog")
                .build());
    
            var exampleServiceIntegration = new ServiceIntegration("exampleServiceIntegration", ServiceIntegrationArgs.builder()        
                .vendor(datadog.applyValue(getVendorResult -> getVendorResult.id()))
                .service(exampleService.applyValue(getServiceResult -> getServiceResult.id()))
                .type("generic_events_api_inbound_integration")
                .build());
    
        }
    }
    
    resources:
      exampleServiceIntegration:
        type: pagerduty:ServiceIntegration
        properties:
          vendor: ${datadog.id}
          service: ${exampleService.id}
          type: generic_events_api_inbound_integration
    variables:
      exampleService:
        fn::invoke:
          Function: pagerduty:getService
          Arguments:
            name: My Service
      datadog:
        fn::invoke:
          Function: pagerduty:getVendor
          Arguments:
            name: Datadog
    

    Using getService

    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 getService(args: GetServiceArgs, opts?: InvokeOptions): Promise<GetServiceResult>
    function getServiceOutput(args: GetServiceOutputArgs, opts?: InvokeOptions): Output<GetServiceResult>
    def get_service(name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetServiceResult
    def get_service_output(name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetServiceResult]
    func LookupService(ctx *Context, args *LookupServiceArgs, opts ...InvokeOption) (*LookupServiceResult, error)
    func LookupServiceOutput(ctx *Context, args *LookupServiceOutputArgs, opts ...InvokeOption) LookupServiceResultOutput

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

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

    The following arguments are supported:

    Name string
    The service name to use to find a service in the PagerDuty API.
    Name string
    The service name to use to find a service in the PagerDuty API.
    name String
    The service name to use to find a service in the PagerDuty API.
    name string
    The service name to use to find a service in the PagerDuty API.
    name str
    The service name to use to find a service in the PagerDuty API.
    name String
    The service name to use to find a service in the PagerDuty API.

    getService Result

    The following output properties are available:

    AcknowledgementTimeout int
    Time in seconds that an incident changes to the Triggered State after being Acknowledged. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    AlertCreation string
    Whether a service creates only incidents, or both alerts and incidents. A service must create alerts in order to enable incident merging.
    AutoResolveTimeout int
    Time in seconds that an incident is automatically resolved if left open for that long. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    Description string
    The user-provided description of the service.
    EscalationPolicy string
    The escalation policy associated with this service.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The short name of the found service.
    Teams List<GetServiceTeam>
    The set of teams associated with the service.
    Type string
    The type of object. The value returned will be service. Can be used for passing to a service dependency.
    AcknowledgementTimeout int
    Time in seconds that an incident changes to the Triggered State after being Acknowledged. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    AlertCreation string
    Whether a service creates only incidents, or both alerts and incidents. A service must create alerts in order to enable incident merging.
    AutoResolveTimeout int
    Time in seconds that an incident is automatically resolved if left open for that long. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    Description string
    The user-provided description of the service.
    EscalationPolicy string
    The escalation policy associated with this service.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The short name of the found service.
    Teams []GetServiceTeam
    The set of teams associated with the service.
    Type string
    The type of object. The value returned will be service. Can be used for passing to a service dependency.
    acknowledgementTimeout Integer
    Time in seconds that an incident changes to the Triggered State after being Acknowledged. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    alertCreation String
    Whether a service creates only incidents, or both alerts and incidents. A service must create alerts in order to enable incident merging.
    autoResolveTimeout Integer
    Time in seconds that an incident is automatically resolved if left open for that long. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    description String
    The user-provided description of the service.
    escalationPolicy String
    The escalation policy associated with this service.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The short name of the found service.
    teams List<GetServiceTeam>
    The set of teams associated with the service.
    type String
    The type of object. The value returned will be service. Can be used for passing to a service dependency.
    acknowledgementTimeout number
    Time in seconds that an incident changes to the Triggered State after being Acknowledged. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    alertCreation string
    Whether a service creates only incidents, or both alerts and incidents. A service must create alerts in order to enable incident merging.
    autoResolveTimeout number
    Time in seconds that an incident is automatically resolved if left open for that long. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    description string
    The user-provided description of the service.
    escalationPolicy string
    The escalation policy associated with this service.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The short name of the found service.
    teams GetServiceTeam[]
    The set of teams associated with the service.
    type string
    The type of object. The value returned will be service. Can be used for passing to a service dependency.
    acknowledgement_timeout int
    Time in seconds that an incident changes to the Triggered State after being Acknowledged. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    alert_creation str
    Whether a service creates only incidents, or both alerts and incidents. A service must create alerts in order to enable incident merging.
    auto_resolve_timeout int
    Time in seconds that an incident is automatically resolved if left open for that long. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    description str
    The user-provided description of the service.
    escalation_policy str
    The escalation policy associated with this service.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The short name of the found service.
    teams Sequence[GetServiceTeam]
    The set of teams associated with the service.
    type str
    The type of object. The value returned will be service. Can be used for passing to a service dependency.
    acknowledgementTimeout Number
    Time in seconds that an incident changes to the Triggered State after being Acknowledged. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    alertCreation String
    Whether a service creates only incidents, or both alerts and incidents. A service must create alerts in order to enable incident merging.
    autoResolveTimeout Number
    Time in seconds that an incident is automatically resolved if left open for that long. Value is null if the feature is disabled. Value must not be negative. Setting this field to 0, null (or unset) will disable the feature.
    description String
    The user-provided description of the service.
    escalationPolicy String
    The escalation policy associated with this service.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The short name of the found service.
    teams List<Property Map>
    The set of teams associated with the service.
    type String
    The type of object. The value returned will be service. Can be used for passing to a service dependency.

    Supporting Types

    GetServiceTeam

    Id string
    The ID of the found service.
    Name string
    The service name to use to find a service in the PagerDuty API.
    Id string
    The ID of the found service.
    Name string
    The service name to use to find a service in the PagerDuty API.
    id String
    The ID of the found service.
    name String
    The service name to use to find a service in the PagerDuty API.
    id string
    The ID of the found service.
    name string
    The service name to use to find a service in the PagerDuty API.
    id str
    The ID of the found service.
    name str
    The service name to use to find a service in the PagerDuty API.
    id String
    The ID of the found service.
    name String
    The service name to use to find a service in the PagerDuty API.

    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.10.1 published on Wednesday, Mar 27, 2024 by Pulumi