1. Packages
  2. Fortios
  3. API Docs
  4. json
  5. GenericApi
Fortios v0.0.6 published on Tuesday, Jul 9, 2024 by pulumiverse

fortios.json.GenericApi

Explore with Pulumi AI

fortios logo
Fortios v0.0.6 published on Tuesday, Jul 9, 2024 by pulumiverse

    FortiAPI Generic Interface.

    Example Usage

    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;
    
    import pulumi
    import pulumiverse_fortios as fortios
    
    test1 = fortios.json.GenericApi("test1",
        json="",
        method="GET",
        path="/api/v2/cmdb/firewall/address")
    pulumi.export("response1", test1.response)
    test2 = 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")
    pulumi.export("response2", test2.response)
    test3 = fortios.json.GenericApi("test3",
        json="",
        method="PUT",
        path="/api/v2/cmdb/firewall/policy/3",
        specialparams="action=move&after=1")
    pulumi.export("response3", test3.response)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/json"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		test1, err := json.NewGenericApi(ctx, "test1", &json.GenericApiArgs{
    			Json:   pulumi.String(""),
    			Method: pulumi.String("GET"),
    			Path:   pulumi.String("/api/v2/cmdb/firewall/address"),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("response1", test1.Response)
    		test2, err := json.NewGenericApi(ctx, "test2", &json.GenericApiArgs{
    			Json: pulumi.String(`{
      "name": "11221",
      "type": "geography",
      "fqdn": "",
      "country": "AL",
      "comment": "ccc",
      "visibility": "enable",
      "associated-interface": "port1",
      "allow-routing": "disable"
    }
    
    `),
    			Method: pulumi.String("POST"),
    			Path:   pulumi.String("/api/v2/cmdb/firewall/address"),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("response2", test2.Response)
    		test3, err := json.NewGenericApi(ctx, "test3", &json.GenericApiArgs{
    			Json:          pulumi.String(""),
    			Method:        pulumi.String("PUT"),
    			Path:          pulumi.String("/api/v2/cmdb/firewall/policy/3"),
    			Specialparams: pulumi.String("action=move&after=1"),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("response3", test3.Response)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fortios = Pulumiverse.Fortios;
    
    return await Deployment.RunAsync(() => 
    {
        var test1 = new Fortios.Json.GenericApi("test1", new()
        {
            Json = "",
            Method = "GET",
            Path = "/api/v2/cmdb/firewall/address",
        });
    
        var test2 = new Fortios.Json.GenericApi("test2", new()
        {
            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",
        });
    
        var test3 = new Fortios.Json.GenericApi("test3", new()
        {
            Json = "",
            Method = "PUT",
            Path = "/api/v2/cmdb/firewall/policy/3",
            Specialparams = "action=move&after=1",
        });
    
        return new Dictionary<string, object?>
        {
            ["response1"] = test1.Response,
            ["response2"] = test2.Response,
            ["response3"] = test3.Response,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.fortios.json.GenericApi;
    import com.pulumi.fortios.json.GenericApiArgs;
    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 test1 = new GenericApi("test1", GenericApiArgs.builder()
                .json("")
                .method("GET")
                .path("/api/v2/cmdb/firewall/address")
                .build());
    
            ctx.export("response1", test1.response());
            var test2 = new GenericApi("test2", GenericApiArgs.builder()
                .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")
                .build());
    
            ctx.export("response2", test2.response());
            var test3 = new GenericApi("test3", GenericApiArgs.builder()
                .json("")
                .method("PUT")
                .path("/api/v2/cmdb/firewall/policy/3")
                .specialparams("action=move&after=1")
                .build());
    
            ctx.export("response3", test3.response());
        }
    }
    
    resources:
      test1:
        type: fortios:json:GenericApi
        properties:
          json:
          method: GET
          path: /api/v2/cmdb/firewall/address
      test2:
        type: fortios:json:GenericApi
        properties:
          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
      test3:
        type: fortios:json:GenericApi
        properties:
          json:
          method: PUT
          path: /api/v2/cmdb/firewall/policy/3
          specialparams: action=move&after=1
    outputs:
      response1: ${test1.response}
      response2: ${test2.response}
      response3: ${test3.response}
    

    Create GenericApi Resource

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

    Constructor syntax

    new GenericApi(name: string, args: GenericApiArgs, opts?: CustomResourceOptions);
    @overload
    def GenericApi(resource_name: str,
                   args: GenericApiArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def GenericApi(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   method: Optional[str] = None,
                   path: Optional[str] = None,
                   force_recreate: Optional[str] = None,
                   json: Optional[str] = None,
                   specialparams: Optional[str] = None,
                   vdomparam: Optional[str] = None)
    func NewGenericApi(ctx *Context, name string, args GenericApiArgs, opts ...ResourceOption) (*GenericApi, error)
    public GenericApi(string name, GenericApiArgs args, CustomResourceOptions? opts = null)
    public GenericApi(String name, GenericApiArgs args)
    public GenericApi(String name, GenericApiArgs args, CustomResourceOptions options)
    
    type: fortios:json:GenericApi
    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 GenericApiArgs
    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 GenericApiArgs
    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 GenericApiArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GenericApiArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GenericApiArgs
    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 genericApiResource = new Fortios.Json.GenericApi("genericApiResource", new()
    {
        Method = "string",
        Path = "string",
        ForceRecreate = "string",
        Json = "string",
        Specialparams = "string",
        Vdomparam = "string",
    });
    
    example, err := json.NewGenericApi(ctx, "genericApiResource", &json.GenericApiArgs{
    	Method:        pulumi.String("string"),
    	Path:          pulumi.String("string"),
    	ForceRecreate: pulumi.String("string"),
    	Json:          pulumi.String("string"),
    	Specialparams: pulumi.String("string"),
    	Vdomparam:     pulumi.String("string"),
    })
    
    var genericApiResource = new GenericApi("genericApiResource", GenericApiArgs.builder()
        .method("string")
        .path("string")
        .forceRecreate("string")
        .json("string")
        .specialparams("string")
        .vdomparam("string")
        .build());
    
    generic_api_resource = fortios.json.GenericApi("genericApiResource",
        method="string",
        path="string",
        force_recreate="string",
        json="string",
        specialparams="string",
        vdomparam="string")
    
    const genericApiResource = new fortios.json.GenericApi("genericApiResource", {
        method: "string",
        path: "string",
        forceRecreate: "string",
        json: "string",
        specialparams: "string",
        vdomparam: "string",
    });
    
    type: fortios:json:GenericApi
    properties:
        forceRecreate: string
        json: string
        method: string
        path: string
        specialparams: string
        vdomparam: string
    

    GenericApi Resource Properties

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

    Inputs

    The GenericApi resource accepts the following input properties:

    Method string
    HTTP method.
    Path string
    FortiAPI URL path.
    ForceRecreate string
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    Json string
    Body data in JSON format.
    Specialparams string
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    Vdomparam string
    Method string
    HTTP method.
    Path string
    FortiAPI URL path.
    ForceRecreate string
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    Json string
    Body data in JSON format.
    Specialparams string
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    Vdomparam string
    method String
    HTTP method.
    path String
    FortiAPI URL path.
    forceRecreate String
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    json String
    Body data in JSON format.
    specialparams String
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    vdomparam String
    method string
    HTTP method.
    path string
    FortiAPI URL path.
    forceRecreate string
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    json string
    Body data in JSON format.
    specialparams string
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    vdomparam string
    method str
    HTTP method.
    path str
    FortiAPI URL path.
    force_recreate str
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    json str
    Body data in JSON format.
    specialparams str
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    vdomparam str
    method String
    HTTP method.
    path String
    FortiAPI URL path.
    forceRecreate String
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    json String
    Body data in JSON format.
    specialparams String
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    vdomparam String

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Response string
    FortiAPI returns results.
    Id string
    The provider-assigned unique ID for this managed resource.
    Response string
    FortiAPI returns results.
    id String
    The provider-assigned unique ID for this managed resource.
    response String
    FortiAPI returns results.
    id string
    The provider-assigned unique ID for this managed resource.
    response string
    FortiAPI returns results.
    id str
    The provider-assigned unique ID for this managed resource.
    response str
    FortiAPI returns results.
    id String
    The provider-assigned unique ID for this managed resource.
    response String
    FortiAPI returns results.

    Look up Existing GenericApi Resource

    Get an existing GenericApi 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?: GenericApiState, opts?: CustomResourceOptions): GenericApi
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            force_recreate: Optional[str] = None,
            json: Optional[str] = None,
            method: Optional[str] = None,
            path: Optional[str] = None,
            response: Optional[str] = None,
            specialparams: Optional[str] = None,
            vdomparam: Optional[str] = None) -> GenericApi
    func GetGenericApi(ctx *Context, name string, id IDInput, state *GenericApiState, opts ...ResourceOption) (*GenericApi, error)
    public static GenericApi Get(string name, Input<string> id, GenericApiState? state, CustomResourceOptions? opts = null)
    public static GenericApi get(String name, Output<String> id, GenericApiState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    ForceRecreate string
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    Json string
    Body data in JSON format.
    Method string
    HTTP method.
    Path string
    FortiAPI URL path.
    Response string
    FortiAPI returns results.
    Specialparams string
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    Vdomparam string
    ForceRecreate string
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    Json string
    Body data in JSON format.
    Method string
    HTTP method.
    Path string
    FortiAPI URL path.
    Response string
    FortiAPI returns results.
    Specialparams string
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    Vdomparam string
    forceRecreate String
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    json String
    Body data in JSON format.
    method String
    HTTP method.
    path String
    FortiAPI URL path.
    response String
    FortiAPI returns results.
    specialparams String
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    vdomparam String
    forceRecreate string
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    json string
    Body data in JSON format.
    method string
    HTTP method.
    path string
    FortiAPI URL path.
    response string
    FortiAPI returns results.
    specialparams string
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    vdomparam string
    force_recreate str
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    json str
    Body data in JSON format.
    method str
    HTTP method.
    path str
    FortiAPI URL path.
    response str
    FortiAPI returns results.
    specialparams str
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    vdomparam str
    forceRecreate String
    The argument is optional, if it is set, when its value changes, the resource will be re-created. It is usually used when the return value needs to be forced to update.
    json String
    Body data in JSON format.
    method String
    HTTP method.
    path String
    FortiAPI URL path.
    response String
    FortiAPI returns results.
    specialparams String
    URL parameters, in addition to the URL path, user can specify URL parameters which are appended to the URL path.
    vdomparam String

    Package Details

    Repository
    fortios pulumiverse/pulumi-fortios
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the fortios Terraform Provider.
    fortios logo
    Fortios v0.0.6 published on Tuesday, Jul 9, 2024 by pulumiverse