1. Packages
  2. Fortimanager Provider
  3. API Docs
  4. ObjectSwitchcontrollerCustomcommand
fortimanager 1.13.0 published on Thursday, Mar 13, 2025 by fortinetdev

fortimanager.ObjectSwitchcontrollerCustomcommand

Explore with Pulumi AI

fortimanager logo
fortimanager 1.13.0 published on Thursday, Mar 13, 2025 by fortinetdev

    Configure the FortiGate switch controller to send custom commands to managed FortiSwitch devices.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fortimanager from "@pulumi/fortimanager";
    
    const trname = new fortimanager.ObjectSwitchcontrollerCustomcommand("trname", {
        command: `  config switch trunk 0x0.07f258d1c4808p-1022
        edit myTrunk 0x0.00000172e012p-1022
          set members port1 port2
        end
      
    `,
        commandName: "cmd",
    });
    
    import pulumi
    import pulumi_fortimanager as fortimanager
    
    trname = fortimanager.ObjectSwitchcontrollerCustomcommand("trname",
        command="""  config switch trunk 0x0.07f258d1c4808p-1022
        edit myTrunk 0x0.00000172e012p-1022
          set members port1 port2
        end
      
    """,
        command_name="cmd")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/fortimanager/fortimanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := fortimanager.NewObjectSwitchcontrollerCustomcommand(ctx, "trname", &fortimanager.ObjectSwitchcontrollerCustomcommandArgs{
    			Command: pulumi.String(`  config switch trunk 0x0.07f258d1c4808p-1022
        edit myTrunk 0x0.00000172e012p-1022
          set members port1 port2
        end
      
    `),
    			CommandName: pulumi.String("cmd"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fortimanager = Pulumi.Fortimanager;
    
    return await Deployment.RunAsync(() => 
    {
        var trname = new Fortimanager.ObjectSwitchcontrollerCustomcommand("trname", new()
        {
            Command = @"  config switch trunk 0x0.07f258d1c4808p-1022
        edit myTrunk 0x0.00000172e012p-1022
          set members port1 port2
        end
      
    ",
            CommandName = "cmd",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.fortimanager.ObjectSwitchcontrollerCustomcommand;
    import com.pulumi.fortimanager.ObjectSwitchcontrollerCustomcommandArgs;
    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 trname = new ObjectSwitchcontrollerCustomcommand("trname", ObjectSwitchcontrollerCustomcommandArgs.builder()
                .command("""
      config switch trunk 0x0.07f258d1c4808p-1022
        edit myTrunk 0x0.00000172e012p-1022
          set members port1 port2
        end
      
                """)
                .commandName("cmd")
                .build());
    
        }
    }
    
    resources:
      trname:
        type: fortimanager:ObjectSwitchcontrollerCustomcommand
        properties:
          command: "  config switch trunk 0x0.07f258d1c4808p-1022\n    edit myTrunk 0x0.00000172e012p-1022\n      set members port1 port2\n    end\n  \n"
          commandName: cmd
    

    Create ObjectSwitchcontrollerCustomcommand Resource

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

    Constructor syntax

    new ObjectSwitchcontrollerCustomcommand(name: string, args?: ObjectSwitchcontrollerCustomcommandArgs, opts?: CustomResourceOptions);
    @overload
    def ObjectSwitchcontrollerCustomcommand(resource_name: str,
                                            args: Optional[ObjectSwitchcontrollerCustomcommandArgs] = None,
                                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def ObjectSwitchcontrollerCustomcommand(resource_name: str,
                                            opts: Optional[ResourceOptions] = None,
                                            adom: Optional[str] = None,
                                            command: Optional[str] = None,
                                            command_name: Optional[str] = None,
                                            description: Optional[str] = None,
                                            object_switchcontroller_customcommand_id: Optional[str] = None,
                                            scopetype: Optional[str] = None)
    func NewObjectSwitchcontrollerCustomcommand(ctx *Context, name string, args *ObjectSwitchcontrollerCustomcommandArgs, opts ...ResourceOption) (*ObjectSwitchcontrollerCustomcommand, error)
    public ObjectSwitchcontrollerCustomcommand(string name, ObjectSwitchcontrollerCustomcommandArgs? args = null, CustomResourceOptions? opts = null)
    public ObjectSwitchcontrollerCustomcommand(String name, ObjectSwitchcontrollerCustomcommandArgs args)
    public ObjectSwitchcontrollerCustomcommand(String name, ObjectSwitchcontrollerCustomcommandArgs args, CustomResourceOptions options)
    
    type: fortimanager:ObjectSwitchcontrollerCustomcommand
    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 ObjectSwitchcontrollerCustomcommandArgs
    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 ObjectSwitchcontrollerCustomcommandArgs
    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 ObjectSwitchcontrollerCustomcommandArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ObjectSwitchcontrollerCustomcommandArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ObjectSwitchcontrollerCustomcommandArgs
    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 objectSwitchcontrollerCustomcommandResource = new Fortimanager.ObjectSwitchcontrollerCustomcommand("objectSwitchcontrollerCustomcommandResource", new()
    {
        Adom = "string",
        Command = "string",
        CommandName = "string",
        Description = "string",
        ObjectSwitchcontrollerCustomcommandId = "string",
        Scopetype = "string",
    });
    
    example, err := fortimanager.NewObjectSwitchcontrollerCustomcommand(ctx, "objectSwitchcontrollerCustomcommandResource", &fortimanager.ObjectSwitchcontrollerCustomcommandArgs{
    Adom: pulumi.String("string"),
    Command: pulumi.String("string"),
    CommandName: pulumi.String("string"),
    Description: pulumi.String("string"),
    ObjectSwitchcontrollerCustomcommandId: pulumi.String("string"),
    Scopetype: pulumi.String("string"),
    })
    
    var objectSwitchcontrollerCustomcommandResource = new ObjectSwitchcontrollerCustomcommand("objectSwitchcontrollerCustomcommandResource", ObjectSwitchcontrollerCustomcommandArgs.builder()
        .adom("string")
        .command("string")
        .commandName("string")
        .description("string")
        .objectSwitchcontrollerCustomcommandId("string")
        .scopetype("string")
        .build());
    
    object_switchcontroller_customcommand_resource = fortimanager.ObjectSwitchcontrollerCustomcommand("objectSwitchcontrollerCustomcommandResource",
        adom="string",
        command="string",
        command_name="string",
        description="string",
        object_switchcontroller_customcommand_id="string",
        scopetype="string")
    
    const objectSwitchcontrollerCustomcommandResource = new fortimanager.ObjectSwitchcontrollerCustomcommand("objectSwitchcontrollerCustomcommandResource", {
        adom: "string",
        command: "string",
        commandName: "string",
        description: "string",
        objectSwitchcontrollerCustomcommandId: "string",
        scopetype: "string",
    });
    
    type: fortimanager:ObjectSwitchcontrollerCustomcommand
    properties:
        adom: string
        command: string
        commandName: string
        description: string
        objectSwitchcontrollerCustomcommandId: string
        scopetype: string
    

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

    Adom string
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    Command string
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    CommandName string
    Command name called by the FortiGate switch controller in the execute command.
    Description string
    Description.
    ObjectSwitchcontrollerCustomcommandId string
    an identifier for the resource with format {{command_name}}.
    Scopetype string
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
    Adom string
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    Command string
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    CommandName string
    Command name called by the FortiGate switch controller in the execute command.
    Description string
    Description.
    ObjectSwitchcontrollerCustomcommandId string
    an identifier for the resource with format {{command_name}}.
    Scopetype string
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
    adom String
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    command String
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    commandName String
    Command name called by the FortiGate switch controller in the execute command.
    description String
    Description.
    objectSwitchcontrollerCustomcommandId String
    an identifier for the resource with format {{command_name}}.
    scopetype String
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
    adom string
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    command string
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    commandName string
    Command name called by the FortiGate switch controller in the execute command.
    description string
    Description.
    objectSwitchcontrollerCustomcommandId string
    an identifier for the resource with format {{command_name}}.
    scopetype string
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
    adom str
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    command str
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    command_name str
    Command name called by the FortiGate switch controller in the execute command.
    description str
    Description.
    object_switchcontroller_customcommand_id str
    an identifier for the resource with format {{command_name}}.
    scopetype str
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
    adom String
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    command String
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    commandName String
    Command name called by the FortiGate switch controller in the execute command.
    description String
    Description.
    objectSwitchcontrollerCustomcommandId String
    an identifier for the resource with format {{command_name}}.
    scopetype String
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ObjectSwitchcontrollerCustomcommand Resource

    Get an existing ObjectSwitchcontrollerCustomcommand 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?: ObjectSwitchcontrollerCustomcommandState, opts?: CustomResourceOptions): ObjectSwitchcontrollerCustomcommand
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            adom: Optional[str] = None,
            command: Optional[str] = None,
            command_name: Optional[str] = None,
            description: Optional[str] = None,
            object_switchcontroller_customcommand_id: Optional[str] = None,
            scopetype: Optional[str] = None) -> ObjectSwitchcontrollerCustomcommand
    func GetObjectSwitchcontrollerCustomcommand(ctx *Context, name string, id IDInput, state *ObjectSwitchcontrollerCustomcommandState, opts ...ResourceOption) (*ObjectSwitchcontrollerCustomcommand, error)
    public static ObjectSwitchcontrollerCustomcommand Get(string name, Input<string> id, ObjectSwitchcontrollerCustomcommandState? state, CustomResourceOptions? opts = null)
    public static ObjectSwitchcontrollerCustomcommand get(String name, Output<String> id, ObjectSwitchcontrollerCustomcommandState state, CustomResourceOptions options)
    resources:  _:    type: fortimanager:ObjectSwitchcontrollerCustomcommand    get:      id: ${id}
    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:
    Adom string
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    Command string
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    CommandName string
    Command name called by the FortiGate switch controller in the execute command.
    Description string
    Description.
    ObjectSwitchcontrollerCustomcommandId string
    an identifier for the resource with format {{command_name}}.
    Scopetype string
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
    Adom string
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    Command string
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    CommandName string
    Command name called by the FortiGate switch controller in the execute command.
    Description string
    Description.
    ObjectSwitchcontrollerCustomcommandId string
    an identifier for the resource with format {{command_name}}.
    Scopetype string
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
    adom String
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    command String
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    commandName String
    Command name called by the FortiGate switch controller in the execute command.
    description String
    Description.
    objectSwitchcontrollerCustomcommandId String
    an identifier for the resource with format {{command_name}}.
    scopetype String
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
    adom string
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    command string
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    commandName string
    Command name called by the FortiGate switch controller in the execute command.
    description string
    Description.
    objectSwitchcontrollerCustomcommandId string
    an identifier for the resource with format {{command_name}}.
    scopetype string
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
    adom str
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    command str
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    command_name str
    Command name called by the FortiGate switch controller in the execute command.
    description str
    Description.
    object_switchcontroller_customcommand_id str
    an identifier for the resource with format {{command_name}}.
    scopetype str
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
    adom String
    Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
    command String
    String of commands to send to FortiSwitch devices (For example (0x0.00000172e012p-1022 = return key): config switch trunk 0x0.07f258d1c4808p-1022 edit myTrunk 0x0.00000172e012p-1022 set members port1 port2 0x0.0000000000001p-1022 end 0x0.00000172df7ep-1022).
    commandName String
    Command name called by the FortiGate switch controller in the execute command.
    description String
    Description.
    objectSwitchcontrollerCustomcommandId String
    an identifier for the resource with format {{command_name}}.
    scopetype String
    The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.

    Import

    ObjectSwitchController CustomCommand can be imported using any of these accepted formats:

    $ export “FORTIMANAGER_IMPORT_TABLE”=“true”

    $ pulumi import fortimanager:index/objectSwitchcontrollerCustomcommand:ObjectSwitchcontrollerCustomcommand labelname {{command_name}}
    

    $ unset “FORTIMANAGER_IMPORT_TABLE”

    -> Hint: The scopetype and adom for import will directly inherit the scopetype and adom configuration of the provider.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    fortimanager fortinetdev/terraform-provider-fortimanager
    License
    Notes
    This Pulumi package is based on the fortimanager Terraform Provider.
    fortimanager logo
    fortimanager 1.13.0 published on Thursday, Mar 13, 2025 by fortinetdev