1. Packages
  2. Packages
  3. Netbox Provider
  4. API Docs
  5. getRackType
Viewing docs for netbox 5.7.0
published on Wednesday, Jul 15, 2026 by e-breuninger
Viewing docs for netbox 5.7.0
published on Wednesday, Jul 15, 2026 by e-breuninger

    Look up a rack type by model or slug.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    // Get rack type by model
    const ex1 = netbox.getRackType({
        model: "APC 4-Post Cabinet",
    });
    // Get rack type by slug
    const ex2 = netbox.getRackType({
        slug: "apc-4-post-cabinet",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    # Get rack type by model
    ex1 = netbox.get_rack_type(model="APC 4-Post Cabinet")
    # Get rack type by slug
    ex2 = netbox.get_rack_type(slug="apc-4-post-cabinet")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v5/netbox"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Get rack type by model
    		_, err := netbox.LookupRackType(ctx, &netbox.LookupRackTypeArgs{
    			Model: pulumi.StringRef("APC 4-Post Cabinet"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Get rack type by slug
    		_, err = netbox.LookupRackType(ctx, &netbox.LookupRackTypeArgs{
    			Slug: pulumi.StringRef("apc-4-post-cabinet"),
    		}, 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(() => 
    {
        // Get rack type by model
        var ex1 = Netbox.GetRackType.Invoke(new()
        {
            Model = "APC 4-Post Cabinet",
        });
    
        // Get rack type by slug
        var ex2 = Netbox.GetRackType.Invoke(new()
        {
            Slug = "apc-4-post-cabinet",
        });
    
    });
    
    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.GetRackTypeArgs;
    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) {
            // Get rack type by model
            final var ex1 = NetboxFunctions.getRackType(GetRackTypeArgs.builder()
                .model("APC 4-Post Cabinet")
                .build());
    
            // Get rack type by slug
            final var ex2 = NetboxFunctions.getRackType(GetRackTypeArgs.builder()
                .slug("apc-4-post-cabinet")
                .build());
    
        }
    }
    
    variables:
      # Get rack type by model
      ex1:
        fn::invoke:
          function: netbox:getRackType
          arguments:
            model: APC 4-Post Cabinet
      # Get rack type by slug
      ex2:
        fn::invoke:
          function: netbox:getRackType
          arguments:
            slug: apc-4-post-cabinet
    
    Example coming soon!
    

    Using getRackType

    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 getRackType(args: GetRackTypeArgs, opts?: InvokeOptions): Promise<GetRackTypeResult>
    function getRackTypeOutput(args: GetRackTypeOutputArgs, opts?: InvokeOptions): Output<GetRackTypeResult>
    def get_rack_type(id: Optional[str] = None,
                      model: Optional[str] = None,
                      slug: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetRackTypeResult
    def get_rack_type_output(id: pulumi.Input[Optional[str]] = None,
                      model: pulumi.Input[Optional[str]] = None,
                      slug: pulumi.Input[Optional[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetRackTypeResult]
    func LookupRackType(ctx *Context, args *LookupRackTypeArgs, opts ...InvokeOption) (*LookupRackTypeResult, error)
    func LookupRackTypeOutput(ctx *Context, args *LookupRackTypeOutputArgs, opts ...InvokeOption) LookupRackTypeResultOutput

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

    public static class GetRackType 
    {
        public static Task<GetRackTypeResult> InvokeAsync(GetRackTypeArgs args, InvokeOptions? opts = null)
        public static Output<GetRackTypeResult> Invoke(GetRackTypeInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRackTypeResult> getRackType(GetRackTypeArgs args, InvokeOptions options)
    public static Output<GetRackTypeResult> getRackType(GetRackTypeArgs args, InvokeOptions options)
    
    fn::invoke:
      function: netbox:index/getRackType:getRackType
      arguments:
        # arguments dictionary
    data "netbox_get_rack_type" "name" {
        # arguments
    }

    The following arguments are supported:

    Id string
    The ID of this resource.
    Model string
    At least one of model or slug must be given.
    Slug string
    At least one of model or slug must be given.
    Id string
    The ID of this resource.
    Model string
    At least one of model or slug must be given.
    Slug string
    At least one of model or slug must be given.
    id string
    The ID of this resource.
    model string
    At least one of model or slug must be given.
    slug string
    At least one of model or slug must be given.
    id String
    The ID of this resource.
    model String
    At least one of model or slug must be given.
    slug String
    At least one of model or slug must be given.
    id string
    The ID of this resource.
    model string
    At least one of model or slug must be given.
    slug string
    At least one of model or slug must be given.
    id str
    The ID of this resource.
    model str
    At least one of model or slug must be given.
    slug str
    At least one of model or slug must be given.
    id String
    The ID of this resource.
    model String
    At least one of model or slug must be given.
    slug String
    At least one of model or slug must be given.

    getRackType Result

    The following output properties are available:

    Comments string
    Description string
    FormFactor string
    Id string
    The ID of this resource.
    ManufacturerId double
    MaxWeight double
    Model string
    At least one of model or slug must be given.
    MountingDepthMm double
    OuterDepth double
    OuterUnit string
    OuterWidth double
    Slug string
    At least one of model or slug must be given.
    StartingUnit double
    UHeight double
    Weight double
    WeightUnit string
    Width double
    Comments string
    Description string
    FormFactor string
    Id string
    The ID of this resource.
    ManufacturerId float64
    MaxWeight float64
    Model string
    At least one of model or slug must be given.
    MountingDepthMm float64
    OuterDepth float64
    OuterUnit string
    OuterWidth float64
    Slug string
    At least one of model or slug must be given.
    StartingUnit float64
    UHeight float64
    Weight float64
    WeightUnit string
    Width float64
    comments string
    description string
    form_factor string
    id string
    The ID of this resource.
    manufacturer_id number
    max_weight number
    model string
    At least one of model or slug must be given.
    mounting_depth_mm number
    outer_depth number
    outer_unit string
    outer_width number
    slug string
    At least one of model or slug must be given.
    starting_unit number
    u_height number
    weight number
    weight_unit string
    width number
    comments String
    description String
    formFactor String
    id String
    The ID of this resource.
    manufacturerId Double
    maxWeight Double
    model String
    At least one of model or slug must be given.
    mountingDepthMm Double
    outerDepth Double
    outerUnit String
    outerWidth Double
    slug String
    At least one of model or slug must be given.
    startingUnit Double
    uHeight Double
    weight Double
    weightUnit String
    width Double
    comments string
    description string
    formFactor string
    id string
    The ID of this resource.
    manufacturerId number
    maxWeight number
    model string
    At least one of model or slug must be given.
    mountingDepthMm number
    outerDepth number
    outerUnit string
    outerWidth number
    slug string
    At least one of model or slug must be given.
    startingUnit number
    uHeight number
    weight number
    weightUnit string
    width number
    comments str
    description str
    form_factor str
    id str
    The ID of this resource.
    manufacturer_id float
    max_weight float
    model str
    At least one of model or slug must be given.
    mounting_depth_mm float
    outer_depth float
    outer_unit str
    outer_width float
    slug str
    At least one of model or slug must be given.
    starting_unit float
    u_height float
    weight float
    weight_unit str
    width float
    comments String
    description String
    formFactor String
    id String
    The ID of this resource.
    manufacturerId Number
    maxWeight Number
    model String
    At least one of model or slug must be given.
    mountingDepthMm Number
    outerDepth Number
    outerUnit String
    outerWidth Number
    slug String
    At least one of model or slug must be given.
    startingUnit Number
    uHeight Number
    weight Number
    weightUnit String
    width Number

    Package Details

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

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial