routing

package
v0.0.0-...-245676f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rules

type Rules struct {
	pulumi.CustomResourceState

	Rules RulesRuleArrayOutput `pulumi:"rules"`
	// Service id.
	ServiceId pulumi.StringOutput `pulumi:"serviceId"`
	// Team id.
	TeamId pulumi.StringOutput `pulumi:"teamId"`
}

[Routing rules](https://support.squadcast.com/docs/alert-routing) allows you to ensure that alerts are routed to the right responder with the help of `event tags` attached to them.

## Example Usage

```go package main

import (

"github.com/IrisDande/pulumi-squadcast/sdk/go/squadcast"
"github.com/IrisDande/pulumi-squadcast/sdk/go/squadcast/routing"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleTeam, err := squadcast.LookupTeam(ctx, &squadcast.LookupTeamArgs{
			Name: "example team name",
		}, nil)
		if err != nil {
			return err
		}
		exampleUser, err := squadcast.LookupUser(ctx, &squadcast.LookupUserArgs{
			Email: "test@example.com",
		}, nil)
		if err != nil {
			return err
		}
		exampleService, err := squadcast.LookupService(ctx, &squadcast.LookupServiceArgs{
			Name:   "example service name",
			TeamId: exampleTeam.Id,
		}, nil)
		if err != nil {
			return err
		}
		exampleEscalaionPolicy, err := squadcast.LookupEscalationPolicy(ctx, &squadcast.LookupEscalationPolicyArgs{
			Name:   "example escalation policy name",
			TeamId: exampleTeam.Id,
		}, nil)
		if err != nil {
			return err
		}
		_, err = squadcast.LookupSquad(ctx, &squadcast.LookupSquadArgs{
			Name:   "example squad name",
			TeamId: exampleTeam.Id,
		}, nil)
		if err != nil {
			return err
		}
		_, err = routing.NewRules(ctx, "exampleRoutingRules", &routing.RulesArgs{
			TeamId:    pulumi.String(exampleTeam.Id),
			ServiceId: pulumi.String(exampleService.Id),
			Rules: routing.RulesRuleArray{
				&routing.RulesRuleArgs{
					IsBasic:     pulumi.Bool(false),
					Expression:  pulumi.String("payload[\"event_id\"] == 40"),
					RouteToId:   pulumi.String(exampleEscalaionPolicy.Id),
					RouteToType: pulumi.String("escalationpolicy"),
				},
				&routing.RulesRuleArgs{
					IsBasic: pulumi.Bool(true),
					BasicExpressions: routing.RulesRuleBasicExpressionArray{
						&routing.RulesRuleBasicExpressionArgs{
							Lhs: pulumi.String("payload[\"foo\"]"),
							Rhs: pulumi.String("bar"),
						},
					},
					RouteToId:   pulumi.String(exampleUser.Id),
					RouteToType: pulumi.String("user"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

teamID:serviceID

Use 'Get All Teams' and 'Get All Services' APIs to get the id of the team and service respectively

```sh $ pulumi import squadcast:routing/rules:Rules test 62d2fe23a57381088224d726:62da76c088f407f9ca756ca5 ```

func GetRules

func GetRules(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *RulesState, opts ...pulumi.ResourceOption) (*Rules, error)

GetRules gets an existing Rules resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewRules

func NewRules(ctx *pulumi.Context,
	name string, args *RulesArgs, opts ...pulumi.ResourceOption) (*Rules, error)

NewRules registers a new resource with the given unique name, arguments, and options.

func (*Rules) ElementType

func (*Rules) ElementType() reflect.Type

func (*Rules) ToRulesOutput

func (i *Rules) ToRulesOutput() RulesOutput

func (*Rules) ToRulesOutputWithContext

func (i *Rules) ToRulesOutputWithContext(ctx context.Context) RulesOutput

type RulesArgs

type RulesArgs struct {
	Rules RulesRuleArrayInput
	// Service id.
	ServiceId pulumi.StringInput
	// Team id.
	TeamId pulumi.StringInput
}

The set of arguments for constructing a Rules resource.

func (RulesArgs) ElementType

func (RulesArgs) ElementType() reflect.Type

type RulesArray

type RulesArray []RulesInput

func (RulesArray) ElementType

func (RulesArray) ElementType() reflect.Type

func (RulesArray) ToRulesArrayOutput

func (i RulesArray) ToRulesArrayOutput() RulesArrayOutput

func (RulesArray) ToRulesArrayOutputWithContext

func (i RulesArray) ToRulesArrayOutputWithContext(ctx context.Context) RulesArrayOutput

type RulesArrayInput

type RulesArrayInput interface {
	pulumi.Input

	ToRulesArrayOutput() RulesArrayOutput
	ToRulesArrayOutputWithContext(context.Context) RulesArrayOutput
}

RulesArrayInput is an input type that accepts RulesArray and RulesArrayOutput values. You can construct a concrete instance of `RulesArrayInput` via:

RulesArray{ RulesArgs{...} }

type RulesArrayOutput

type RulesArrayOutput struct{ *pulumi.OutputState }

func (RulesArrayOutput) ElementType

func (RulesArrayOutput) ElementType() reflect.Type

func (RulesArrayOutput) Index

func (RulesArrayOutput) ToRulesArrayOutput

func (o RulesArrayOutput) ToRulesArrayOutput() RulesArrayOutput

func (RulesArrayOutput) ToRulesArrayOutputWithContext

func (o RulesArrayOutput) ToRulesArrayOutputWithContext(ctx context.Context) RulesArrayOutput

type RulesInput

type RulesInput interface {
	pulumi.Input

	ToRulesOutput() RulesOutput
	ToRulesOutputWithContext(ctx context.Context) RulesOutput
}

type RulesMap

type RulesMap map[string]RulesInput

func (RulesMap) ElementType

func (RulesMap) ElementType() reflect.Type

func (RulesMap) ToRulesMapOutput

func (i RulesMap) ToRulesMapOutput() RulesMapOutput

func (RulesMap) ToRulesMapOutputWithContext

func (i RulesMap) ToRulesMapOutputWithContext(ctx context.Context) RulesMapOutput

type RulesMapInput

type RulesMapInput interface {
	pulumi.Input

	ToRulesMapOutput() RulesMapOutput
	ToRulesMapOutputWithContext(context.Context) RulesMapOutput
}

RulesMapInput is an input type that accepts RulesMap and RulesMapOutput values. You can construct a concrete instance of `RulesMapInput` via:

RulesMap{ "key": RulesArgs{...} }

type RulesMapOutput

type RulesMapOutput struct{ *pulumi.OutputState }

func (RulesMapOutput) ElementType

func (RulesMapOutput) ElementType() reflect.Type

func (RulesMapOutput) MapIndex

func (RulesMapOutput) ToRulesMapOutput

func (o RulesMapOutput) ToRulesMapOutput() RulesMapOutput

func (RulesMapOutput) ToRulesMapOutputWithContext

func (o RulesMapOutput) ToRulesMapOutputWithContext(ctx context.Context) RulesMapOutput

type RulesOutput

type RulesOutput struct{ *pulumi.OutputState }

func (RulesOutput) ElementType

func (RulesOutput) ElementType() reflect.Type

func (RulesOutput) Rules

func (RulesOutput) ServiceId

func (o RulesOutput) ServiceId() pulumi.StringOutput

Service id.

func (RulesOutput) TeamId

func (o RulesOutput) TeamId() pulumi.StringOutput

Team id.

func (RulesOutput) ToRulesOutput

func (o RulesOutput) ToRulesOutput() RulesOutput

func (RulesOutput) ToRulesOutputWithContext

func (o RulesOutput) ToRulesOutputWithContext(ctx context.Context) RulesOutput

type RulesRule

type RulesRule struct {
	// The basic expression which needs to be evaluated to be true for this rule to apply.
	BasicExpressions []RulesRuleBasicExpression `pulumi:"basicExpressions"`
	// The expression which needs to be evaluated to be true for this rule to apply.
	Expression *string `pulumi:"expression"`
	// is_basic will be true when users use the drop down selectors which will have lhs, op & rhs value, whereas it will be false when they use the advanced mode and it would have the expression for it's value
	IsBasic bool `pulumi:"isBasic"`
	// The id of the entity (user, escalation policy, squad) for which we are routing this incident.
	RouteToId string `pulumi:"routeToId"`
	// Type of the entity for which we are routing this incident - User, Escalation Policy or Squad
	RouteToType string `pulumi:"routeToType"`
}

type RulesRuleArgs

type RulesRuleArgs struct {
	// The basic expression which needs to be evaluated to be true for this rule to apply.
	BasicExpressions RulesRuleBasicExpressionArrayInput `pulumi:"basicExpressions"`
	// The expression which needs to be evaluated to be true for this rule to apply.
	Expression pulumi.StringPtrInput `pulumi:"expression"`
	// is_basic will be true when users use the drop down selectors which will have lhs, op & rhs value, whereas it will be false when they use the advanced mode and it would have the expression for it's value
	IsBasic pulumi.BoolInput `pulumi:"isBasic"`
	// The id of the entity (user, escalation policy, squad) for which we are routing this incident.
	RouteToId pulumi.StringInput `pulumi:"routeToId"`
	// Type of the entity for which we are routing this incident - User, Escalation Policy or Squad
	RouteToType pulumi.StringInput `pulumi:"routeToType"`
}

func (RulesRuleArgs) ElementType

func (RulesRuleArgs) ElementType() reflect.Type

func (RulesRuleArgs) ToRulesRuleOutput

func (i RulesRuleArgs) ToRulesRuleOutput() RulesRuleOutput

func (RulesRuleArgs) ToRulesRuleOutputWithContext

func (i RulesRuleArgs) ToRulesRuleOutputWithContext(ctx context.Context) RulesRuleOutput

type RulesRuleArray

type RulesRuleArray []RulesRuleInput

func (RulesRuleArray) ElementType

func (RulesRuleArray) ElementType() reflect.Type

func (RulesRuleArray) ToRulesRuleArrayOutput

func (i RulesRuleArray) ToRulesRuleArrayOutput() RulesRuleArrayOutput

func (RulesRuleArray) ToRulesRuleArrayOutputWithContext

func (i RulesRuleArray) ToRulesRuleArrayOutputWithContext(ctx context.Context) RulesRuleArrayOutput

type RulesRuleArrayInput

type RulesRuleArrayInput interface {
	pulumi.Input

	ToRulesRuleArrayOutput() RulesRuleArrayOutput
	ToRulesRuleArrayOutputWithContext(context.Context) RulesRuleArrayOutput
}

RulesRuleArrayInput is an input type that accepts RulesRuleArray and RulesRuleArrayOutput values. You can construct a concrete instance of `RulesRuleArrayInput` via:

RulesRuleArray{ RulesRuleArgs{...} }

type RulesRuleArrayOutput

type RulesRuleArrayOutput struct{ *pulumi.OutputState }

func (RulesRuleArrayOutput) ElementType

func (RulesRuleArrayOutput) ElementType() reflect.Type

func (RulesRuleArrayOutput) Index

func (RulesRuleArrayOutput) ToRulesRuleArrayOutput

func (o RulesRuleArrayOutput) ToRulesRuleArrayOutput() RulesRuleArrayOutput

func (RulesRuleArrayOutput) ToRulesRuleArrayOutputWithContext

func (o RulesRuleArrayOutput) ToRulesRuleArrayOutputWithContext(ctx context.Context) RulesRuleArrayOutput

type RulesRuleBasicExpression

type RulesRuleBasicExpression struct {
	// left hand side dropdown value
	Lhs string `pulumi:"lhs"`
	// right hand side value
	Rhs string `pulumi:"rhs"`
}

type RulesRuleBasicExpressionArgs

type RulesRuleBasicExpressionArgs struct {
	// left hand side dropdown value
	Lhs pulumi.StringInput `pulumi:"lhs"`
	// right hand side value
	Rhs pulumi.StringInput `pulumi:"rhs"`
}

func (RulesRuleBasicExpressionArgs) ElementType

func (RulesRuleBasicExpressionArgs) ToRulesRuleBasicExpressionOutput

func (i RulesRuleBasicExpressionArgs) ToRulesRuleBasicExpressionOutput() RulesRuleBasicExpressionOutput

func (RulesRuleBasicExpressionArgs) ToRulesRuleBasicExpressionOutputWithContext

func (i RulesRuleBasicExpressionArgs) ToRulesRuleBasicExpressionOutputWithContext(ctx context.Context) RulesRuleBasicExpressionOutput

type RulesRuleBasicExpressionArray

type RulesRuleBasicExpressionArray []RulesRuleBasicExpressionInput

func (RulesRuleBasicExpressionArray) ElementType

func (RulesRuleBasicExpressionArray) ToRulesRuleBasicExpressionArrayOutput

func (i RulesRuleBasicExpressionArray) ToRulesRuleBasicExpressionArrayOutput() RulesRuleBasicExpressionArrayOutput

func (RulesRuleBasicExpressionArray) ToRulesRuleBasicExpressionArrayOutputWithContext

func (i RulesRuleBasicExpressionArray) ToRulesRuleBasicExpressionArrayOutputWithContext(ctx context.Context) RulesRuleBasicExpressionArrayOutput

type RulesRuleBasicExpressionArrayInput

type RulesRuleBasicExpressionArrayInput interface {
	pulumi.Input

	ToRulesRuleBasicExpressionArrayOutput() RulesRuleBasicExpressionArrayOutput
	ToRulesRuleBasicExpressionArrayOutputWithContext(context.Context) RulesRuleBasicExpressionArrayOutput
}

RulesRuleBasicExpressionArrayInput is an input type that accepts RulesRuleBasicExpressionArray and RulesRuleBasicExpressionArrayOutput values. You can construct a concrete instance of `RulesRuleBasicExpressionArrayInput` via:

RulesRuleBasicExpressionArray{ RulesRuleBasicExpressionArgs{...} }

type RulesRuleBasicExpressionArrayOutput

type RulesRuleBasicExpressionArrayOutput struct{ *pulumi.OutputState }

func (RulesRuleBasicExpressionArrayOutput) ElementType

func (RulesRuleBasicExpressionArrayOutput) Index

func (RulesRuleBasicExpressionArrayOutput) ToRulesRuleBasicExpressionArrayOutput

func (o RulesRuleBasicExpressionArrayOutput) ToRulesRuleBasicExpressionArrayOutput() RulesRuleBasicExpressionArrayOutput

func (RulesRuleBasicExpressionArrayOutput) ToRulesRuleBasicExpressionArrayOutputWithContext

func (o RulesRuleBasicExpressionArrayOutput) ToRulesRuleBasicExpressionArrayOutputWithContext(ctx context.Context) RulesRuleBasicExpressionArrayOutput

type RulesRuleBasicExpressionInput

type RulesRuleBasicExpressionInput interface {
	pulumi.Input

	ToRulesRuleBasicExpressionOutput() RulesRuleBasicExpressionOutput
	ToRulesRuleBasicExpressionOutputWithContext(context.Context) RulesRuleBasicExpressionOutput
}

RulesRuleBasicExpressionInput is an input type that accepts RulesRuleBasicExpressionArgs and RulesRuleBasicExpressionOutput values. You can construct a concrete instance of `RulesRuleBasicExpressionInput` via:

RulesRuleBasicExpressionArgs{...}

type RulesRuleBasicExpressionOutput

type RulesRuleBasicExpressionOutput struct{ *pulumi.OutputState }

func (RulesRuleBasicExpressionOutput) ElementType

func (RulesRuleBasicExpressionOutput) Lhs

left hand side dropdown value

func (RulesRuleBasicExpressionOutput) Rhs

right hand side value

func (RulesRuleBasicExpressionOutput) ToRulesRuleBasicExpressionOutput

func (o RulesRuleBasicExpressionOutput) ToRulesRuleBasicExpressionOutput() RulesRuleBasicExpressionOutput

func (RulesRuleBasicExpressionOutput) ToRulesRuleBasicExpressionOutputWithContext

func (o RulesRuleBasicExpressionOutput) ToRulesRuleBasicExpressionOutputWithContext(ctx context.Context) RulesRuleBasicExpressionOutput

type RulesRuleInput

type RulesRuleInput interface {
	pulumi.Input

	ToRulesRuleOutput() RulesRuleOutput
	ToRulesRuleOutputWithContext(context.Context) RulesRuleOutput
}

RulesRuleInput is an input type that accepts RulesRuleArgs and RulesRuleOutput values. You can construct a concrete instance of `RulesRuleInput` via:

RulesRuleArgs{...}

type RulesRuleOutput

type RulesRuleOutput struct{ *pulumi.OutputState }

func (RulesRuleOutput) BasicExpressions

The basic expression which needs to be evaluated to be true for this rule to apply.

func (RulesRuleOutput) ElementType

func (RulesRuleOutput) ElementType() reflect.Type

func (RulesRuleOutput) Expression

func (o RulesRuleOutput) Expression() pulumi.StringPtrOutput

The expression which needs to be evaluated to be true for this rule to apply.

func (RulesRuleOutput) IsBasic

func (o RulesRuleOutput) IsBasic() pulumi.BoolOutput

is_basic will be true when users use the drop down selectors which will have lhs, op & rhs value, whereas it will be false when they use the advanced mode and it would have the expression for it's value

func (RulesRuleOutput) RouteToId

func (o RulesRuleOutput) RouteToId() pulumi.StringOutput

The id of the entity (user, escalation policy, squad) for which we are routing this incident.

func (RulesRuleOutput) RouteToType

func (o RulesRuleOutput) RouteToType() pulumi.StringOutput

Type of the entity for which we are routing this incident - User, Escalation Policy or Squad

func (RulesRuleOutput) ToRulesRuleOutput

func (o RulesRuleOutput) ToRulesRuleOutput() RulesRuleOutput

func (RulesRuleOutput) ToRulesRuleOutputWithContext

func (o RulesRuleOutput) ToRulesRuleOutputWithContext(ctx context.Context) RulesRuleOutput

type RulesState

type RulesState struct {
	Rules RulesRuleArrayInput
	// Service id.
	ServiceId pulumi.StringPtrInput
	// Team id.
	TeamId pulumi.StringPtrInput
}

func (RulesState) ElementType

func (RulesState) ElementType() reflect.Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL