@natzka-oss/pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox cloud resources.
98 lines (97 loc) • 4.77 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* From the [official documentation](https://docs.netbox.dev/en/stable/customization/custom-fields/#custom-fields):
*
* > Each model in NetBox is represented in the database as a discrete table, and each attribute of a model exists as a column within its table. For example, sites are stored in the dcimSite table, which has columns named name, facility, physical_address, and so on. As new attributes are added to objects throughout the development of NetBox, tables are expanded to include new rows.
* >
* > However, some users might want to store additional object attributes that are somewhat esoteric in nature, and that would not make sense to include in the core NetBox database schema. For instance, suppose your organization needs to associate each device with a ticket number correlating it with an internal support system record. This is certainly a legitimate use for NetBox, but it's not a common enough need to warrant including a field for every NetBox installation. Instead, you can create a custom field to hold this data.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as netbox from "@natzka-oss/pulumi-netbox";
*
* const test = new netbox.CustomField("test", {
* name: "test",
* type: "text",
* contentTypes: ["virtualization.vminterface"],
* weight: 100,
* validationRegex: "^.*$",
* });
* ```
*/
export declare class CustomField extends pulumi.CustomResource {
/**
* Get an existing CustomField 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?: CustomFieldState, opts?: pulumi.CustomResourceOptions): CustomField;
/**
* Returns true if the given object is an instance of CustomField. 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 CustomField;
readonly choiceSetId: pulumi.Output<number | undefined>;
readonly contentTypes: pulumi.Output<string[]>;
readonly default: pulumi.Output<string | undefined>;
readonly description: pulumi.Output<string | undefined>;
readonly groupName: pulumi.Output<string | undefined>;
readonly label: pulumi.Output<string | undefined>;
readonly name: pulumi.Output<string>;
readonly required: pulumi.Output<boolean | undefined>;
readonly type: pulumi.Output<string>;
readonly validationMaximum: pulumi.Output<number | undefined>;
readonly validationMinimum: pulumi.Output<number | undefined>;
readonly validationRegex: pulumi.Output<string | undefined>;
readonly weight: pulumi.Output<number>;
/**
* Create a CustomField 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: CustomFieldArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering CustomField resources.
*/
export interface CustomFieldState {
choiceSetId?: pulumi.Input<number>;
contentTypes?: pulumi.Input<pulumi.Input<string>[]>;
default?: pulumi.Input<string>;
description?: pulumi.Input<string>;
groupName?: pulumi.Input<string>;
label?: pulumi.Input<string>;
name?: pulumi.Input<string>;
required?: pulumi.Input<boolean>;
type?: pulumi.Input<string>;
validationMaximum?: pulumi.Input<number>;
validationMinimum?: pulumi.Input<number>;
validationRegex?: pulumi.Input<string>;
weight?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a CustomField resource.
*/
export interface CustomFieldArgs {
choiceSetId?: pulumi.Input<number>;
contentTypes: pulumi.Input<pulumi.Input<string>[]>;
default?: pulumi.Input<string>;
description?: pulumi.Input<string>;
groupName?: pulumi.Input<string>;
label?: pulumi.Input<string>;
name?: pulumi.Input<string>;
required?: pulumi.Input<boolean>;
type: pulumi.Input<string>;
validationMaximum?: pulumi.Input<number>;
validationMinimum?: pulumi.Input<number>;
validationRegex?: pulumi.Input<string>;
weight: pulumi.Input<number>;
}