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

netbox.DeviceConsolePort

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 port provides connectivity to the physical console of a device. These are typically used for temporary access by someone who is physically near the device, or for remote out-of-band access provided via a networked console server.

    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 testDeviceConsolePort = new netbox.DeviceConsolePort("testDeviceConsolePort", {
        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_port = netbox.DeviceConsolePort("testDeviceConsolePort",
        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.NewDeviceConsolePort(ctx, "testDeviceConsolePort", &netbox.DeviceConsolePortArgs{
    			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 testDeviceConsolePort = new Netbox.DeviceConsolePort("testDeviceConsolePort", 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.DeviceConsolePort;
    import com.pulumi.netbox.DeviceConsolePortArgs;
    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 testDeviceConsolePort = new DeviceConsolePort("testDeviceConsolePort", DeviceConsolePortArgs.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}
      testDeviceConsolePort:
        type: netbox:DeviceConsolePort
        properties:
          deviceId: ${testDevice.deviceId}
          type: de-9
          speed: 1200
          markConnected: true
    

    Create DeviceConsolePort Resource

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

    Constructor syntax

    new DeviceConsolePort(name: string, args: DeviceConsolePortArgs, opts?: CustomResourceOptions);
    @overload
    def DeviceConsolePort(resource_name: str,
                          args: DeviceConsolePortArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def DeviceConsolePort(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_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 NewDeviceConsolePort(ctx *Context, name string, args DeviceConsolePortArgs, opts ...ResourceOption) (*DeviceConsolePort, error)
    public DeviceConsolePort(string name, DeviceConsolePortArgs args, CustomResourceOptions? opts = null)
    public DeviceConsolePort(String name, DeviceConsolePortArgs args)
    public DeviceConsolePort(String name, DeviceConsolePortArgs args, CustomResourceOptions options)
    
    type: netbox:DeviceConsolePort
    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 DeviceConsolePortArgs
    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 DeviceConsolePortArgs
    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 DeviceConsolePortArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DeviceConsolePortArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DeviceConsolePortArgs
    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 deviceConsolePortResource = new Netbox.DeviceConsolePort("deviceConsolePortResource", new()
    {
        DeviceId = 0,
        CustomFields = 
        {
            { "string", "string" },
        },
        Description = "string",
        DeviceConsolePortId = "string",
        Label = "string",
        MarkConnected = false,
        ModuleId = 0,
        Name = "string",
        Speed = 0,
        Tags = new[]
        {
            "string",
        },
        Type = "string",
    });
    
    example, err := netbox.NewDeviceConsolePort(ctx, "deviceConsolePortResource", &netbox.DeviceConsolePortArgs{
    	DeviceId: pulumi.Float64(0),
    	CustomFields: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Description:         pulumi.String("string"),
    	DeviceConsolePortId: 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 deviceConsolePortResource = new DeviceConsolePort("deviceConsolePortResource", DeviceConsolePortArgs.builder()
        .deviceId(0)
        .customFields(Map.of("string", "string"))
        .description("string")
        .deviceConsolePortId("string")
        .label("string")
        .markConnected(false)
        .moduleId(0)
        .name("string")
        .speed(0)
        .tags("string")
        .type("string")
        .build());
    
    device_console_port_resource = netbox.DeviceConsolePort("deviceConsolePortResource",
        device_id=0,
        custom_fields={
            "string": "string",
        },
        description="string",
        device_console_port_id="string",
        label="string",
        mark_connected=False,
        module_id=0,
        name="string",
        speed=0,
        tags=["string"],
        type="string")
    
    const deviceConsolePortResource = new netbox.DeviceConsolePort("deviceConsolePortResource", {
        deviceId: 0,
        customFields: {
            string: "string",
        },
        description: "string",
        deviceConsolePortId: "string",
        label: "string",
        markConnected: false,
        moduleId: 0,
        name: "string",
        speed: 0,
        tags: ["string"],
        type: "string",
    });
    
    type: netbox:DeviceConsolePort
    properties:
        customFields:
            string: string
        description: string
        deviceConsolePortId: string
        deviceId: 0
        label: string
        markConnected: false
        moduleId: 0
        name: string
        speed: 0
        tags:
            - string
        type: string
    

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

    DeviceId double
    CustomFields Dictionary<string, string>
    Description string
    DeviceConsolePortId 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
    DeviceConsolePortId 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
    deviceConsolePortId 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
    deviceConsolePortId 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_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
    deviceConsolePortId 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 DeviceConsolePort 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 DeviceConsolePort Resource

    Get an existing DeviceConsolePort 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?: DeviceConsolePortState, opts?: CustomResourceOptions): DeviceConsolePort
    @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_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) -> DeviceConsolePort
    func GetDeviceConsolePort(ctx *Context, name string, id IDInput, state *DeviceConsolePortState, opts ...ResourceOption) (*DeviceConsolePort, error)
    public static DeviceConsolePort Get(string name, Input<string> id, DeviceConsolePortState? state, CustomResourceOptions? opts = null)
    public static DeviceConsolePort get(String name, Output<String> id, DeviceConsolePortState state, CustomResourceOptions options)
    resources:  _:    type: netbox:DeviceConsolePort    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
    DeviceConsolePortId 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
    DeviceConsolePortId 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
    deviceConsolePortId 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
    deviceConsolePortId 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_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
    deviceConsolePortId 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