1. Packages
  2. Netbox Provider
  3. API Docs
  4. DeviceConsoleServerPort
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

netbox.DeviceConsoleServerPort

Explore with Pulumi AI

netbox logo
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

    From the official documentation:

    A console server is a device which provides remote access to the local consoles of connected devices. They are typically used to provide remote out-of-band access to network devices, and generally connect to console ports.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    // Note that some terraform code is not included in the example for brevity
    const testDevice = new netbox.Device("testDevice", {
        deviceTypeId: netbox_device_type.test.id,
        roleId: netbox_device_role.test.id,
        siteId: netbox_site.test.id,
    });
    const testDeviceConsoleServerPort = new netbox.DeviceConsoleServerPort("testDeviceConsoleServerPort", {
        deviceId: testDevice.deviceId,
        type: "de-9",
        speed: 1200,
        markConnected: true,
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    # Note that some terraform code is not included in the example for brevity
    test_device = netbox.Device("testDevice",
        device_type_id=netbox_device_type["test"]["id"],
        role_id=netbox_device_role["test"]["id"],
        site_id=netbox_site["test"]["id"])
    test_device_console_server_port = netbox.DeviceConsoleServerPort("testDeviceConsoleServerPort",
        device_id=test_device.device_id,
        type="de-9",
        speed=1200,
        mark_connected=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Note that some terraform code is not included in the example for brevity
    		testDevice, err := netbox.NewDevice(ctx, "testDevice", &netbox.DeviceArgs{
    			DeviceTypeId: pulumi.Any(netbox_device_type.Test.Id),
    			RoleId:       pulumi.Any(netbox_device_role.Test.Id),
    			SiteId:       pulumi.Any(netbox_site.Test.Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = netbox.NewDeviceConsoleServerPort(ctx, "testDeviceConsoleServerPort", &netbox.DeviceConsoleServerPortArgs{
    			DeviceId:      testDevice.DeviceId,
    			Type:          pulumi.String("de-9"),
    			Speed:         pulumi.Float64(1200),
    			MarkConnected: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Netbox = Pulumi.Netbox;
    
    return await Deployment.RunAsync(() => 
    {
        // Note that some terraform code is not included in the example for brevity
        var testDevice = new Netbox.Device("testDevice", new()
        {
            DeviceTypeId = netbox_device_type.Test.Id,
            RoleId = netbox_device_role.Test.Id,
            SiteId = netbox_site.Test.Id,
        });
    
        var testDeviceConsoleServerPort = new Netbox.DeviceConsoleServerPort("testDeviceConsoleServerPort", new()
        {
            DeviceId = testDevice.DeviceId,
            Type = "de-9",
            Speed = 1200,
            MarkConnected = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.Device;
    import com.pulumi.netbox.DeviceArgs;
    import com.pulumi.netbox.DeviceConsoleServerPort;
    import com.pulumi.netbox.DeviceConsoleServerPortArgs;
    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) {
            // Note that some terraform code is not included in the example for brevity
            var testDevice = new Device("testDevice", DeviceArgs.builder()
                .deviceTypeId(netbox_device_type.test().id())
                .roleId(netbox_device_role.test().id())
                .siteId(netbox_site.test().id())
                .build());
    
            var testDeviceConsoleServerPort = new DeviceConsoleServerPort("testDeviceConsoleServerPort", DeviceConsoleServerPortArgs.builder()
                .deviceId(testDevice.deviceId())
                .type("de-9")
                .speed(1200)
                .markConnected(true)
                .build());
    
        }
    }
    
    resources:
      # Note that some terraform code is not included in the example for brevity
      testDevice:
        type: netbox:Device
        properties:
          deviceTypeId: ${netbox_device_type.test.id}
          roleId: ${netbox_device_role.test.id}
          siteId: ${netbox_site.test.id}
      testDeviceConsoleServerPort:
        type: netbox:DeviceConsoleServerPort
        properties:
          deviceId: ${testDevice.deviceId}
          type: de-9
          speed: 1200
          markConnected: true
    

    Create DeviceConsoleServerPort Resource

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

    Constructor syntax

    new DeviceConsoleServerPort(name: string, args: DeviceConsoleServerPortArgs, opts?: CustomResourceOptions);
    @overload
    def DeviceConsoleServerPort(resource_name: str,
                                args: DeviceConsoleServerPortArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def DeviceConsoleServerPort(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                device_id: Optional[float] = None,
                                custom_fields: Optional[Mapping[str, str]] = None,
                                description: Optional[str] = None,
                                device_console_server_port_id: Optional[str] = None,
                                label: Optional[str] = None,
                                mark_connected: Optional[bool] = None,
                                module_id: Optional[float] = None,
                                name: Optional[str] = None,
                                speed: Optional[float] = None,
                                tags: Optional[Sequence[str]] = None,
                                type: Optional[str] = None)
    func NewDeviceConsoleServerPort(ctx *Context, name string, args DeviceConsoleServerPortArgs, opts ...ResourceOption) (*DeviceConsoleServerPort, error)
    public DeviceConsoleServerPort(string name, DeviceConsoleServerPortArgs args, CustomResourceOptions? opts = null)
    public DeviceConsoleServerPort(String name, DeviceConsoleServerPortArgs args)
    public DeviceConsoleServerPort(String name, DeviceConsoleServerPortArgs args, CustomResourceOptions options)
    
    type: netbox:DeviceConsoleServerPort
    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 DeviceConsoleServerPortArgs
    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 DeviceConsoleServerPortArgs
    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 DeviceConsoleServerPortArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DeviceConsoleServerPortArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DeviceConsoleServerPortArgs
    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 deviceConsoleServerPortResource = new Netbox.DeviceConsoleServerPort("deviceConsoleServerPortResource", new()
    {
        DeviceId = 0,
        CustomFields = 
        {
            { "string", "string" },
        },
        Description = "string",
        DeviceConsoleServerPortId = "string",
        Label = "string",
        MarkConnected = false,
        ModuleId = 0,
        Name = "string",
        Speed = 0,
        Tags = new[]
        {
            "string",
        },
        Type = "string",
    });
    
    example, err := netbox.NewDeviceConsoleServerPort(ctx, "deviceConsoleServerPortResource", &netbox.DeviceConsoleServerPortArgs{
    	DeviceId: pulumi.Float64(0),
    	CustomFields: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Description:               pulumi.String("string"),
    	DeviceConsoleServerPortId: pulumi.String("string"),
    	Label:                     pulumi.String("string"),
    	MarkConnected:             pulumi.Bool(false),
    	ModuleId:                  pulumi.Float64(0),
    	Name:                      pulumi.String("string"),
    	Speed:                     pulumi.Float64(0),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Type: pulumi.String("string"),
    })
    
    var deviceConsoleServerPortResource = new DeviceConsoleServerPort("deviceConsoleServerPortResource", DeviceConsoleServerPortArgs.builder()
        .deviceId(0)
        .customFields(Map.of("string", "string"))
        .description("string")
        .deviceConsoleServerPortId("string")
        .label("string")
        .markConnected(false)
        .moduleId(0)
        .name("string")
        .speed(0)
        .tags("string")
        .type("string")
        .build());
    
    device_console_server_port_resource = netbox.DeviceConsoleServerPort("deviceConsoleServerPortResource",
        device_id=0,
        custom_fields={
            "string": "string",
        },
        description="string",
        device_console_server_port_id="string",
        label="string",
        mark_connected=False,
        module_id=0,
        name="string",
        speed=0,
        tags=["string"],
        type="string")
    
    const deviceConsoleServerPortResource = new netbox.DeviceConsoleServerPort("deviceConsoleServerPortResource", {
        deviceId: 0,
        customFields: {
            string: "string",
        },
        description: "string",
        deviceConsoleServerPortId: "string",
        label: "string",
        markConnected: false,
        moduleId: 0,
        name: "string",
        speed: 0,
        tags: ["string"],
        type: "string",
    });
    
    type: netbox:DeviceConsoleServerPort
    properties:
        customFields:
            string: string
        description: string
        deviceConsoleServerPortId: string
        deviceId: 0
        label: string
        markConnected: false
        moduleId: 0
        name: string
        speed: 0
        tags:
            - string
        type: string
    

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

    DeviceId double
    CustomFields Dictionary<string, string>
    Description string
    DeviceConsoleServerPortId string
    The ID of this resource.
    Label string
    MarkConnected bool
    Defaults to false.
    ModuleId double
    Name string
    Speed double
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    Tags List<string>
    Type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    DeviceId float64
    CustomFields map[string]string
    Description string
    DeviceConsoleServerPortId string
    The ID of this resource.
    Label string
    MarkConnected bool
    Defaults to false.
    ModuleId float64
    Name string
    Speed float64
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    Tags []string
    Type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    deviceId Double
    customFields Map<String,String>
    description String
    deviceConsoleServerPortId String
    The ID of this resource.
    label String
    markConnected Boolean
    Defaults to false.
    moduleId Double
    name String
    speed Double
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    tags List<String>
    type String
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    deviceId number
    customFields {[key: string]: string}
    description string
    deviceConsoleServerPortId string
    The ID of this resource.
    label string
    markConnected boolean
    Defaults to false.
    moduleId number
    name string
    speed number
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    tags string[]
    type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    device_id float
    custom_fields Mapping[str, str]
    description str
    device_console_server_port_id str
    The ID of this resource.
    label str
    mark_connected bool
    Defaults to false.
    module_id float
    name str
    speed float
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    tags Sequence[str]
    type str
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    deviceId Number
    customFields Map<String>
    description String
    deviceConsoleServerPortId String
    The ID of this resource.
    label String
    markConnected Boolean
    Defaults to false.
    moduleId Number
    name String
    speed Number
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    tags List<String>
    type String
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DeviceConsoleServerPort 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 DeviceConsoleServerPort Resource

    Get an existing DeviceConsoleServerPort 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?: DeviceConsoleServerPortState, opts?: CustomResourceOptions): DeviceConsoleServerPort
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            custom_fields: Optional[Mapping[str, str]] = None,
            description: Optional[str] = None,
            device_console_server_port_id: Optional[str] = None,
            device_id: Optional[float] = None,
            label: Optional[str] = None,
            mark_connected: Optional[bool] = None,
            module_id: Optional[float] = None,
            name: Optional[str] = None,
            speed: Optional[float] = None,
            tags: Optional[Sequence[str]] = None,
            type: Optional[str] = None) -> DeviceConsoleServerPort
    func GetDeviceConsoleServerPort(ctx *Context, name string, id IDInput, state *DeviceConsoleServerPortState, opts ...ResourceOption) (*DeviceConsoleServerPort, error)
    public static DeviceConsoleServerPort Get(string name, Input<string> id, DeviceConsoleServerPortState? state, CustomResourceOptions? opts = null)
    public static DeviceConsoleServerPort get(String name, Output<String> id, DeviceConsoleServerPortState state, CustomResourceOptions options)
    resources:  _:    type: netbox:DeviceConsoleServerPort    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:
    CustomFields Dictionary<string, string>
    Description string
    DeviceConsoleServerPortId string
    The ID of this resource.
    DeviceId double
    Label string
    MarkConnected bool
    Defaults to false.
    ModuleId double
    Name string
    Speed double
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    Tags List<string>
    Type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    CustomFields map[string]string
    Description string
    DeviceConsoleServerPortId string
    The ID of this resource.
    DeviceId float64
    Label string
    MarkConnected bool
    Defaults to false.
    ModuleId float64
    Name string
    Speed float64
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    Tags []string
    Type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    customFields Map<String,String>
    description String
    deviceConsoleServerPortId String
    The ID of this resource.
    deviceId Double
    label String
    markConnected Boolean
    Defaults to false.
    moduleId Double
    name String
    speed Double
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    tags List<String>
    type String
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    customFields {[key: string]: string}
    description string
    deviceConsoleServerPortId string
    The ID of this resource.
    deviceId number
    label string
    markConnected boolean
    Defaults to false.
    moduleId number
    name string
    speed number
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    tags string[]
    type string
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    custom_fields Mapping[str, str]
    description str
    device_console_server_port_id str
    The ID of this resource.
    device_id float
    label str
    mark_connected bool
    Defaults to false.
    module_id float
    name str
    speed float
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    tags Sequence[str]
    type str
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].
    customFields Map<String>
    description String
    deviceConsoleServerPortId String
    The ID of this resource.
    deviceId Number
    label String
    markConnected Boolean
    Defaults to false.
    moduleId Number
    name String
    speed Number
    One of [1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200].
    tags List<String>
    type String
    One of [de-9, db-25, rj-11, rj-12, rj-45, mini-din-8, usb-a, usb-b, usb-c, usb-mini-a, usb-mini-b, usb-micro-a, usb-micro-b, usb-micro-ab, other].

    Package Details

    Repository
    netbox e-breuninger/terraform-provider-netbox
    License
    Notes
    This Pulumi package is based on the netbox Terraform Provider.
    netbox logo
    netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger