Wowza Community

update a stream target using REST API in WOWZA Streaming Engine

Hi ,

I am trying to update some of the fields in Stream target using PUT rest API.

I am getting the response as { “success”: true, “message”: “Saved”, “data”: null }

But when i browse through EngineManger , the change is not getting reflected.

Is PUT supported for Streamtargets RESTapi?

The PUT method for the /pushpublish/ endpoint is supported in order to update an existing stream target. Can you post the exact command you are getting (with the JSON data you are passing), as well as a screenshot of the Manager UI? Note that you may need to refresh the Manager UI in order to view the changes.

Hi Michelle,

Find the attached zip file containing screenshots of PUT request details

streamtargets.zip

Also below are the Request and response details:

http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/pushpublish/mapentries

JSON : {“mapEntries”: [ { “entryName”: “Test”, “sourceStreamName”: “YYY” }]}

RESPONSE:

{ “success”: true, “message”: “Saved”, “data”: null }

Hi,

It looks like you are only passing the source stream name and the entry name. When updating a stream target, you would need to pass all the parameters required for the profile you’re using. The format should be the same as when initially creating the stream target, except you’re using a PUT and not a POST method.

Michelle

Here is my entry in PushPublishMap.txt

This file has been upgraded for use by the Wowza Streaming Engine REST API. Please avoid hand-editing.

SourceStreamName={“entryName”:“Test”, “profile”:“rtmp”, “password”:“Password”, “application”:“DestinationApplicationName”, “destinationName”:“rtmp”, “host”:“DestinationHost”, “appInstance”:“DestinationApplicationInstance”, “userName”:“UserName”, “streamName”:“DestinationStreamName”}

Now I am sending the below PUT method to update the streamName from “DestinationStreamName” to “Modified
http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/pushpublish/mapentries
{
“serverName”: “defaultServer”,
“sourceStreamName”: “SourceStreamName”,
“entryName”: “Test”,
“profile”: “rtmp”,
“destinationName”:“rtmp”,
“host”: “DestinationHost”,
“application”: “DestinationApplicationName”,
“userName”: “UserName”,
“password”: “Password”,
“streamName”: “Modified”,
“appInstance”: “DestinationApplicationInstance”
}
iam gettting the response as:
{
“success”: true,
“message”: “Saved”,
“data”: null
}
But if i go to the engine manager and check the value is unchanged. There is no change in PushPublishMap.txt also