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

netbox.SiteGroup

Explore with Pulumi AI

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

    From the official documentation:

    Like regions, site groups can be arranged in a recursive hierarchy for grouping sites. However, whereas regions are intended for geographic organization, site groups may be used for functional grouping. For example, you might classify sites as corporate, branch, or customer sites in addition to where they are physically located.

    The use of both regions and site groups affords to independent but complementary dimensions across which sites can be organized.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const parent = new netbox.SiteGroup("parent", {description: "sample description"});
    const child = new netbox.SiteGroup("child", {
        description: "sample description",
        parentId: parent.siteGroupId,
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    parent = netbox.SiteGroup("parent", description="sample description")
    child = netbox.SiteGroup("child",
        description="sample description",
        parent_id=parent.site_group_id)
    
    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 {
    		parent, err := netbox.NewSiteGroup(ctx, "parent", &netbox.SiteGroupArgs{
    			Description: pulumi.String("sample description"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = netbox.NewSiteGroup(ctx, "child", &netbox.SiteGroupArgs{
    			Description: pulumi.String("sample description"),
    			ParentId:    parent.SiteGroupId,
    		})
    		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 parent = new Netbox.SiteGroup("parent", new()
        {
            Description = "sample description",
        });
    
        var child = new Netbox.SiteGroup("child", new()
        {
            Description = "sample description",
            ParentId = parent.SiteGroupId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.SiteGroup;
    import com.pulumi.netbox.SiteGroupArgs;
    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 parent = new SiteGroup("parent", SiteGroupArgs.builder()
                .description("sample description")
                .build());
    
            var child = new SiteGroup("child", SiteGroupArgs.builder()
                .description("sample description")
                .parentId(parent.siteGroupId())
                .build());
    
        }
    }
    
    resources:
      parent:
        type: netbox:SiteGroup
        properties:
          description: sample description
      child:
        type: netbox:SiteGroup
        properties:
          description: sample description
          parentId: ${parent.siteGroupId}
    

    Create SiteGroup Resource

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

    Constructor syntax

    new SiteGroup(name: string, args?: SiteGroupArgs, opts?: CustomResourceOptions);
    @overload
    def SiteGroup(resource_name: str,
                  args: Optional[SiteGroupArgs] = None,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def SiteGroup(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  description: Optional[str] = None,
                  name: Optional[str] = None,
                  parent_id: Optional[float] = None,
                  site_group_id: Optional[str] = None,
                  slug: Optional[str] = None)
    func NewSiteGroup(ctx *Context, name string, args *SiteGroupArgs, opts ...ResourceOption) (*SiteGroup, error)
    public SiteGroup(string name, SiteGroupArgs? args = null, CustomResourceOptions? opts = null)
    public SiteGroup(String name, SiteGroupArgs args)
    public SiteGroup(String name, SiteGroupArgs args, CustomResourceOptions options)
    
    type: netbox:SiteGroup
    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 SiteGroupArgs
    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 SiteGroupArgs
    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 SiteGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SiteGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SiteGroupArgs
    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 siteGroupResource = new Netbox.SiteGroup("siteGroupResource", new()
    {
        Description = "string",
        Name = "string",
        ParentId = 0,
        SiteGroupId = "string",
        Slug = "string",
    });
    
    example, err := netbox.NewSiteGroup(ctx, "siteGroupResource", &netbox.SiteGroupArgs{
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	ParentId:    pulumi.Float64(0),
    	SiteGroupId: pulumi.String("string"),
    	Slug:        pulumi.String("string"),
    })
    
    var siteGroupResource = new SiteGroup("siteGroupResource", SiteGroupArgs.builder()
        .description("string")
        .name("string")
        .parentId(0)
        .siteGroupId("string")
        .slug("string")
        .build());
    
    site_group_resource = netbox.SiteGroup("siteGroupResource",
        description="string",
        name="string",
        parent_id=0,
        site_group_id="string",
        slug="string")
    
    const siteGroupResource = new netbox.SiteGroup("siteGroupResource", {
        description: "string",
        name: "string",
        parentId: 0,
        siteGroupId: "string",
        slug: "string",
    });
    
    type: netbox:SiteGroup
    properties:
        description: string
        name: string
        parentId: 0
        siteGroupId: string
        slug: string
    

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

    Description string
    Name string
    ParentId double
    SiteGroupId string
    The ID of this resource.
    Slug string
    Description string
    Name string
    ParentId float64
    SiteGroupId string
    The ID of this resource.
    Slug string
    description String
    name String
    parentId Double
    siteGroupId String
    The ID of this resource.
    slug String
    description string
    name string
    parentId number
    siteGroupId string
    The ID of this resource.
    slug string
    description str
    name str
    parent_id float
    site_group_id str
    The ID of this resource.
    slug str
    description String
    name String
    parentId Number
    siteGroupId String
    The ID of this resource.
    slug String

    Outputs

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

    Get an existing SiteGroup 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?: SiteGroupState, opts?: CustomResourceOptions): SiteGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            parent_id: Optional[float] = None,
            site_group_id: Optional[str] = None,
            slug: Optional[str] = None) -> SiteGroup
    func GetSiteGroup(ctx *Context, name string, id IDInput, state *SiteGroupState, opts ...ResourceOption) (*SiteGroup, error)
    public static SiteGroup Get(string name, Input<string> id, SiteGroupState? state, CustomResourceOptions? opts = null)
    public static SiteGroup get(String name, Output<String> id, SiteGroupState state, CustomResourceOptions options)
    resources:  _:    type: netbox:SiteGroup    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:
    Description string
    Name string
    ParentId double
    SiteGroupId string
    The ID of this resource.
    Slug string
    Description string
    Name string
    ParentId float64
    SiteGroupId string
    The ID of this resource.
    Slug string
    description String
    name String
    parentId Double
    siteGroupId String
    The ID of this resource.
    slug String
    description string
    name string
    parentId number
    siteGroupId string
    The ID of this resource.
    slug string
    description str
    name str
    parent_id float
    site_group_id str
    The ID of this resource.
    slug str
    description String
    name String
    parentId Number
    siteGroupId String
    The ID of this resource.
    slug 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