/

Stream Provisioning


Please note the following:

  • authentication: specifies the username and password that have been configured for the video stream if required (for round-trip authentication, for example)
  • georules: based on the restricted boolean value, this specifies which regions should be allowed or restricted to subscribe to a video stream. Note that restricting by region requires some additional programming to determine what region your clients are trying to connect from, so it is recommended that you set the restricted value to false for base installations.
  • qos: is an integer that indicates the quality of service that needs to be provided (currently 3 is the only valid level).

Note: See this document for some additional parameters that can be sent with a stream provision.

Create Stream Provision

Description

Create a new stream provision for a given Stream and Scope; returns the newly created provision data.

REQUEST

  • URI: http://{host}:{port}/streammanager/api/4.0/admin/event/meta/{scopeName}/{streamName}?accessToken=<accessToken>
  • Method: POST
  • DATA:
{
  "meta": {
      "authentication": {
      "username": "<username>",
      "password": "<password>"
     },
      "stream": [
        {
          "name": "<variant_name>",
          "level": "<variant_level>",
          "properties": {}
         }
],
      "georules": {
      "regions": [
        "<location_name>"
      ],
      "restricted": "<restriction_status>"
    },
    "qos": "<QOS-Constant-Index>"
  }
}

RESPONSE

  • Success: HTTP CODE 200
  • DATA:
{
    "name": "<streamName>",
    "scope": "<scopeName>",
    "data": {
       "meta": {
           "authentication": {
                "username": "<username>",
                "password": "<password>"
            },
            "stream": [
                    {
                        "name": "<variant_name>",
                        "level": <variant_level>,
                        "properties": {}
                    }
  ],
            "georules": {
                "regions": [
                    "<location_name>"
                ],
                "restricted": "<restriction_status>"
            },
            "qos": <QOS-Constant-Index>
        }
    },
    "updated": <updated-timestamp>
}
  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}

Example

REQUEST URI: https://streammanager.url.com/streammanager/api/4.0/admin/event/meta/live/stream1?accessToken=xyz123

  • Method: POST
  • Data: JSON
{
  "meta": {
      "authentication": {
      "username": "acme",
      "password": "acme!newpass"
     },
    "stream": [{
          "name": "stream1_3",
          "level": 3,
          "properties": {
          "videoWidth": 320,
          "videoHeight": 240,
          "videoBR": 300000,
          "videoFPS": 15,
        }
        },
        {
          "name": "stream1_2",
          "level": 2,
          "properties": {
          "videoWidth": 640,
          "videoHeight": 480,
          "videoBR": 500000,
          "videoFPS": 30,
        }
        },
        {
          "name": "stream1_1",
          "level": 1,
          "properties": {
          "videoWidth": 800,
          "videoHeight": 600,
          "videoBR": 750000,
          "videoFPS": 30,
        }
        }
    ],
      "georules": {
      "regions": [
        "US"
      ],
       "restricted": "false"
    },
    "qos": 3
  }
}

RESPONSE

  • Success: HTTP CODE 201
  • Data:
{
    "name": "stream1",
    "scope": "live",
    "data": {
        "meta": {
            "authentication": {
                "username": "acme",
                "password": "acme!newpass"
            },
            "stream": [{
          "name": "stream1_3",
          "level": 3,
          "properties": {
          "videoWidth": 320,
          "videoHeight": 240,
          "videoBR": 300000,
          "videoFPS": 15,
        }
        },
        {
          "name": "stream1_2",
          "level": 2,
          "properties": {
          "videoWidth": 640,
          "videoHeight": 480,
          "videoBR": 500000,
          "videoFPS": 30,
        }
        },
        {
          "name": "stream1_1",
          "level": 1,
          "properties": {
          "videoWidth": 800,
          "videoHeight": 600,
          "videoBR": 750000,
          "videoFPS": 30,
        }
        }
    ],
            "georules": {
                "regions": [
                    "US"
                ],
                "restricted": "false"
            },
            "qos": 3
        }
    },
    "updated": 1520946314644
}

List Stream Provisions

DESCRIPTION:

Lists the streams that are provisioned through the Stream Manager.

  • URI: http://{host}:{port}/streammanager/api/4.0/admin/event/meta/?accessToken=<accessToken>

METHOD: GET

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}

SUCCESS

