<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.telcobridges.com/w/index.php?action=history&amp;feed=atom&amp;title=Restful_api_ruby_implementation</id>
	<title>Restful api ruby implementation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://docs.telcobridges.com/w/index.php?action=history&amp;feed=atom&amp;title=Restful_api_ruby_implementation"/>
	<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/w/index.php?title=Restful_api_ruby_implementation&amp;action=history"/>
	<updated>2026-07-28T01:46:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://docs.telcobridges.com/w/index.php?title=Restful_api_ruby_implementation&amp;diff=32653&amp;oldid=prev</id>
		<title>Luc Morissette: Updated link to httprestapi, since it was not working with .gz</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/w/index.php?title=Restful_api_ruby_implementation&amp;diff=32653&amp;oldid=prev"/>
		<updated>2023-08-11T13:36:50Z</updated>

		<summary type="html">&lt;p&gt;Updated link to httprestapi, since it was not working with .gz&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:36, 11 August 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DISPLAYTITLE:Northbound interface: Ruby Implementation}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DISPLAYTITLE:Northbound interface: Ruby Implementation}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This ruby script ([[Media:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Httprestapi&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rb.gz‎&lt;/del&gt;|httprestapi]]) is an example of how to use TelcoBridges RESTful Northbound Interface.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This ruby script ([[Media:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;httprestapi&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zip‎&lt;/ins&gt;|httprestapi]]) is an example of how to use TelcoBridges RESTful Northbound Interface.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The script can be executed from any computer having access to the management web interface.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The script can be executed from any computer having access to the management web interface.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The script can also be copied on the internal host of a &amp;#039;&amp;#039;T&amp;#039;&amp;#039;media and executed from a SSH client (as shown in the examples below using &amp;lt;nowiki&amp;gt;127.0.0.1:12358&amp;lt;/nowiki&amp;gt;).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The script can also be copied on the internal host of a &amp;#039;&amp;#039;T&amp;#039;&amp;#039;media and executed from a SSH client (as shown in the examples below using &amp;lt;nowiki&amp;gt;127.0.0.1:12358&amp;lt;/nowiki&amp;gt;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Download script ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Download script ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Media:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Httprestapi&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rb.gz‎&lt;/del&gt;|httprestapi.rb [click to download]]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Media:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;httprestapi&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zip‎&lt;/ins&gt;|httprestapi.rb [click to download]]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Usage ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Usage ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Luc Morissette</name></author>
	</entry>
	<entry>
		<id>https://docs.telcobridges.com/w/index.php?title=Restful_api_ruby_implementation&amp;diff=32615&amp;oldid=prev</id>
		<title>Luc Morissette: New page for restful API ruby implementation</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/w/index.php?title=Restful_api_ruby_implementation&amp;diff=32615&amp;oldid=prev"/>
		<updated>2023-08-07T18:56:12Z</updated>

		<summary type="html">&lt;p&gt;New page for restful API ruby implementation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:Northbound interface: Ruby Implementation}}&lt;br /&gt;
This ruby script ([[Media:Httprestapi.rb.gz‎|httprestapi]]) is an example of how to use TelcoBridges RESTful Northbound Interface. &lt;br /&gt;
* The script can be executed from any computer having access to the management web interface.&lt;br /&gt;
* The script can also be copied on the internal host of a &amp;#039;&amp;#039;T&amp;#039;&amp;#039;media and executed from a SSH client (as shown in the examples below using &amp;lt;nowiki&amp;gt;127.0.0.1:12358&amp;lt;/nowiki&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Download script ==&lt;br /&gt;
* [[Media:Httprestapi.rb.gz‎|httprestapi.rb [click to download]]]&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
 ./httprestapi.rb &amp;lt;URI&amp;gt; &amp;lt;user&amp;gt; &amp;lt;password&amp;gt; &amp;lt;http request&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   With &amp;lt;URI&amp;gt; = &amp;lt;nowiki&amp;gt;http://ip:port&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     Example: &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; &amp;#039;root&amp;#039; &amp;#039;password&amp;#039; &amp;lt;http request&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   With &amp;lt;http request&amp;gt; = &amp;lt;GET|PUT|POST|DELETE&amp;gt; &amp;lt;element path&amp;gt; [json | -i jsonfile | -o jsonfile]&lt;br /&gt;
     -i jsonfile = input json file used for PUT or POST http request&lt;br /&gt;
     -o jsonfile = output json file used for GET http request&lt;br /&gt;
