1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. getVirtualDeviceContext
Viewing docs for netbox 6.0.0
published on Wednesday, Nov 4, 2026 by e-breuninger
netbox
Viewing docs for netbox 6.0.0
published on Wednesday, Nov 4, 2026 by e-breuninger

    A virtual device context: a logical partition of a device with its own interfaces and addresses (dcim.virtualdevicecontext).

    From the official documentation:

    A virtual device context (VDC) represents a logical partition within a physical device, to which interfaces from the parent device can be allocated. Each VDC effectively provides an isolated control plane, but relies on shared resources of the parent device. A VDC is somewhat similar to a virtual machine in that it effects isolation between various components, but stops short of delivering a fully virtualized environment.

    Each VDC must be assigned to a device upon creation, after which interfaces belonging to that device can be assigned to one or more of its VDCs. A VDC can have any number of interfaces assigned to it, and an interface can belong to any number of VDCs.

    A VDC by Any Other Name: Network vendors use differing names for this concept. Cisco uses the term VDC, whereas Juniper refers to it as a Virtual Routing Instance, and Fortinet uses Virtual Domain, for instance. While there may be some nuance among the vendors’ unique implementations, the general concept remains the same for each.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const test = netbox.getVirtualDeviceContext({
        name: "test-virtual_device_context",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.get_virtual_device_context(name="test-virtual_device_context")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v6/netbox"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := netbox.LookupVirtualDeviceContext(ctx, &netbox.LookupVirtualDeviceContextArgs{
    			Name: pulumi.StringRef("test-virtual_device_context"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Netbox = Pulumi.Netbox;
    
    return await Deployment.RunAsync(() => 
    {
        var test = Netbox.GetVirtualDeviceContext.Invoke(new()
        {
            Name = "test-virtual_device_context",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.NetboxFunctions;
    import com.pulumi.netbox.inputs.GetVirtualDeviceContextArgs;
    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) {
            final var test = NetboxFunctions.getVirtualDeviceContext(GetVirtualDeviceContextArgs.builder()
                .name("test-virtual_device_context")
                .build());
    
        }
    }
    
    variables:
      test:
        fn::invoke:
          function: netbox:getVirtualDeviceContext
          arguments:
            name: test-virtual_device_context
    
    Example coming soon!
    

    Using getVirtualDeviceContext

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getVirtualDeviceContext(args: GetVirtualDeviceContextArgs, opts?: InvokeOptions): Promise<GetVirtualDeviceContextResult>
    function getVirtualDeviceContextOutput(args: GetVirtualDeviceContextOutputArgs, opts?: InvokeOutputOptions): Output<GetVirtualDeviceContextResult>
    def get_virtual_device_context(custom_field_filters: Optional[Mapping[str, str]] = None,
                                   device_id: Optional[float] = None,
                                   id: Optional[float] = None,
                                   identifier: Optional[float] = None,
                                   name: Optional[str] = None,
                                   owner_id: Optional[float] = None,
                                   status: Optional[str] = None,
                                   tag_slug: Optional[str] = None,
                                   tenant_id: Optional[float] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetVirtualDeviceContextResult
    def get_virtual_device_context_output(custom_field_filters: pulumi.Input[Optional[Mapping[str, pulumi.Input[str]]]] = None,
                                   device_id: pulumi.Input[Optional[float]] = None,
                                   id: pulumi.Input[Optional[float]] = None,
                                   identifier: pulumi.Input[Optional[float]] = None,
                                   name: pulumi.Input[Optional[str]] = None,
                                   owner_id: pulumi.Input[Optional[float]] = None,
                                   status: pulumi.Input[Optional[str]] = None,
                                   tag_slug: pulumi.Input[Optional[str]] = None,
                                   tenant_id: pulumi.Input[Optional[float]] = None,
                                   opts: Optional[InvokeOutputOptions] = None) -> Output[GetVirtualDeviceContextResult]
    func LookupVirtualDeviceContext(ctx *Context, args *LookupVirtualDeviceContextArgs, opts ...InvokeOption) (*LookupVirtualDeviceContextResult, error)
    func LookupVirtualDeviceContextOutput(ctx *Context, args *LookupVirtualDeviceContextOutputArgs, opts ...InvokeOption) LookupVirtualDeviceContextResultOutput

    > Note: This function is named LookupVirtualDeviceContext in the Go SDK.

    public static class GetVirtualDeviceContext 
    {
        public static Task<GetVirtualDeviceContextResult> InvokeAsync(GetVirtualDeviceContextArgs args, InvokeOptions? opts = null)
        public static Output<GetVirtualDeviceContextResult> Invoke(GetVirtualDeviceContextInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetVirtualDeviceContextResult> Invoke(GetVirtualDeviceContextInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetVirtualDeviceContextResult> getVirtualDeviceContext(GetVirtualDeviceContextArgs args, InvokeOptions options)
    public static Output<GetVirtualDeviceContextResult> getVirtualDeviceContext(GetVirtualDeviceContextArgs args, InvokeOptions options)
    public static Output<GetVirtualDeviceContextResult> getVirtualDeviceContext(GetVirtualDeviceContextArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: netbox:index/getVirtualDeviceContext:getVirtualDeviceContext
      arguments:
        # arguments dictionary
    data "netbox_get_virtual_device_context" "name" {
        # arguments
    }

    The following arguments are supported:

    CustomFieldFilters Dictionary<string, string>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    DeviceId double
    Id of the device.
    Id double
    NetBox id.
    Identifier double
    Numeric identifier, unique within the device. Must be a whole number.
    Name string
    OwnerId double
    Id of the owner the object is assigned to.
    Status string
    Operational status. One of: active, planned, offline.
    TagSlug string
    Slug of a tag the object carries.
    TenantId double
    Id of the tenant.
    CustomFieldFilters map[string]string
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    DeviceId float64
    Id of the device.
    Id float64
    NetBox id.
    Identifier float64
    Numeric identifier, unique within the device. Must be a whole number.
    Name string
    OwnerId float64
    Id of the owner the object is assigned to.
    Status string
    Operational status. One of: active, planned, offline.
    TagSlug string
    Slug of a tag the object carries.
    TenantId float64
    Id of the tenant.
    custom_field_filters map(string)
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    device_id number
    Id of the device.
    id number
    NetBox id.
    identifier number
    Numeric identifier, unique within the device. Must be a whole number.
    name string
    owner_id number
    Id of the owner the object is assigned to.
    status string
    Operational status. One of: active, planned, offline.
    tag_slug string
    Slug of a tag the object carries.
    tenant_id number
    Id of the tenant.
    customFieldFilters Map<String,String>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    deviceId Double
    Id of the device.
    id Double
    NetBox id.
    identifier Double
    Numeric identifier, unique within the device. Must be a whole number.
    name String
    ownerId Double
    Id of the owner the object is assigned to.
    status String
    Operational status. One of: active, planned, offline.
    tagSlug String
    Slug of a tag the object carries.
    tenantId Double
    Id of the tenant.
    customFieldFilters {[key: string]: string}
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    deviceId number
    Id of the device.
    id number
    NetBox id.
    identifier number
    Numeric identifier, unique within the device. Must be a whole number.
    name string
    ownerId number
    Id of the owner the object is assigned to.
    status string
    Operational status. One of: active, planned, offline.
    tagSlug string
    Slug of a tag the object carries.
    tenantId number
    Id of the tenant.
    custom_field_filters Mapping[str, str]
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    device_id float
    Id of the device.
    id float
    NetBox id.
    identifier float
    Numeric identifier, unique within the device. Must be a whole number.
    name str
    owner_id float
    Id of the owner the object is assigned to.
    status str
    Operational status. One of: active, planned, offline.
    tag_slug str
    Slug of a tag the object carries.
    tenant_id float
    Id of the tenant.
    customFieldFilters Map<String>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    deviceId Number
    Id of the device.
    id Number
    NetBox id.
    identifier Number
    Numeric identifier, unique within the device. Must be a whole number.
    name String
    ownerId Number
    Id of the owner the object is assigned to.
    status String
    Operational status. One of: active, planned, offline.
    tagSlug String
    Slug of a tag the object carries.
    tenantId Number
    Id of the tenant.

    getVirtualDeviceContext Result

    The following output properties are available:

    Comments string
    Created string
    CustomFields Dictionary<string, string>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    Description string
    DeviceId double
    Id of the device.
    Id double
    NetBox id.
    Identifier double
    Numeric identifier, unique within the device. Must be a whole number.
    InterfaceCount double
    Number of interfaces assigned to the context.
    LastUpdated string
    Name string
    OwnerId double
    Id of the owner the object is assigned to.
    PrimaryIp4Id double
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    PrimaryIp6Id double
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    Status string
    Operational status. One of: active, planned, offline.
    Tags List<string>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TagsAlls List<string>
    Slugs of all tags on the object, including the provider's default_tags.
    TenantId double
    Id of the tenant.
    Url string
    CustomFieldFilters Dictionary<string, string>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    TagSlug string
    Slug of a tag the object carries.
    Comments string
    Created string
    CustomFields map[string]string
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    Description string
    DeviceId float64
    Id of the device.
    Id float64
    NetBox id.
    Identifier float64
    Numeric identifier, unique within the device. Must be a whole number.
    InterfaceCount float64
    Number of interfaces assigned to the context.
    LastUpdated string
    Name string
    OwnerId float64
    Id of the owner the object is assigned to.
    PrimaryIp4Id float64
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    PrimaryIp6Id float64
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    Status string
    Operational status. One of: active, planned, offline.
    Tags []string
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    TagsAlls []string
    Slugs of all tags on the object, including the provider's default_tags.
    TenantId float64
    Id of the tenant.
    Url string
    CustomFieldFilters map[string]string
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    TagSlug string
    Slug of a tag the object carries.
    comments string
    created string
    custom_fields map(string)
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description string
    device_id number
    Id of the device.
    id number
    NetBox id.
    identifier number
    Numeric identifier, unique within the device. Must be a whole number.
    interface_count number
    Number of interfaces assigned to the context.
    last_updated string
    name string
    owner_id number
    Id of the owner the object is assigned to.
    primary_ip4_id number
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primary_ip6_id number
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    status string
    Operational status. One of: active, planned, offline.
    tags list(string)
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tags_alls list(string)
    Slugs of all tags on the object, including the provider's default_tags.
    tenant_id number
    Id of the tenant.
    url string
    custom_field_filters map(string)
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    tag_slug string
    Slug of a tag the object carries.
    comments String
    created String
    customFields Map<String,String>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description String
    deviceId Double
    Id of the device.
    id Double
    NetBox id.
    identifier Double
    Numeric identifier, unique within the device. Must be a whole number.
    interfaceCount Double
    Number of interfaces assigned to the context.
    lastUpdated String
    name String
    ownerId Double
    Id of the owner the object is assigned to.
    primaryIp4Id Double
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primaryIp6Id Double
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    status String
    Operational status. One of: active, planned, offline.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId Double
    Id of the tenant.
    url String
    customFieldFilters Map<String,String>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    tagSlug String
    Slug of a tag the object carries.
    comments string
    created string
    customFields {[key: string]: string}
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description string
    deviceId number
    Id of the device.
    id number
    NetBox id.
    identifier number
    Numeric identifier, unique within the device. Must be a whole number.
    interfaceCount number
    Number of interfaces assigned to the context.
    lastUpdated string
    name string
    ownerId number
    Id of the owner the object is assigned to.
    primaryIp4Id number
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primaryIp6Id number
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    status string
    Operational status. One of: active, planned, offline.
    tags string[]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls string[]
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId number
    Id of the tenant.
    url string
    customFieldFilters {[key: string]: string}
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    tagSlug string
    Slug of a tag the object carries.
    comments str
    created str
    custom_fields Mapping[str, str]
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description str
    device_id float
    Id of the device.
    id float
    NetBox id.
    identifier float
    Numeric identifier, unique within the device. Must be a whole number.
    interface_count float
    Number of interfaces assigned to the context.
    last_updated str
    name str
    owner_id float
    Id of the owner the object is assigned to.
    primary_ip4_id float
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primary_ip6_id float
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    status str
    Operational status. One of: active, planned, offline.
    tags Sequence[str]
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tags_alls Sequence[str]
    Slugs of all tags on the object, including the provider's default_tags.
    tenant_id float
    Id of the tenant.
    url str
    custom_field_filters Mapping[str, str]
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    tag_slug str
    Slug of a tag the object carries.
    comments String
    created String
    customFields Map<String>
    Custom field values by field name. Every value is a string; NetBox coerces numbers and booleans. An object field holds the related object's id, e.g. "12", a multiobject field a JSON list of ids in any order, e.g. jsonencode([12, 13]). A key removed from the map is cleared in NetBox (set {} to clear all).
    description String
    deviceId Number
    Id of the device.
    id Number
    NetBox id.
    identifier Number
    Numeric identifier, unique within the device. Must be a whole number.
    interfaceCount Number
    Number of interfaces assigned to the context.
    lastUpdated String
    name String
    ownerId Number
    Id of the owner the object is assigned to.
    primaryIp4Id Number
    Id of the primary IPv4 address; it must be assigned to an interface of the device.
    primaryIp6Id Number
    Id of the primary IPv6 address; it must be assigned to an interface of the device.
    status String
    Operational status. One of: active, planned, offline.
    tags List<String>
    Slugs of the tags assigned to the object (the provider's defaulttags are added on top, see tagsall).
    tagsAlls List<String>
    Slugs of all tags on the object, including the provider's default_tags.
    tenantId Number
    Id of the tenant.
    url String
    customFieldFilters Map<String>
    Custom field values to match, by field name, e.g. { tier = "gold" }: each entry filters as cf_\n\n with the field's own filter logic, loose (case-insensitive substring) or exact.
    tagSlug String
    Slug of a tag the object carries.

    Package Details

    Repository
    netbox e-breuninger/terraform-provider-netbox
    License
    Notes
    This Pulumi package is based on the netbox Terraform Provider.
    netbox
    Viewing docs for netbox 6.0.0
    published on Wednesday, Nov 4, 2026 by e-breuninger

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial