├── .gitignore
├── LICENSE
├── README.md
├── chapter1
├── README.md
├── chapter1-recipe1
│ └── pom.xml
├── chapter1-recipe2
│ └── pom.xml
├── chapter1-recipe3
│ └── pom.xml
├── chapter1-recipe4
│ └── pom.xml
├── chapter1-recipe5
│ └── pom.xml
├── chapter1-recipe6
│ └── pom.xml
├── chapter1-recipe7
│ └── pom.xml
├── chapter1-recipe8
│ └── pom.xml
└── pom.xml
├── chapter10
├── README.md
├── chapter10-recipe1
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── etc
│ │ └── org.apache.karaf.shell.cfg
├── chapter10-recipe2
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── resources
│ │ └── org
│ │ └── apache
│ │ └── karaf
│ │ └── branding
│ │ └── branding.properties
├── chapter10-recipe3
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── etc
│ │ └── org.ops4j.pax.url.mvn.cfg
├── chapter10-recipe4
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── etc
│ │ └── org.apache.karaf.features.cfg
├── chapter10-recipe5
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── etc
│ │ └── ODL-BE-wrapper.conf
├── chapter10-recipe6
│ ├── README.txt
│ ├── command
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── packt
│ │ │ │ └── sample.java
│ │ │ └── resources
│ │ │ └── OSGI-INF
│ │ │ └── blueprint
│ │ │ └── shell-log.xml
│ └── pom.xml
├── chapter10-recipe7
│ ├── README.txt
│ ├── feature
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── resources
│ │ │ └── features.xml
│ ├── moduleA
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── packt
│ │ │ └── chapter10
│ │ │ └── recipe7
│ │ │ └── moduleA
│ │ │ └── Activator.java
│ ├── moduleB
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── packt
│ │ │ └── chapter10
│ │ │ └── recipe7
│ │ │ └── moduleB
│ │ │ └── Activator.java
│ └── pom.xml
├── chapter10-recipe8
│ ├── README.txt
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── etc
│ │ ├── org.apache.karaf.management.cfg
│ │ └── users.properties
├── chapter10-recipe9
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── etc
│ │ ├── org.apache.karaf.decanter.appender.elasticsearch.cfg
│ │ ├── org.apache.karaf.decanter.collector.jmx-local.cfg
│ │ ├── org.apache.karaf.decanter.collector.system.cfg
│ │ ├── org.apache.karaf.decanter.scheduler.simple.cfg
│ │ ├── org.apache.karaf.decanter.sla.checker.cfg
│ │ └── org.apache.karaf.decanter.sla.email.cfg
└── pom.xml
├── chapter3
├── README.md
├── chapter3-recipe1
│ └── pom.xml
├── chapter3-recipe2
│ └── pom.xml
├── chapter3-recipe3
│ ├── shortest_path.py
│ ├── README
│ └── pom.xml
├── chapter3-recipe4
│ ├── EchoServer.jar
│ ├── README.md
│ ├── UscAgent.jar
│ ├── pom.xml
│ └── resources
│ │ └── etc
│ │ └── usc
│ │ ├── akka.conf
│ │ ├── certificates
│ │ ├── client.key.pem
│ │ ├── client.pem
│ │ └── rootCA.pem
│ │ └── usc.properties
├── chapter3-recipe5
│ └── pom.xml
├── chapter3-recipe6
│ ├── PCMM_Sample_Local.postman_environment
│ └── pom.xml
└── pom.xml
├── chapter4
├── .idea
│ ├── .name
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── encodings.xml
│ ├── misc.xml
│ ├── modules.xml
│ └── workspace.xml
├── README.md
├── chapter4-recipe1
│ ├── SNMP-Plugin.postman_collection.json
│ └── pom.xml
├── chapter4-recipe2
│ ├── SNMP4SDN.postman_collection.json
│ ├── pom.xml
│ ├── snmp4sdn_VendorSpecificSwitchConfig.xml
│ └── snmp4sdn_swdb.csv
├── chapter4-recipe3
│ ├── DIDM-VM
│ │ ├── README.md
│ │ └── Vagrantfile
│ ├── DIDM.postman_collection.json
│ └── pom.xml
├── chapter4-recipe4
│ ├── OF-ConfigVM
│ │ └── Vagrantfile
│ └── pom.xml
├── chapter4-recipe5
│ ├── SnbiVMs
│ │ └── Vagrantfile
│ └── pom.xml
├── chapter4-recipe6
│ ├── NemoVM
│ │ └── Vagrantfile
│ ├── VPC
│ │ ├── bod-1024.py
│ │ ├── bod-512 .py
│ │ ├── nemo-odl.py
│ │ ├── network-down.sh
│ │ └── network-up.sh
│ └── pom.xml
├── chapter4-recipe7
│ ├── SXP.postman_collection.json
│ └── pom.xml
├── chapter4-recipe8
│ ├── NetIDEVM
│ │ └── Vagrantfile
│ └── pom.xml
└── pom.xml
├── chapter5
├── README.md
├── chapter5-recipe1
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── resources
│ │ └── vtn.json.postman_collection
├── chapter5-recipe2
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── resources
│ │ ├── features-neutron-test-0.6.0-Beryllium-features.xml
│ │ ├── features-neutron-test-0.6.1-Beryllium-SR1-features.xml
│ │ └── features-neutron-test-0.6.2-Beryllium-SR2-features.xml
├── chapter5-recipe3
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── resources
│ │ └── prerequisite.md
├── chapter5-recipe4
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── resources
│ │ ├── compute-node-topo.txt
│ │ ├── console-output.txt
│ │ └── control-node-topo.txt
├── chapter5-recipe5
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── resources
│ │ ├── acl.json
│ │ ├── classifiers_topo.txt
│ │ ├── setup_classifier_prerequisites.sh
│ │ ├── setup_odl.sh
│ │ ├── setup_sf.sh
│ │ └── sff.json
└── pom.xml
├── chapter6
├── README.md
├── chapter6-recipe1
│ ├── pom.xml
│ ├── postman
│ │ └── Recipe_1-Retrieving_BGP_information.postman_collection
│ ├── quagga
│ │ └── README_setup.txt
│ └── samples
│ │ ├── network_topology.txt
│ │ └── rib_data.txt
├── chapter6-recipe2
│ ├── pom.xml
│ ├── postman
│ │ └── Recipe_2-Managing_and_visualizing_topologies_using_BGP-LS.postman_collection
│ └── samples
│ │ ├── ipv4-topology.txt
│ │ ├── ipv6-topology.txt
│ │ └── linkstate-topology.txt
├── chapter6-recipe3
│ ├── pom.xml
│ ├── postman
│ │ └── Recipe_3-Adding_and_removing_BGP_routes_to_the_network.postman_collection
│ └── samples
│ │ ├── add-ipv4-flowspec.txt
│ │ ├── add-ipv4-labelled-unicast-route.txt
│ │ ├── add-ipv4-unicast-route.txt
│ │ ├── add-ipv6-flowspec.txt
│ │ └── add-ipv6-unicast-route.txt
├── chapter6-recipe4
│ └── pom.xml
├── chapter6-recipe5
│ ├── pcc-mock
│ │ └── resources
│ │ │ ├── README.md
│ │ │ ├── pcep-pcc-mock-0.5.3-executable.jar
│ │ │ ├── pcep-pcc-mock-0.5.3-javadoc.jar
│ │ │ ├── pcep-pcc-mock-0.5.3-sources.jar
│ │ │ └── pcep-pcc-mock-0.5.3.jar
│ ├── pom.xml
│ └── postman
│ │ └── Recipe_5-Managing_LSP_Tunnels_with_PCEP.postman_collection
├── chapter6-recipe6
│ └── pom.xml
├── chapter6-recipe7
│ └── pom.xml
├── chapter6-recipe8
│ └── pom.xml
├── chapter6-recipe9
│ └── pom.xml
└── pom.xml
├── chapter9
├── chapter9-recipe1
│ └── pom.xml
├── chapter9-recipe10
│ └── pom.xml
├── chapter9-recipe11
│ └── pom.xml
├── chapter9-recipe12
│ └── pom.xml
├── chapter9-recipe2
│ ├── shortest_path.py
│ ├── mapping_service_config.json
│ └── pom.xml
├── chapter9-recipe3
│ ├── pom.xml
│ ├── redirect_test.py
│ ├── service_config.json
│ └── service_functions_config.json
├── chapter9-recipe4
│ └── pom.xml
├── chapter9-recipe5
│ └── pom.xml
├── chapter9-recipe6
│ ├── local.conf
│ └── pom.xml
├── chapter9-recipe7
│ └── pom.xml
├── chapter9-recipe8
│ └── pom.xml
├── chapter9-recipe9
│ └── pom.xml
├── pom.xml
├── provision_h1_and_h2.sh
├── provision_h2_and_h3.sh
└── update_h1_and_h2.sh
└── pom.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .settings
3 | .project
4 | .vagrant
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OpenDaylightCookbook
2 | OpenDaylight Cookbook
3 |
--------------------------------------------------------------------------------
/chapter1/README.md:
--------------------------------------------------------------------------------
1 | # Chapter 1
2 |
3 | Chapter 1 :: OpenDaylight Fundamentals.
4 |
5 |
6 | Recipe 1:: Connecting OpenFlow Switches.
7 |
8 | Recipe 2:: Mounting a Netconf Device.
9 |
10 | Recipe 3:: Browsing Data Models with Yang UI.
11 |
12 | Recipe 4:: Basic Distributer Switching.
13 |
14 | Recipe 5:: Bonding Links using LACP.
15 |
16 | Recipe 6:: Working with Multile Controllers.
17 |
18 | Recipe 7:: Changing User Authentication
19 |
20 | Recipe 8:: OpenDaylight Clustering
21 |
22 |
--------------------------------------------------------------------------------
/chapter1/chapter1-recipe1/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter1
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter1-recipe1
16 | pom
17 | Chapter 1 :: Recipe 1 :: Conecting OpenFlow Switches
18 |
19 |
--------------------------------------------------------------------------------
/chapter1/chapter1-recipe2/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter1
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter1-recipe2
16 | pom
17 | Chapter 1 :: Recipe 2 :: Mounting a Netconf Device
18 |
19 |
--------------------------------------------------------------------------------
/chapter1/chapter1-recipe3/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter1
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter1-recipe3
16 | pom
17 | Chapter 1 :: Recipe 3 :: Browsing Data Models with Yang UI
18 |
19 |
--------------------------------------------------------------------------------
/chapter1/chapter1-recipe4/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter1
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter1-recipe4
16 | pom
17 | Chapter 1 :: Recipe 4 :: Basic Distributed Switching
18 |
19 |
--------------------------------------------------------------------------------
/chapter1/chapter1-recipe5/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter1
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter1-recipe5
16 | pom
17 | Chapter 1 :: Recipe 5 :: Bonding Links using LACP
18 |
19 |
--------------------------------------------------------------------------------
/chapter1/chapter1-recipe6/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter1
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter1-recipe6
16 | pom
17 | Chapter 1 :: Recipe 6 :: Working with Multiple Controllers
18 |
19 |
--------------------------------------------------------------------------------
/chapter1/chapter1-recipe7/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter1
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter1-recipe7
16 | pom
17 | Chapter 1 :: Recipe 7 :: Changing User Authentication
18 |
19 |
--------------------------------------------------------------------------------
/chapter1/chapter1-recipe8/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter1
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter1-recipe8
16 | pom
17 | Chapter 1 :: Recipe 8 :: OpenDaylight Clustering
18 |
19 |
--------------------------------------------------------------------------------
/chapter1/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 |
6 | com.packt
7 | opendaylight-cookbook
8 | 1.0.0-SNAPSHOT
9 |
10 |
11 | chapter1
12 | pom
13 | Chapter 1 :: OpenDaylight Fundamentals
14 |
15 |
16 | chapter1-recipe1
17 | chapter1-recipe2
18 | chapter1-recipe3
19 | chapter1-recipe4
20 | chapter1-recipe5
21 | chapter1-recipe6
22 | chapter1-recipe7
23 | chapter1-recipe8
24 |
25 |
26 |
--------------------------------------------------------------------------------
/chapter10/README.md:
--------------------------------------------------------------------------------
1 | # Chapter 10
2 |
3 | Chapter 10 :: OpenDaylight Container Customization.
4 |
5 |
6 | Recipe 1:: Reconfigure SSH access to OpenDaylight
7 |
8 | Recipe 2:: Creating your own branded OpenDaylight.
9 |
10 | Recipe 3:: Customize your OpenDaylight repositories.
11 |
12 | Recipe 4:: Customize your start up applications.
13 |
14 | Recipe 5:: Install OpenDaylight as a service.
15 |
16 | Recipe 6:: Creating our own custom OpenDaylight command using Maven Archetype.
17 |
18 | Recipe 7:: Deploy applications using features.
19 |
20 | Recipe 8:: Use JMX to monitor and administer OpenDaylight.
21 |
22 | Recipe 9:: Setup Apache Karaf Decanter to monitor OpenDaylight.
23 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe1/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter10
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapter10-recipe1
16 | pom
17 |
18 | Chapter 10 :: Recipe 1 :: Customizing SSH
19 |
20 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe1/src/main/etc/org.apache.karaf.shell.cfg:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | ################################################################################
19 |
20 | #
21 | # These properties are used to configure Karaf's ssh shell.
22 | #
23 |
24 | #
25 | # Via sshPort and sshHost you define the address you can login into Karaf.
26 | #
27 | sshPort = 8102
28 | sshHost = 0.0.0.0
29 |
30 | #
31 | # The sshIdleTimeout defines the inactivity timeout to logout the SSH session.
32 | # The sshIdleTimeout is in milliseconds, and the default is set to 30 minutes.
33 | #
34 | sshIdleTimeout = 1800000
35 |
36 | #
37 | # sshRealm defines which JAAS domain to use for password authentication.
38 | #
39 | sshRealm = karaf
40 |
41 | #
42 | # The location of the hostKey file defines where the private/public key of the server
43 | # is located. If no file is at the defined location it will be ignored.
44 | #
45 | hostKey = ${karaf.etc}/host.key
46 |
47 | #
48 | # Self defined key size in 1024, 2048, 3072, or 4096
49 | # If not set, this defaults to 1024.
50 | #
51 | # keySize = 1024
52 |
53 | #
54 | # Specify host key algorithm, defaults to DSA
55 | #
56 | # algorithm = DSA
57 |
58 | # Specify an additional welcome banner to be displayed when a user logs into the server.
59 | #
60 | # welcomeBanner =
61 |
62 | #
63 | # Defines the completion mode on the Karaf shell console. The possible values are:
64 | # - GLOBAL: it's the same behavior as in previous Karaf releases. The completion displays all commands and all aliases
65 | # ignoring if you are in a subshell or not.
66 | # - FIRST: the completion displays all commands and all aliases only when you are not in a subshell. When you are
67 | # in a subshell, the completion displays only the commands local to the subshell.
68 | # - SUBSHELL: the completion displays only the subshells on the root level. When you are in a subshell, the completion
69 | # displays only the commands local to the subshell.
70 | # This property define the default value when you use the Karaf shell console.
71 | # You can change the completion mode directly in the shell console, using shell:completion command.
72 | #
73 | completionMode = GLOBAL
74 |
75 | #
76 | # Enable the console logger.
77 | # The console logger allows to generate log messages for all actions/commands performed in the shell console.
78 | #
79 | # consoleLogger property enable/disable the logger. The logger is disabled by default
80 | #
81 | consoleLogger = false
82 | #
83 | # consoleLoggerName allows you to define the logger name used for the log messages
84 | #
85 | consoleLoggerName = org.apache.karaf.shell.console.Logger
86 | #
87 | # consoleLoggerOutLevel allows you to define the log level for the log messages corresponding to the System.out stream
88 | #
89 | consoleLoggerOutLevel = debug
90 | #
91 | # consoleLoggerErrLevel allows you to define the log level for the log messages corresponding to the System.err stream
92 | #
93 | consoleLoggerErrLevel = error
94 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe2/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | 4.0.0
9 |
10 |
11 | com.packt
12 | chapter10
13 | 1.0.0-SNAPSHOT
14 |
15 |
16 | chapter10-recipe2
17 | bundle
18 | Chapter 10 :: Recipe 2 :: Custom Branding
19 |
20 |
21 |
22 |
23 | ${project.basedir}/src/main/resources
24 | true
25 |
26 | **/*
27 |
28 |
29 |
30 |
31 |
32 | org.apache.felix
33 | maven-bundle-plugin
34 | 2.4.0
35 | true
36 |
37 |
38 | ${project.artifactId}
39 | *
40 | !*
41 |
42 | org.apache.karaf.branding
43 |
44 | *;publish-context:=false
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe2/src/main/resources/org/apache/karaf/branding/branding.properties:
--------------------------------------------------------------------------------
1 | ##
2 | welcome = \
3 | \u001B[33m\u001B[0m\n\
4 | \u001B[33m ___ ____ _ \u001B[0m\n\
5 | \u001B[33m / _ \\| _ \\| | \u001B[0m\n\
6 | \u001B[33m | | | | | | | | \u001B[0m\n\
7 | \u001B[33m | |_| | |_| | |___ \u001B[0m\n\
8 | \u001B[33m \\___/|____/|_____| \u001B[0m\n\
9 | \u001B[33m \u001B[0m\n\
10 | \u001B[33m \u001B[0m\n\
11 | \u001B[33m OpenDaylight Cookbook \u001B[0m\n\
12 | \u001B[33m Packt Publishing - http://www.packtpub.com\u001B[0m\n\
13 | \u001B[33m (version ${project.version})\u001B[0m\n\
14 | \u001B[33m\u001B[0m\n\
15 | \u001B[33mHit '\u001B[1m\u001B[0m' for a list of available commands\u001B[0m\n\
16 | \u001B[33mand '\u001B[1m[cmd] --help\u001B[0m' for help on a specific command.\u001B[0m\n\
17 | \u001B[33mHit '\u001B[1m\u001B[0m' or '\u001B[1mosgi:shutdown\u001B[0m' to shutdown\u001B[0m\n\
18 | \u001B[33m\u001B[0m\n\
19 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe3/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | 4.0.0
9 |
10 |
11 | com.packt
12 | chapter10
13 | 1.0.0-SNAPSHOT
14 |
15 |
16 | chapter10-recipe3
17 | pom
18 | Chapter 10 :: Recipe 3 :: Custom Repositories
19 |
20 |
21 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe3/src/main/etc/org.ops4j.pax.url.mvn.cfg:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | ################################################################################
19 |
20 | #
21 | # If set to true, the following property will not allow any certificate to be used
22 | # when accessing Maven repositories through SSL
23 | #
24 | #org.ops4j.pax.url.mvn.certificateCheck=
25 |
26 | #
27 | # Path to the local Maven settings file.
28 | # The repositories defined in this file will be automatically added to the list
29 | # of default repositories if the 'org.ops4j.pax.url.mvn.repositories' property
30 | # below is not set.
31 | # The following locations are checked for the existence of the settings.xml file
32 | # * 1. looks for the specified url
33 | # * 2. if not found looks for ${user.home}/.m2/settings.xml
34 | # * 3. if not found looks for ${maven.home}/conf/settings.xml
35 | # * 4. if not found looks for ${M2_HOME}/conf/settings.xml
36 | #
37 | #org.ops4j.pax.url.mvn.settings=
38 |
39 | #
40 | # Path to the local Maven repository which is used to avoid downloading
41 | # artifacts when they already exist locally.
42 | # The value of this property will be extracted from the settings.xml file
43 | # above, or defaulted to:
44 | # System.getProperty( "user.home" ) + "/.m2/repository"
45 | #
46 | org.ops4j.pax.url.mvn.localRepository=${karaf.home}/${karaf.default.repository}
47 |
48 | #
49 | # Default this to false. It's just weird to use undocumented repos
50 | #
51 | org.ops4j.pax.url.mvn.useFallbackRepositories=false
52 |
53 | #
54 | # Uncomment if you don't wanna use the proxy settings
55 | # from the Maven conf/settings.xml file
56 | #
57 | # org.ops4j.pax.url.mvn.proxySupport=false
58 |
59 | #
60 | # Disable aether support by default. This ensure that the defaultRepositories
61 | # below will be used
62 | #
63 | #org.ops4j.pax.url.mvn.disableAether=true
64 |
65 | #
66 | # Comma separated list of repositories scanned when resolving an artifact.
67 | # Those repositories will be checked before iterating through the
68 | # below list of repositories and even before the local repository
69 | # A repository url can be appended with zero or more of the following flags:
70 | # @snapshots : the repository contains snaphots
71 | # @noreleases : the repository does not contain any released artifacts
72 | #
73 | # The following property value will add the system folder as a repo.
74 | #
75 | #org.ops4j.pax.url.mvn.defaultRepositories=
76 |
77 | # Use the default local repo (e.g.~/.m2/repository) as a "remote" repo
78 | org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=false
79 |
80 | #
81 | # Comma separated list of repositories scanned when resolving an artifact.
82 | # The default list includes the following repositories containing releases:
83 | # http://repo1.maven.org/maven2
84 | # http://repository.apache.org/content/groups/snapshots-group
85 | # http://svn.apache.org/repos/asf/servicemix/m2-repo
86 | # http://repository.springsource.com/maven/bundles/release
87 | # http://repository.springsource.com/maven/bundles/external
88 | # To add repositories to the default ones, prepend '+' to the list of repositories
89 | # to add.
90 | # A repository url can be appended with zero or more of the following flags:
91 | # @snapshots : the repository contains snaphots
92 | # @noreleases : the repository does not contain any released artifacts
93 | # @id=reponid : the id for the repository, just like in the settings.xml this is optional but recomendet
94 | #
95 | # The default list doesn't contain any repository containing snapshots as it can impact the artifacts resolution.
96 | # You may want to add the following repositories containing snapshots:
97 | # http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases
98 | # http://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@norelease
99 | # http://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases
100 | #
101 | org.ops4j.pax.url.mvn.repositories= \
102 | file:${karaf.home}/${karaf.default.repository}@id=system.repository, \
103 | file:${karaf.data}/kar@id=kar.repository@multi, \
104 | http://repo1.maven.org/maven2@id=central, \
105 | http://repository.springsource.com/maven/bundles/release@id=spring.ebr.release, \
106 | http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external, \
107 | http://zodiac.springsource.com/maven/bundles/release@id=gemini
108 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe4/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | 4.0.0
9 |
10 |
11 | com.packt
12 | chapter10
13 | 1.0.0-SNAPSHOT
14 |
15 |
16 | chapter10-recipe4
17 | pom
18 | Chapter 10 :: Recipe 4 :: Custom Startup Applications
19 |
20 |
21 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe4/src/main/etc/org.apache.karaf.features.cfg:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | ################################################################################
19 |
20 | #
21 | # Defines if the startlvl should be respected during feature startup. The default value is true. The default
22 | # behavior for 2.x is false (!) for this property
23 | #
24 | # Be aware that this property is deprecated and will be removed in Karaf 4.0. So, if you need to
25 | # set this to false, please use this only as a temporary solution!
26 | #
27 | #respectStartLvlDuringFeatureStartup=true
28 |
29 |
30 | #
31 | # Defines if the startlvl should be respected during feature uninstall. The default value is true.
32 | # If true, means stop bundles respecting the descend order of start level in a certain feature.
33 | #
34 | #respectStartLvlDuringFeatureUninstall=true
35 |
36 | #
37 | # Comma separated list of features repositories to register by default
38 | #
39 | featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.3/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features,mvn:org.apache.karaf.features/spring/3.0.3/xml/features,mvn:org.opendaylight.integration/features-integration-index/0.4.0-Beryllium/xml/features
40 |
41 | #
42 | # Comma separated list of features to install at startup
43 | #
44 | featuresBoot=config,standard,region,package,kar,ssh,management
45 |
46 | #
47 | # Defines if the boot features are started in asynchronous mode (in a dedicated thread)
48 | #
49 | featuresBootAsynchronous=false
50 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe5/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | 4.0.0
9 |
10 |
11 | com.packt
12 | chapter10
13 | 1.0.0-SNAPSHOT
14 |
15 |
16 | chapter10-recipe5
17 | pom
18 | Chapter 10 :: Recipe 5 :: Install as a System Service
19 |
20 |
21 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe6/README.txt:
--------------------------------------------------------------------------------
1 |
2 | Making a custom OpenDaylight BE command.
3 | ========================================
4 |
5 | OpenDaylight BE is based upon the Apache Karaf 3.0.4 container.
6 | We can use Apache Karaf's Maven archetype to generate a
7 | custom command project.
8 |
9 | The below Maven Archetype will generate a project structure
10 | for the development of an Apache Karaf command. You should
11 | select the archetypeVersion to match the Karaf version.
12 |
13 | mvn archetype:generate \
14 | -DarchetypeGroupId=org.apache.karaf.archetypes \
15 | -DarchetypeArtifactId=karaf-command-archetype \
16 | -DarchetypeVersion=3.0.4 \
17 | -DgroupId=com.mycompany \
18 | -DartifactId=com.mycompany.command \
19 | -Dversion=1.0.0-SNAPSHOT \
20 | -Dpackage=com.mycompany.package
21 |
22 | When the archetype is executed you will be presented
23 | with several choices as below:
24 |
25 | Define value for property 'command': : sample
26 | Define value for property 'description': : a sample custom command
27 | Define value for property 'scope': : cookbook
28 |
29 | Above we provided a command name "sample", a description of
30 | our sample command, and a command family scope of "cookbook".
31 |
32 | Sample Invocation:
33 | ------------------
34 |
35 | mvn archetype:generate \
36 | -DarchetypeGroupId=org.apache.karaf.archetypes \
37 | -DarchetypeArtifactId=karaf-command-archetype \
38 | -DarchetypeVersion=3.0.4 \
39 | -DgroupId=com.packt.chapter10 \
40 | -DartifactId=command \
41 | -Dversion=1.0.0-SNAPSHOT \
42 | -Dpackage=com.packt
43 |
44 | Sample installation of Bundle into ODL BE
45 | -----------------------------------------
46 |
47 | karaf@root()> install mvn:com.packt/odl-be-command
48 | Bundle ID: 88
49 | karaf@root()>
50 |
51 | Sample invocation in ODL BE
52 | ---------------------------
53 |
54 | karaf@root()> cookbook:sample -o 4 test
55 | Executing command sample
56 | Option: 4
57 | Argument: test
58 | karaf@root()
59 |
60 | Sample invocation without specifying scope
61 | ------------------------------------------
62 |
63 | karaf@root()> sample -o 4 test
64 | Executing command sample
65 | Option: 4
66 | Argument: test
67 | karaf@root()>
68 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe6/command/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
23 |
24 | 4.0.0
25 |
26 |
27 | com.packt
28 | chapter10-recipe6
29 | 1.0.0-SNAPSHOT
30 |
31 |
32 | odl-be-command
33 | bundle
34 | 1.0.0-SNAPSHOT
35 | Chapter 10 :: Recipe 6 :: Custom Command
36 |
37 | Sample OpenDaylight BE Command
38 |
39 |
40 |
41 | org.apache.karaf.shell
42 | org.apache.karaf.shell.console
43 | 3.0.0
44 |
45 |
46 |
47 | org.osgi
48 | org.osgi.core
49 | 5.0.0
50 | provided
51 |
52 |
53 |
54 | org.osgi
55 | org.osgi.compendium
56 | 5.0.0
57 | provided
58 |
59 |
60 |
61 | org.apache.servicemix.bundles
62 | org.apache.servicemix.bundles.junit
63 | 4.10_1
64 | test
65 |
66 |
67 |
68 |
69 |
70 |
71 | maven-compiler-plugin
72 | true
73 | 2.3.2
74 |
75 | 1.5
76 | 1.5
77 |
78 |
79 |
80 | org.apache.felix
81 | maven-bundle-plugin
82 | 2.4.0
83 | true
84 |
85 |
86 | ${project.artifactId}
87 | com.packt*;version=${project.version}
88 | !com.packt*,
89 | org.apache.aries.blueprint,
90 | org.osgi.service.blueprint.container,
91 | org.osgi.service.blueprint.reflect,
92 | org.apache.felix.service.command,
93 | org.apache.karaf.shell.commands,
94 | org.apache.karaf.shell.console,
95 | *
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe6/command/src/main/java/com/packt/sample.java:
--------------------------------------------------------------------------------
1 |
2 | package com.packt;
3 |
4 | import org.apache.karaf.shell.console.OsgiCommandSupport;
5 | import org.apache.karaf.shell.commands.Command;
6 | import org.apache.karaf.shell.commands.Option;
7 | import org.apache.karaf.shell.commands.Argument;
8 |
9 | @Command(scope = "cookbook", name = "sample", description = "a sample custom command")
10 | public class sample extends OsgiCommandSupport {
11 |
12 | @Option(name = "-o", aliases = { "--option" }, description = "An option to the command", required = false, multiValued = false)
13 | private String option;
14 |
15 | @Argument(name = "argument", description = "Argument to the command", required = false, multiValued = false)
16 | private String argument;
17 |
18 | protected Object doExecute() throws Exception {
19 | System.out.println("Executing command sample");
20 | System.out.println("Option: " + option);
21 | System.out.println("Argument: " + argument);
22 | return null;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe6/command/src/main/resources/OSGI-INF/blueprint/shell-log.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe6/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | 4.0.0
9 |
10 |
11 | com.packt
12 | chapter10
13 | 1.0.0-SNAPSHOT
14 |
15 |
16 | chapter10-recipe6
17 | pom
18 | Chapter 10 :: Recipe 6 :: Custom Command Parent
19 |
20 |
21 | command
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe7/README.txt:
--------------------------------------------------------------------------------
1 |
2 | Feature Descriptor Demo
3 | =======================
4 |
5 | Build code with "mvn install".
6 |
7 | Deployment:
8 |
9 | karaf@root()> feature:repo-add mvn:com.packt/opendaylight-features-file/1.0.0-SNAPSHOT/xml/features
10 |
11 | karaf@root()> feature:install recipe4-all-modules
12 | Apache Karaf starting moduleA bundle
13 | Apache Karaf starting moduleB bundle
14 | karaf@root()> list
15 | START LEVEL 100 , List Threshold: 50
16 | ID | State | Lvl | Version | Name
17 | ---------------------------------------------------------------------
18 | 91 | Active | 80 | 1.0.0.SNAPSHOT | Chapter 10 :: Recipe 7 :: moduleA
19 | 92 | Active | 80 | 1.0.0.SNAPSHOT | Chapter 10 :: Recipe 7 :: moduleB
20 | karaf@root()>
21 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe7/feature/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 |
6 | com.packt
7 | chapter10-recipe7
8 | 1.0.0-SNAPSHOT
9 |
10 |
11 | opendaylight-features-file
12 | pom
13 | Chapter 10 :: Recipe 7 :: Karaf Feature Descriptor
14 | Features POM
15 |
16 |
17 | features.xml
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | src/main/resources
28 | true
29 |
30 |
31 |
32 |
33 | org.apache.maven.plugins
34 | maven-resources-plugin
35 |
36 |
37 | filter
38 | generate-resources
39 |
40 | resources
41 |
42 |
43 |
44 |
45 |
46 | org.codehaus.mojo
47 | build-helper-maven-plugin
48 |
49 |
50 | attach-artifacts
51 | package
52 |
53 | attach-artifact
54 |
55 |
56 |
57 |
58 | ${project.build.directory}/classes/${features.file}
59 | xml
60 | features
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe7/feature/src/main/resources/features.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | mvn:com.packt/opendaylight-moduleA/${project.version}
7 |
8 |
9 |
10 | mvn:com.packt/opendaylight-moduleB/${project.version}
11 |
12 |
13 |
14 | moduleA
15 | moduleB
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe7/moduleA/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter10-recipe7
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | opendaylight-moduleA
16 | bundle
17 |
18 | Chapter 10 :: Recipe 7 :: moduleA
19 | A sample project for learning features files
20 |
21 |
22 |
23 | org.osgi
24 | org.osgi.core
25 | 5.0.0
26 | provided
27 |
28 |
29 |
30 |
31 |
32 |
33 | org.apache.felix
34 | maven-bundle-plugin
35 | 2.4.0
36 | true
37 |
38 |
39 | ${project.artifactId}
40 | ${project.version}
41 | com.packt.chapter10.recipe7.moduleA.Activator
42 |
43 | com.packt.chapter10.recipe7.moduleA*;version=${project.version}
44 |
45 |
46 | *
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe7/moduleA/src/main/java/com/packt/chapter10/recipe7/moduleA/Activator.java:
--------------------------------------------------------------------------------
1 | package com.packt.chapter10.recipe7.moduleA;
2 |
3 | import org.osgi.framework.BundleActivator;
4 | import org.osgi.framework.BundleContext;
5 |
6 | public class Activator implements BundleActivator {
7 |
8 | public void start(BundleContext context) {
9 | System.out.println("OpenDaylight starting moduleA bundle");
10 | }
11 |
12 | public void stop(BundleContext context) {
13 | System.out.println("OpenDaylight stopping moduleA bundle");
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe7/moduleB/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter10-recipe7
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | opendaylight-moduleB
16 | bundle
17 |
18 | Chapter 10 :: Recipe 7 :: moduleB
19 | A sample project for learning features files
20 |
21 |
22 |
23 | org.osgi
24 | org.osgi.core
25 | 5.0.0
26 | provided
27 |
28 |
29 |
30 |
31 |
32 |
33 | org.apache.felix
34 | maven-bundle-plugin
35 | 2.4.0
36 | true
37 |
38 |
39 | ${project.artifactId}
40 | ${project.version}
41 | com.packt.chapter10.recipe7.moduleB.Activator
42 |
43 | com.packt.chapter10.recipe7.moduleB*;version=${project.version}
44 |
45 |
46 | *
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe7/moduleB/src/main/java/com/packt/chapter10/recipe7/moduleB/Activator.java:
--------------------------------------------------------------------------------
1 | package com.packt.chapter10.recipe7.moduleB;
2 |
3 | import org.osgi.framework.BundleActivator;
4 | import org.osgi.framework.BundleContext;
5 |
6 | public class Activator implements BundleActivator {
7 |
8 | public void start(BundleContext context) {
9 | System.out.println("OpenDaylight starting moduleB bundle");
10 | }
11 |
12 | public void stop(BundleContext context) {
13 | System.out.println("OpenDaylight stopping moduleB bundle");
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe7/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | 4.0.0
9 |
10 |
11 | com.packt
12 | chapter10
13 | 1.0.0-SNAPSHOT
14 |
15 |
16 | chapter10-recipe7
17 | pom
18 | Chapter 10 :: Recipe 7 :: Feature Descriptor
19 |
20 |
21 | moduleA
22 | moduleB
23 |
24 | feature
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe8/README.txt:
--------------------------------------------------------------------------------
1 |
2 | JMX Access
3 | ==========
4 |
5 | JConsole Connection URL:
6 | service:jmx:rmi://{hostname}:44445/jndi/rmi://{hostname}:11099/karaf-root
7 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe8/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | 4.0.0
9 |
10 |
11 | com.packt
12 | chapter10
13 | 1.0.0-SNAPSHOT
14 |
15 |
16 | chapter10-recipe8
17 | pom
18 | Chapter 10 :: Recipe 8 :: JMX Management
19 |
20 |
21 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe8/src/main/etc/org.apache.karaf.management.cfg:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | ################################################################################
19 |
20 | #
21 | # The properties in this file define the configuration of Apache Karaf's JMX Management
22 | #
23 |
24 | #
25 | # Port number for RMI registry connection
26 | #
27 | rmiRegistryPort = 11099
28 |
29 | #
30 | # Host for RMI registry
31 | #
32 | rmiRegistryHost = 0.0.0.0
33 |
34 | #
35 | # Port number for RMI server connection
36 | #
37 | rmiServerPort = 44445
38 |
39 | #
40 | # Host for RMI server
41 | #
42 | rmiServerHost = 0.0.0.0
43 |
44 | #
45 | # Name of the JAAS realm used for authentication
46 | #
47 | jmxRealm = karaf
48 |
49 | #
50 | # The service URL for the JMXConnectorServer
51 | #
52 | serviceUrl = service:jmx:rmi://${rmiServerHost}:${rmiServerPort}/jndi/rmi://${rmiRegistryHost}:${rmiRegistryPort}/karaf-${karaf.name}
53 |
54 | #
55 | # Whether any threads started for the JMXConnectorServer should be started as daemon threads
56 | #
57 | daemon = true
58 |
59 | #
60 | # Whether the JMXConnectorServer should be started in a separate thread
61 | #
62 | threaded = true
63 |
64 | #
65 | # The ObjectName used to register the JMXConnectorServer
66 | #
67 | objectName = connector:name=rmi
68 |
69 | #
70 | # Role name used for JMX access authorization
71 | # If not set, this defaults to the ${karaf.admin.role} configured in etc/system.properties
72 | #
73 | jmxRole=admin
74 |
75 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe8/src/main/etc/users.properties:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | #
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | ################################################################################
19 |
20 | #
21 | # This file contains the users, groups, and roles.
22 | # Each line has to be of the format:
23 | #
24 | # USER=PASSWORD,ROLE1,ROLE2,...
25 | # USER=PASSWORD,_g_:GROUP,...
26 | # _g_\:GROUP=ROLE1,ROLE2,...
27 | #
28 | # All users, groups, and roles entered in this file are available after Karaf startup
29 | # and modifiable via the JAAS command group. These users reside in a JAAS domain
30 | # with the name "karaf".
31 | #
32 | karaf = karaf,_g_:admingroup
33 | _g_\:admingroup = group,admin,manager,viewer,webconsole,jmxRole
34 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe9/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | 4.0.0
9 |
10 |
11 | com.packt
12 | chapter10
13 | 1.0.0-SNAPSHOT
14 |
15 |
16 | opendaylight-decanter
17 | pom
18 |
19 | Chapter 10 :: Recipe 9 :: Decanter Monitoring
20 |
21 |
22 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe9/src/main/etc/org.apache.karaf.decanter.appender.elasticsearch.cfg:
--------------------------------------------------------------------------------
1 | ################################################
2 | # Decanter Elasticsearch Appender Configuration
3 | ################################################
4 |
5 | # Hostname of the elasticsearch instance
6 | host=localhost
7 | # Port number of the elasticsearch instance
8 | port=9300
9 | # Name of the elasticsearch cluster
10 | clusterName=elasticsearch
11 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe9/src/main/etc/org.apache.karaf.decanter.collector.jmx-local.cfg:
--------------------------------------------------------------------------------
1 | #
2 | # Decanter Local JMX collector configuration
3 | #
4 |
5 | # Name/type of the JMX collection
6 | type=jmx-local
7 |
8 | # URL of the JMX MBeanServer.
9 | # local keyword means the local platform MBeanServer or you can specify to full JMX URL
10 | # like service:jmx:rmi:///jndi/rmi://hostname:port/karaf-instance
11 | url=local
12 |
13 | # Username to connect to the JMX MBeanServer
14 | username=karaf
15 |
16 | # Password to connect to the JMX MBeanServer
17 | password=karaf
18 |
19 | # Object name filter to use. Instead of harvesting all MBeans, you can select only
20 | # some MBeans matching the object name filter
21 | #object.name=org.apache.camel:context=*,type=routes,name=*
22 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe9/src/main/etc/org.apache.karaf.decanter.collector.system.cfg:
--------------------------------------------------------------------------------
1 | #
2 | # Decanter OperationSystem Collector configuration
3 | #
4 |
5 | # This collector executes system commands, retrieve the exec output/err
6 | # sent to the appenders
7 | #
8 | # The format is key=command
9 | # for instance:
10 | # df=df -h
11 | # free=free
12 | # You can also create a script containing command like:
13 | #
14 | # df -k / | awk -F " |%" '/dev/{print $8}'
15 | #
16 | # This script will get the available space on the / filesystem for instance.
17 | # and call the script:
18 | # df=/bin/script
19 | #
20 | # Another example of script to get the temperature:
21 | #
22 | # sensors|grep temp1|awk '{print $2}'|cut -b2,3,4,5
23 | #
24 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe9/src/main/etc/org.apache.karaf.decanter.scheduler.simple.cfg:
--------------------------------------------------------------------------------
1 | # Define the Decanter simple scheduler period
2 | period=5000
3 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe9/src/main/etc/org.apache.karaf.decanter.sla.checker.cfg:
--------------------------------------------------------------------------------
1 | #
2 | # Decanter SLA Checker
3 | #
4 |
5 | # This cfg file allows you to define the check to perform on the collected data
6 | #
7 | # The format is the following:
8 | #
9 | # eventProperty.level=check:value
10 | #
11 | # eventProperty is the collected event property name.
12 | # level is error or warn, depending if the alert to send is critical or severe
13 | # check is the check type. It could be range, equal, notequal, match, notmatch
14 | # value is the actual check pattern
15 | #
16 | # For instance, if you want to create a critical (error) alert if the loggerLevel is ERROR, you can do:
17 | # loggerLevel.error=match:ERROR
18 | #
19 | # For instance, if you want to create a severe (warn) alert if the message contains foo:
20 | # message.warn=match:.*foobar.*
21 | #
22 | # For instance, if you want to create a critical (error) alert if the HeapMemoryUsage.used is greater than 200M:
23 | # HeapMemoryUsage.used.warn=range:[0,200000)
24 |
25 | ThreadCount.error=range:[0,60]
26 |
--------------------------------------------------------------------------------
/chapter10/chapter10-recipe9/src/main/etc/org.apache.karaf.decanter.sla.email.cfg:
--------------------------------------------------------------------------------
1 | #
2 | # Decanter SLA e-mail alerter configuration
3 | #
4 |
5 | # From e-mail address
6 | from=
7 |
8 | # To e-mail address
9 | to=
10 |
11 | # Hostname of the SMTP server
12 | host=smtp.gmail.com
13 |
14 | # Port of the SMTP server
15 | port=587
16 |
17 | # enable SMTP auth
18 | auth=true
19 |
20 | # enable starttls and ssl
21 | starttls=true
22 | ssl=false
23 |
24 | # Optionally, username for the SMTP server
25 | #username=
26 |
27 | # Optionally, password for the SMTP server
28 | #password=
29 |
--------------------------------------------------------------------------------
/chapter10/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 |
6 | com.packt
7 | opendaylight-cookbook
8 | 1.0.0-SNAPSHOT
9 |
10 |
11 | chapter10
12 | pom
13 | Chapter 10 :: OpenDaylight Container Customizations
14 |
15 |
16 | chapter10-recipe1
17 | chapter10-recipe2
18 | chapter10-recipe3
19 | chapter10-recipe4
20 | chapter10-recipe5
21 | chapter10-recipe6
22 | chapter10-recipe7
23 | chapter10-recipe8
24 | chapter10-recipe9
25 |
26 |
27 |
--------------------------------------------------------------------------------
/chapter3/README.md:
--------------------------------------------------------------------------------
1 | # Chapter 3
2 |
3 | Chapter 3 :: Virtual Customer Edge.
4 |
5 |
6 | Recipe 1:: Leveraging UNI Manager for E2E WAN links.
7 |
8 | Recipe 2:: Linking Customer Sites via VPN.
9 |
10 | Recipe 3:: Linking Multiple Networks across MPLS VPN.
11 |
12 | Recipe 4:: Use USC secure channels to work with devices.
13 |
14 | Recipe 5:: Internet of Things Protocol.
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe1/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter3
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter3-recipe1
16 | pom
17 | Chapter 3 :: Recipe 1 :: Leveraging UNI Manager for E2E WAN links
18 |
19 |
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe2/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter3
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter3-recipe2
16 | pom
17 | Chapter 3 :: Recipe 2 :: Linking Customer Sites via VPN
18 |
19 |
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe3/ shortest_path.py:
--------------------------------------------------------------------------------
1 | # Fast-Failover-Demo Topology
2 | from mininet.topo import Topo
3 | from mininet.cli import CLI
4 | from mininet.net import Mininet
5 | from mininet.link import TCLink
6 | from mininet.util import irange,dumpNodeConnections
7 | from mininet.log import setLogLevel
8 |
9 | class Fast_Failover_Demo_Topo(Topo):
10 |
11 | def __init__(self):
12 | # Initialize topology and default options
13 | Topo.__init__(self)
14 |
15 | s1 = self.addSwitch('s1',dpid='0000000000000001')
16 | s2a = self.addSwitch('s2a',dpid='000000000000002a')
17 | s2b = self.addSwitch('s2b',dpid='000000000000002b')
18 | s2c = self.addSwitch('s2c',dpid='000000000000002c')
19 | s3 = self.addSwitch('s3',dpid='0000000000000003')
20 | self.addLink(s1, s2a)
21 | self.addLink(s1, s2b)
22 | self.addLink(s2b, s2c)
23 | self.addLink(s3, s2a)
24 | self.addLink(s3, s2c)
25 | host_1 = self.addHost('h1',ip='10.0.0.1',mac='10:00:00:00:00:01')
26 | host_2 = self.addHost('h2',ip='10.0.0.2',mac='10:00:00:00:00:02')
27 | self.addLink(host_1, s1)
28 | self.addLink(host_2, s3)
29 |
30 | topos = { 'shortest_path': ( lambda: Fast_Failover_Demo_Topo() ) }
31 |
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe3/README:
--------------------------------------------------------------------------------
1 | Topology to test shortest path & suurballe:
2 |
3 | $ wget -O shortest_path.py https://github.com/jgoodyear/OpenDaylightCookbook/blob/master/chapter3/chapter3-recipe3/%20shortest_path.py
4 | $ sudo mn --controller=remote,ip=192.168.2.11 --custom ~/shortest_path.py --topo shortest_path --switch ovsk,protocols=OpenFlow13
5 |
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe3/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter3
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter3-recipe3
16 | pom
17 | Chapter 3 :: Recipe 3 :: Linking Multiple Networks across MPLS VPN
18 |
19 |
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe4/EchoServer.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoodyear/OpenDaylightCookbook/8500641c37cf6117b7db215a5812e01a9ce7c7da/chapter3/chapter3-recipe4/EchoServer.jar
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe4/README.md:
--------------------------------------------------------------------------------
1 | # usc-tools
2 |
3 | ### Start UscAgent
4 | ####TCP
5 | `java -jar UscAgent.jar -t true`
6 | ####UDP
7 | `java -jar UscAgent.jar -t false`
8 |
9 | ### Start Echo server on port 2007
10 | ####TCP
11 | `java -jar EchoServer.jar -t true -p 2007`
12 | ####UDP
13 | `java -jar EchoServer.jar -t false -p 2007`
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe4/UscAgent.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgoodyear/OpenDaylightCookbook/8500641c37cf6117b7db215a5812e01a9ce7c7da/chapter3/chapter3-recipe4/UscAgent.jar
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe4/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter3
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter3-recipe4
16 | pom
17 | Chapter 3 :: Recipe 4 :: Use USC secure channels to work with devices
18 |
19 |
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe4/resources/etc/usc/akka.conf:
--------------------------------------------------------------------------------
1 | odl-cluster-data {
2 | bounded-mailbox {
3 | mailbox-type = "org.opendaylight.controller.cluster.common.actor.MeteredBoundedMailbox"
4 | mailbox-capacity = 1000
5 | mailbox-push-timeout-time = 100ms
6 | }
7 |
8 | metric-capture-enabled = true
9 |
10 | akka {
11 | loglevel = "INFO"
12 | loggers = ["akka.event.slf4j.Slf4jLogger"]
13 |
14 | actor {
15 | provider = "akka.cluster.ClusterActorRefProvider"
16 | serializers {
17 | java = "akka.serialization.JavaSerializer"
18 | proto = "akka.remote.serialization.ProtobufSerializer"
19 | }
20 |
21 | serialization-bindings {
22 | "com.google.protobuf.Message" = proto
23 | }
24 |
25 | default-dispatcher {
26 | # Setting throughput to 1 makes the dispatcher fair. It processes 1 message from
27 | # the mailbox before moving on to the next mailbox
28 | throughput = 1
29 | }
30 |
31 | default-mailbox {
32 | # When not using a BalancingDispatcher it is recommended that we use the SingleConsumerOnlyUnboundedMailbox
33 | # as it is the most efficient for multiple producer/single consumer use cases
34 | mailbox-type="akka.dispatch.SingleConsumerOnlyUnboundedMailbox"
35 | }
36 | }
37 | remote {
38 | log-remote-lifecycle-events = off
39 | netty.tcp {
40 | hostname = "127.0.0.1"
41 | port = 2550
42 | maximum-frame-size = 419430400
43 | send-buffer-size = 52428800
44 | receive-buffer-size = 52428800
45 | }
46 | }
47 |
48 | cluster {
49 | seed-nodes = ["akka.tcp://opendaylight-cluster-data@127.0.0.1:2550"]
50 |
51 | auto-down-unreachable-after = 300s
52 |
53 | roles = [
54 | "member-1"
55 | ]
56 |
57 | }
58 | }
59 | }
60 |
61 | odl-cluster-rpc {
62 | bounded-mailbox {
63 | mailbox-type = "org.opendaylight.controller.cluster.common.actor.MeteredBoundedMailbox"
64 | mailbox-capacity = 1000
65 | mailbox-push-timeout-time = 100ms
66 | }
67 |
68 | metric-capture-enabled = true
69 |
70 | akka {
71 | loglevel = "INFO"
72 | loggers = ["akka.event.slf4j.Slf4jLogger"]
73 |
74 | actor {
75 | provider = "akka.cluster.ClusterActorRefProvider"
76 |
77 | }
78 | remote {
79 | log-remote-lifecycle-events = off
80 | netty.tcp {
81 | hostname = "127.0.0.1"
82 | port = 2551
83 | maximum-frame-size = 419430400
84 | send-buffer-size = 52428800
85 | receive-buffer-size = 52428800
86 | }
87 | }
88 |
89 | cluster {
90 | seed-nodes = ["akka.tcp://odl-cluster-rpc@127.0.0.1:2551"]
91 |
92 | auto-down-unreachable-after = 300s
93 | }
94 | }
95 | }
96 | odl-cluster-usc {
97 | bounded-mailbox {
98 | mailbox-type = "org.opendaylight.controller.cluster.common.actor.MeteredBoundedMailbox"
99 | mailbox-capacity = 1000
100 | mailbox-push-timeout-time = 100ms
101 | }
102 |
103 | metric-capture-enabled = true
104 |
105 | akka {
106 | loglevel = "INFO"
107 | loggers = ["akka.event.slf4j.Slf4jLogger"]
108 |
109 | actor {
110 | provider = "akka.cluster.ClusterActorRefProvider"
111 |
112 | }
113 | remote {
114 | log-remote-lifecycle-events = off
115 | netty.tcp {
116 | hostname = "127.0.0.1"
117 | port = 2552
118 | maximum-frame-size = 419430400
119 | send-buffer-size = 52428800
120 | receive-buffer-size = 52428800
121 | }
122 | }
123 |
124 | cluster {
125 | seed-nodes = ["akka.tcp://odl-cluster-usc@127.0.0.1:2552"]
126 |
127 | auto-down-unreachable-after = 300s
128 | }
129 | }
130 | }
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe4/resources/etc/usc/certificates/client.key.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN PRIVATE KEY-----
2 | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC5HvOQNkRljjMr
3 | /gE+p1R2U73kuGu2JdefNlGwkj8TEBCfMoK0qd+rGsfREWNp7G9OlAvHLe84r7C8
4 | MQ2qKPQLBDg4UfeQTK6s7hpfQHBe6pbOEatFly/sxgZbRGlVkKsPPcz4gl3WTv++
5 | qjGnUQyRHtHGG1k7eRzgeE9QrZZMp6Xy6qq8V+PUtuCpwcGSzjRd0GSpkzhKS6hd
6 | LAyxWENtXqMwe1ESWdKTzU24qpV7HS2tbjfxr3AAs8sBESC2KKlYEO3BzRqg9zRM
7 | tA1XLIn34vHZ3Q1TeNH31V8tfjmSGS5tZKmnQJiIjaKeg0pbYNJCs/qcBuk+ZW+J
8 | WXaHffltAgMBAAECggEBALIth1ML2INC/h/eqIYMenA1o/WMSCgWflZA6xmfedQ4
9 | RzdjX4jSZHUFHsQtD1m5d1zThA6fOLx/5gUM1dEs/8/GrPIQes7J7+qEdp+tnzrM
10 | YoBPY2Fk5nzoEOAxlY0E5JCT9EBRAk6u1NtIZuhbS1Q2rMQYOKfUp6WqRvUpTxvR
11 | MRpLJ+g6ZvbGGnlJa2Cqz+DpvnRXgNkcOKAu2DsDDU6tjiCCeX+hHoP0MOprpUiA
12 | kkAB0sw3t3q1pA1xlbTc/Hp4ATnTdPw8Xoa5ALotbl/xrTP8MJHtr4mfEB7obSwY
13 | amaaqxffpnC7cy7Cj1WvVlOlLQpM8UOsV/4xHFqm2aUCgYEA6LYtRHlqkd4h9M0G
14 | WCTsH8Dn5mcEVY+dqc38XS59TxQyggz6TwIQaDJiolCXGy3nktZdQCeNH4EX8XOH
15 | uBh67HaGz/NaKI5Cqk7QHdM8Ea4kscQ9CLLqWNRsk/erUUet75NxJeYdGVX3fEPB
16 | SQDqtaqVKAiVyxII81klg3Jud3cCgYEAy6WNFVbhhYhZ5iNn0XZEW0l9Po4Nf7ro
17 | GolLrcRBW98E4aULtDX6jVTJwirq8Ia97XeCyWClXIvP2eGanqbZDDZ75q2DJcMb
18 | OL3+I445Ae1hvx4vzAMQqz8FMYn388Dp7jw0c0mM/V4kSaEaacRXpjb47S1Fil4o
19 | 0q/Z+PfJVzsCgYBDHGapnKpTLtB0HLx7pwpBjgxSsdraIfTCB5mD9ehFafm2768w
20 | IdRBeGZhkQRC3lYuTovN+JoGP+B7zWmSedzZXMU8K14Q3BX1r4ztTQHBx4rliUZg
21 | v9g9jeVSNta9NgK/WLIEz/wMVnJs781KFG2bvnoNdYxdZ/IU29ypr9KTuQKBgHyf
22 | oUkP1A9NtAY8YIo0n/xlarnfYK9sCCJFJwT99ylrv6b+w7zS07Ot0ZJ7hS8QpiYu
23 | XuExvcB25wnlICQ64tSwev5d7MYtMfl1e5LytDxTst+sb3+f2JGTjXAViKGoyv+5
24 | 5DcxKZDcDcTpTCqxtxnGxmsOq2HT4ZOdffz4VkSFAoGAZgOz8b9NTXC9KCf+iAVy
25 | +34j+LkSYNPGfRljIzhVeH05k8oRCkvkjPO2A5nh98gEm2v9iuhgmqoG6lS0AlOK
26 | W3PGk1M/i64ecmzyT8WPdEVg30aTadtKo+ADr1YgVNFwXEYMmb/riAGzjdeys5Xk
27 | nX4CpQtxx+YBgCiABFdAy7I=
28 | -----END PRIVATE KEY-----
29 |
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe4/resources/etc/usc/certificates/client.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDyzCCArMCCQDDTIojEcuIczANBgkqhkiG9w0BAQsFADCBqzELMAkGA1UEBhMC
3 | VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFDASBgNVBAcMC1NhbnRhIENsYXJhMR8w
4 | HQYDVQQKDBZGdXR1cmV3ZWkgVGVjaG5vbG9naWVzMQ8wDQYDVQQLDAZJUCBMYWIx
5 | GzAZBgNVBAMMElVTQyBTYW1wbGUgUm9vdCBDQTEiMCAGCSqGSIb3DQEJARYTZ2Fy
6 | eS53dTFAaHVhd2VpLmNvbTAeFw0xNTAyMjMxODM2MzZaFw0xNjA3MDcxODM2MzZa
7 | MIGiMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEUMBIGA1UEBwwL
8 | U2FudGEgQ2xhcmExHzAdBgNVBAoMFkZ1dHVyZXdlaSBUZWNobm9sb2dpZXMxDzAN
9 | BgNVBAsMBklQIExhYjESMBAGA1UEAwwJbG9jYWxob3N0MSIwIAYJKoZIhvcNAQkB
10 | FhNnYXJ5Lnd1MUBodWF3ZWkuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
11 | CgKCAQEAuR7zkDZEZY4zK/4BPqdUdlO95LhrtiXXnzZRsJI/ExAQnzKCtKnfqxrH
12 | 0RFjaexvTpQLxy3vOK+wvDENqij0CwQ4OFH3kEyurO4aX0BwXuqWzhGrRZcv7MYG
13 | W0RpVZCrDz3M+IJd1k7/vqoxp1EMkR7RxhtZO3kc4HhPUK2WTKel8uqqvFfj1Lbg
14 | qcHBks40XdBkqZM4SkuoXSwMsVhDbV6jMHtRElnSk81NuKqVex0trW438a9wALPL
15 | AREgtiipWBDtwc0aoPc0TLQNVyyJ9+Lx2d0NU3jR99VfLX45khkubWSpp0CYiI2i
16 | noNKW2DSQrP6nAbpPmVviVl2h335bQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAd
17 | FmJCeovcCqBFHJfftKC0S2ZO4kRcRaS96/SHCnhoQYgY9aCVJ57hlvXDustEndPm
18 | 8hMJxAleXyRcymV2vtdH14nwDUhnuzRQc3Ky1WvhJlD8UffQoI0jp4RCSe66rUSE
19 | AqEgnVN8XvFmnsZz576QybvUQhbiP3n+3NIWCTASPbhdZn/MmEBljPCAkrsKwThS
20 | oJnqfBHtG+CPZh3ODov4+lEqwi+prJY4xgd1hdWBm2Mm22khoytkWEnjK0R5W5hy
21 | 9uj3QtHRxW+dSRkw/QC65pFYJP/FJciAikYTaRIQCYhv+mdrJHYZNkYK7+nMmHh0
22 | hqdIGqMuCq8zAyNFix2K
23 | -----END CERTIFICATE-----
24 |
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe4/resources/etc/usc/certificates/rootCA.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIEKzCCAxOgAwIBAgIJAPWsBdH4jD2CMA0GCSqGSIb3DQEBCwUAMIGrMQswCQYD
3 | VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEUMBIGA1UEBwwLU2FudGEgQ2xh
4 | cmExHzAdBgNVBAoMFkZ1dHVyZXdlaSBUZWNobm9sb2dpZXMxDzANBgNVBAsMBklQ
5 | IExhYjEbMBkGA1UEAwwSVVNDIFNhbXBsZSBSb290IENBMSIwIAYJKoZIhvcNAQkB
6 | FhNnYXJ5Lnd1MUBodWF3ZWkuY29tMB4XDTE1MDIyMzE4MzYzNVoXDTE3MTIxMzE4
7 | MzYzNVowgasxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRQwEgYD
8 | VQQHDAtTYW50YSBDbGFyYTEfMB0GA1UECgwWRnV0dXJld2VpIFRlY2hub2xvZ2ll
9 | czEPMA0GA1UECwwGSVAgTGFiMRswGQYDVQQDDBJVU0MgU2FtcGxlIFJvb3QgQ0Ex
10 | IjAgBgkqhkiG9w0BCQEWE2dhcnkud3UxQGh1YXdlaS5jb20wggEiMA0GCSqGSIb3
11 | DQEBAQUAA4IBDwAwggEKAoIBAQDSOzZBtGB9yQqvq1/zZNaQDb93PMACSEGaZooR
12 | lK+Z5QAzGXTJXgqxk/ORuFRo2fpGzXE3nf3VaWddZdmXltpjM37Z1vCy8UWkfWKQ
13 | /MF9MhWR98/21ten/xi123bjLCfKhvJhINXP3VBzlGNj5cDIQOI8Irl1DYbyxokf
14 | NAtL2JG4pzOXMzXCknJNKSf3TiFi6SpqWAUaxfwAFyUuiIvIClHzTpObMRaW2i9f
15 | xwPPUr55fElaQpJ6qSlO0Uhjj75XjfFLSjnXV5ELOK+c8iZtvjlFck4YYcHFG7b6
16 | 3WUU3apSs0W1IFDAA8iHpztntI0UKdg7Il97GQF0Tl5Ol4bnAgMBAAGjUDBOMB0G
17 | A1UdDgQWBBQcekS2YuWUYK7x+91pFRE0ohW7mzAfBgNVHSMEGDAWgBQcekS2YuWU
18 | YK7x+91pFRE0ohW7mzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCD
19 | xrNghCozCnRJcR9sKrBCO/JNKwOXCAfrL11GI9gBflxorc04GLi6KopeszNZEjI5
20 | QWLLW9hsWnmeGofnLmKwDrUv7C+7n4VpxlNiYtruixcjW9AmcaLxIZ0gT1Sh78Yx
21 | kE/liIoUD1OVRnIaVu6K1VpJdVnMdB7FH8Y2BQz7E7eIuUSYvderbz0CMtYt9uxG
22 | 8d3LMiAv/QDuSlrY7DhB53qGYoK3dBsxxuOj4qoGnUWOmTCD7hhQqJiCE2eEKc6d
23 | 995LMiBedZSj4skHWPy+I/yF9Yn1/LSWWvUZkvtsmlIVwArdAGyJtmMAfKCo0Z7l
24 | TIRY47TRqogVD+FnsULb
25 | -----END CERTIFICATE-----
26 |
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe4/resources/etc/usc/usc.properties:
--------------------------------------------------------------------------------
1 | #Copyright (c) 2015 Huawei, Inc and others. All rights reserved.
2 |
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Eclipse Public License v1.0 which accompanies this distribution,
5 | # and is available at http://www.eclipse.org/legal/epl-v10.html
6 |
7 | #the configuration key of the plug-in listen port of USC
8 | org.opendaylight.usc.PluginPort=1069
9 | #the configuration key of the agent listen port of USC
10 | org.opendaylight.usc.AgentPort=1068
11 | # the configuration key of the max number of errors of session or
12 | #USC channel links
13 | org.opendaylight.usc.MaxErrorNumber=100
14 | #the configuration key of the max thread pool size for the thread pool of
15 | #asynchronous event handler
16 | org.opendaylight.usc.MaxThreadNumber=100
17 | #the configuration key of the flag if log the event error
18 | org.opendaylight.usc.LogErrorEvent=true
19 | #the configuration key of the root path of security related files
20 | org.opendaylight.usc.SecurityFilesRoot=resources/etc/usc/certificates
21 | #the configuration key of the trust X.509 certificate chain file for
22 | #authenticating peer side,in PEM format
23 | org.opendaylight.usc.TrustChainFile=rootCA.pem
24 | #the configuration key of the public X.509 certificate chain file of local
25 | #side, in PEM format
26 | org.opendaylight.usc.PubicChainFile=client.pem
27 | #the configuration key of the PKCS#8 private key file of local side, in
28 | #PEM format
29 | org.opendaylight.usc.PrivateKeyFile=client.key.pem
30 | #the configuration key of the configuration file path of akka cluster
31 | org.opendaylight.usc.CusterConfigurationFile=resources/etc/usc/akka.conf
32 |
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe5/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter3
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter3-recipe5
16 | pom
17 | Chapter 3 :: Recipe 5 :: Internet of Things Protocol
18 |
19 |
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe6/PCMM_Sample_Local.postman_environment:
--------------------------------------------------------------------------------
1 | {
2 | "id": "670ca9cc-da01-2124-5172-341a9594cbed",
3 | "name": "PCMM Sample Local",
4 | "values": [
5 | {
6 | "key": "odlHost",
7 | "value": "localhost",
8 | "type": "text",
9 | "name": "odlHost",
10 | "enabled": true
11 | },
12 | {
13 | "key": "odlPort",
14 | "value": "8181",
15 | "type": "text",
16 | "name": "odlPort",
17 | "enabled": true
18 | },
19 | {
20 | "key": "ccapId-1",
21 | "value": "ccap-1",
22 | "type": "text",
23 | "name": "ccapId-1",
24 | "enabled": true
25 | },
26 | {
27 | "key": "ccapIp-1",
28 | "value": "127.0.0.1",
29 | "type": "text",
30 | "name": "ccapIp-1",
31 | "enabled": true
32 | },
33 | {
34 | "key": "ccapPort-1",
35 | "value": "3918",
36 | "type": "text",
37 | "name": "ccapPort-1",
38 | "enabled": true
39 | },
40 | {
41 | "key": "ccapId-2",
42 | "value": "ccap-2",
43 | "type": "text",
44 | "name": "ccapId-2",
45 | "enabled": true
46 | },
47 | {
48 | "key": "ccapIp-2",
49 | "value": "127.0.0.1",
50 | "type": "text",
51 | "name": "ccapIp-2",
52 | "enabled": true
53 | },
54 | {
55 | "key": "ccapPort-2",
56 | "value": "3919",
57 | "type": "text",
58 | "name": "ccapPort-2",
59 | "enabled": true
60 | },
61 | {
62 | "key": "scnUp",
63 | "value": "extrm_up",
64 | "type": "text",
65 | "name": "scnUp",
66 | "enabled": true
67 | },
68 | {
69 | "key": "scnDn",
70 | "value": "extrm_dn",
71 | "type": "text",
72 | "name": "scnDn",
73 | "enabled": true
74 | },
75 | {
76 | "key": "gateId-classifier",
77 | "value": "gateClassifier",
78 | "type": "text",
79 | "name": "gateId-classifier",
80 | "enabled": true
81 | },
82 | {
83 | "key": "appId-classifier",
84 | "value": "appClassifier",
85 | "type": "text",
86 | "name": "appId-classifier",
87 | "enabled": true
88 | },
89 | {
90 | "key": "subId-classifier",
91 | "value": "10.32.110.180",
92 | "type": "text",
93 | "name": "subId-classifier",
94 | "enabled": true
95 | },
96 | {
97 | "key": "gateId-ext",
98 | "value": "gateExtClassifier",
99 | "type": "text",
100 | "name": "gateId-ext",
101 | "enabled": true
102 | },
103 | {
104 | "key": "appId-ext",
105 | "value": "appExt",
106 | "type": "text",
107 | "name": "appId-ext",
108 | "enabled": true
109 | },
110 | {
111 | "key": "subId-ext",
112 | "value": "10.32.110.179",
113 | "type": "text",
114 | "name": "subId-ext",
115 | "enabled": true
116 | },
117 | {
118 | "key": "gateId-ipv6",
119 | "value": "gateIpv6Classifier",
120 | "type": "text",
121 | "name": "gateId-ipv6",
122 | "enabled": true
123 | },
124 | {
125 | "key": "appId-ipv6",
126 | "value": "appIdIPv6",
127 | "type": "text",
128 | "name": "appId-ipv6",
129 | "enabled": true
130 | },
131 | {
132 | "key": "subId-ipv6",
133 | "value": "10.32.110.178",
134 | "type": "text",
135 | "name": "subId-ipv6",
136 | "enabled": true
137 | },
138 | {
139 | "key": "srcIp-1a",
140 | "value": "10.10.10.0",
141 | "type": "text",
142 | "name": "srcIp-1a",
143 | "enabled": true
144 | },
145 | {
146 | "key": "srcPort-1a",
147 | "value": "1234",
148 | "type": "text",
149 | "name": "srcPort-1a",
150 | "enabled": true
151 | },
152 | {
153 | "key": "srcPort-1b",
154 | "value": "1235",
155 | "type": "text",
156 | "name": "srcPort-1b",
157 | "enabled": true
158 | },
159 | {
160 | "key": "dstIp-1a",
161 | "value": "10.32.110.178",
162 | "type": "text",
163 | "name": "dstIp-1a",
164 | "enabled": true
165 | },
166 | {
167 | "key": "dstIp-2a",
168 | "value": "10.32.110.188",
169 | "type": "text",
170 | "name": "dstIp-2a",
171 | "enabled": true
172 | },
173 | {
174 | "key": "dstIp-3a",
175 | "value": "10.4.0.22",
176 | "type": "text",
177 | "name": "dstIp-3a",
178 | "enabled": true
179 | },
180 | {
181 | "key": "dstIp-4a",
182 | "value": "10.32.110.77",
183 | "type": "text",
184 | "name": "dstIp-4a",
185 | "enabled": true
186 | },
187 | {
188 | "key": "dstPort-1a",
189 | "value": "4321",
190 | "type": "text",
191 | "name": "dstPort-1a",
192 | "enabled": true
193 | },
194 | {
195 | "key": "dstPort-1b",
196 | "value": "4322",
197 | "type": "text",
198 | "name": "dstPort-1b",
199 | "enabled": true
200 | },
201 | {
202 | "key": "srcIp-IPv6",
203 | "value": "2001:4978:030d:1000:0:0:0:0/64",
204 | "type": "text",
205 | "name": "srcIp-IPv6",
206 | "enabled": true
207 | },
208 | {
209 | "key": "dstIp-IPv6",
210 | "value": "2001:4978:030d:1100:0:0:0:0/64",
211 | "type": "text",
212 | "name": "dstIp-IPv6",
213 | "enabled": true
214 | },
215 | {
216 | "key": "srcIpMask",
217 | "value": "255.255.255.0",
218 | "type": "text",
219 | "name": "srcIpMask",
220 | "enabled": true
221 | },
222 | {
223 | "key": "dstIpMask",
224 | "value": "255.255.255.255",
225 | "type": "text",
226 | "name": "dstIpMask",
227 | "enabled": true
228 | },
229 | {
230 | "key": "gateid-bad",
231 | "value": "incompleteGate",
232 | "type": "text",
233 | "name": "gateid-bad",
234 | "enabled": true
235 | },
236 | {
237 | "key": "appId-bad",
238 | "value": "badApp",
239 | "type": "text",
240 | "name": "appId-bad",
241 | "enabled": true
242 | },
243 | {
244 | "key": "appId-multi",
245 | "value": "multiApp",
246 | "type": "text",
247 | "name": "appId-multi",
248 | "enabled": true
249 | },
250 | {
251 | "key": "gateId-multi",
252 | "value": "multiGate",
253 | "type": "text",
254 | "name": "gateId-multi",
255 | "enabled": true
256 | }
257 | ],
258 | "timestamp": 1448397810877,
259 | "synced": false,
260 | "syncedFilename": ""
261 | }
--------------------------------------------------------------------------------
/chapter3/chapter3-recipe6/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter3
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapiter3-recipe6
16 | pom
17 | Chapter 3 :: Recipe 6 :: Control cable modem termination system
18 |
19 |
20 |
--------------------------------------------------------------------------------
/chapter3/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 |
6 | com.packt
7 | opendaylight-cookbook
8 | 1.0.0-SNAPSHOT
9 |
10 |
11 | chapter3
12 | pom
13 | Chapter 3 :: Virtual Customer Edge
14 |
15 |
16 | chapter3-recipe1
17 | chapter3-recipe2
18 | chapter3-recipe3
19 | chapter3-recipe4
20 | chapter3-recipe5
21 |
22 |
23 |
--------------------------------------------------------------------------------
/chapter4/.idea/.name:
--------------------------------------------------------------------------------
1 | chapter4
--------------------------------------------------------------------------------
/chapter4/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/chapter4/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/chapter4/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/chapter4/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | 1.7
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/chapter4/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/chapter4/README.md:
--------------------------------------------------------------------------------
1 | Chapter 4
--------------------------------------------------------------------------------
/chapter4/chapter4-recipe1/SNMP-Plugin.postman_collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "c8aabf75-1e79-b9aa-f12d-7a0a5ed23a8e",
3 | "name": "SNMP Plugin",
4 | "description": "",
5 | "order": [
6 | "31310aee-9f6d-2e39-8a21-56676a7a747d",
7 | "3e0be3b1-d972-5586-c0ae-48eee84519ab",
8 | "69630a63-16a5-0fcd-4fbb-6c768c351f48",
9 | "e2c45fce-5392-ccd1-70b7-8d4924f9d6ec"
10 | ],
11 | "folders": [],
12 | "timestamp": 1465956925965,
13 | "owner": 0,
14 | "remoteLink": "",
15 | "public": false,
16 | "requests": [
17 | {
18 | "id": "31310aee-9f6d-2e39-8a21-56676a7a747d",
19 | "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
20 | "url": "http://localhost:8181/restconf/operations/snmp:get-interfaces",
21 | "preRequestScript": null,
22 | "pathVariables": {},
23 | "method": "POST",
24 | "data": [],
25 | "dataMode": "raw",
26 | "version": 2,
27 | "tests": null,
28 | "currentHelper": "normal",
29 | "helperAttributes": {},
30 | "time": 1465959088686,
31 | "name": "get interfaces",
32 | "description": "",
33 | "collectionId": "c8aabf75-1e79-b9aa-f12d-7a0a5ed23a8e",
34 | "responses": [],
35 | "rawModeData": "{\n \"input\": {\n \"ip-address\": \"195.218.195.228\"\n }\n}"
36 | },
37 | {
38 | "id": "3e0be3b1-d972-5586-c0ae-48eee84519ab",
39 | "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
40 | "url": "http://localhost:8181/restconf/operations/snmp:get-node-properties",
41 | "preRequestScript": null,
42 | "pathVariables": {},
43 | "method": "POST",
44 | "data": [],
45 | "dataMode": "raw",
46 | "version": 2,
47 | "tests": null,
48 | "currentHelper": "normal",
49 | "helperAttributes": {},
50 | "time": 1465958866324,
51 | "name": "get node properties",
52 | "description": "",
53 | "collectionId": "c8aabf75-1e79-b9aa-f12d-7a0a5ed23a8e",
54 | "responses": [],
55 | "rawModeData": "{\n \"input\": {\n \"ip-address\": \"195.218.195.228\"\n }\n}"
56 | },
57 | {
58 | "id": "69630a63-16a5-0fcd-4fbb-6c768c351f48",
59 | "headers": "Content-Type: application/json\n",
60 | "url": "http://localhost:8181/restconf/operational/snmp:snmp-get",
61 | "preRequestScript": null,
62 | "pathVariables": {},
63 | "method": "POST",
64 | "data": [],
65 | "dataMode": "raw",
66 | "version": 2,
67 | "tests": null,
68 | "currentHelper": "normal",
69 | "helperAttributes": {},
70 | "time": 1465959266572,
71 | "name": "get snmp",
72 | "description": "",
73 | "collectionId": "c8aabf75-1e79-b9aa-f12d-7a0a5ed23a8e",
74 | "responses": [],
75 | "rawModeData": "{\n \"input\": {\n \"ip-address\": \"195.218.195.228\",\n \"oid\": \"1.3.6.1.2.1.2.2.1.2.1\",\n \"get-type\": \"GET\",\n \"community\": \"public\"\n }\n}"
76 | },
77 | {
78 | "id": "e2c45fce-5392-ccd1-70b7-8d4924f9d6ec",
79 | "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
80 | "url": "http://localhost:8181/restconf/operations/snmp:snmp-set",
81 | "preRequestScript": null,
82 | "pathVariables": {},
83 | "method": "POST",
84 | "data": [],
85 | "dataMode": "raw",
86 | "tests": null,
87 | "currentHelper": "normal",
88 | "helperAttributes": {},
89 | "time": 1465858772072,
90 | "name": "set snmp",
91 | "description": "",
92 | "collectionId": "c8aabf75-1e79-b9aa-f12d-7a0a5ed23a8e",
93 | "responses": [],
94 | "rawModeData": "{\n \"input\": {\n \"ip-address\": \"195.218.195.228\",\n \t\"oid\" : \"1.3.6.1.2.1.1.8.0\",\n \"community\" : \"public\",\n \"value\" : \"GET\"\n }\n}"
95 | }
96 | ]
97 | }
--------------------------------------------------------------------------------
/chapter4/chapter4-recipe1/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter4
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapter-recipe1
16 | pom
17 | Chapter 4 :: Recipe 1 :: SNMP plugin for Opendaylight
18 |
19 |
--------------------------------------------------------------------------------
/chapter4/chapter4-recipe2/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 |
10 | com.packt
11 | chapter4
12 | 1.0.0-SNAPSHOT
13 |
14 |
15 | chapter-recipe2
16 | pom
17 | Chapter 4 :: Recipe 2 :: Managing Ethernet switch in SDN environment
18 |
19 |
--------------------------------------------------------------------------------
/chapter4/chapter4-recipe2/snmp4sdn_swdb.csv:
--------------------------------------------------------------------------------
1 | MAC,IP,SNMP_Community,CLI_Username,CLI_Password,Model
2 | 90:94:e4:23:13:e0,192.168.0.32,private,admin,password,D-Link_DGS3650
3 | 90:94:e4:23:0b:00,192.168.0.33,private,admin,password,D-Link_DGS3650
4 | 90:94:e4:23:0b:20,192.168.0.34,private,admin,password,D-Link_DGS3650
--------------------------------------------------------------------------------
/chapter4/chapter4-recipe3/DIDM-VM/README.md:
--------------------------------------------------------------------------------
1 | # vagrant-mininet
2 |
3 | This Vagrantfile tries to be an all-inclusive script to provide an
4 | OpenFlow 1.3 playground in a VM.
5 |
6 | Tools included:
7 |
8 | - Mininet 2.1.0
9 | - OpenVSwitch 2.3.0
10 | - Ryu
11 |
12 | ## Usage
13 |
14 | Start with installation of VirtualBox and Vagrant. Next, download the
15 | Vagrantfile and run `vagrant up` from the folder it is stored in.
16 |
17 | After the script finishes its job, `vagrant ssh` from the corresponding folder
18 | should let you in the VM.
19 |
20 | Windows users may want to install `msysgit` distribution for a
21 | seamless ssh experience.
--------------------------------------------------------------------------------
/chapter4/chapter4-recipe3/DIDM-VM/Vagrantfile:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | $init = <