0
# Circuit Management
1
2
Service provider circuit management including circuits, providers, and circuit terminations. Manages external network connectivity and carrier services.
3
4
## Capabilities
5
6
### Service Providers
7
8
Service provider and network management.
9
10
```python { .api }
11
class Provider:
12
"""
13
Service providers for circuit management.
14
15
Attributes:
16
name (str): Provider name
17
slug (str): URL-safe slug
18
asn (int): Autonomous System Number
19
account (str): Account number
20
portal_url (str): Customer portal URL
21
noc_contact (str): NOC contact information
22
admin_contact (str): Administrative contact
23
comments (str): Comments
24
tags (list): Associated tags
25
"""
26
27
class ProviderNetwork:
28
"""
29
Provider networks for service delivery.
30
31
Attributes:
32
name (str): Network name
33
provider (Provider): Associated provider
34
description (str): Network description
35
service_id (str): Service identifier
36
comments (str): Comments
37
tags (list): Associated tags
38
"""
39
```
40
41
### Circuit Management
42
43
Circuit definitions and management.
44
45
```python { .api }
46
class CircuitType:
47
"""
48
Circuit type definitions.
49
50
Attributes:
51
name (str): Circuit type name
52
slug (str): URL-safe slug
53
description (str): Type description
54
"""
55
56
class Circuit:
57
"""
58
Service provider circuits.
59
60
Attributes:
61
cid (str): Circuit ID
62
provider (Provider): Service provider
63
type (CircuitType): Circuit type
64
status (Status): Circuit status
65
tenant (Tenant): Tenant assignment
66
install_date (date): Installation date
67
commit_rate (int): Committed rate in Kbps
68
description (str): Circuit description
69
comments (str): Comments
70
tags (list): Associated tags
71
"""
72
73
class CircuitTermination:
74
"""
75
Circuit endpoints/terminations.
76
77
Attributes:
78
circuit (Circuit): Associated circuit
79
term_side (str): Termination side (A or Z)
80
location (Location): Termination location
81
provider_network (ProviderNetwork): Provider network
82
port_speed (int): Port speed in Kbps
83
upstream_speed (int): Upstream speed in Kbps
84
xconnect_id (str): Cross-connect ID
85
pp_info (str): Patch panel information
86
description (str): Termination description
87
"""
88
```
89
90
## Usage Examples
91
92
### Provider Management
93
94
```python
95
from nautobot.circuits.models import Provider, ProviderNetwork
96
97
# Create provider
98
provider = Provider.objects.create(
99
name="Acme Telecom",
100
asn=65001,
101
account="ACCT-12345",
102
portal_url="https://portal.acme-telecom.com",
103
noc_contact="noc@acme-telecom.com"
104
)
105
106
# Create provider network
107
network = ProviderNetwork.objects.create(
108
name="MPLS-Core",
109
provider=provider,
110
description="Core MPLS network"
111
)
112
```
113
114
### Circuit Management
115
116
```python
117
from nautobot.circuits.models import Circuit, CircuitType, CircuitTermination
118
from nautobot.dcim.models import Location
119
120
# Create circuit type
121
circuit_type = CircuitType.objects.create(
122
name="MPLS",
123
description="MPLS VPN Service"
124
)
125
126
# Create circuit
127
circuit = Circuit.objects.create(
128
cid="MPLS-001",
129
provider=provider,
130
type=circuit_type,
131
commit_rate=100000, # 100 Mbps
132
description="Primary MPLS connection"
133
)
134
135
# Create circuit terminations
136
site_a = Location.objects.get(name="New York")
137
site_z = Location.objects.get(name="Chicago")
138
139
term_a = CircuitTermination.objects.create(
140
circuit=circuit,
141
term_side="A",
142
location=site_a,
143
port_speed=100000
144
)
145
146
term_z = CircuitTermination.objects.create(
147
circuit=circuit,
148
term_side="Z",
149
location=site_z,
150
port_speed=100000
151
)
152
```