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

netbox.RackReservation

Explore with Pulumi AI

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

    From the official documentation:

    Users can reserve specific units within a rack for future use. An arbitrary set of units within a rack can be associated with a single reservation, but reservations cannot span multiple racks. A description is required for each reservation, reservations may optionally be associated with a specific tenant.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const testSite = new netbox.Site("testSite", {status: "active"});
    const testRack = new netbox.Rack("testRack", {
        siteId: testSite.siteId,
        status: "active",
        width: 10,
        uHeight: 40,
    });
    const testRackReservation = new netbox.RackReservation("testRackReservation", {
        rackId: testRack.rackId,
        units: [
            1,
            2,
            3,
            4,
            5,
        ],
        userId: 1,
        description: "my description",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test_site = netbox.Site("testSite", status="active")
    test_rack = netbox.Rack("testRack",
        site_id=test_site.site_id,
        status="active",
        width=10,
        u_height=40)
    test_rack_reservation = netbox.RackReservation("testRackReservation",
        rack_id=test_rack.rack_id,
        units=[
            1,
            2,
            3,
            4,
            5,
        ],
        user_id=1,
        description="my description")
    
    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 {
    		testSite, err := netbox.NewSite(ctx, "testSite", &netbox.SiteArgs{
    			Status: pulumi.String("active"),
    		})
    		if err != nil {
    			return err
    		}
    		testRack, err := netbox.NewRack(ctx, "testRack", &netbox.RackArgs{
    			SiteId:  testSite.SiteId,
    			Status:  pulumi.String("active"),
    			Width:   pulumi.Float64(10),
    			UHeight: pulumi.Float64(40),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = netbox.NewRackReservation(ctx, "testRackReservation", &netbox.RackReservationArgs{
    			RackId: testRack.RackId,
    			Units: pulumi.Float64Array{
    				pulumi.Float64(1),
    				pulumi.Float64(2),
    				pulumi.Float64(3),
    				pulumi.Float64(4),
    				pulumi.Float64(5),
    			},
    			UserId:      pulumi.Float64(1),
    			Description: pulumi.String("my description"),
    		})
    		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 testSite = new Netbox.Site("testSite", new()
        {
            Status = "active",
        });
    
        var testRack = new Netbox.Rack("testRack", new()
        {
            SiteId = testSite.SiteId,
            Status = "active",
            Width = 10,
            UHeight = 40,
        });
    
        var testRackReservation = new Netbox.RackReservation("testRackReservation", new()
        {
            RackId = testRack.RackId,
            Units = new[]
            {
                1,
                2,
                3,
                4,
                5,
            },
            UserId = 1,
            Description = "my description",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.Site;
    import com.pulumi.netbox.SiteArgs;
    import com.pulumi.netbox.Rack;
    import com.pulumi.netbox.RackArgs;
    import com.pulumi.netbox.RackReservation;
    import com.pulumi.netbox.RackReservationArgs;
    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) {
            var testSite = new Site("testSite", SiteArgs.builder()
                .status("active")
                .build());
    
            var testRack = new Rack("testRack", RackArgs.builder()
                .siteId(testSite.siteId())
                .status("active")
                .width(10)
                .uHeight(40)
                .build());
    
            var testRackReservation = new RackReservation("testRackReservation", RackReservationArgs.builder()
                .rackId(testRack.rackId())
                .units(            
                    1,
                    2,
                    3,
                    4,
                    5)
                .userId(1)
                .description("my description")
                .build());
    
        }
    }
    
    resources:
      testSite:
        type: netbox:Site
        properties:
          status: active
      testRack:
        type: netbox:Rack
        properties:
          siteId: ${testSite.siteId}
          status: active
          width: 10
          uHeight: 40
      testRackReservation:
        type: netbox:RackReservation
        properties:
          rackId: ${testRack.rackId}
          units:
            - 1
            - 2
            - 3
            - 4
            - 5
          userId: 1
          description: my description
    

    Create RackReservation Resource

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

    Constructor syntax

    new RackReservation(name: string, args: RackReservationArgs, opts?: CustomResourceOptions);
    @overload
    def RackReservation(resource_name: str,
                        args: RackReservationArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def RackReservation(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        description: Optional[str] = None,
                        rack_id: Optional[float] = None,
                        units: Optional[Sequence[float]] = None,
                        user_id: Optional[float] = None,
                        comments: Optional[str] = None,
                        rack_reservation_id: Optional[str] = None,
                        tags: Optional[Sequence[str]] = None,
                        tenant_id: Optional[float] = None)
    func NewRackReservation(ctx *Context, name string, args RackReservationArgs, opts ...ResourceOption) (*RackReservation, error)
    public RackReservation(string name, RackReservationArgs args, CustomResourceOptions? opts = null)
    public RackReservation(String name, RackReservationArgs args)
    public RackReservation(String name, RackReservationArgs args, CustomResourceOptions options)
    
    type: netbox:RackReservation
    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 RackReservationArgs
    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 RackReservationArgs
    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 RackReservationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RackReservationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RackReservationArgs
    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 rackReservationResource = new Netbox.RackReservation("rackReservationResource", new()
    {
        Description = "string",
        RackId = 0,
        Units = new[]
        {
            0,
        },
        UserId = 0,
        Comments = "string",
        RackReservationId = "string",
        Tags = new[]
        {
            "string",
        },
        TenantId = 0,
    });
    
    example, err := netbox.NewRackReservation(ctx, "rackReservationResource", &netbox.RackReservationArgs{
    	Description: pulumi.String("string"),
    	RackId:      pulumi.Float64(0),
    	Units: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	UserId:            pulumi.Float64(0),
    	Comments:          pulumi.String("string"),
    	RackReservationId: pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	TenantId: pulumi.Float64(0),
    })
    
    var rackReservationResource = new RackReservation("rackReservationResource", RackReservationArgs.builder()
        .description("string")
        .rackId(0)
        .units(0)
        .userId(0)
        .comments("string")
        .rackReservationId("string")
        .tags("string")
        .tenantId(0)
        .build());
    
    rack_reservation_resource = netbox.RackReservation("rackReservationResource",
        description="string",
        rack_id=0,
        units=[0],
        user_id=0,
        comments="string",
        rack_reservation_id="string",
        tags=["string"],
        tenant_id=0)
    
    const rackReservationResource = new netbox.RackReservation("rackReservationResource", {
        description: "string",
        rackId: 0,
        units: [0],
        userId: 0,
        comments: "string",
        rackReservationId: "string",
        tags: ["string"],
        tenantId: 0,
    });
    
    type: netbox:RackReservation
    properties:
        comments: string
        description: string
        rackId: 0
        rackReservationId: string
        tags:
            - string
        tenantId: 0
        units:
            - 0
        userId: 0
    

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

    Description string
    RackId double
    Units List<double>
    UserId double
    Comments string
    RackReservationId string
    The ID of this resource.
    Tags List<string>
    TenantId double
    Description string
    RackId float64
    Units []float64
    UserId float64
    Comments string
    RackReservationId string
    The ID of this resource.
    Tags []string
    TenantId float64
    description String
    rackId Double
    units List<Double>
    userId Double
    comments String
    rackReservationId String
    The ID of this resource.
    tags List<String>
    tenantId Double
    description string
    rackId number
    units number[]
    userId number
    comments string
    rackReservationId string
    The ID of this resource.
    tags string[]
    tenantId number
    description str
    rack_id float
    units Sequence[float]
    user_id float
    comments str
    rack_reservation_id str
    The ID of this resource.
    tags Sequence[str]
    tenant_id float
    description String
    rackId Number
    units List<Number>
    userId Number
    comments String
    rackReservationId String
    The ID of this resource.
    tags List<String>
    tenantId Number

    Outputs

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

    Get an existing RackReservation 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?: RackReservationState, opts?: CustomResourceOptions): RackReservation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comments: Optional[str] = None,
            description: Optional[str] = None,
            rack_id: Optional[float] = None,
            rack_reservation_id: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            tenant_id: Optional[float] = None,
            units: Optional[Sequence[float]] = None,
            user_id: Optional[float] = None) -> RackReservation
    func GetRackReservation(ctx *Context, name string, id IDInput, state *RackReservationState, opts ...ResourceOption) (*RackReservation, error)
    public static RackReservation Get(string name, Input<string> id, RackReservationState? state, CustomResourceOptions? opts = null)
    public static RackReservation get(String name, Output<String> id, RackReservationState state, CustomResourceOptions options)
    resources:  _:    type: netbox:RackReservation    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:
    Comments string
    Description string
    RackId double
    RackReservationId string
    The ID of this resource.
    Tags List<string>
    TenantId double
    Units List<double>
    UserId double
    Comments string
    Description string
    RackId float64
    RackReservationId string
    The ID of this resource.
    Tags []string
    TenantId float64
    Units []float64
    UserId float64
    comments String
    description String
    rackId Double
    rackReservationId String
    The ID of this resource.
    tags List<String>
    tenantId Double
    units List<Double>
    userId Double
    comments string
    description string
    rackId number
    rackReservationId string
    The ID of this resource.
    tags string[]
    tenantId number
    units number[]
    userId number
    comments str
    description str
    rack_id float
    rack_reservation_id str
    The ID of this resource.
    tags Sequence[str]
    tenant_id float
    units Sequence[float]
    user_id float
    comments String
    description String
    rackId Number
    rackReservationId String
    The ID of this resource.
    tags List<String>
    tenantId Number
    units List<Number>
    userId Number

    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