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",
});
import pulumi
import pulumi_netbox as netbox
test = netbox.Webhook("test",
bodytemplate="Sample body",
payload_url="https://example.com/webhook")
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
})
}
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",
});
});
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());
}
}
resources:
test:
type: netbox:Webhook
properties:
bodytemplate: Sample body
payloadUrl: https://example.com/webhook
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 string
- The unique name of the resource.
- args WebhookArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args WebhookArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WebhookArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
var webhookResource = new Webhook("webhookResource", WebhookArgs.builder()
.payloadUrl("string")
.additionalHeaders("string")
.bodyTemplate("string")
.httpContentType("string")
.httpMethod("string")
.name("string")
.webhookId("string")
.build());
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")
const webhookResource = new netbox.Webhook("webhookResource", {
payloadUrl: "string",
additionalHeaders: "string",
bodyTemplate: "string",
httpContentType: "string",
httpMethod: "string",
name: "string",
webhookId: "string",
});
type: netbox:Webhook
properties:
additionalHeaders: string
bodyTemplate: string
httpContentType: string
httpMethod: string
name: string
payloadUrl: string
webhookId: string
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:
- Payload
Url string - Additional
Headers string - Body
Template string - Http
Content stringType - The complete list of official content types is available here. Defaults to
application/json
. - Http
Method string - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - Name string
- Webhook
Id string - The ID of this resource.
- Payload
Url string - Additional
Headers string - Body
Template string - Http
Content stringType - The complete list of official content types is available here. Defaults to
application/json
. - Http
Method string - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - Name string
- Webhook
Id string - The ID of this resource.
- payload
Url String - additional
Headers String - body
Template String - http
Content StringType - The complete list of official content types is available here. Defaults to
application/json
. - http
Method String - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - name String
- webhook
Id String - The ID of this resource.
- payload
Url string - additional
Headers string - body
Template string - http
Content stringType - The complete list of official content types is available here. Defaults to
application/json
. - http
Method string - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - name string
- webhook
Id string - The ID of this resource.
- payload_
url str - additional_
headers str - body_
template str - http_
content_ strtype - The complete list of official content types is available here. Defaults to
application/json
. - http_
method str - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - name str
- webhook_
id str - The ID of this resource.
- payload
Url String - additional
Headers String - body
Template String - http
Content StringType - The complete list of official content types is available here. Defaults to
application/json
. - http
Method String - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - name String
- webhook
Id 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Additional
Headers string - Body
Template string - Http
Content stringType - The complete list of official content types is available here. Defaults to
application/json
. - Http
Method string - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - Name string
- Payload
Url string - Webhook
Id string - The ID of this resource.
- Additional
Headers string - Body
Template string - Http
Content stringType - The complete list of official content types is available here. Defaults to
application/json
. - Http
Method string - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - Name string
- Payload
Url string - Webhook
Id string - The ID of this resource.
- additional
Headers String - body
Template String - http
Content StringType - The complete list of official content types is available here. Defaults to
application/json
. - http
Method String - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - name String
- payload
Url String - webhook
Id String - The ID of this resource.
- additional
Headers string - body
Template string - http
Content stringType - The complete list of official content types is available here. Defaults to
application/json
. - http
Method string - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - name string
- payload
Url string - webhook
Id string - The ID of this resource.
- additional_
headers str - body_
template str - http_
content_ strtype - The complete list of official content types is available here. Defaults to
application/json
. - http_
method str - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - name str
- payload_
url str - webhook_
id str - The ID of this resource.
- additional
Headers String - body
Template String - http
Content StringType - The complete list of official content types is available here. Defaults to
application/json
. - http
Method String - Valid values are
GET
,POST
,PUT
,PATCH
andDELETE
. Defaults toPOST
. - name String
- payload
Url String - webhook
Id 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.