CODE: 200
DATA:
{
    "name": "<streamName>",
    "scope": "<scopeName>",
    "data": {
        "meta": {
            "authentication": {
                "username": "<username>",
                "password": "<password>"
            },
            "stream": [
                    {
                        "name": "<variant_name>",
                        "level": <variant_level>,
                        "properties": {}
                    }
        ],
            "georules": {
                "regions": [
                    "<location_name>"
                ],
                "restricted": "<restriction_status>"
            },
            "qos": <QOS-Constant-Index>
        }
    },
    "updated": <updated-timestamp>
}

Example: Lists the provisioned streams

REQUEST URI: https://streammanager.url.com/streammanager/api/4.0/admin/event/meta?accessToken=xyz123

Method: GET

RESPONSE

  • Success: HTTP CODE 201
  • Data:
{
    "name": "stream1",
    "scope": "live",
    "data": {
        "meta": {
            "authentication": {
                "username": "acme",
                "password": "acme!newpass"
            },
            "stream": [
                {
                    "name": "stream1_1",
                    "level": 3,
                    "properties": {}
                },
                {
                    "name": "stream1_2",
                    "level": 2,
                    "properties": {}
                },
                {
                    "name": "stream1_3",
                    "level": 1,
                    "properties": {}
                }
            ],
            "georules": {
                "regions": [
                    "US"
                ],
                "restricted": "false"
            },
            "qos": 3
        }
    },
    "updated": 1520946314644
}

Read Stream Provision

DESCRIPTION:

Reads and returns a stream provision from Stream Manager data store for a given Stream and Scope.

  • URI: http://{host}:{port}/streammanager/api/4.0/admin/event/meta/{scopeName}/{streamName}?accessToken=<accessToken>

METHOD: GET

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}

SUCCESS

CODE: 200
DATA:
{
    "name": "<streamName>",
    "scope": "<scopeName>",
    "data": {
        "meta": {
            "authentication": {
                "username": "<username>",
                "password": "<password>"
            },
            "stream": [
                    {
                        "name": "<variant_name>",
                        "level": <variant_level>,
                        "properties": {}
                    }
        ],
            "georules": {
                "regions": [
                    "<location_name>"
                ],
                "restricted": "<restriction_status>"
            },
            "qos": <QOS-Constant-Index>
        }
    },
    "updated": <updated-timestamp>
}

Example: Reads a stream provision data from store

REQUEST URI: https://streammanager.url.com/streammanager/api/4.0/admin/event/meta/live/stream1?accessToken=xyz123

Method: GET

RESPONSE

  • Success: HTTP CODE 201
  • Data:
{
    "name": "stream1",
    "scope": "live",
    "data": {
        "meta": {
            "authentication": {
                "username": "acme",
                "password": "acme!newpass"
            },
            "stream": [
                {
                    "name": "stream1_1",
                    "level": 3,
                    "properties": {}
                },
                {
                    "name": "stream1_2",
                    "level": 2,
                    "properties": {}
                },
                {
                    "name": "stream1_3",
                    "level": 1,
                    "properties": {}
                }
            ],
            "georules": {
                "regions": [
                    "US"
                ],
                "restricted": "false"
            },
            "qos": 3
        }
    },
    "updated": 1520946314644
}

Read Stream Provision Fragment

Description

Reads and returns a part of the stream provision from Stream Manager data store for a given Stream and Scope by a specified meta ‘key’.

NOTE: The property targeted by the key parameter must exist at the root level, ie: under the meta object.

URI: http://{host}:{port}/streammanager/api/4.0/admin/event/meta/{scopeName}/{streamName}?accessToken=<accessToken>&key=<metaKey>

  • Method: GET
  • Parameters:
ParameterDescriptionValue
keyName of a property to be read. This property should exist under the root object metaA property name string

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}

SUCCESS

  • CODE: 200
  • DATA:
{
    "name": "<streamName>",
    "scope": "<scopeName>",
    "data": {
        "<key>": {
        <data>
    },
    "updated": <updated-timestamp>
}

Example: Reading global authentication information

URI: https://streammanager.url.com/streammanager/api/4.0/admin/event/meta/live/stream1?accessToken=xyz123&key=authentication

Method: GET

RESPONSE

  • Success: HTTP CODE 201
  • Data:
{
    "name": "stream1",
    "scope": "live",
    "data": {
        "authentication": {
            "username": "acme",
            "password": "acme!newpass"
        }
    },
    "updated": 1520946314644
}

Update Stream Provision

DESCRIPTION

Updates a provision in the Stream Manager data store for a given Stream and Scope with new data and returns the updated provision.

  • URI: http://{host}:{port}/streammanager/api/4.0/admin/event/meta/{scopeName}/{streamName}?accessToken=<accessToken>
  • METHOD: PUT
  • DATA:
{
  "meta": {
    "authentication": {
      "username": "<username>",
      "password": "<password>"
    },
    "stream": [
                    {
                        "name": "<variant_name>",
                        "level": <variant_level>,
                        "properties": {}
                    }
      ],
    "georules": {
      "regions": [
        "<location_name>"
      ],
      "restricted": "<restriction_status>"
    },
    "qos": <QOS-Constant-Index>
  }
}

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}

