pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox resources.
76 lines • 3.99 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.IpAddress = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* From the [official documentation](https://docs.netbox.dev/en/stable/core-functionality/ipam/#ip-addresses):
*
* > An IP address comprises a single host address (either IPv4 or IPv6) and its subnet mask. Its mask should match exactly how the IP address is configured on an interface in the real world.
* >
* > Like a prefix, an IP address can optionally be assigned to a VRF (otherwise, it will appear in the "global" table). IP addresses are automatically arranged under parent prefixes within their respective VRFs according to the IP hierarchy.
*/
class IpAddress extends pulumi.CustomResource {
/**
* Get an existing IpAddress 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, id, state, opts) {
return new IpAddress(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of IpAddress. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === IpAddress.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["dnsName"] = state ? state.dnsName : undefined;
resourceInputs["interfaceId"] = state ? state.interfaceId : undefined;
resourceInputs["ipAddress"] = state ? state.ipAddress : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tenantId"] = state ? state.tenantId : undefined;
resourceInputs["vrfId"] = state ? state.vrfId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.ipAddress === undefined) && !opts.urn) {
throw new Error("Missing required property 'ipAddress'");
}
if ((!args || args.status === undefined) && !opts.urn) {
throw new Error("Missing required property 'status'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["dnsName"] = args ? args.dnsName : undefined;
resourceInputs["interfaceId"] = args ? args.interfaceId : undefined;
resourceInputs["ipAddress"] = args ? args.ipAddress : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["tenantId"] = args ? args.tenantId : undefined;
resourceInputs["vrfId"] = args ? args.vrfId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(IpAddress.__pulumiType, name, resourceInputs, opts);
}
}
exports.IpAddress = IpAddress;
/** @internal */
IpAddress.__pulumiType = 'netbox:index/ipAddress:IpAddress';
//# sourceMappingURL=ipAddress.js.map