Wowza Community

Swagger json and 2.0?

Two questions about the REST API documentation through Swagger:

  • Is there any source available for the “swagger.json” that can be used in tooling to exposed the models and apis for orchestration and development?
  • Is there any plan to update this to Swagger 2.0, since it seems like most tooling and integration stuff has moved pretty aggressively in that direction?

Hello Matt-Presto,

To answer your questions:

  1. You can obtain endpoint information to build your own tool by querying against the
http://localhost:8089/api-docs

url.

  1. It is in our sights but no timeframe specified.

Thanks,

Matt

Hello Matt-Presto

I downloaded the 3rd party app to give it a test and did come up with the same result that you did. Even when I tried to add the json via “Paste Raw Text” and included a basepath (and other variations as found within their support boards) and was also unsuccessful. Are you just looking to have a tool to test the API? Are you looking to embed the data into an application?

Thanks,

Matt

Great! Thanks for sharing your findings!

I can see a raw json file by going to that url, but it’s not a valid swagger definition file, so you can’t import it to anything, and it doesn’t give the needed information to get any of the details. The results on a 4.4.1 server are:

[COLOR=#000000]{"info":null,"swaggerVersion":"1.2","apis":[{"b":"Application Operations","path":"/v2/servers/{serverName}/vhosts/{vhostName}/applications","description":"Application Operations"},{"b":"Machine Level Current Statistics","path":"/v2/machine/monitoring/current","description":"Machine Level Current Statistics"},{"b":"Machine Level Historic Statistics","path":"/v2/machine/monitoring/historic","description":"Machine Level Historic Statistics"},{"b":"Server Licenses","path":"/v2/servers/{serverName}/licenses","description":"Server Licenses"},{"b":"Server Listeners","path":"/v2/servers/{serverName}/listeners","description":"Server Listeners"},{"b":"Server log4j system","path":"/v2/servers/{serverName}/log4j","description":"Server log4j system"},{"b":"Server MediaCache","path":"/v2/servers/{serverName}/mediacache","description":"Server MediaCache"},{"b":"Server MediaCasters","path":"/v2/servers/{serverName}/mediacasters","description":"Server MediaCasters"},{"b":"Server Monitoring","path":"/v2/servers/{serverName}/monitoring","description":"Server Monitoring"},{"b":"Server Publishers","path":"/v2/servers/{serverName}/publishers","description":"Server Publishers"},{"b":"REST information","path":"/restinfo","description":"REST information"},{"b":"Servers Configuration","path":"/v2/servers","description":"Servers Configuration"},{"b":"Server Status","path":"/v2/servers/{serverName}/status","description":"Server Status"},{"b":"Server Transcoder","path":"/v2/servers/{serverName}/transcoder","description":"Server Transcoder"},{"b":"Server Tuning","path":"/v2/servers/{serverName}/tune","description":"Server Tuning"},{"b":"Server Users","path":"/v2/servers/{serverName}/users","description":"Server Users"},{"b":"VHost Operations","path":"/v2/servers/{serverName}/vhosts","description":"VHost Operations"}],"authorizations":null,"apiVersion":"1.0.0"}
[/COLOR]

it gives the meta-endpoints for all of the top-level service groups, but it doesn’t supply a base url, or how to get to the individual services. The number of tools that can handle the v1.2 swagger is a lot smaller than 2.0, so mostly I’ve tried the importer for Postman, and it won’t accept it. It always gives: “Error while importing Swagger: ReferenceError: dir is not defined”.

Thanks Matt,

Yeah, I tried the same things. I use a couple of standalone tools for testing the API calls and working out the calls I want to build into my app. Eventually I’ll be building all of it into our app for integration, but being able to pull all the models and APIs into the tool would make things a lot cleaner/faster.

Yahtzee! Ok, so if you look in the swagger interface, next to each grouping, there’s a “Raw” link which ends up with you getting something like:

http://server:8089/api-docs/v2/servers/%7BserverName%7D/vhosts/%7BvhostName%7D/applications. I was able to import that in Postman.