Wowza Community

Create user for REST API & enable Stream Targets for the Application

Hi guys,

I have two problems to solve on my project. We built a system around Wowza Streaming Engine with a setup script. But I didn’t find:

1 - How to create an user for REST API without the UI (using the command line or the API itself).

2 - How to enable the Stream Targets through REST API. I know how to add new Stream Targets, but I don’t know how to enable the Stream Targets option for the Application.

Someone know something about?

Thank you

Hi,

For the first one, see https://www.wowza.com/docs/user-management-query-examples

For the second one, you need to update the modules to add the Push Publish module. You need to include all of the existing modules in the application when you do the update so get the existing list of modules using the following request:

curl -X GET --header 'Accept:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/modules

That will return something like the following:

{
  "version":"1448571999000",
  "serverName":"_defaultServer_",
  "moduleList": [
    {
      "order": 0,
      "name": "base",
      "description": "Base",
      "class": "com.wowza.wms.module.ModuleCore"
    },
    {
      "order": 1,
      "name": "logging",
      "description": "Client Logging",
      "class": "com.wowza.wms.module.ModuleClientLogging"
    },
    {
      "order": 2,
      "name": "flvplayback",
      "description": "FLVPlayback",
      "class": "com.wowza.wms.module.ModuleFLVPlayback"
    },
    {
      "order": 3,
      "name": "ModuleCoreSecurity",
      "description": "Core Security Module for Applications",
      "class": "com.wowza.wms.security.ModuleCoreSecurity"
    }
  ]
}

Add the Push Publish module to the list and submit it as a PUT request:

curl -X PUT --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/modules -d'
{
  "version":"1448571999000",
  "serverName":"_defaultServer_",
  "moduleList": [
    {
      "order": 0,
      "name": "base",
      "description": "Base",
      "class": "com.wowza.wms.module.ModuleCore"
    },
    {
      "order": 1,
      "name": "logging",
      "description": "Client Logging",
      "class": "com.wowza.wms.module.ModuleClientLogging"
    },
    {
      "order": 2,
      "name": "flvplayback",
      "description": "FLVPlayback",
      "class": "com.wowza.wms.module.ModuleFLVPlayback"
    },
    [i]{
      "order": 3,
      "name": "ModulePushPublish",
      "description": "ModulePushPublish",
      "class": "com.wowza.wms.pushpublish.module.ModulePushPublish"
    },[/i]
    {
      "order": 4,
      "name": "ModuleCoreSecurity",
      "description": "Core Security Module for Applications",
      "class": "com.wowza.wms.security.ModuleCoreSecurity"
    }
  ]
}'

If the application is currently running, you will need to restart the it after the update:

curl -X PUT --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/actions/restart

Hello

Please try the following example:

curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/publishers -d'
{
"description": "This is my live source encoder.",
"name": "source1",
"password": "myPassword"
}'

If it does not work for you, please reply with the exact cURL command you used and the response.

Thanks,

Matt

Thank you Roger!

Worked perfectly.

Hi,

I am facing a problem in creating a user. The rest API does create a publisher, but with null name. Neither can I edit it on my web version.

Any Idea? Why is this happening?