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

netbox.RackRole

Explore with Pulumi AI

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

    From the official documentation:

    Each rack can optionally be assigned a user-defined functional role. For example, you might designate a rack for compute or storage resources, or to house colocated customer devices.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const test = new netbox.RackRole("test", {colorHex: "111111"});
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.RackRole("test", color_hex="111111")
    
    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 {
    		_, err := netbox.NewRackRole(ctx, "test", &netbox.RackRoleArgs{
    			ColorHex: pulumi.String("111111"),
    		})
    		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 = new Netbox.RackRole("test", new()
        {
            ColorHex = "111111",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.RackRole;
    import com.pulumi.netbox.RackRoleArgs;
    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 test = new RackRole("test", RackRoleArgs.builder()
                .colorHex("111111")
                .build());
    
        }
    }
    
    resources:
      test:
        type: netbox:RackRole
        properties:
          colorHex: '111111'
    

    Create RackRole Resource

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

    Constructor syntax

    new RackRole(name: string, args: RackRoleArgs, opts?: CustomResourceOptions);
    @overload
    def RackRole(resource_name: str,
                 args: RackRoleArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def RackRole(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 color_hex: Optional[str] = None,
                 description: Optional[str] = None,
                 name: Optional[str] = None,
                 rack_role_id: Optional[str] = None,
                 slug: Optional[str] = None,
                 tags: Optional[Sequence[str]] = None)
    func NewRackRole(ctx *Context, name string, args RackRoleArgs, opts ...ResourceOption) (*RackRole, error)
    public RackRole(string name, RackRoleArgs args, CustomResourceOptions? opts = null)
    public RackRole(String name, RackRoleArgs args)
    public RackRole(String name, RackRoleArgs args, CustomResourceOptions options)
    
    type: netbox:RackRole
    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 RackRoleArgs
    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 RackRoleArgs
    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 RackRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RackRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RackRoleArgs
    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 rackRoleResource = new Netbox.RackRole("rackRoleResource", new()
    {
        ColorHex = "string",
        Description = "string",
        Name = "string",
        RackRoleId = "string",
        Slug = "string",
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := netbox.NewRackRole(ctx, "rackRoleResource", &netbox.RackRoleArgs{
    	ColorHex:    pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	RackRoleId:  pulumi.String("string"),
    	Slug:        pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var rackRoleResource = new RackRole("rackRoleResource", RackRoleArgs.builder()
        .colorHex("string")
        .description("string")
        .name("string")
        .rackRoleId("string")
        .slug("string")
        .tags("string")
        .build());
    
    rack_role_resource = netbox.RackRole("rackRoleResource",
        color_hex="string",
        description="string",
        name="string",
        rack_role_id="string",
        slug="string",
        tags=["string"])
    
    const rackRoleResource = new netbox.RackRole("rackRoleResource", {
        colorHex: "string",
        description: "string",
        name: "string",
        rackRoleId: "string",
        slug: "string",
        tags: ["string"],
    });
    
    type: netbox:RackRole
    properties:
        colorHex: string
        description: string
        name: string
        rackRoleId: string
        slug: string
        tags:
            - string
    

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

    ColorHex string
    Description string
    Name string
    RackRoleId string
    The ID of this resource.
    Slug string
    Tags List<string>
    ColorHex string
    Description string
    Name string
    RackRoleId string
    The ID of this resource.
    Slug string
    Tags []string
    colorHex String
    description String
    name String
    rackRoleId String
    The ID of this resource.
    slug String
    tags List<String>
    colorHex string
    description string
    name string
    rackRoleId string
    The ID of this resource.
    slug string
    tags string[]
    color_hex str
    description str
    name str
    rack_role_id str
    The ID of this resource.
    slug str
    tags Sequence[str]
    colorHex String
    description String
    name String
    rackRoleId String
    The ID of this resource.
    slug String
    tags List<String>

    Outputs

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

    Get an existing RackRole 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?: RackRoleState, opts?: CustomResourceOptions): RackRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            color_hex: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            rack_role_id: Optional[str] = None,
            slug: Optional[str] = None,
            tags: Optional[Sequence[str]] = None) -> RackRole
    func GetRackRole(ctx *Context, name string, id IDInput, state *RackRoleState, opts ...ResourceOption) (*RackRole, error)
    public static RackRole Get(string name, Input<string> id, RackRoleState? state, CustomResourceOptions? opts = null)
    public static RackRole get(String name, Output<String> id, RackRoleState state, CustomResourceOptions options)
    resources:  _:    type: netbox:RackRole    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:
    ColorHex string
    Description string
    Name string
    RackRoleId string
    The ID of this resource.
    Slug string
    Tags List<string>
    ColorHex string
    Description string
    Name string
    RackRoleId string
    The ID of this resource.
    Slug string
    Tags []string
    colorHex String
    description String
    name String
    rackRoleId String
    The ID of this resource.
    slug String
    tags List<String>
    colorHex string
    description string
    name string
    rackRoleId string
    The ID of this resource.
    slug string
    tags string[]
    color_hex str
    description str
    name str
    rack_role_id str
    The ID of this resource.
    slug str
    tags Sequence[str]
    colorHex String
    description String
    name String
    rackRoleId String
    The ID of this resource.
    slug String
    tags List<String>

    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