1. Registry
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. getDeviceRoles
Viewing docs for netbox 6.0.1
published on Monday, Nov 16, 2026 by e-breuninger
netbox
Viewing docs for netbox 6.0.1
published on Monday, Nov 16, 2026 by e-breuninger

    Lists device_role objects matching the given filters.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const test = netbox.getDeviceRoles({
        filters: [{
            name: "name",
            value: "test-device_role",
        }],
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.get_device_roles(filters=[{
        "name": "name",
        "value": "test-device_role",
    }])
    
    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.GetDeviceRoles(ctx, &netbox.GetDeviceRolesArgs{
    			Filters: []netbox.GetDeviceRolesFilter{
    				{
    					Name:  "name",
    					Value: "test-device_role",
    				},
    			},
    		}, 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.GetDeviceRoles.Invoke(new()
        {
            Filters = new[]
            {
                new Netbox.Inputs.GetDeviceRolesFilterInputArgs
                {
                    Name = "name",
                    Value = "test-device_role",
                },
            },
        });
    
    });
    
    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.GetDeviceRolesArgs;
    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.getDeviceRoles(GetDeviceRolesArgs.builder()
                .filters(GetDeviceRolesFilterArgs.builder()
                    .name("name")
                    .value("test-device_role")
                    .build())
                .build());
    
        }
    }
    
    variables:
      test:
        fn::invoke:
          function: netbox:getDeviceRoles
          arguments:
            filters:
              - name: name
                value: test-device_role
    
    Example coming soon!
    

    Using getDeviceRoles

    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 getDeviceRoles(args: GetDeviceRolesArgs, opts?: InvokeOptions): Promise<GetDeviceRolesResult>
    function getDeviceRolesOutput(args: GetDeviceRolesOutputArgs, opts?: InvokeOutputOptions): Output<GetDeviceRolesResult>
    def get_device_roles(filters: Optional[Sequence[GetDeviceRolesFilter]] = None,
                         limit: Optional[float] = None,
                         opts: Optional[InvokeOptions] = None) -> GetDeviceRolesResult
    def get_device_roles_output(filters: pulumi.Input[Optional[Sequence[pulumi.Input[GetDeviceRolesFilterArgs]]]] = None,
                         limit: pulumi.Input[Optional[float]] = None,
                         opts: Optional[InvokeOutputOptions] = None) -> Output[GetDeviceRolesResult]
    func GetDeviceRoles(ctx *Context, args *GetDeviceRolesArgs, opts ...InvokeOption) (*GetDeviceRolesResult, error)
    func GetDeviceRolesOutput(ctx *Context, args *GetDeviceRolesOutputArgs, opts ...InvokeOption) GetDeviceRolesResultOutput

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

    public static class GetDeviceRoles 
    {
        public static Task<GetDeviceRolesResult> InvokeAsync(GetDeviceRolesArgs args, InvokeOptions? opts = null)
        public static Output<GetDeviceRolesResult> Invoke(GetDeviceRolesInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetDeviceRolesResult> Invoke(GetDeviceRolesInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetDeviceRolesResult> getDeviceRoles(GetDeviceRolesArgs args, InvokeOptions options)
    public static Output<GetDeviceRolesResult> getDeviceRoles(GetDeviceRolesArgs args, InvokeOptions options)
    public static Output<GetDeviceRolesResult> getDeviceRoles(GetDeviceRolesArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: netbox:index/getDeviceRoles:getDeviceRoles
      arguments:
        # arguments dictionary
    data "netbox_get_device_roles" "name" {
        # arguments
    }

    The following arguments are supported:

    Filters List<GetDeviceRolesFilter>
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    Limit double
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    Filters []GetDeviceRolesFilter
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    Limit float64
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    filters list(object)
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    limit number
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    filters List<GetDeviceRolesFilter>
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    limit Double
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    filters GetDeviceRolesFilter[]
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    limit number
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    filters Sequence[GetDeviceRolesFilter]
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    limit float
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    filters List<Property Map>
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    limit Number
    The maximum number of objects to return from the API lookup. Defaults to 1000.

    getDeviceRoles Result

    The following output properties are available:

    DeviceRoles List<GetDeviceRolesDeviceRole>
    The matching device*roles.
    Id string
    The provider-assigned unique ID for this managed resource.
    Filters List<GetDeviceRolesFilter>
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    Limit double
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    DeviceRoles []GetDeviceRolesDeviceRole
    The matching device*roles.
    Id string
    The provider-assigned unique ID for this managed resource.
    Filters []GetDeviceRolesFilter
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    Limit float64
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    device_roles list(object)
    The matching device*roles.
    id string
    The provider-assigned unique ID for this managed resource.
    filters list(object)
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    limit number
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    deviceRoles List<GetDeviceRolesDeviceRole>
    The matching device*roles.
    id String
    The provider-assigned unique ID for this managed resource.
    filters List<GetDeviceRolesFilter>
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    limit Double
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    deviceRoles GetDeviceRolesDeviceRole[]
    The matching device*roles.
    id string
    The provider-assigned unique ID for this managed resource.
    filters GetDeviceRolesFilter[]
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    limit number
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    device_roles Sequence[GetDeviceRolesDeviceRole]
    The matching device*roles.
    id str
    The provider-assigned unique ID for this managed resource.
    filters Sequence[GetDeviceRolesFilter]
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    limit float
    The maximum number of objects to return from the API lookup. Defaults to 1000.
    deviceRoles List<Property Map>
    The matching device*roles.
    id String
    The provider-assigned unique ID for this managed resource.
    filters List<Property Map>
    Query filters, sent as API list parameters. Supported names: ancestor, ancestorn, ancestorid, ancestoridn, color, colorempty, coloric, colorie, coloriew, coloriregex, colorisw, colorn, colornic, colornie, colorniew, colornisw, colorregex, configtemplateid, configtemplateidn, created, createdempty, createdgt, createdgte, createdlt, createdlte, createdn, description, descriptionempty, descriptionic, descriptionie, descriptioniew, descriptioniregex, descriptionisw, descriptionn, descriptionnic, descriptionnie, descriptionniew, descriptionnisw, descriptionregex, id, idempty, idgt, idgte, idlt, idlte, idn, lastupdated, lastupdatedempty, last_updatedgt, last_updatedgte, last_updatedlt, last_updatedlte, last_updatedn, name, nameempty, nameic, nameie, nameiew, nameiregex, nameisw, namen, namenic, namenie, nameniew, namenisw, nameregex, owner, ownern, ownergroup, ownergroupn, ownergroupid, ownergroupidn, ownerid, owneridn, parent, parentn, parentid, parentidn, q, slug, slugempty, slugic, slugie, slugiew, slugiregex, slugisw, slugn, slugnic, slugnie, slugniew, slugnisw, slugregex, tag, tagany, tagn, tagid, tagidany, tag_id_*n, vm*role. Repeating a name sends that parameter once per value. Custom fields filter as cf*\n\n, e.g. cf*tier, with the field's own filter logic: loose is a case-insensitive substring match, exact an exact match. NetBox ignores names it has no custom field for, and such an entry does not narrow the result.
    limit Number
    The maximum number of objects to return from the API lookup. Defaults to 1000.

    Supporting Types

    GetDeviceRolesDeviceRole

    ColorHex string
    RGB color in hex (e.g. ff0000). Defaults to 9e9e9e.
    Comments string
    ConfigTemplateId double
    Id of the config template devices of this role render by default.
    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
    DeviceCount double
    Number of devices with the role.
    Id double
    NetBox id.
    LastUpdated string
    Name string
    OwnerId double
    Id of the owner the object is assigned to.
    ParentId double
    Id of the parent device role.
    Slug string
    URL-friendly unique shorthand; derived from name when not set.
    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.
    Url string
    VirtualMachineCount double
    Number of virtual machines with the role.
    VmRole bool
    Whether virtual machines may be assigned this role.
    ColorHex string
    RGB color in hex (e.g. ff0000). Defaults to 9e9e9e.
    Comments string
    ConfigTemplateId float64
    Id of the config template devices of this role render by default.
    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
    DeviceCount float64
    Number of devices with the role.
    Id float64
    NetBox id.
    LastUpdated string
    Name string
    OwnerId float64
    Id of the owner the object is assigned to.
    ParentId float64
    Id of the parent device role.
    Slug string
    URL-friendly unique shorthand; derived from name when not set.
    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.
    Url string
    VirtualMachineCount float64
    Number of virtual machines with the role.
    VmRole bool
    Whether virtual machines may be assigned this role.
    color_hex string
    RGB color in hex (e.g. ff0000). Defaults to 9e9e9e.
    comments string
    config_template_id number
    Id of the config template devices of this role render by default.
    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_count number
    Number of devices with the role.
    id number
    NetBox id.
    last_updated string
    name string
    owner_id number
    Id of the owner the object is assigned to.
    parent_id number
    Id of the parent device role.
    slug string
    URL-friendly unique shorthand; derived from name when not set.
    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.
    url string
    virtual_machine_count number
    Number of virtual machines with the role.
    vm_role bool
    Whether virtual machines may be assigned this role.
    colorHex String
    RGB color in hex (e.g. ff0000). Defaults to 9e9e9e.
    comments String
    configTemplateId Double
    Id of the config template devices of this role render by default.
    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
    deviceCount Double
    Number of devices with the role.
    id Double
    NetBox id.
    lastUpdated String
    name String
    ownerId Double
    Id of the owner the object is assigned to.
    parentId Double
    Id of the parent device role.
    slug String
    URL-friendly unique shorthand; derived from name when not set.
    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.
    url String
    virtualMachineCount Double
    Number of virtual machines with the role.
    vmRole Boolean
    Whether virtual machines may be assigned this role.
    colorHex string
    RGB color in hex (e.g. ff0000). Defaults to 9e9e9e.
    comments string
    configTemplateId number
    Id of the config template devices of this role render by default.
    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
    deviceCount number
    Number of devices with the role.
    id number
    NetBox id.
    lastUpdated string
    name string
    ownerId number
    Id of the owner the object is assigned to.
    parentId number
    Id of the parent device role.
    slug string
    URL-friendly unique shorthand; derived from name when not set.
    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.
    url string
    virtualMachineCount number
    Number of virtual machines with the role.
    vmRole boolean
    Whether virtual machines may be assigned this role.
    color_hex str
    RGB color in hex (e.g. ff0000). Defaults to 9e9e9e.
    comments str
    config_template_id float
    Id of the config template devices of this role render by default.
    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_count float
    Number of devices with the role.
    id float
    NetBox id.
    last_updated str
    name str
    owner_id float
    Id of the owner the object is assigned to.
    parent_id float
    Id of the parent device role.
    slug str
    URL-friendly unique shorthand; derived from name when not set.
    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.
    url str
    virtual_machine_count float
    Number of virtual machines with the role.
    vm_role bool
    Whether virtual machines may be assigned this role.
    colorHex String
    RGB color in hex (e.g. ff0000). Defaults to 9e9e9e.
    comments String
    configTemplateId Number
    Id of the config template devices of this role render by default.
    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
    deviceCount Number
    Number of devices with the role.
    id Number
    NetBox id.
    lastUpdated String
    name String
    ownerId Number
    Id of the owner the object is assigned to.
    parentId Number
    Id of the parent device role.
    slug String
    URL-friendly unique shorthand; derived from name when not set.
    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.
    url String
    virtualMachineCount Number
    Number of virtual machines with the role.
    vmRole Boolean
    Whether virtual machines may be assigned this role.

    GetDeviceRolesFilter

    Name string
    Name of the query filter (the API list parameter).
    Value string
    Value to filter by.
    Name string
    Name of the query filter (the API list parameter).
    Value string
    Value to filter by.
    name string
    Name of the query filter (the API list parameter).
    value string
    Value to filter by.
    name String
    Name of the query filter (the API list parameter).
    value String
    Value to filter by.
    name string
    Name of the query filter (the API list parameter).
    value string
    Value to filter by.
    name str
    Name of the query filter (the API list parameter).
    value str
    Value to filter by.
    name String
    Name of the query filter (the API list parameter).
    value String
    Value to filter by.

    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.1
    published on Monday, Nov 16, 2026 by e-breuninger

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial