netbox.Circuit
Explore with Pulumi AI
From the official documentation:
A communications circuit represents a single physical link connecting exactly two endpoints, commonly referred to as its A and Z terminations. A circuit in NetBox may have zero, one, or two terminations defined. It is common to have only one termination defined when you don’t necessarily care about the details of the provider side of the circuit, e.g. for Internet access circuits. Both terminations would likely be modeled for circuits which connect one customer site to another.
Each circuit is associated with a provider and a user-defined type. For example, you might have Internet access circuits delivered to each site by one provider, and private MPLS circuits delivered by another. Each circuit must be assigned a circuit ID, each of which must be unique per provider.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as netbox from "@pulumi/netbox";
const testTenant = new netbox.Tenant("testTenant", {});
const testCircuitProvider = new netbox.CircuitProvider("testCircuitProvider", {});
const testCircuitType = new netbox.CircuitType("testCircuitType", {});
const testCircuit = new netbox.Circuit("testCircuit", {
cid: "test",
status: "active",
providerId: testCircuitProvider.circuitProviderId,
typeId: testCircuitType.circuitTypeId,
});
import pulumi
import pulumi_netbox as netbox
test_tenant = netbox.Tenant("testTenant")
test_circuit_provider = netbox.CircuitProvider("testCircuitProvider")
test_circuit_type = netbox.CircuitType("testCircuitType")
test_circuit = netbox.Circuit("testCircuit",
cid="test",
status="active",
provider_id=test_circuit_provider.circuit_provider_id,
type_id=test_circuit_type.circuit_type_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 {
_, err := netbox.NewTenant(ctx, "testTenant", nil)
if err != nil {
return err
}
testCircuitProvider, err := netbox.NewCircuitProvider(ctx, "testCircuitProvider", nil)
if err != nil {
return err
}
testCircuitType, err := netbox.NewCircuitType(ctx, "testCircuitType", nil)
if err != nil {
return err
}
_, err = netbox.NewCircuit(ctx, "testCircuit", &netbox.CircuitArgs{
Cid: pulumi.String("test"),
Status: pulumi.String("active"),
ProviderId: testCircuitProvider.CircuitProviderId,
TypeId: testCircuitType.CircuitTypeId,
})
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 testTenant = new Netbox.Tenant("testTenant");
var testCircuitProvider = new Netbox.CircuitProvider("testCircuitProvider");
var testCircuitType = new Netbox.CircuitType("testCircuitType");
var testCircuit = new Netbox.Circuit("testCircuit", new()
{
Cid = "test",
Status = "active",
ProviderId = testCircuitProvider.CircuitProviderId,
TypeId = testCircuitType.CircuitTypeId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.netbox.Tenant;
import com.pulumi.netbox.CircuitProvider;
import com.pulumi.netbox.CircuitType;
import com.pulumi.netbox.Circuit;
import com.pulumi.netbox.CircuitArgs;
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 testTenant = new Tenant("testTenant");
var testCircuitProvider = new CircuitProvider("testCircuitProvider");
var testCircuitType = new CircuitType("testCircuitType");
var testCircuit = new Circuit("testCircuit", CircuitArgs.builder()
.cid("test")
.status("active")
.providerId(testCircuitProvider.circuitProviderId())
.typeId(testCircuitType.circuitTypeId())
.build());
}
}
resources:
testTenant:
type: netbox:Tenant
testCircuitProvider:
type: netbox:CircuitProvider
testCircuitType:
type: netbox:CircuitType
testCircuit:
type: netbox:Circuit
properties:
cid: test
status: active
providerId: ${testCircuitProvider.circuitProviderId}
typeId: ${testCircuitType.circuitTypeId}
Create Circuit Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Circuit(name: string, args: CircuitArgs, opts?: CustomResourceOptions);
@overload
def Circuit(resource_name: str,
args: CircuitArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Circuit(resource_name: str,
opts: Optional[ResourceOptions] = None,
cid: Optional[str] = None,
provider_id: Optional[float] = None,
status: Optional[str] = None,
type_id: Optional[float] = None,
circuit_id: Optional[str] = None,
tenant_id: Optional[float] = None)
func NewCircuit(ctx *Context, name string, args CircuitArgs, opts ...ResourceOption) (*Circuit, error)
public Circuit(string name, CircuitArgs args, CustomResourceOptions? opts = null)
public Circuit(String name, CircuitArgs args)
public Circuit(String name, CircuitArgs args, CustomResourceOptions options)
type: netbox:Circuit
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 CircuitArgs
- 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 CircuitArgs
- 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 CircuitArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CircuitArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CircuitArgs
- 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 circuitResource = new Netbox.Circuit("circuitResource", new()
{
Cid = "string",
ProviderId = 0,
Status = "string",
TypeId = 0,
CircuitId = "string",
TenantId = 0,
});
example, err := netbox.NewCircuit(ctx, "circuitResource", &netbox.CircuitArgs{
Cid: pulumi.String("string"),
ProviderId: pulumi.Float64(0),
Status: pulumi.String("string"),
TypeId: pulumi.Float64(0),
CircuitId: pulumi.String("string"),
TenantId: pulumi.Float64(0),
})
var circuitResource = new Circuit("circuitResource", CircuitArgs.builder()
.cid("string")
.providerId(0)
.status("string")
.typeId(0)
.circuitId("string")
.tenantId(0)
.build());
circuit_resource = netbox.Circuit("circuitResource",
cid="string",
provider_id=0,
status="string",
type_id=0,
circuit_id="string",
tenant_id=0)
const circuitResource = new netbox.Circuit("circuitResource", {
cid: "string",
providerId: 0,
status: "string",
typeId: 0,
circuitId: "string",
tenantId: 0,
});
type: netbox:Circuit
properties:
cid: string
circuitId: string
providerId: 0
status: string
tenantId: 0
typeId: 0
Circuit 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 Circuit resource accepts the following input properties:
- cid str
- provider_
id float - status str
- Valid values are
planned
,provisioning
,active
,offline
,deprovisioning
anddecommissioning
. - type_
id float - circuit_
id str - The ID of this resource.
- tenant_
id float
Outputs
All input properties are implicitly available as output properties. Additionally, the Circuit 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 Circuit Resource
Get an existing Circuit 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?: CircuitState, opts?: CustomResourceOptions): Circuit
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cid: Optional[str] = None,
circuit_id: Optional[str] = None,
provider_id: Optional[float] = None,
status: Optional[str] = None,
tenant_id: Optional[float] = None,
type_id: Optional[float] = None) -> Circuit
func GetCircuit(ctx *Context, name string, id IDInput, state *CircuitState, opts ...ResourceOption) (*Circuit, error)
public static Circuit Get(string name, Input<string> id, CircuitState? state, CustomResourceOptions? opts = null)
public static Circuit get(String name, Output<String> id, CircuitState state, CustomResourceOptions options)
resources: _: type: netbox:Circuit 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.
- cid str
- circuit_
id str - The ID of this resource.
- provider_
id float - status str
- Valid values are
planned
,provisioning
,active
,offline
,deprovisioning
anddecommissioning
. - tenant_
id float - type_
id float
Package Details
- Repository
- netbox e-breuninger/terraform-provider-netbox
- License
- Notes
- This Pulumi package is based on the
netbox
Terraform Provider.