-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Additional example for blog post.
- Loading branch information
Showing
8 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
7 changes: 7 additions & 0 deletions
7
examples/backbone_design/designs/edge_site/context/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"""This module contains the render context for the basic design.""" | ||
from nautobot_design_builder.context import Context, context_file | ||
|
||
|
||
@context_file("context.yaml") | ||
class EdgeDesignContext(Context): | ||
"""Render context for basic design.""" |
1 change: 1 addition & 0 deletions
1
examples/backbone_design/designs/edge_site/context/context.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
31 changes: 31 additions & 0 deletions
31
examples/backbone_design/designs/edge_site/designs/0001_design.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
sites: | ||
- name: "{{ site_name }}" | ||
status__name: "Staging" | ||
prefixes: | ||
- prefix: "{{ site_prefix }}" | ||
status__name: "Reserved" | ||
devices: | ||
{% for i in range(2) %} | ||
- name: "{{ site_name }}-LR{{ i }}" | ||
status__name: "Planned" | ||
device_type__model: "C8300-1N1S-6T" | ||
device_role__name: "Edge Router" | ||
interfaces: | ||
- name: "GigabitEthernet0/0" | ||
type: "1000base-t" | ||
description: "Uplink to backbone" | ||
status__name: "Planned" | ||
{% endfor %} | ||
circuits: | ||
{% for i in range(2) %} | ||
- cid: "{{ site_name }}-CKT-{{ i }}" | ||
status__name: "Planned" | ||
provider__name: "NTC" | ||
type__name: "Ethernet" | ||
terminations: | ||
- term_side: "A" | ||
site__name: "{{ site_name }}" | ||
- term_side: "Z" | ||
provider_network__name: "NTC-WAN" | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"""Basic design demonstrates the capabilities of the Design Builder.""" | ||
from nautobot.extras.jobs import StringVar, IPNetworkVar | ||
|
||
from nautobot_design_builder.design_job import DesignJob | ||
|
||
from .context import EdgeDesignContext | ||
|
||
|
||
class EdgeDesign(DesignJob): | ||
"""A basic design for design builder.""" | ||
|
||
site_name = StringVar(label="Site Name", regex=r"\w{3}\d+") | ||
site_prefix = IPNetworkVar(label="Site Prefix") | ||
|
||
class Meta: | ||
"""Metadata describing this design job.""" | ||
|
||
name = "Edge Design" | ||
commit_default = False | ||
design_file = "designs/0001_design.yaml.j2" | ||
context_class = EdgeDesignContext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters