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

fortios.fmg.JsonrpcRequest

Explore with Pulumi AI

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

    This resource supports handling JSON RPC request for FortiManager.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fortios from "@pulumiverse/fortios";
    
    const test1 = new fortios.fmg.JsonrpcRequest("test1", {jsonContent: `{
      "method": "add",
      "params": [
        {
          "data": [
            {
              "action": "accept",
              "dstaddr": ["all"],
              "dstintf": "any",
              "name": "policytest",
              "schedule": "none",
              "service": "ALL",
              "srcaddr": "all",
              "srcintf": "any",
              "internet-service": "enable",
              "internet-service-id": "Alibaba-Web",
              "internet-service-src": "enable",
              "internet-service-src-id": "Alibaba-Web",
              "users": "guest",
              "groups": "Guest-group"
            }
          ],
          "url": "/pm/config/adom/root/pkg/default/firewall/policy"
        }
      ]
    }
    
    `});
    const test2 = new fortios.fmg.JsonrpcRequest("test2", {jsonContent: `{
      "method": "add",
      "params": [
        {
          "data": [
            {
              "ip": "192.168.1.2",
              "name": "logserver4",
              "port": "514"
            }
          ],
          "url": "/cli/global/system/syslog"
        }
      ]
    }
    
    `});
    const test3 = new fortios.fmg.JsonrpcRequest("test3", {jsonContent: `{
      "method": "get",
      "params": [
        {
          "url": "/cli/global/system/admin/user/APIUser"
        }
      ]
    }
    
    `});
    
    import pulumi
    import pulumiverse_fortios as fortios
    
    test1 = fortios.fmg.JsonrpcRequest("test1", json_content="""{
      "method": "add",
      "params": [
        {
          "data": [
            {
              "action": "accept",
              "dstaddr": ["all"],
              "dstintf": "any",
              "name": "policytest",
              "schedule": "none",
              "service": "ALL",
              "srcaddr": "all",
              "srcintf": "any",
              "internet-service": "enable",
              "internet-service-id": "Alibaba-Web",
              "internet-service-src": "enable",
              "internet-service-src-id": "Alibaba-Web",
              "users": "guest",
              "groups": "Guest-group"
            }
          ],
          "url": "/pm/config/adom/root/pkg/default/firewall/policy"
        }
      ]
    }
    
    """)
    test2 = fortios.fmg.JsonrpcRequest("test2", json_content="""{
      "method": "add",
      "params": [
        {
          "data": [
            {
              "ip": "192.168.1.2",
              "name": "logserver4",
              "port": "514"
            }
          ],
          "url": "/cli/global/system/syslog"
        }
      ]
    }
    
    """)
    test3 = fortios.fmg.JsonrpcRequest("test3", json_content="""{
      "method": "get",
      "params": [
        {
          "url": "/cli/global/system/admin/user/APIUser"
        }
      ]
    }
    
    """)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/fmg"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := fmg.NewJsonrpcRequest(ctx, "test1", &fmg.JsonrpcRequestArgs{
    			JsonContent: pulumi.String(`{
      "method": "add",
      "params": [
        {
          "data": [
            {
              "action": "accept",
              "dstaddr": ["all"],
              "dstintf": "any",
              "name": "policytest",
              "schedule": "none",
              "service": "ALL",
              "srcaddr": "all",
              "srcintf": "any",
              "internet-service": "enable",
              "internet-service-id": "Alibaba-Web",
              "internet-service-src": "enable",
              "internet-service-src-id": "Alibaba-Web",
              "users": "guest",
              "groups": "Guest-group"
            }
          ],
          "url": "/pm/config/adom/root/pkg/default/firewall/policy"
        }
      ]
    }
    
    `),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = fmg.NewJsonrpcRequest(ctx, "test2", &fmg.JsonrpcRequestArgs{
    			JsonContent: pulumi.String(`{
      "method": "add",
      "params": [
        {
          "data": [
            {
              "ip": "192.168.1.2",
              "name": "logserver4",
              "port": "514"
            }
          ],
          "url": "/cli/global/system/syslog"
        }
      ]
    }
    
    `),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = fmg.NewJsonrpcRequest(ctx, "test3", &fmg.JsonrpcRequestArgs{
    			JsonContent: pulumi.String(`{
      "method": "get",
      "params": [
        {
          "url": "/cli/global/system/admin/user/APIUser"
        }
      ]
    }
    
    `),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fortios = Pulumiverse.Fortios;
    
    return await Deployment.RunAsync(() => 
    {
        var test1 = new Fortios.Fmg.JsonrpcRequest("test1", new()
        {
            JsonContent = @"{
      ""method"": ""add"",
      ""params"": [
        {
          ""data"": [
            {
              ""action"": ""accept"",
              ""dstaddr"": [""all""],
              ""dstintf"": ""any"",
              ""name"": ""policytest"",
              ""schedule"": ""none"",
              ""service"": ""ALL"",
              ""srcaddr"": ""all"",
              ""srcintf"": ""any"",
              ""internet-service"": ""enable"",
              ""internet-service-id"": ""Alibaba-Web"",
              ""internet-service-src"": ""enable"",
              ""internet-service-src-id"": ""Alibaba-Web"",
              ""users"": ""guest"",
              ""groups"": ""Guest-group""
            }
          ],
          ""url"": ""/pm/config/adom/root/pkg/default/firewall/policy""
        }
      ]
    }
    
    ",
        });
    
        var test2 = new Fortios.Fmg.JsonrpcRequest("test2", new()
        {
            JsonContent = @"{
      ""method"": ""add"",
      ""params"": [
        {
          ""data"": [
            {
              ""ip"": ""192.168.1.2"",
              ""name"": ""logserver4"",
              ""port"": ""514""
            }
          ],
          ""url"": ""/cli/global/system/syslog""
        }
      ]
    }
    
    ",
        });
    
        var test3 = new Fortios.Fmg.JsonrpcRequest("test3", new()
        {
            JsonContent = @"{
      ""method"": ""get"",
      ""params"": [
        {
          ""url"": ""/cli/global/system/admin/user/APIUser""
        }
      ]
    }
    
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.fortios.fmg.JsonrpcRequest;
    import com.pulumi.fortios.fmg.JsonrpcRequestArgs;
    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 JsonrpcRequest("test1", JsonrpcRequestArgs.builder()
                .jsonContent("""
    {
      "method": "add",
      "params": [
        {
          "data": [
            {
              "action": "accept",
              "dstaddr": ["all"],
              "dstintf": "any",
              "name": "policytest",
              "schedule": "none",
              "service": "ALL",
              "srcaddr": "all",
              "srcintf": "any",
              "internet-service": "enable",
              "internet-service-id": "Alibaba-Web",
              "internet-service-src": "enable",
              "internet-service-src-id": "Alibaba-Web",
              "users": "guest",
              "groups": "Guest-group"
            }
          ],
          "url": "/pm/config/adom/root/pkg/default/firewall/policy"
        }
      ]
    }
    
                """)
                .build());
    
            var test2 = new JsonrpcRequest("test2", JsonrpcRequestArgs.builder()
                .jsonContent("""
    {
      "method": "add",
      "params": [
        {
          "data": [
            {
              "ip": "192.168.1.2",
              "name": "logserver4",
              "port": "514"
            }
          ],
          "url": "/cli/global/system/syslog"
        }
      ]
    }
    
                """)
                .build());
    
            var test3 = new JsonrpcRequest("test3", JsonrpcRequestArgs.builder()
                .jsonContent("""
    {
      "method": "get",
      "params": [
        {
          "url": "/cli/global/system/admin/user/APIUser"
        }
      ]
    }
    
                """)
                .build());
    
        }
    }
    
    resources:
      test1:
        type: fortios:fmg:JsonrpcRequest
        properties:
          jsonContent: |+
            {
              "method": "add",
              "params": [
                {
                  "data": [
                    {
                      "action": "accept",
                      "dstaddr": ["all"],
                      "dstintf": "any",
                      "name": "policytest",
                      "schedule": "none",
                      "service": "ALL",
                      "srcaddr": "all",
                      "srcintf": "any",
                      "internet-service": "enable",
                      "internet-service-id": "Alibaba-Web",
                      "internet-service-src": "enable",
                      "internet-service-src-id": "Alibaba-Web",
                      "users": "guest",
                      "groups": "Guest-group"
                    }
                  ],
                  "url": "/pm/config/adom/root/pkg/default/firewall/policy"
                }
              ]
            }        
    
      test2:
        type: fortios:fmg:JsonrpcRequest
        properties:
          jsonContent: |+
            {
              "method": "add",
              "params": [
                {
                  "data": [
                    {
                      "ip": "192.168.1.2",
                      "name": "logserver4",
                      "port": "514"
                    }
                  ],
                  "url": "/cli/global/system/syslog"
                }
              ]
            }        
    
      test3:
        type: fortios:fmg:JsonrpcRequest
        properties:
          jsonContent: |+
            {
              "method": "get",
              "params": [
                {
                  "url": "/cli/global/system/admin/user/APIUser"
                }
              ]
            }        
    

    Create JsonrpcRequest Resource

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

    Constructor syntax

    new JsonrpcRequest(name: string, args: JsonrpcRequestArgs, opts?: CustomResourceOptions);
    @overload
    def JsonrpcRequest(resource_name: str,
                       args: JsonrpcRequestArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def JsonrpcRequest(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       json_content: Optional[str] = None,
                       comment: Optional[str] = None)
    func NewJsonrpcRequest(ctx *Context, name string, args JsonrpcRequestArgs, opts ...ResourceOption) (*JsonrpcRequest, error)
    public JsonrpcRequest(string name, JsonrpcRequestArgs args, CustomResourceOptions? opts = null)
    public JsonrpcRequest(String name, JsonrpcRequestArgs args)
    public JsonrpcRequest(String name, JsonrpcRequestArgs args, CustomResourceOptions options)
    
    type: fortios:fmg:JsonrpcRequest
    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 JsonrpcRequestArgs
    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 JsonrpcRequestArgs
    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 JsonrpcRequestArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args JsonrpcRequestArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args JsonrpcRequestArgs
    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 jsonrpcRequestResource = new Fortios.Fmg.JsonrpcRequest("jsonrpcRequestResource", new()
    {
        JsonContent = "string",
        Comment = "string",
    });
    
    example, err := fmg.NewJsonrpcRequest(ctx, "jsonrpcRequestResource", &fmg.JsonrpcRequestArgs{
    	JsonContent: pulumi.String("string"),
    	Comment:     pulumi.String("string"),
    })
    
    var jsonrpcRequestResource = new JsonrpcRequest("jsonrpcRequestResource", JsonrpcRequestArgs.builder()
        .jsonContent("string")
        .comment("string")
        .build());
    
    jsonrpc_request_resource = fortios.fmg.JsonrpcRequest("jsonrpcRequestResource",
        json_content="string",
        comment="string")
    
    const jsonrpcRequestResource = new fortios.fmg.JsonrpcRequest("jsonrpcRequestResource", {
        jsonContent: "string",
        comment: "string",
    });
    
    type: fortios:fmg:JsonrpcRequest
    properties:
        comment: string
        jsonContent: string
    

    JsonrpcRequest 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 JsonrpcRequest resource accepts the following input properties:

    JsonContent string
    JSON RPC request, which should contain 'method' and 'params' parameters.
    Comment string
    Comment.
    JsonContent string
    JSON RPC request, which should contain 'method' and 'params' parameters.
    Comment string
    Comment.
    jsonContent String
    JSON RPC request, which should contain 'method' and 'params' parameters.
    comment String
    Comment.
    jsonContent string
    JSON RPC request, which should contain 'method' and 'params' parameters.
    comment string
    Comment.
    json_content str
    JSON RPC request, which should contain 'method' and 'params' parameters.
    comment str
    Comment.
    jsonContent String
    JSON RPC request, which should contain 'method' and 'params' parameters.
    comment String
    Comment.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Response string
    JSON RPC request response data.
    Id string
    The provider-assigned unique ID for this managed resource.
    Response string
    JSON RPC request response data.
    id String
    The provider-assigned unique ID for this managed resource.
    response String
    JSON RPC request response data.
    id string
    The provider-assigned unique ID for this managed resource.
    response string
    JSON RPC request response data.
    id str
    The provider-assigned unique ID for this managed resource.
    response str
    JSON RPC request response data.
    id String
    The provider-assigned unique ID for this managed resource.
    response String
    JSON RPC request response data.

    Look up Existing JsonrpcRequest Resource

    Get an existing JsonrpcRequest 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?: JsonrpcRequestState, opts?: CustomResourceOptions): JsonrpcRequest
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comment: Optional[str] = None,
            json_content: Optional[str] = None,
            response: Optional[str] = None) -> JsonrpcRequest
    func GetJsonrpcRequest(ctx *Context, name string, id IDInput, state *JsonrpcRequestState, opts ...ResourceOption) (*JsonrpcRequest, error)
    public static JsonrpcRequest Get(string name, Input<string> id, JsonrpcRequestState? state, CustomResourceOptions? opts = null)
    public static JsonrpcRequest get(String name, Output<String> id, JsonrpcRequestState 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:
    Comment string
    Comment.
    JsonContent string
    JSON RPC request, which should contain 'method' and 'params' parameters.
    Response string
    JSON RPC request response data.
    Comment string
    Comment.
    JsonContent string
    JSON RPC request, which should contain 'method' and 'params' parameters.
    Response string
    JSON RPC request response data.
    comment String
    Comment.
    jsonContent String
    JSON RPC request, which should contain 'method' and 'params' parameters.
    response String
    JSON RPC request response data.
    comment string
    Comment.
    jsonContent string
    JSON RPC request, which should contain 'method' and 'params' parameters.
    response string
    JSON RPC request response data.
    comment str
    Comment.
    json_content str
    JSON RPC request, which should contain 'method' and 'params' parameters.
    response str
    JSON RPC request response data.
    comment String
    Comment.
    jsonContent String
    JSON RPC request, which should contain 'method' and 'params' parameters.
    response String
    JSON RPC request response data.

    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