forked from jprice-juniper/NCE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c487516
commit f6ffcd1
Showing
4 changed files
with
30 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Logging Network Statistics Using Accounting Profiles | ||
=========== | ||
|
||
This example is described in detail in the following document: | ||
http://www.juniper.net/techpubs/en_US/release-independent/nce/information-products/topic-collections/nce/accounting-profiles-statistics-logging/accounting-profiles-statistics-logging.pdf | ||
|
||
Usage | ||
----- | ||
|
||
```sh | ||
python accounting-profile-statistics-logging.py | ||
``` |
Empty file.
17 changes: 17 additions & 0 deletions
17
accounting-profile-statistics-logging/accounting-profile-statistics-logging.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,17 @@ | ||
|
||
|
||
import yaml | ||
import sys | ||
from glob import glob | ||
from jinja2 import Template | ||
|
||
# YAML file. | ||
with open(glob('*.yml')[0]) as fh: | ||
data = yaml.load(fh.read()) | ||
|
||
# Jinja2 template file. | ||
with open(glob('*.j2')[0]) as t_fh: | ||
t_format = t_fh.read() | ||
|
||
template = Template(t_format) | ||
print (template.render(data)) |
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 @@ | ||
--- |