1. Packages
  2. Harness Provider
  3. API Docs
  4. getTrigger
Harness v0.4.4 published on Tuesday, Nov 12, 2024 by Pulumi

harness.getTrigger

Explore with Pulumi AI

harness logo
Harness v0.4.4 published on Tuesday, Nov 12, 2024 by Pulumi

    Data source for retrieving a Harness trigger.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const exampleByName = harness.getTrigger({
        appId: "app_id",
        name: "name",
    });
    const exampleById = harness.getTrigger({
        id: "trigger_id",
    });
    
    import pulumi
    import pulumi_harness as harness
    
    example_by_name = harness.get_trigger(app_id="app_id",
        name="name")
    example_by_id = harness.get_trigger(id="trigger_id")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-harness/sdk/go/harness"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := harness.GetTrigger(ctx, &harness.GetTriggerArgs{
    			AppId: pulumi.StringRef("app_id"),
    			Name:  pulumi.StringRef("name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = harness.GetTrigger(ctx, &harness.GetTriggerArgs{
    			Id: pulumi.StringRef("trigger_id"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Harness = Pulumi.Harness;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleByName = Harness.GetTrigger.Invoke(new()
        {
            AppId = "app_id",
            Name = "name",
        });
    
        var exampleById = Harness.GetTrigger.Invoke(new()
        {
            Id = "trigger_id",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.HarnessFunctions;
    import com.pulumi.harness.inputs.GetTriggerArgs;
    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 exampleByName = HarnessFunctions.getTrigger(GetTriggerArgs.builder()
                .appId("app_id")
                .name("name")
                .build());
    
            final var exampleById = HarnessFunctions.getTrigger(GetTriggerArgs.builder()
                .id("trigger_id")
                .build());
    
        }
    }
    
    variables:
      exampleByName:
        fn::invoke:
          Function: harness:getTrigger
          Arguments:
            appId: app_id
            name: name
      exampleById:
        fn::invoke:
          Function: harness:getTrigger
          Arguments:
            id: trigger_id
    

    Using getTrigger

    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 getTrigger(args: GetTriggerArgs, opts?: InvokeOptions): Promise<GetTriggerResult>
    function getTriggerOutput(args: GetTriggerOutputArgs, opts?: InvokeOptions): Output<GetTriggerResult>
    def get_trigger(app_id: Optional[str] = None,
                    description: Optional[str] = None,
                    id: Optional[str] = None,
                    name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetTriggerResult
    def get_trigger_output(app_id: Optional[pulumi.Input[str]] = None,
                    description: Optional[pulumi.Input[str]] = None,
                    id: Optional[pulumi.Input[str]] = None,
                    name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetTriggerResult]
    func GetTrigger(ctx *Context, args *GetTriggerArgs, opts ...InvokeOption) (*GetTriggerResult, error)
    func GetTriggerOutput(ctx *Context, args *GetTriggerOutputArgs, opts ...InvokeOption) GetTriggerResultOutput

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

    public static class GetTrigger 
    {
        public static Task<GetTriggerResult> InvokeAsync(GetTriggerArgs args, InvokeOptions? opts = null)
        public static Output<GetTriggerResult> Invoke(GetTriggerInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTriggerResult> getTrigger(GetTriggerArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: harness:index/getTrigger:getTrigger
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AppId string
    The id of the application.
    Description string
    The trigger description.
    Id string
    Unique identifier of the trigger.
    Name string
    The name of the trigger.
    AppId string
    The id of the application.
    Description string
    The trigger description.
    Id string
    Unique identifier of the trigger.
    Name string
    The name of the trigger.
    appId String
    The id of the application.
    description String
    The trigger description.
    id String
    Unique identifier of the trigger.
    name String
    The name of the trigger.
    appId string
    The id of the application.
    description string
    The trigger description.
    id string
    Unique identifier of the trigger.
    name string
    The name of the trigger.
    app_id str
    The id of the application.
    description str
    The trigger description.
    id str
    Unique identifier of the trigger.
    name str
    The name of the trigger.
    appId String
    The id of the application.
    description String
    The trigger description.
    id String
    Unique identifier of the trigger.
    name String
    The name of the trigger.

    getTrigger Result

    The following output properties are available:

    Conditions List<GetTriggerCondition>
    The condition that will execute the Trigger: On new artifact, On pipeline completion, On Cron schedule, On webhook, On New Manifest.
    AppId string
    The id of the application.
    Description string
    The trigger description.
    Id string
    Unique identifier of the trigger.
    Name string
    The name of the trigger.
    Conditions []GetTriggerCondition
    The condition that will execute the Trigger: On new artifact, On pipeline completion, On Cron schedule, On webhook, On New Manifest.
    AppId string
    The id of the application.
    Description string
    The trigger description.
    Id string
    Unique identifier of the trigger.
    Name string
    The name of the trigger.
    conditions List<GetTriggerCondition>
    The condition that will execute the Trigger: On new artifact, On pipeline completion, On Cron schedule, On webhook, On New Manifest.
    appId String
    The id of the application.
    description String
    The trigger description.
    id String
    Unique identifier of the trigger.
    name String
    The name of the trigger.
    conditions GetTriggerCondition[]
    The condition that will execute the Trigger: On new artifact, On pipeline completion, On Cron schedule, On webhook, On New Manifest.
    appId string
    The id of the application.
    description string
    The trigger description.
    id string
    Unique identifier of the trigger.
    name string
    The name of the trigger.
    conditions Sequence[GetTriggerCondition]
    The condition that will execute the Trigger: On new artifact, On pipeline completion, On Cron schedule, On webhook, On New Manifest.
    app_id str
    The id of the application.
    description str
    The trigger description.
    id str
    Unique identifier of the trigger.
    name str
    The name of the trigger.
    conditions List<Property Map>
    The condition that will execute the Trigger: On new artifact, On pipeline completion, On Cron schedule, On webhook, On New Manifest.
    appId String
    The id of the application.
    description String
    The trigger description.
    id String
    Unique identifier of the trigger.
    name String
    The name of the trigger.

    Supporting Types

    GetTriggerCondition

    onWebhooks List<Property Map>
    On webhook.
    triggerConditionType String
    Trigger condition.

    GetTriggerConditionOnWebhook

    GetTriggerConditionOnWebhookWebhookDetail

    Header string
    Header.
    Method string
    Method.
    Payload string
    Payload.
    WebhookToken string
    Webhook token.
    WebhookUrl string
    Webhook URL.
    Header string
    Header.
    Method string
    Method.
    Payload string
    Payload.
    WebhookToken string
    Webhook token.
    WebhookUrl string
    Webhook URL.
    header String
    Header.
    method String
    Method.
    payload String
    Payload.
    webhookToken String
    Webhook token.
    webhookUrl String
    Webhook URL.
    header string
    Header.
    method string
    Method.
    payload string
    Payload.
    webhookToken string
    Webhook token.
    webhookUrl string
    Webhook URL.
    header str
    Header.
    method str
    Method.
    payload str
    Payload.
    webhook_token str
    Webhook token.
    webhook_url str
    Webhook URL.
    header String
    Header.
    method String
    Method.
    payload String
    Payload.
    webhookToken String
    Webhook token.
    webhookUrl String
    Webhook URL.

    Package Details

    Repository
    harness pulumi/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Harness v0.4.4 published on Tuesday, Nov 12, 2024 by Pulumi