@pulumiverse/fortios
Version:
A Pulumi package for creating and managing Fortios resources. Based on terraform-provider-fortios: version v1.16.0
108 lines • 4.32 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.GenericApi = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* FortiAPI Generic Interface.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fortios from "@pulumiverse/fortios";
*
* const test1 = new fortios.json.GenericApi("test1", {
* json: "",
* method: "GET",
* path: "/api/v2/cmdb/firewall/address",
* });
* export const response1 = test1.response;
* const test2 = new fortios.json.GenericApi("test2", {
* json: `{
* "name": "11221",
* "type": "geography",
* "fqdn": "",
* "country": "AL",
* "comment": "ccc",
* "visibility": "enable",
* "associated-interface": "port1",
* "allow-routing": "disable"
* }
*
* `,
* method: "POST",
* path: "/api/v2/cmdb/firewall/address",
* });
* export const response2 = test2.response;
* const test3 = new fortios.json.GenericApi("test3", {
* json: "",
* method: "PUT",
* path: "/api/v2/cmdb/firewall/policy/3",
* specialparams: "action=move&after=1",
* });
* export const response3 = test3.response;
* ```
*/
class GenericApi extends pulumi.CustomResource {
/**
* Get an existing GenericApi 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 GenericApi(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of GenericApi. 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'] === GenericApi.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["forceRecreate"] = state ? state.forceRecreate : undefined;
resourceInputs["json"] = state ? state.json : undefined;
resourceInputs["method"] = state ? state.method : undefined;
resourceInputs["path"] = state ? state.path : undefined;
resourceInputs["response"] = state ? state.response : undefined;
resourceInputs["specialparams"] = state ? state.specialparams : undefined;
resourceInputs["vdomparam"] = state ? state.vdomparam : undefined;
}
else {
const args = argsOrState;
if ((!args || args.method === undefined) && !opts.urn) {
throw new Error("Missing required property 'method'");
}
if ((!args || args.path === undefined) && !opts.urn) {
throw new Error("Missing required property 'path'");
}
resourceInputs["forceRecreate"] = args ? args.forceRecreate : undefined;
resourceInputs["json"] = args ? args.json : undefined;
resourceInputs["method"] = args ? args.method : undefined;
resourceInputs["path"] = args ? args.path : undefined;
resourceInputs["specialparams"] = args ? args.specialparams : undefined;
resourceInputs["vdomparam"] = args ? args.vdomparam : undefined;
resourceInputs["response"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(GenericApi.__pulumiType, name, resourceInputs, opts);
}
}
exports.GenericApi = GenericApi;
/** @internal */
GenericApi.__pulumiType = 'fortios:json/genericApi:GenericApi';
//# sourceMappingURL=genericApi.js.map
;