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

netbox.Site

Explore with Pulumi AI

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

    From the official documentation:

    How you choose to employ sites when modeling your network may vary depending on the nature of your organization, but generally a site will equate to a building or campus. For example, a chain of banks might create a site to represent each of its branches, a site for its corporate headquarters, and two additional sites for its presence in two colocation facilities.

    Each site must be assigned a unique name and may optionally be assigned to a region and/or tenant.

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    resources:
      example1:
        type: netbox:Site
        properties:
          asn: 1337
          facility: Data center
          latitude: '-45.4085'
          longitude: '30.1496'
          status: staging
          timezone: Africa/Johannesburg
    

    Create Site Resource

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

    Constructor syntax

    new Site(name: string, args?: SiteArgs, opts?: CustomResourceOptions);
    @overload
    def Site(resource_name: str,
             args: Optional[SiteArgs] = None,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Site(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             asn_ids: Optional[Sequence[float]] = None,
             custom_fields: Optional[Mapping[str, str]] = None,
             description: Optional[str] = None,
             facility: Optional[str] = None,
             group_id: Optional[float] = None,
             latitude: Optional[float] = None,
             longitude: Optional[float] = None,
             name: Optional[str] = None,
             physical_address: Optional[str] = None,
             region_id: Optional[float] = None,
             shipping_address: Optional[str] = None,
             site_id: Optional[str] = None,
             slug: Optional[str] = None,
             status: Optional[str] = None,
             tags: Optional[Sequence[str]] = None,
             tenant_id: Optional[float] = None,
             timezone: Optional[str] = None)
    func NewSite(ctx *Context, name string, args *SiteArgs, opts ...ResourceOption) (*Site, error)
    public Site(string name, SiteArgs? args = null, CustomResourceOptions? opts = null)
    public Site(String name, SiteArgs args)
    public Site(String name, SiteArgs args, CustomResourceOptions options)
    
    type: netbox:Site
    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 SiteArgs
    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 SiteArgs
    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 SiteArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SiteArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SiteArgs
    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 siteResource = new Netbox.Site("siteResource", new()
    {
        AsnIds = new[]
        {
            0,
        },
        CustomFields = 
        {
            { "string", "string" },
        },
        Description = "string",
        Facility = "string",
        GroupId = 0,
        Latitude = 0,
        Longitude = 0,
        Name = "string",
        PhysicalAddress = "string",
        RegionId = 0,
        ShippingAddress = "string",
        SiteId = "string",
        Slug = "string",
        Status = "string",
        Tags = new[]
        {
            "string",
        },
        TenantId = 0,
        Timezone = "string",
    });
    
    example, err := netbox.NewSite(ctx, "siteResource", &netbox.SiteArgs{
    	AsnIds: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	CustomFields: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Description:     pulumi.String("string"),
    	Facility:        pulumi.String("string"),
    	GroupId:         pulumi.Float64(0),
    	Latitude:        pulumi.Float64(0),
    	Longitude:       pulumi.Float64(0),
    	Name:            pulumi.String("string"),
    	PhysicalAddress: pulumi.String("string"),
    	RegionId:        pulumi.Float64(0),
    	ShippingAddress: pulumi.String("string"),
    	SiteId:          pulumi.String("string"),
    	Slug:            pulumi.String("string"),
    	Status:          pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	TenantId: pulumi.Float64(0),
    	Timezone: pulumi.String("string"),
    })
    
    var siteResource = new Site("siteResource", SiteArgs.builder()
        .asnIds(0)
        .customFields(Map.of("string", "string"))
        .description("string")
        .facility("string")
        .groupId(0)
        .latitude(0)
        .longitude(0)
        .name("string")
        .physicalAddress("string")
        .regionId(0)
        .shippingAddress("string")
        .siteId("string")
        .slug("string")
        .status("string")
        .tags("string")
        .tenantId(0)
        .timezone("string")
        .build());
    
    site_resource = netbox.Site("siteResource",
        asn_ids=[0],
        custom_fields={
            "string": "string",
        },
        description="string",
        facility="string",
        group_id=0,
        latitude=0,
        longitude=0,
        name="string",
        physical_address="string",
        region_id=0,
        shipping_address="string",
        site_id="string",
        slug="string",
        status="string",
        tags=["string"],
        tenant_id=0,
        timezone="string")
    
    const siteResource = new netbox.Site("siteResource", {
        asnIds: [0],
        customFields: {
            string: "string",
        },
        description: "string",
        facility: "string",
        groupId: 0,
        latitude: 0,
        longitude: 0,
        name: "string",
        physicalAddress: "string",
        regionId: 0,
        shippingAddress: "string",
        siteId: "string",
        slug: "string",
        status: "string",
        tags: ["string"],
        tenantId: 0,
        timezone: "string",
    });
    
    type: netbox:Site
    properties:
        asnIds:
            - 0
        customFields:
            string: string
        description: string
        facility: string
        groupId: 0
        latitude: 0
        longitude: 0
        name: string
        physicalAddress: string
        regionId: 0
        shippingAddress: string
        siteId: string
        slug: string
        status: string
        tags:
            - string
        tenantId: 0
        timezone: string
    

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

    AsnIds List<double>
    CustomFields Dictionary<string, string>
    Description string
    Facility string
    GroupId double
    Latitude double
    Longitude double
    Name string
    PhysicalAddress string
    RegionId double
    ShippingAddress string
    SiteId string
    The ID of this resource.
    Slug string
    Status string
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    Tags List<string>
    TenantId double
    Timezone string
    AsnIds []float64
    CustomFields map[string]string
    Description string
    Facility string
    GroupId float64
    Latitude float64
    Longitude float64
    Name string
    PhysicalAddress string
    RegionId float64
    ShippingAddress string
    SiteId string
    The ID of this resource.
    Slug string
    Status string
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    Tags []string
    TenantId float64
    Timezone string
    asnIds List<Double>
    customFields Map<String,String>
    description String
    facility String
    groupId Double
    latitude Double
    longitude Double
    name String
    physicalAddress String
    regionId Double
    shippingAddress String
    siteId String
    The ID of this resource.
    slug String
    status String
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    tags List<String>
    tenantId Double
    timezone String
    asnIds number[]
    customFields {[key: string]: string}
    description string
    facility string
    groupId number
    latitude number
    longitude number
    name string
    physicalAddress string
    regionId number
    shippingAddress string
    siteId string
    The ID of this resource.
    slug string
    status string
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    tags string[]
    tenantId number
    timezone string
    asn_ids Sequence[float]
    custom_fields Mapping[str, str]
    description str
    facility str
    group_id float
    latitude float
    longitude float
    name str
    physical_address str
    region_id float
    shipping_address str
    site_id str
    The ID of this resource.
    slug str
    status str
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    tags Sequence[str]
    tenant_id float
    timezone str
    asnIds List<Number>
    customFields Map<String>
    description String
    facility String
    groupId Number
    latitude Number
    longitude Number
    name String
    physicalAddress String
    regionId Number
    shippingAddress String
    siteId String
    The ID of this resource.
    slug String
    status String
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    tags List<String>
    tenantId Number
    timezone String

    Outputs

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

    Get an existing Site 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?: SiteState, opts?: CustomResourceOptions): Site
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            asn_ids: Optional[Sequence[float]] = None,
            custom_fields: Optional[Mapping[str, str]] = None,
            description: Optional[str] = None,
            facility: Optional[str] = None,
            group_id: Optional[float] = None,
            latitude: Optional[float] = None,
            longitude: Optional[float] = None,
            name: Optional[str] = None,
            physical_address: Optional[str] = None,
            region_id: Optional[float] = None,
            shipping_address: Optional[str] = None,
            site_id: Optional[str] = None,
            slug: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            tenant_id: Optional[float] = None,
            timezone: Optional[str] = None) -> Site
    func GetSite(ctx *Context, name string, id IDInput, state *SiteState, opts ...ResourceOption) (*Site, error)
    public static Site Get(string name, Input<string> id, SiteState? state, CustomResourceOptions? opts = null)
    public static Site get(String name, Output<String> id, SiteState state, CustomResourceOptions options)
    resources:  _:    type: netbox:Site    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:
    AsnIds List<double>
    CustomFields Dictionary<string, string>
    Description string
    Facility string
    GroupId double
    Latitude double
    Longitude double
    Name string
    PhysicalAddress string
    RegionId double
    ShippingAddress string
    SiteId string
    The ID of this resource.
    Slug string
    Status string
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    Tags List<string>
    TenantId double
    Timezone string
    AsnIds []float64
    CustomFields map[string]string
    Description string
    Facility string
    GroupId float64
    Latitude float64
    Longitude float64
    Name string
    PhysicalAddress string
    RegionId float64
    ShippingAddress string
    SiteId string
    The ID of this resource.
    Slug string
    Status string
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    Tags []string
    TenantId float64
    Timezone string
    asnIds List<Double>
    customFields Map<String,String>
    description String
    facility String
    groupId Double
    latitude Double
    longitude Double
    name String
    physicalAddress String
    regionId Double
    shippingAddress String
    siteId String
    The ID of this resource.
    slug String
    status String
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    tags List<String>
    tenantId Double
    timezone String
    asnIds number[]
    customFields {[key: string]: string}
    description string
    facility string
    groupId number
    latitude number
    longitude number
    name string
    physicalAddress string
    regionId number
    shippingAddress string
    siteId string
    The ID of this resource.
    slug string
    status string
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    tags string[]
    tenantId number
    timezone string
    asn_ids Sequence[float]
    custom_fields Mapping[str, str]
    description str
    facility str
    group_id float
    latitude float
    longitude float
    name str
    physical_address str
    region_id float
    shipping_address str
    site_id str
    The ID of this resource.
    slug str
    status str
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    tags Sequence[str]
    tenant_id float
    timezone str
    asnIds List<Number>
    customFields Map<String>
    description String
    facility String
    groupId Number
    latitude Number
    longitude Number
    name String
    physicalAddress String
    regionId Number
    shippingAddress String
    siteId String
    The ID of this resource.
    slug String
    status String
    Valid values are planned, staging, active, decommissioning and retired. Defaults to active.
    tags List<String>
    tenantId Number
    timezone 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