Update Failover Group Configuration

Updates a failover group's failover mode, automatic failback, or both.

Request

Request syntax:

PATCH /failover-groups/Failover Group ID

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 parameters:

Pass the following request body parameters:

NameData TypeDescription
auto_failbackBooleanDetermines whether our service will switch back to a higher priority Live Slicer when it resumes a healthy state. Valid values are: TrueFalse This parameter is only applicable when the failover group uses a prioritized failover mode.
modeStringDetermines how our system chooses which Live Slicer will serve as a source for your live stream. Valid values are: flat: Use this mode to set the source for your live stream to a healthy Live Slicer that is randomly selected from your failover group. prioritized: Use this mode to failover your Live Slicers in a specific order. Upon switching to this mode, you may use the Update Live Slicer Failover Eligibility endpoint to define the order in which Live Slicers will failover. Switching to a prioritized failover mode will set the priority to each Live Slicer in the failover group according to the order in which they are listed within the failover group. Learn more.

Response

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

Sample Request/Response

Call the update_failover_group_configuration module (Python 3) to update a failover group's failover mode, automatic failback, or both. 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._update_failover_group_configuration()

    def _update_failover_group_configuration(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)

        payload = {
            'auto_failback': True,
            'mode': 'prioritized'
        }

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

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

        print(response.status_code)

FailoverGroup().run()