How to set stream target custom properties using REST APIs?

Is there a way to set custom properties to for a stream target using REST APIs?

I noticed it is possibile on the web manager but it is not documented anywhere on the REST APIs documentation.

Sorry, I just noticed the developer section of the forum. Please some admin could move this post there?

No problem. Please let us know if you need a assistance in the future.

Regards,

Salvadore

Hi,

As per the documentation you can add a stream target like so

[php]

curl -X POST --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/pushpublish/mapentries/ppsource -d’

{

“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/pushpublish/mapentries/ppsource”,

“serverName”:“defaultServer”,

“sourceStreamName”: “myStream”,

“entryName”: “ppsource”,

“profile”: “rtmp”,

“host”: “localhost”,

“application”:“live”,

“userName”:“testUser”,

“password”:“pass”,

“streamName”:“myStream”

}’

[/php]

You can then set certain values with a call such as

[php]

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/pushpublish/mapentries/ppsource -d’

{

“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/pushpublish/mapentries/ppsource”,

“host”: “paulhost”,

“destinationServer”: “dest”

}’

[/php]

The full model schema for stream targets is

[php]

{

“shoutcast.destination”: “”,

“icecast2.public”: false,

“akamai.destinationServer”: “”,

“shoutcast.icq”: “”,

“timeToLive”: 0,

“password”: “”,

“rtpWrap”: false,

“icecast2.name”: “”,

“akamai.hostId”: “”,

“icecast2.icq”: “”,

“host”: “”,

“connectionFlashVersion”: “”,

“cupertino.renditions”: “”,

“debugPackets”: false,

“shoutcast.public”: false,

“shoutcast.aim”: “”,

“profile”: “”,

“icecast2.description”: “”,

“sessionStatus”: “”,

“shoutcast.metaname”: “”,

“icecast2.genre”: “”,

“queryString”: “”,

“akamai.eventName”: “”,

“version”: “”,

“shoutcast.name”: “”,

“sendStreamCloseCommands”: false,

“port”: 0,

“sendFCPublish”: false,

“icecast2.aim”: “”,

“http.playlistCount”: 0,

“http.playlistTimeout”: 0,

“audioPort”: “”,

“icecast2.metaname”: “”,

“sourceStreamName”: “”,

“connectionCode”: “”,

“localBindAddress”: “”,

“shoutcast.protocol”: “”,

“debugLogChildren”: false,

“serverName”: “”,

“adaptiveStreaming”: false,

“enabled”: false,

“shoutcast.irc”: “”,

“sendReleaseStream”: false,

“shoutcast.url”: “”,

“icecast2.irc”: “”,

“debugLog”: false,

“shoutcast.genre”: “”,

“akamai.streamId”: “”,

“akamai.hdNetwork”: false,

“adaptiveGroups”: “”,

“saveFieldList”: [

“”

],

“http.playlistAcrossSessions”: false,

“secureTokenSharedSecret”: “”,

“http.fakePosts”: false,

“sendSSL”: false,

“sendOriginalTimecodes”: false,

“icecast2.destination”: “”,

“userName”: “”,

“streamName”: “”,

“removeDefaultAppInstance”: false,

“videoPort”: “”,

“http.writerDebug”: false,

“icecast2.url”: “”,

“akamai.sendToBackupServer”: false,

“destinationServer”: “”,

“application”: “”,

“entryName”: “”,

“streamWaitTimeout”: 0,

“appInstance”: “”,

“originalTimecodeThreshold”: “”,

“autoStartTranscoder”: false,

“sanjose.representationId”: “”

}

[/php]

Paul

Hi,

My apologies - I missed the specific requirement for custom properties. Unfortunately it’s currently not possible to add custom properties in this way via the REST API. I have raised this internally and such functionality is being looked at, though I can’t say if or when this will be made available.

Paul

Hi,

Sorry for any confusion on this, but in fact you can add custom properties via REST API for your stream target. It is not currently documented (as we’ve both discovered - I’ll look at getting that amended) and the method is to use extraOptions, for example:

[php]

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/pushpublish/mapentries/ppsource -d’

{

“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/pushpublish/mapentries/ppsource”,

“serverName”:“defaultServer”,

“sourceStreamName”: “myStream3”,

“entryName”: “ppsource”,

“profile”: “rtmp”,

“host”: “localhost”,

“application”:“live”,

“userName”:“testUser”,

“password”:“pass”,

“extraOptions”:{ “option1”:“value1” },

“streamName”:“myStream3”

}’

[/php]

Paul

No problem, and apologies for the less than efficient responses.

Paul

Thank you, Paul, for your answer. Anyway I was asking for custom properties like the ones you can set in the manager.

Is there a way to add them using REST APIs, too? I can’t find anyting about pushpublish custom properties on the documentation.

Thank you, Paul. I hope this functionality will be soon available because it would be a further step in wowza customization for the developer as stated in the manager help panel.

Well, that’s great! Thank you again, Paul.