Toggle Source Feed

Toggles the source of a failover group's feed between a Live Slicer and slate.

Request

Request syntax:

PUT /failover-groups/Failover Group ID/set_no_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 RequiredReplace 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:

NameData TypeDescription
no_slicer RequiredBooleanDetermines the source for the failover group's feed. Valid values are: True: Sets the source to missing content slate. Additionally, it sets the failover group's active_slicer_id to no_slicer. False: Sets the source to the active Live Slicer. Additionally, it sets the failover group's active_slicer_id to this Live Slicer's ID.

Response

The response for a successful request is a 204 No Content.

Sample Request/Response

Call the toggle_source_feed module (Python 3) to toggle the source of a failover group's feed. This module imports names from the api_auth module.

import json
import requests
from api_auth import APICredentials, APIParams

class FailoverGroup:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        self._toggle_source_feed()

    def _toggle_source_feed(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, "/set_no_slicer")

        payload = {
            'no_slicer': True
        }

        headers = {'Content-Type': 'application/json'}

        response = requests.put(
            url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
        )

        print(response.status_code)

FailoverGroup().run()