netbox.PowerPanel
Explore with Pulumi AI
From the official documentation:
A power panel represents the origin point in NetBox for electrical power being disseminated by one or more power feeds. In a data center environment, one power panel often serves a group of racks, with an individual power feed extending to each rack, though this is not always the case. It is common to have two sets of panels and feeds arranged in parallel to provide redundant power to each rack.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const testSite = new netbox.Site("testSite", {status: "active"});
const testLocation = new netbox.Location("testLocation", {siteId: testSite.siteId});
const testPowerPanel = new netbox.PowerPanel("testPowerPanel", {
siteId: testSite.siteId,
locationId: testLocation.locationId,
});
import pulumi
import pulumi_netbox as netbox
test_site = netbox.Site("testSite", status="active")
test_location = netbox.Location("testLocation", site_id=test_site.site_id)
test_power_panel = netbox.PowerPanel("testPowerPanel",
site_id=test_site.site_id,
location_id=test_location.location_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 {
testSite, err := netbox.NewSite(ctx, "testSite", &netbox.SiteArgs{
Status: pulumi.String("active"),
})
if err != nil {
return err
}
testLocation, err := netbox.NewLocation(ctx, "testLocation", &netbox.LocationArgs{
SiteId: testSite.SiteId,
})
if err != nil {
return err
}
_, err = netbox.NewPowerPanel(ctx, "testPowerPanel", &netbox.PowerPanelArgs{
SiteId: testSite.SiteId,
LocationId: testLocation.LocationId,
})
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 testSite = new Netbox.Site("testSite", new()
{
Status = "active",
});
var testLocation = new Netbox.Location("testLocation", new()
{
SiteId = testSite.SiteId,
});
var testPowerPanel = new Netbox.PowerPanel("testPowerPanel", new()
{
SiteId = testSite.SiteId,
LocationId = testLocation.LocationId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.Site;
import com.pulumi.netbox.SiteArgs;
import com.pulumi.netbox.Location;
import com.pulumi.netbox.LocationArgs;
import com.pulumi.netbox.PowerPanel;
import com.pulumi.netbox.PowerPanelArgs;
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 testSite = new Site("testSite", SiteArgs.builder()
.status("active")
.build());
var testLocation = new Location("testLocation", LocationArgs.builder()
.siteId(testSite.siteId())
.build());
var testPowerPanel = new PowerPanel("testPowerPanel", PowerPanelArgs.builder()
.siteId(testSite.siteId())
.locationId(testLocation.locationId())
.build());
}
}
resources:
testSite:
type: netbox:Site
properties:
status: active
testLocation:
type: netbox:Location
properties:
siteId: ${testSite.siteId}
testPowerPanel:
type: netbox:PowerPanel
properties:
siteId: ${testSite.siteId}
locationId: ${testLocation.locationId}
Create PowerPanel Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PowerPanel(name: string, args: PowerPanelArgs, opts?: CustomResourceOptions);
@overload
def PowerPanel(resource_name: str,
args: PowerPanelArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PowerPanel(resource_name: str,
opts: Optional[ResourceOptions] = None,
site_id: Optional[float] = None,
comments: Optional[str] = None,
custom_fields: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
location_id: Optional[float] = None,
name: Optional[str] = None,
power_panel_id: Optional[str] = None,
tags: Optional[Sequence[str]] = None)
func NewPowerPanel(ctx *Context, name string, args PowerPanelArgs, opts ...ResourceOption) (*PowerPanel, error)
public PowerPanel(string name, PowerPanelArgs args, CustomResourceOptions? opts = null)
public PowerPanel(String name, PowerPanelArgs args)
public PowerPanel(String name, PowerPanelArgs args, CustomResourceOptions options)
type: netbox:PowerPanel
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 PowerPanelArgs
- 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 PowerPanelArgs
- 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 PowerPanelArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PowerPanelArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PowerPanelArgs
- 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 powerPanelResource = new Netbox.PowerPanel("powerPanelResource", new()
{
SiteId = 0,
Comments = "string",
CustomFields =
{
{ "string", "string" },
},
Description = "string",
LocationId = 0,
Name = "string",
PowerPanelId = "string",
Tags = new[]
{
"string",
},
});
example, err := netbox.NewPowerPanel(ctx, "powerPanelResource", &netbox.PowerPanelArgs{
SiteId: pulumi.Float64(0),
Comments: pulumi.String("string"),
CustomFields: pulumi.StringMap{
"string": pulumi.String("string"),
},
Description: pulumi.String("string"),
LocationId: pulumi.Float64(0),
Name: pulumi.String("string"),
PowerPanelId: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
})
var powerPanelResource = new PowerPanel("powerPanelResource", PowerPanelArgs.builder()
.siteId(0)
.comments("string")
.customFields(Map.of("string", "string"))
.description("string")
.locationId(0)
.name("string")
.powerPanelId("string")
.tags("string")
.build());
power_panel_resource = netbox.PowerPanel("powerPanelResource",
site_id=0,
comments="string",
custom_fields={
"string": "string",
},
description="string",
location_id=0,
name="string",
power_panel_id="string",
tags=["string"])
const powerPanelResource = new netbox.PowerPanel("powerPanelResource", {
siteId: 0,
comments: "string",
customFields: {
string: "string",
},
description: "string",
locationId: 0,
name: "string",
powerPanelId: "string",
tags: ["string"],
});
type: netbox:PowerPanel
properties:
comments: string
customFields:
string: string
description: string
locationId: 0
name: string
powerPanelId: string
siteId: 0
tags:
- string
PowerPanel 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 PowerPanel resource accepts the following input properties:
- Site
Id double - Comments string
- Custom
Fields Dictionary<string, string> - Description string
- Location
Id double - Name string
- Power
Panel stringId - The ID of this resource.
- List<string>
- Site
Id float64 - Comments string
- Custom
Fields map[string]string - Description string
- Location
Id float64 - Name string
- Power
Panel stringId - The ID of this resource.
- []string
- site
Id Double - comments String
- custom
Fields Map<String,String> - description String
- location
Id Double - name String
- power
Panel StringId - The ID of this resource.
- List<String>
- site
Id number - comments string
- custom
Fields {[key: string]: string} - description string
- location
Id number - name string
- power
Panel stringId - The ID of this resource.
- string[]
- site_
id float - comments str
- custom_
fields Mapping[str, str] - description str
- location_
id float - name str
- power_
panel_ strid - The ID of this resource.
- Sequence[str]
- site
Id Number - comments String
- custom
Fields Map<String> - description String
- location
Id Number - name String
- power
Panel StringId - The ID of this resource.
- List<String>
Outputs
All input properties are implicitly available as output properties. Additionally, the PowerPanel 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 PowerPanel Resource
Get an existing PowerPanel 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?: PowerPanelState, opts?: CustomResourceOptions): PowerPanel
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
comments: Optional[str] = None,
custom_fields: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
location_id: Optional[float] = None,
name: Optional[str] = None,
power_panel_id: Optional[str] = None,
site_id: Optional[float] = None,
tags: Optional[Sequence[str]] = None) -> PowerPanel
func GetPowerPanel(ctx *Context, name string, id IDInput, state *PowerPanelState, opts ...ResourceOption) (*PowerPanel, error)
public static PowerPanel Get(string name, Input<string> id, PowerPanelState? state, CustomResourceOptions? opts = null)
public static PowerPanel get(String name, Output<String> id, PowerPanelState state, CustomResourceOptions options)
resources: _: type: netbox:PowerPanel 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.
- Comments string
- Custom
Fields Dictionary<string, string> - Description string
- Location
Id double - Name string
- Power
Panel stringId - The ID of this resource.
- Site
Id double - List<string>
- Comments string
- Custom
Fields map[string]string - Description string
- Location
Id float64 - Name string
- Power
Panel stringId - The ID of this resource.
- Site
Id float64 - []string
- comments String
- custom
Fields Map<String,String> - description String
- location
Id Double - name String
- power
Panel StringId - The ID of this resource.
- site
Id Double - List<String>
- comments string
- custom
Fields {[key: string]: string} - description string
- location
Id number - name string
- power
Panel stringId - The ID of this resource.
- site
Id number - string[]
- comments str
- custom_
fields Mapping[str, str] - description str
- location_
id float - name str
- power_
panel_ strid - The ID of this resource.
- site_
id float - Sequence[str]
- comments String
- custom
Fields Map<String> - description String
- location
Id Number - name String
- power
Panel StringId - The ID of this resource.
- site
Id Number - List<String>
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.