-
Notifications
You must be signed in to change notification settings - Fork 2
/
getService.go
69 lines (64 loc) · 1.99 KB
/
getService.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package pagerduty
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Use this data source to get information about a specific [service](https://api-reference.pagerduty.com/#!/Services/get_services).
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-pagerduty/sdk/go/pagerduty"
// "github.com/pulumi/pulumi/sdk/v2/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
// })
// }
// ```
func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) {
var rv LookupServiceResult
err := ctx.Invoke("pagerduty:index/getService:getService", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getService.
type LookupServiceArgs struct {
// The service name to use to find a service in the PagerDuty API.
Name string `pulumi:"name"`
}
// A collection of values returned by getService.
type LookupServiceResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The short name of the found service.
Name string `pulumi:"name"`
}