1. Packages
  2. Netbox Provider
  3. API Docs
  4. Webhook
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

netbox.Webhook

Explore with Pulumi AI

From the official documentation:

A webhook is a mechanism for conveying to some external system a change that took place in NetBox. For example, you may want to notify a monitoring system whenever the status of a device is updated in NetBox. This can be done by creating a webhook for the device model in NetBox and identifying the webhook receiver. When NetBox detects a change to a device, an HTTP request containing the details of the change and who made it be sent to the specified receiver.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";

const test = new netbox.Webhook("test", {
    bodytemplate: "Sample body",
    payloadUrl: "https://example.com/webhook",
});
Copy
import pulumi
import pulumi_netbox as netbox

test = netbox.Webhook("test",
    bodytemplate="Sample body",
    payload_url="https://example.com/webhook")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := netbox.NewWebhook(ctx, "test", &netbox.WebhookArgs{
			Bodytemplate: pulumi.String("Sample body"),
			PayloadUrl:   pulumi.String("https://example.com/webhook"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Netbox = Pulumi.Netbox;

return await Deployment.RunAsync(() => 
{
    var test = new Netbox.Webhook("test", new()
    {
        Bodytemplate = "Sample body",
        PayloadUrl = "https://example.com/webhook",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.Webhook;
import com.pulumi.netbox.WebhookArgs;
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) {
        var test = new Webhook("test", WebhookArgs.builder()
            .bodytemplate("Sample body")
            .payloadUrl("https://example.com/webhook")
            .build());

    }
}
Copy
resources:
  test:
    type: netbox:Webhook
    properties:
      bodytemplate: Sample body
      payloadUrl: https://example.com/webhook
Copy

Create Webhook Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Webhook(name: string, args: WebhookArgs, opts?: CustomResourceOptions);
@overload
def Webhook(resource_name: str,
            args: WebhookArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def Webhook(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            payload_url: Optional[str] = None,
            additional_headers: Optional[str] = None,
            body_template: Optional[str] = None,
            http_content_type: Optional[str] = None,
            http_method: Optional[str] = None,
            name: Optional[str] = None,
            webhook_id: Optional[str] = None)
func NewWebhook(ctx *Context, name string, args WebhookArgs, opts ...ResourceOption) (*Webhook, error)
public Webhook(string name, WebhookArgs args, CustomResourceOptions? opts = null)
public Webhook(String name, WebhookArgs args)
public Webhook(String name, WebhookArgs args, CustomResourceOptions options)
type: netbox:Webhook
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. WebhookArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var webhookResource = new Netbox.Webhook("webhookResource", new()
{
    PayloadUrl = "string",
    AdditionalHeaders = "string",
    BodyTemplate = "string",
    HttpContentType = "string",
    HttpMethod = "string",
    Name = "string",
    WebhookId = "string",
});
Copy
example, err := netbox.NewWebhook(ctx, "webhookResource", &netbox.WebhookArgs{
PayloadUrl: pulumi.String("string"),
AdditionalHeaders: pulumi.String("string"),
BodyTemplate: pulumi.String("string"),
HttpContentType: pulumi.String("string"),
HttpMethod: pulumi.String("string"),
Name: pulumi.String("string"),
WebhookId: pulumi.String("string"),
})
Copy
var webhookResource = new Webhook("webhookResource", WebhookArgs.builder()
    .payloadUrl("string")
    .additionalHeaders("string")
    .bodyTemplate("string")
    .httpContentType("string")
    .httpMethod("string")
    .name("string")
    .webhookId("string")
    .build());
Copy
webhook_resource = netbox.Webhook("webhookResource",
    payload_url="string",
    additional_headers="string",
    body_template="string",
    http_content_type="string",
    http_method="string",
    name="string",
    webhook_id="string")
Copy
const webhookResource = new netbox.Webhook("webhookResource", {
    payloadUrl: "string",
    additionalHeaders: "string",
    bodyTemplate: "string",
    httpContentType: "string",
    httpMethod: "string",
    name: "string",
    webhookId: "string",
});
Copy
type: netbox:Webhook
properties:
    additionalHeaders: string
    bodyTemplate: string
    httpContentType: string
    httpMethod: string
    name: string
    payloadUrl: string
    webhookId: string
Copy

Webhook Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Webhook resource accepts the following input properties:

PayloadUrl This property is required. string
AdditionalHeaders string
BodyTemplate string
HttpContentType string
The complete list of official content types is available here. Defaults to application/json.
HttpMethod string
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
Name string
WebhookId string
The ID of this resource.
PayloadUrl This property is required. string
AdditionalHeaders string
BodyTemplate string
HttpContentType string
The complete list of official content types is available here. Defaults to application/json.
HttpMethod string
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
Name string
WebhookId string
The ID of this resource.
payloadUrl This property is required. String
additionalHeaders String
bodyTemplate String
httpContentType String
The complete list of official content types is available here. Defaults to application/json.
httpMethod String
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
name String
webhookId String
The ID of this resource.
payloadUrl This property is required. string
additionalHeaders string
bodyTemplate string
httpContentType string
The complete list of official content types is available here. Defaults to application/json.
httpMethod string
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
name string
webhookId string
The ID of this resource.
payload_url This property is required. str
additional_headers str
body_template str
http_content_type str
The complete list of official content types is available here. Defaults to application/json.
http_method str
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
name str
webhook_id str
The ID of this resource.
payloadUrl This property is required. String
additionalHeaders String
bodyTemplate String
httpContentType String
The complete list of official content types is available here. Defaults to application/json.
httpMethod String
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
name String
webhookId String
The ID of this resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the Webhook resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing Webhook Resource

Get an existing Webhook resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: WebhookState, opts?: CustomResourceOptions): Webhook
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        additional_headers: Optional[str] = None,
        body_template: Optional[str] = None,
        http_content_type: Optional[str] = None,
        http_method: Optional[str] = None,
        name: Optional[str] = None,
        payload_url: Optional[str] = None,
        webhook_id: Optional[str] = None) -> Webhook
func GetWebhook(ctx *Context, name string, id IDInput, state *WebhookState, opts ...ResourceOption) (*Webhook, error)
public static Webhook Get(string name, Input<string> id, WebhookState? state, CustomResourceOptions? opts = null)
public static Webhook get(String name, Output<String> id, WebhookState state, CustomResourceOptions options)
resources:  _:    type: netbox:Webhook    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AdditionalHeaders string
BodyTemplate string
HttpContentType string
The complete list of official content types is available here. Defaults to application/json.
HttpMethod string
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
Name string
PayloadUrl string
WebhookId string
The ID of this resource.
AdditionalHeaders string
BodyTemplate string
HttpContentType string
The complete list of official content types is available here. Defaults to application/json.
HttpMethod string
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
Name string
PayloadUrl string
WebhookId string
The ID of this resource.
additionalHeaders String
bodyTemplate String
httpContentType String
The complete list of official content types is available here. Defaults to application/json.
httpMethod String
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
name String
payloadUrl String
webhookId String
The ID of this resource.
additionalHeaders string
bodyTemplate string
httpContentType string
The complete list of official content types is available here. Defaults to application/json.
httpMethod string
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
name string
payloadUrl string
webhookId string
The ID of this resource.
additional_headers str
body_template str
http_content_type str
The complete list of official content types is available here. Defaults to application/json.
http_method str
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
name str
payload_url str
webhook_id str
The ID of this resource.
additionalHeaders String
bodyTemplate String
httpContentType String
The complete list of official content types is available here. Defaults to application/json.
httpMethod String
Valid values are GET, POST, PUT, PATCH and DELETE. Defaults to POST.
name String
payloadUrl String
webhookId String
The ID of this resource.

Package Details

Repository
netbox e-breuninger/terraform-provider-netbox
License
Notes
This Pulumi package is based on the netbox Terraform Provider.