{"id":39567,"date":"2016-08-28T13:48:02","date_gmt":"2016-08-28T08:18:02","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=39567"},"modified":"2016-08-29T09:29:58","modified_gmt":"2016-08-29T03:59:58","slug":"wowza-servers-application-management-using-rest-api","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/wowza-servers-application-management-using-rest-api\/","title":{"rendered":"Wowza Servers Application Management using REST-API"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-39568\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/08\/wowza-streaming-engine-horizontal-1024-1920x600-300x93.png\" alt=\"wowza-streaming-engine-horizontal-1024-1920x600\" width=\"610\" height=\"189\" \/><\/p>\n<p><b>Wowza Streaming Engine<\/b><span style=\"font-weight: 400;\"> is a streaming software utility which is developed by Wowza Media Systems. The utility is capable of streaming various types of videos and audio files on mobile, tablet and personal computer etc. The types of streaming videos include live video and on-demand streaming. It is basically a <a title=\"java consulting services\" href=\"http:\/\/www.tothenew.com\/java-development-services-development-services\">Java application<\/a> which is supported on almost all types of operating systems.<\/span><\/p>\n<p><b>Use Case<br \/>\n<\/b>In this blog, I\u2019ll be demonstrating the use of Wowza REST-API which can be used to <a title=\"DevOps Automation Services\" href=\"http:\/\/www.tothenew.com\/devops-automation-consulting\">automate the tasks<\/a> on Wowza servers running in your application stack. The tasks include creating new application channels, copying existing channels to create new ones and deleting the non-required applications using command\u00a0line as it is a bit tedious and repetitive task when performed from Wowza\u2019s GUI. The tasks can be automated using shell scripts in any language.<\/p>\n<p><b>Enabling Wowza REST-API<br \/>\n<\/b>To enable Wowza REST-API in an existing Wowza server, go to the installation directory of Wowza [install_dir]\/conf\/Server.xml and add the following code snippet:<\/p>\n<p>[js]<br \/>\n &lt;RESTInterface&gt;<br \/>\n                        &lt;Enable&gt;true&lt;\/Enable&gt;<br \/>\n                        &lt;IPAddress&gt;*&lt;\/IPAddress&gt;<br \/>\n                        &lt;Port&gt;8087&lt;\/Port&gt;<br \/>\n                        &lt;!&#8211; none, basic, digest&#8211;&gt;<br \/>\n                        &lt;AuthenticationMethod&gt;none&lt;\/AuthenticationMethod&gt;<br \/>\n                        &lt;DiagnosticURLEnable&gt;true&lt;\/DiagnosticURLEnable&gt;<br \/>\n                        &lt;SSLConfig&gt;<br \/>\n                                &lt;Enable&gt;false&lt;\/Enable&gt;<br \/>\n                                &lt;KeyStorePath&gt;&lt;\/KeyStorePath&gt;<br \/>\n                                &lt;KeyStorePassword&gt;&lt;\/KeyStorePassword&gt;<br \/>\n                                &lt;KeyStoreType&gt;JKS&lt;\/KeyStoreType&gt;<br \/>\n                                &lt;SSLProtocol&gt;TLS&lt;\/SSLProtocol&gt;<br \/>\n                                &lt;Algorithm&gt;SunX509&lt;\/Algorithm&gt;<br \/>\n                                &lt;CipherSuites&gt;&lt;\/CipherSuites&gt;<br \/>\n                                &lt;Protocols&gt;&lt;\/Protocols&gt;<br \/>\n                        &lt;\/SSLConfig&gt;<br \/>\n                        &lt;IPWhiteList&gt;*&lt;\/IPWhiteList&gt;<br \/>\n                        &lt;IPBlackList&gt;&lt;\/IPBlackList&gt;<br \/>\n                        &lt;EnableXMLFile&gt;false&lt;\/EnableXMLFile&gt;<br \/>\n                        &lt;DocumentationServerEnable&gt;true&lt;\/DocumentationServerEnable&gt;<br \/>\n                        &lt;DocumentationServerPort&gt;8089&lt;\/DocumentationServerPort&gt;<br \/>\n                        &lt;!&#8211; none, basic, digest&#8211;&gt;<br \/>\n                        &lt;DocumentationServerAuthenticationMethod&gt;none&lt;\/DocumentationServerAuthenticationMethod&gt;<br \/>\n                        &lt;Properties&gt;<br \/>\n                                &lt;Property&gt;<br \/>\n                                        &lt;Name&gt;restUserHTTPHeaders&lt;\/Name&gt;<br \/>\n                                        &lt;Value&gt;Access-Control-Allow-Origin:*|Access-Control-Allow-Methods:OPTIONS,GET,PUT,DELETE,POST|Access-Control-Allow-Headers:Content-Type&lt;\/Value&gt;<br \/>\n                                &lt;\/Property&gt;<br \/>\n                        &lt;\/Properties&gt;<br \/>\n                &lt;\/RESTInterface&gt;[\/js]<\/p>\n<p><b>Options which can be set from the above configuration:<br \/>\n<\/b><b>1) Port: <\/b><span style=\"font-weight: 400;\">Port on which you want the REST-API to respond to the queries<br \/>\n<\/span><b>2) Authentication Method: <\/b><span style=\"font-weight: 400;\">The authentication method to be used while accessing the REST-API interface<br \/>\n<\/span><b>3) SSL Certificate: <\/b><span style=\"font-weight: 400;\">SSL setup for the REST-API (if required)<br \/>\n<\/span><b>4) IP (Whitelist and Blacklist): <\/b><span style=\"font-weight: 400;\">To specifie the IP addresses from where<\/span> <span style=\"font-weight: 400;\">we want to access\/deny \u00a0the REST-API interface<br \/>\n<\/span><b>5) Custom Headers: <\/b><span style=\"font-weight: 400;\">Custom headers to be used with REST-API<\/span><\/p>\n<p><b>Note:<\/b><span style=\"font-weight: 400;\"> After modifying the Server.xml configuration file in Wowza, there is a need to restart the Wowza Streaming Engine.<\/span><\/p>\n<p><b>Important Commands For REST-API:<\/b><\/p>\n<p><b><b>1) To get list of Wowza channels:<br \/>\n<\/b><\/b><\/p>\n<p>[js]<br \/>\ncurl -X GET &#8211;header &#8216;Accept:application\/json; charset=utf-8&#8217; http:\/\/localhost:8087\/v2\/servers\/_defaultServer_\/vhosts\/_defaultVHost_\/applications<br \/>\n[\/js]<\/p>\n<p><b>2) To get the information of a single Wowza Application (Channel: live1)<br \/>\n<\/b><\/p>\n<p>[js]curl -X GET &#8211;header &#8216;Accept:application\/json; charset=utf-8&#8217; http:\/\/localhost:8087\/v2\/servers\/_defaultServer_\/vhosts\/_defaultVHost_\/applications\/live1[\/js]<\/p>\n<p><b style=\"line-height: 1.71429; font-size: 1rem;\">\u00a03) To create a single Wowza Application (Channel: live2)<br \/>\n<\/b><\/p>\n<p>[js]curl -X POST &#8211;header &#8216;Accept:application\/json; charset=utf-8&#8217; &#8211;header &#8216;Content-type:application\/json; charset=utf-8&#8217; http:\/\/localhost:8087\/v2\/servers\/_defaultServer_\/vhosts\/_defaultVHost_\/applications\/live2 &#8211;data @body.json [\/js]<\/p>\n<p><b>Note: <\/b>In body.json, we can pass the JSON body of the application\u2019s information. We can edit the output of the step 2 accordingly and use it to create a new channel.<\/p>\n<p><b>4) \u00a0\u00a0To delete a single Wowza Application (Channel: live2)<br \/>\n<\/b><\/p>\n<p>[js]curl -X DELETE &#8211;header &#8216;Accept:application\/json; charset=utf-8&#8217; http:\/\/localhost:8087\/v2\/servers\/_defaultServer_\/vhosts\/_defaultVHost_\/applications\/live1 [\/js]<\/p>\n<p><strong><span style=\"font-weight: 400;\">By using the above documentation, you can automate the process of managing Wowza applications using customized scripts on multiple Wowza servers.<\/span><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wowza Streaming Engine is a streaming software utility which is developed by Wowza Media Systems. The utility is capable of streaming various types of videos and audio files on mobile, tablet and personal computer etc. The types of streaming videos include live video and on-demand streaming. It is basically a Java application which is supported [&hellip;]<\/p>\n","protected":false},"author":170,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":15},"categories":[1174,2348,1],"tags":[3938,3931,3932,3939,3934,3936,3935,3933,3937],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/39567"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/170"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=39567"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/39567\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=39567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=39567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=39567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}