How to access Wowza Streaming Engine Swagger Documentation with Swagger CodeGen

This article describes how to configure Swagger CodeGen to work with the Wowza Streaming Engine Swagger documentation server.

Note: Wowza Streaming Engine™ 4.5.0 or later is required.

Installation

  1. Install the Swagger Codegen generator by using the Swagger codegen GitHub project instructions on GitHub. Confirm that the installed Swagger Codegen generator is working before proceeding to the next step.
     
  2. On your Wowza Streaming Engine server, open the [install-dir]/conf/Server.xml configuration file in a text editor, and then add the DocumentationServerBasePath and DocumentationServerRemoveRequestPath settings to the Wowza Streaming Engine REST API configuration section (<Server>/<RESTInterface>). Insert these settings immediately after the DocumentationServerAuthenticationMethod setting, as shown in the following example:
    <RESTInterface>
    	<Enable>true</Enable>
    	<IPAddress>*</IPAddress>
    	<Port>8087</Port>
    	<!-- none, basic, digest-->
    	<AuthenticationMethod>digest</AuthenticationMethod>
    	<DiagnosticURLEnable>true</DiagnosticURLEnable>
    	<SSLConfig>
    		<Enable>false</Enable>
    		<KeyStorePath></KeyStorePath>
    		<KeyStorePassword></KeyStorePassword>
    		<KeyStoreType>JKS</KeyStoreType>
    		<SSLProtocol>TLS</SSLProtocol>
    		<Algorithm>SunX509</Algorithm>
    		<CipherSuites></CipherSuites>
    		<Protocols></Protocols>
    	</SSLConfig>
    	<IPWhiteList>127.0.0.1</IPWhiteList>
    	<IPBlackList></IPBlackList>
    	<EnableXMLFile>false</EnableXMLFile>
    	<DocumentationServerEnable>false</DocumentationServerEnable>
    	<DocumentationServerPort>8089</DocumentationServerPort>
    	<!-- none, basic, digest-->
    	<DocumentationServerAuthenticationMethod>digest</DocumentationServerAuthenticationMethod>
    	<DocumentationServerBasePath>/</DocumentationServerBasePath>
    	<DocumentationServerRemoveRequestPath>swagger.json/</DocumentationServerRemoveRequestPath>
    	<Properties>
    	</Properties>
    </RESTInterface>
  3. Restart Wowza Streaming Engine to apply the changes.

Usage

Run the following command to generate the required code:

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i http://[wowza-ip-address]:8089/swagger.json -l php -o phpCodeOutputFolder/

This generates the PHP code to access the Wowza Streaming Engine REST API and places the results in the phpCodeOutputFolder.

For details, see Getting Started in the Swagger codegen GitHub project.


Originally Published: For Wowza Streaming Engine 4.5.0 on 06-23-2016.

If you're having problems or want to discuss this article, post in our forum.