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
query_parts.append({ | |
'operator': 'or', | |
'val1': { | |
'operator': 'or', | |
'val1': { | |
'operator': 'or', | |
'val1': { | |
'operator': 'or', | |
'val1': { | |
'operator': 'regex_match', |
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
Simple dictSQL to match on one column using the equal operator. val1 contains name of column/attribute name of prefix to match while val2 contains the value it should match using the specified operator. | |
dictSQL = { | |
'val1': 'description', | |
'operator': 'equals', | |
'val2': 'bar' | |
} | |
Expands to: | |
description = 'bar' |
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
""" Trying to mock my imports as I don't need this code to run, only load so | |
that readthedocs.org can generate nice documentation from my docstrings. | |
""" | |
#!/usr/bin/python | |
import sys | |
class Mock(object): | |
def __init__(self, *args, **kwargs): |
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
#!/usr/bin/env python3 | |
import json | |
import re | |
import urllib.request | |
def expand_asset(as_set): | |
pass |
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
#!/usr/bin/env python | |
# Get YANG models from a device by using the get-schema RPC. | |
# | |
# Kristian Larsson <[email protected]> | |
# | |
import urlparse | |
import logging | |
from ncclient import manager | |
import ncclient |
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
Start three XR routers: | |
kll@htpc:~$ docker run --privileged -i -t -d --name xr1 vr-xrv:6.0.1 | |
1d520dde91768a6dc2ee24873f46e3045b2c805e322d3556288080be9a9f6165 | |
kll@htpc:~$ docker run --privileged -i -t -d --name xr2 vr-xrv:6.0.1 | |
15a26c2ea190bd02df952ab90271b865811a1fdbcf9b4626da868297e9f0214f | |
kll@htpc:~$ docker run --privileged -i -t -d --name xr3 vr-xrv:6.0.1 | |
059ea393bbc90c79c51cba79fa3f1c1dbc4e4dedbddf742f1f92400c6407847e | |
kll@htpc:~$ | |
Connect them together, the first interface on xr1 goes to the first interface |
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
root@NIPAP-Demo:~# cat /etc/apache2/sites-available/000-default.conf | |
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
DocumentRoot /var/www | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
<Directory /var/www/> |
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
nipap-db: | |
image: nipap/postgres-ip4r | |
volumes: | |
- ./db-data:/var/lib/postgresql/data | |
environment: | |
- PGDATA=/var/lib/postgres/data/pgdata | |
- POSTGRES_USER=nipap | |
- POSTGRES_PASSWORD=S3cretDBPas5 | |
- POSTGRES_DB=nipap |
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
image: gitlab.dev.terastrm.net:4567/terastream/cisco-nso/ci-cisco-nso:4.2.3 | |
stages: | |
- build | |
- mr-robot | |
variables: | |
NCS_VERSION: "4.2.3" | |
DOCKER_REGISTRY: "gitlab.dev.terastrm.net:4567/terastream/cisco-nso" | |
TARGET_REGISTRY: "repo.dev.terastrm.net:5000/" |
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
class Selftest(Action): | |
@Action.action | |
def cb_action(self, uinfo, name, kp, action_input, action_output): | |
out = action_output.somewhere | |
with ncs.maapi.single_write_trans('python-state-backbone-interface-write', 'system', db=ncs.OPERATIONAL) as t: | |
root = ncs.maagic.get_root(t) | |
service = ncs.maagic.get_node(t, kp) |
OlderNewer