Child pages
  • Add Live Streaming CDN Resource with Advanced Settings
Skip to end of metadata
Go to start of metadata
POST /cdn_resources.xml
POST /cdn_resources.json

XML Request example (with internal publishing point):

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/cdn_resources.xml -d '<cdn_resource><cdn_hostname>testLV.internal</cdn_hostname><resource_type>STREAM_LIVE</resource_type><publishing_point>internal</publishing_point><publishing_location>532</publishing_location><failover_publishing_location>336</failover_publishing_location><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>www.google.com</domains><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries>AO</countries><countries>BH</countries><secure_wowza_on>1</secure_wowza_on><secure_wowza_token>4t534564tyrt</secure_wowza_token><edge_group_ids>224</edge_group_ids><token_auth_on>1</token_auth_on><token_auth_primary_key>zsfdfasga</token_auth_primary_key><token_auth_backup_key>fgff45788787878</token_auth_backup_key><token_auth_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secure_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>'

 JSON Request example (with internal publishing point):

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources.json -d '{"cdn_resource":{"cdn_hostname":"testLSJ.internal", "resource_type":"STREAM_LIVE", "publishing_point":"internal","publishing_location":"532","failover_publishing_location":"336", "hotlink_policy":"BLOCK_BY_DEFAULT", "domains":"www.google.com", "country_access_policy":"ALLOW_BY_DEFAULT", "countries":["AO", "BH"], "secure_wowza_on":"1", "secure_wowza_token":"4t534564tyrt", "edge_group_ids":["224"],"token_auth_on":"1","token_auth_primary_key":"zsfdfasga","token_auth_secure_paths": ["/video1", "/video2"],"token_auth_backup_key":"fgff45788787878"}}'

XML Request example (with external publishing point):

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/cdn_resources.xml -d '<cdn_resource><cdn_hostname>testLV1.external</cdn_hostname><resource_type>STREAM_LIVE</resource_type><publishing_point>external</publishing_point><publishing_location>http://www.google.com</publishing_location><failover_publishing_location>rtmp://test.com/test</failover_publishing_location><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>www.google.com</domains><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries>AO</countries><countries>BH</countries><secure_wowza_on>1</secure_wowza_on><secure_wowza_token>4t534564tyrt</secure_wowza_token><edge_group_ids>224</edge_group_ids></cdn_resource>'

JSON Request example (with external publishing point):

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources.json -d '{"cdn_resource":{"cdn_hostname":"testLSJ.external", "resource_type":"STREAM_LIVE", "publishing_point":"external","publishing_location":"http://www.google.com","failover_publishing_location":"rtmp://test.com/test", "hotlink_policy":"BLOCK_BY_DEFAULT", "domains":"www.google.com", "country_access_policy":"ALLOW_BY_DEFAULT", "countries":["AO", "BH"], "secure_wowza_on":"1", "secure_wowza_token":"4t534564tyrt", "edge_group_ids":["224"]}}'

 

Where:

cdn_hostname* - specify the name which will serve as a label only

resource_type* - STREAM_LIVE

publishing_point* - the publishing point type: external or internal

publishing_location*- specify the URL address for external publishing point. Set the ID of a location that will serve as a publishing point for internal type. For external type, the field can't be blank, must begin with 'rtmp', contain maximum 255 characters and comply with RFC2396.

failover_publishing_location* - publishing point failover URL for external publishing point. Specify the ID of a location that will serve as a failover publishing point for internal type. For external type, the field can't be blank, must begin with 'rtmp', contain maximum 255 characters, and comply with RFC2396. The failover_publishing_location can't be the same as publishing_location parameter.

advanced_settings* - set 1 to enable advanced settings

hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking:

  • BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter
  • NONE - switch off the rule

domains - domains related to hotlink_policy

country_access_policy - configure a rule to control access to the CDN resource's content for specified countries:

  • ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter
  • BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter
  • NONE - switch off the country access policy

countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format.

secure_wowza_on - set 1 to enable secure Wowza streaming encryption, otherwise set 0

secure_wowza_token - specify the Wowza token

token_auth_on - indicate whether Token Authentication is enabled for this resource. It's only supported for VoD PUSH, VoD PULL, and Live Streaming resource.

token_auth_primary_key - set primary key to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. This must not be blank if token_auth_on is enabled.

token_auth_backup_key -  set backup key (optional) to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt (if primary key failed) the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters.

token_auth_secure_paths - set secure paths that marks streaming to these paths requires a valid token to play a stream. Include only the relative path that appears after the content access point. If undefined, forward slash (/) will be set, means the resource is secured at root level and all streaming request to the resource will be granted only if the provided token is valid.  Example - ["/video1", "/video2"]


Response

You will get a response consisting of two parts - the header with HTTP status code and the response body including the parameters. At this stage some of the parameters can be empty. This is expected behavior, because the full process of creation takes some time, and remote service cannot fill in the parameters at this time. For the complete list of parameters use GET request.

 

Page History

v.3.3.1 adds the following parameters:

  • token_auth_on
  • token_auth_primary_key
  • token_auth_backup_key
  • token_auth_secure_paths

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels