UNPKG

@natzka-oss/pulumi-netbox

Version:

A Pulumi package for creating and managing Netbox cloud resources.

126 lines (125 loc) 4.82 kB
import * as pulumi from "@pulumi/pulumi"; /** * From the [official documentation](https://docs.netbox.dev/en/stable/features/event-rules/): * * > NetBox can be configured via Event Rules to transmit outgoing webhooks to remote systems in response to internal object changes. The receiver can act on the data in these webhook messages to perform related tasks. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as netbox from "@natzka-oss/pulumi-netbox"; * * const test = new netbox.Webhook("test", { * name: "my-webhook", * payloadUrl: "https://example.com/webhook", * }); * const testEventRule = new netbox.EventRule("test", { * name: "my-event-rule", * contentTypes: [ * "dcim.site", * "virtualization.cluster", * ], * actionType: "webhook", * actionObjectId: test.id, * eventTypes: [ * "object_created", * "object_updated", * "object_deleted", * "job_started", * "job_completed", * "job_failed", * "job_errored", * ], * }); * ``` */ export declare class EventRule extends pulumi.CustomResource { /** * Get an existing EventRule resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: EventRuleState, opts?: pulumi.CustomResourceOptions): EventRule; /** * Returns true if the given object is an instance of EventRule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is EventRule; readonly actionObjectId: pulumi.Output<number>; /** * Valid values are `webhook`. */ readonly actionType: pulumi.Output<string>; readonly conditions: pulumi.Output<string | undefined>; readonly contentTypes: pulumi.Output<string[]>; readonly description: pulumi.Output<string | undefined>; /** * Defaults to `true`. */ readonly enabled: pulumi.Output<boolean | undefined>; /** * The types of event which will trigger this rule. By default, valid values are `objectCreated`, `ojectUpdated`, `objectDeleted`, `jobStarted`, `jobCompleted`, `jobFailed` and `jobErrored`. */ readonly eventTypes: pulumi.Output<string[]>; readonly name: pulumi.Output<string>; readonly tags: pulumi.Output<string[] | undefined>; /** * Create a EventRule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: EventRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering EventRule resources. */ export interface EventRuleState { actionObjectId?: pulumi.Input<number>; /** * Valid values are `webhook`. */ actionType?: pulumi.Input<string>; conditions?: pulumi.Input<string>; contentTypes?: pulumi.Input<pulumi.Input<string>[]>; description?: pulumi.Input<string>; /** * Defaults to `true`. */ enabled?: pulumi.Input<boolean>; /** * The types of event which will trigger this rule. By default, valid values are `objectCreated`, `ojectUpdated`, `objectDeleted`, `jobStarted`, `jobCompleted`, `jobFailed` and `jobErrored`. */ eventTypes?: pulumi.Input<pulumi.Input<string>[]>; name?: pulumi.Input<string>; tags?: pulumi.Input<pulumi.Input<string>[]>; } /** * The set of arguments for constructing a EventRule resource. */ export interface EventRuleArgs { actionObjectId: pulumi.Input<number>; /** * Valid values are `webhook`. */ actionType: pulumi.Input<string>; conditions?: pulumi.Input<string>; contentTypes: pulumi.Input<pulumi.Input<string>[]>; description?: pulumi.Input<string>; /** * Defaults to `true`. */ enabled?: pulumi.Input<boolean>; /** * The types of event which will trigger this rule. By default, valid values are `objectCreated`, `ojectUpdated`, `objectDeleted`, `jobStarted`, `jobCompleted`, `jobFailed` and `jobErrored`. */ eventTypes: pulumi.Input<pulumi.Input<string>[]>; name?: pulumi.Input<string>; tags?: pulumi.Input<pulumi.Input<string>[]>; }