netbox.Site
Explore with Pulumi AI
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)
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:
- Asn
Ids List<double> - Custom
Fields Dictionary<string, string> - Description string
- Facility string
- Group
Id double - Latitude double
- Longitude double
- Name string
- Physical
Address string - Region
Id double - Shipping
Address string - Site
Id string - The ID of this resource.
- Slug string
- Status string
- Valid values are
planned
,staging
,active
,decommissioning
andretired
. Defaults toactive
. - List<string>
- Tenant
Id double - Timezone string
- Asn
Ids []float64 - Custom
Fields map[string]string - Description string
- Facility string
- Group
Id float64 - Latitude float64
- Longitude float64
- Name string
- Physical
Address string - Region
Id float64 - Shipping
Address string - Site
Id string - The ID of this resource.
- Slug string
- Status string
- Valid values are
planned
,staging
,active
,decommissioning
andretired
. Defaults toactive
. - []string
- Tenant
Id float64 - Timezone string
- asn
Ids List<Double> - custom
Fields Map<String,String> - description String
- facility String
- group
Id Double - latitude Double
- longitude Double
- name String
- physical
Address String - region
Id Double - shipping
Address String - site
Id String - The ID of this resource.
- slug String
- status String
- Valid values are
planned
,staging
,active
,decommissioning
andretired
. Defaults toactive
. - List<String>
- tenant
Id Double - timezone String
- asn
Ids number[] - custom
Fields {[key: string]: string} - description string
- facility string
- group
Id number - latitude number
- longitude number
- name string
- physical
Address string - region
Id number - shipping
Address string - site
Id string - The ID of this resource.
- slug string
- status string
- Valid values are
planned
,staging
,active
,decommissioning
andretired
. Defaults toactive
. - string[]
- tenant
Id 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
andretired
. Defaults toactive
. - Sequence[str]
- tenant_
id float - timezone str
- asn
Ids List<Number> - custom
Fields Map<String> - description String
- facility String
- group
Id Number - latitude Number
- longitude Number
- name String
- physical
Address String - region
Id Number - shipping
Address String - site
Id String - The ID of this resource.
- slug String
- status String
- Valid values are
planned
,staging
,active
,decommissioning
andretired
. Defaults toactive
. - List<String>
- tenant
Id 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.
- Asn
Ids List<double> - Custom
Fields Dictionary<string, string> - Description string
- Facility string
- Group
Id double - Latitude double
- Longitude double
- Name string
- Physical
Address string - Region
Id double - Shipping
Address string - Site
Id string - The ID of this resource.
- Slug string
- Status string
- Valid values are
planned
,staging
,active
,decommissioning
andretired
. Defaults toactive
. - List<string>
- Tenant
Id double - Timezone string
- Asn
Ids []float64 - Custom
Fields map[string]string - Description string
- Facility string
- Group
Id float64 - Latitude float64
- Longitude float64
- Name string
- Physical
Address string - Region
Id float64 - Shipping
Address string - Site
Id string - The ID of this resource.
- Slug string
- Status string
- Valid values are
planned
,staging
,active
,decommissioning
andretired
. Defaults toactive
. - []string
- Tenant
Id float64 - Timezone string
- asn
Ids List<Double> - custom
Fields Map<String,String> - description String
- facility String
- group
Id Double - latitude Double
- longitude Double
- name String
- physical
Address String - region
Id Double - shipping
Address String - site
Id String - The ID of this resource.
- slug String
- status String
- Valid values are
planned
,staging
,active
,decommissioning
andretired
. Defaults toactive
. - List<String>
- tenant
Id Double - timezone String
- asn
Ids number[] - custom
Fields {[key: string]: string} - description string
- facility string
- group
Id number - latitude number
- longitude number
- name string
- physical
Address string - region
Id number - shipping
Address string - site
Id string - The ID of this resource.
- slug string
- status string
- Valid values are
planned
,staging
,active
,decommissioning
andretired
. Defaults toactive
. - string[]
- tenant
Id 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
andretired
. Defaults toactive
. - Sequence[str]
- tenant_
id float - timezone str
- asn
Ids List<Number> - custom
Fields Map<String> - description String
- facility String
- group
Id Number - latitude Number
- longitude Number
- name String
- physical
Address String - region
Id Number - shipping
Address String - site
Id String - The ID of this resource.
- slug String
- status String
- Valid values are
planned
,staging
,active
,decommissioning
andretired
. Defaults toactive
. - List<String>
- tenant
Id Number - timezone String
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.