&lt;br /&gt;
== GET ==&lt;br /&gt;
Get the configuration collection list and display the JSON returned in the body of the HTTP response.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; GET &amp;#039;/configurations&amp;#039;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Show the use of &amp;quot;recursive=yes&amp;quot; to get all sub-element of configuration. Put the returned JSON in &amp;quot;test_configuration.json&amp;quot; file.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; GET &amp;#039;/configurations/test?recursive=yes&amp;#039; &amp;#039;-o test_configuration.json&amp;#039;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;documentation=yes&amp;quot; to return documentation of all attributes of an element. Below example returns documentation for a new route element.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; GET &amp;#039;/configurations/test/routes/new?documentation=yes&amp;#039;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get request can also be used to retrieve the status of some elements of the &amp;#039;&amp;#039;&amp;#039;active&amp;#039;&amp;#039;&amp;#039; configuration.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; GET &amp;#039;/configurations/test/naps/xtel/status&amp;#039;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PUT ==&lt;br /&gt;
Modify attributes of an element. Below example renames the route element named &amp;quot;Test&amp;quot; to &amp;quot;NewName&amp;quot;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; PUT &amp;#039;/configurations/test/routes/test_route&amp;#039; &amp;#039;{&amp;quot;name&amp;quot;:&amp;quot;new_route_name&amp;quot;}&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modify attributes of an element using a JSON file for the HTTP request.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; PUT &amp;#039;/configurations/test/routes/test_route&amp;#039; &amp;#039;-i modified_route.json&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Activate &amp;quot;demo&amp;quot; configuration&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; PUT &amp;#039;/systems/system_1&amp;#039; &amp;#039;{&amp;quot;target_configuration&amp;quot;:&amp;quot;demo&amp;quot;}&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== POST ==&lt;br /&gt;
Create a new element. Below example add a new route named &amp;quot;xtel_to_SBC_1&amp;quot;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; POST &amp;#039;/configurations/test/routes&amp;#039; &amp;#039;{&amp;quot;name&amp;quot;:&amp;quot;xtel_to_SBC_1&amp;quot;,&amp;quot;nap&amp;quot;:&amp;quot;xtel&amp;quot;,&amp;quot;remapped_nap&amp;quot;:&amp;quot;SBC_1&amp;quot;}&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a new element using a JSON file for the HTTP request.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; POST &amp;#039;/configurations/test/routes&amp;#039; &amp;#039;-i new_route.json&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a new configuration using a JSON file for the HTTP request.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; POST &amp;#039;/configurations&amp;#039; &amp;#039;-i test_configuration.json&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== DELETE ==&lt;br /&gt;
Delete an element. Below example delete the route named &amp;quot;xtel_to_SBC_1&amp;quot;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; DELETE &amp;#039;/configurations/test/routes/xtel_to_SBC_1&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using JSON files ==&lt;br /&gt;
=== Modify an element ===&lt;br /&gt;
1. Get route configuration in JSON file&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; GET &amp;#039;/configurations/test/routes/test_route&amp;#039; &amp;#039;-o routes.json&amp;#039;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
2. Edit JSON file attributes&lt;br /&gt;
 vi route.json&lt;br /&gt;
3. Modify element from JSON file&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; PUT &amp;#039;/configurations/test/routes/test_route&amp;#039; &amp;#039;-i routes.json&amp;#039;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create a new element ===&lt;br /&gt;
1. Get an element default attributes value in a JSON file&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; GET &amp;#039;/configurations/test/routes/new&amp;#039; &amp;#039;-o routes.json&amp;#039;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
2. Edit JSON file attributes&lt;br /&gt;
 vi route.json&lt;br /&gt;
3. Create new element from JSON file&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;./httprestapi.rb &amp;#039;http://127.0.0.1:12358&amp;#039; POST &amp;#039;/configurations/test/routes/new_route&amp;#039; &amp;#039;-i routes.json&amp;#039;&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Luc Morissette</name></author>
	</entry>
</feed>