Sets a failover group's active Live Slicer. Upon activating a Live Slicer, it will be assigned to all live channels associated with that failover group.
Do not use this endpoint with a failover group on which the Auto Failback option has been enabled. Attempting to use this endpoint on such a failover group generates a 400 Bad Request response.
Request
Request syntax:
PUT /failover-groups/Failover Group ID/activate_slicer
Request URL variable:
Define the following variable when submitting the above request:
VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3). | Description |
---|---|
Failover Group ID Required | Replace this variable with the system-defined ID assigned to the desired failover group. Use the Get All Failover Groups endpoint to retrieve a list of failover groups and their system-defined ID. |
Request body parameter:
Pass the following request body parameter:
Name | Data Type | Description |
---|---|---|
slicer_id Required | String | Identifies a Live Slicer by its ID. Our system uses this Live Slicer's feed to generate your live stream. You may only activate a Live Slicer that belongs to the failover group defined in the request URL. A Live Slicer's ID is determined by the slicerID setting in its configuration file ClosedHow do I activate a Live Slicer that belongs to a different user? You may activate a Live Slicer that belongs to a different user if it already belongs to the failover group defined in the request URL. Use the following syntax to activate a Live Slicer that belongs to a different userA user, which is a type of customer account, allows an individual user to manage their own Slicers / Live Slicers, live channels, live events, and content. If a user has been associated with an account, then that user may also leverage that account's shared configuration.: User ID:Live Slicer ID Example: abc33864a92c46a1a286cdd49b0a9123:myslicer01 |
Response
The response for a successful request is a 204 No Content.
The response for an invalid request (e.g., trying to activate a Live Slicer that does not belong to the specified failover group) is a 400 Bad Request.
Sample Request/Response
Call the activate_live_slicer module (Python 3) to set a failover group's active Live Slicer. This module imports names from the api_auth module.
import json
import requests
from api_auth import APICredentials, APIParams
class ActivateLiveSlicer:
def __init__(self):
self.host = "https://services.uplynk.com"
def run(self):
self._activate_live_slicer()
def _activate_live_slicer(self):
failover_group_id = 'e8d6b5cb940c40cc9ec6ad081a38f3f0' # Replace with the ID for the desired failover group.
url = "{}{}{}{}".format(self.host, "/api/v4/failover-groups/", failover_group_id, "/activate_slicer")
payload = {
'slicer_id': 'myslicer01'
}
headers = {'Content-Type': 'application/json'}
response = requests.put(
url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
)
print(response.status_code)
ActivateLiveSlicer().run()