SUCCESS

  • CODE: 200
  • DATA:
{
    "name": "<streamName>",
    "scope": "<scopeName>",
    "data": {
        "meta": {
            "authentication": {
                "username": "<username",
                "password": "<password>"
            },
            "stream": [
                    {
                        "name": "<variant_name>",
                        "level": <variant_level>,
                        "properties": {}
                    }
        ],
            "georules": {
                "regions": [
                    "<location_name>"
                ],
                "restricted": "<restriction_status>"
            },
            "qos": <QOS-Constant-Index>
        }
    },
    "updated": <updated-timestamp>
}

Example: Updating authentication password and inverting georule restriction status

  • URI: https://streammanager.url.com/streammanager/api/4.0/admin/event/meta/live/stream1?accessToken=xyz123
  • Method: PUT
  • Data: JSON
{
  "meta": {
    "authentication": {
      "username": "acme",
      "password": "acme!diffpass"
    },
    "stream": [{
          "name": "stream1_1",
          "level": 3,
          "properties": {

          }
        },
        {
          "name": "stream1_2",
          "level": 2,
          "properties": {

          }
        },
        {
          "name": "stream1_3",
          "level": 1,
          "properties": {

          }
        }
    ],
    "georules": {
     "regions": [
        "US"
      ],
      "restricted": "false"
     },
    "qos": 3
  }
}

RESPONSE

  • Success: HTTP CODE 201
  • Data:
{
    "name": "stream1",
    "scope": "live",
    "data": {
        "meta": {
            "authentication": {
                "username": "acme",
                "password": "acme!diffpass"
            },
            "stream": [
                {
                    "name": "stream1_1",
                    "level": 3,
                    "properties": {}
                },
                {
                    "name": "stream1_2",
                    "level": 2,
                    "properties": {}
                },
                {
                    "name": "stream1_3",
                    "level": 1,
                    "properties": {}
                }
            ],
            "georules": {
                "regions": [
                    "US"
                ],
                "restricted": "false"
            },
            "qos": 3
        }
    },
    "updated": 1520947709222
}

Delete Stream Provision

DESCRIPTION

Deletes a stream provision from Stream Manager data store by a given Stream and Scope and returns the deleted provision data.

  • URI: http://{host}:{port}/streammanager/api/4.0/admin/event/meta/{scopeName}/{streamName}?accessToken=<accessToken>
  • METHOD: DELETE

RESPONSE

  • Failure: HTTP CODE 400 or 404
  • Data:
{
  "errorMessage": "<error-message-string>",
  "timestamp": <error-timestamp>
}

SUCCESS

  • CODE: 200
  • DATA:
{
    "name": "<streamName>",
    "scope": "<scopeName>",
    "data": {
        "meta": {
            "authentication": {
                "username": "<username",
                "password": "<password>"
            },
            "stream": [
                    {
                        "name": "<variant_name>",
                        "level": <variant_level>,
                        "properties": {}
                    }
       ],
            "georules": {
                "regions": [
                    "<location_name>"
                ],
                "restricted": "<restriction_status>"
            },
            "qos": <QOS-Constant-Index>
        }
    },
    "updated": <updated-timestamp>
}

Example: Deletes the stream provision created earlier

  • URI: https://streammanager.url.com/streammanager/api/4.0/admin/event/meta/live/stream1?accessToken=xyz123
  • Method: DELETE

RESPONSE

  • Success: HTTP CODE 201
  • Data:
{
    "name": "stream1",
    "scope": "live",
    "data": {
        "meta": {
            "authentication": {
                "username": "acme",
                "password": "acme!newpass"
            },
            "stream": [
                {
                    "name": "stream1_1",
                    "level": 3,
                    "properties": {}
                },
                {
                    "name": "stream1_2",
                    "level": 2,
                    "properties": {}
                },
                {
                    "name": "stream1_3",
                    "level": 1,
                    "properties": {}
                }
            ],
            "georules": {
                "regions": [
                    "US"
                ],
                "restricted": "false"
            },
            "qos": 3
        }
    },
    "updated": 1520947709222
}