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

netbox.getSiteGroup

Explore with Pulumi AI

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const getByName = netbox.getSiteGroup({
        name: "example-sitegroup-1",
    });
    const getBySlug = netbox.getSiteGroup({
        slug: "sitegrp",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    get_by_name = netbox.get_site_group(name="example-sitegroup-1")
    get_by_slug = netbox.get_site_group(slug="sitegrp")
    
    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.LookupSiteGroup(ctx, &netbox.LookupSiteGroupArgs{
    			Name: pulumi.StringRef("example-sitegroup-1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = netbox.LookupSiteGroup(ctx, &netbox.LookupSiteGroupArgs{
    			Slug: pulumi.StringRef("sitegrp"),
    		}, 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 getByName = Netbox.GetSiteGroup.Invoke(new()
        {
            Name = "example-sitegroup-1",
        });
    
        var getBySlug = Netbox.GetSiteGroup.Invoke(new()
        {
            Slug = "sitegrp",
        });
    
    });
    
    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.GetSiteGroupArgs;
    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 getByName = NetboxFunctions.getSiteGroup(GetSiteGroupArgs.builder()
                .name("example-sitegroup-1")
                .build());
    
            final var getBySlug = NetboxFunctions.getSiteGroup(GetSiteGroupArgs.builder()
                .slug("sitegrp")
                .build());
    
        }
    }
    
    variables:
      getByName:
        fn::invoke:
          function: netbox:getSiteGroup
          arguments:
            name: example-sitegroup-1
      getBySlug:
        fn::invoke:
          function: netbox:getSiteGroup
          arguments:
            slug: sitegrp
    

    Using getSiteGroup

    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 getSiteGroup(args: GetSiteGroupArgs, opts?: InvokeOptions): Promise<GetSiteGroupResult>
    function getSiteGroupOutput(args: GetSiteGroupOutputArgs, opts?: InvokeOptions): Output<GetSiteGroupResult>
    def get_site_group(id: Optional[str] = None,
                       name: Optional[str] = None,
                       slug: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetSiteGroupResult
    def get_site_group_output(id: Optional[pulumi.Input[str]] = None,
                       name: Optional[pulumi.Input[str]] = None,
                       slug: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetSiteGroupResult]
    func LookupSiteGroup(ctx *Context, args *LookupSiteGroupArgs, opts ...InvokeOption) (*LookupSiteGroupResult, error)
    func LookupSiteGroupOutput(ctx *Context, args *LookupSiteGroupOutputArgs, opts ...InvokeOption) LookupSiteGroupResultOutput

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

    public static class GetSiteGroup 
    {
        public static Task<GetSiteGroupResult> InvokeAsync(GetSiteGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetSiteGroupResult> Invoke(GetSiteGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSiteGroupResult> getSiteGroup(GetSiteGroupArgs args, InvokeOptions options)
    public static Output<GetSiteGroupResult> getSiteGroup(GetSiteGroupArgs args, InvokeOptions options)
    
    fn::invoke:
      function: netbox:index/getSiteGroup:getSiteGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

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

    getSiteGroup Result

    The following output properties are available:

    Description string
    Id string
    The ID of this resource.
    Name string
    At least one of name or slug must be given.
    Slug string
    At least one of name or slug must be given.
    Description string
    Id string
    The ID of this resource.
    Name string
    At least one of name or slug must be given.
    Slug string
    At least one of name or slug must be given.
    description String
    id String
    The ID of this resource.
    name String
    At least one of name or slug must be given.
    slug String
    At least one of name or slug must be given.
    description string
    id string
    The ID of this resource.
    name string
    At least one of name or slug must be given.
    slug string
    At least one of name or slug must be given.
    description str
    id str
    The ID of this resource.
    name str
    At least one of name or slug must be given.
    slug str
    At least one of name or slug must be given.
    description String
    id String
    The ID of this resource.
    name String
    At least one of name or slug must be given.
    slug String
    At least one of name or slug must be given.

    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