Get Failover Group

Retrieves a failover group by its system-defined ID.

Request

Request syntax:

GET /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.

Response

The response for a successful request contains the following properties:

NameData TypeDescription
@idStringIndicates the relative path to an endpoint that returns this failover group.
@typeStringReturns FailoverGroup.
idStringIdentifies this failover group by its system-defined ID.
ownerStringIndicates the system-defined ID for the user that owns this failover group.
nameStringIndicates the name assigned to this failover group.
hot_warmIntegerIndicates whether all Live Slicers within this failover group will be allowed to encode and store content. Valid values are: 0: Hot-Hot mode 1: Hot-Warm mode * #: Flexible Hot-Warm mode. # represents the maximum number of Live Slicers that will be allowed to encode and store content. Example: A value of 4 indicates that the primary Live Slicer and up to 3 backup Live Slicers are allowed to encode and store content. All other backup Live Slicers will operate in warm mode. Learn more.
modeStringIndicates how our system chooses a Live Slicers upon failover. Valid values are: prioritizedflat Learn more.
auto_failbackBooleanIndicates whether our system will automatically switch back to the primary Live Slicer when it resumes a healthy state.
failover_timeIntegerIndicates the date and time, in Unix time (milliseconds), for the last instance in which failover occurred.
active_slicer_idStringIndicates the system-defined ID for the active Live Slicer. Our system uses this Live Slicer's feed to generate your live stream. If the source for the failover group's feed has been switched to missing content slate, then this property returns no_slicer.
channelsList of DictionariesContains a list of the live channels associated with this failover group.
slicersList of DictionariesContains a list of Live Slicers associated with this failover group.

channels List

The channels list describes each live channel associated with your failover group via the following properties:

NameData TypeDescription
idStringIdentifies this live channel by its system-defined ID.
descStringIndicates the name assigned to this live channel.

slicers List

The slicers list describes each Live Slicer associated with your failover group via the following properties:

NameData TypeDescription
idStringIdentifies this Live Slicer by its system-defined ID.
blacklist_untilIntegerIndicates until when, in Unix time (milliseconds), an unhealthy Live Slicer will be ineligible to become the failover group's active Live Slicer. Key information: If a Live Slicer is still unhealthy after the specified timestamp, then its ineligibility window will be extended. This property returns 0 for healthy Live Slicers that have not been denied eligibility due to health status.
orderIntegerIndicates the order, starting from 1, in which our system will choose Live Slicers upon failover. If the failover group uses flat mode (i.e., random Live Slicer selection), then this property will always return 1.
statusDictionaryContains the Live Slicer's status and thumbnail URL.
hostnameStringIndicates the Live Slicer's hostname.
enabledBooleanIndicates whether failover has been enabled on the Live Slicer.
status Dictionary

The status dictionary contains the following properties:

NameData TypeDescription
stateIntegerIndicates the Live Slicer's status. Valid values are: -1: Inactive 0: Slicing 1: Ad Break 2: Replacing Content * 3: Blackout Learn more.
thumb_urlStringIndicates the URL to a thumbnail preview of the Live Slicer's output.

Sample Request/Response

Call the get_failover_group module (Python 3) to retrieve a failover group. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams

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

    def run(self):
        self._get_failover_group()

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

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

        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({}), headers=headers
        )

        print(response.json())

FailoverGroup().run()

Response:

{
	'@id': '/api/v4/failover-groups/9852b8646dea4cd0a48f5e0ffaa4f8b3',
	'@type': 'FailoverGroup',
	'owner': 'ab533864a92b46a1a286cdd49b0a9bd3',
	'id': '9852b8646dea4cd0a48f5e0ffaa4f8b3',
	'name': 'My Failover Group',
	'hot_warm': 0,
	'mode': 'prioritized',
	'auto_failback': True,
	'failover_time': 1576107800205,
	'active': None,
	'active_slicer_id': 'news01',
	'channels': [{
			'id': '478f6d24e1a643049cdba0c544830752',
			'desc': 'Broadcast01'
		}, {
			'id': 'aad717c2fda649a3b213c56c94b529f4',
			'desc': 'Broadcast02'
		}
	],
	'slicers': [{
			'id': 'news01',
			'blacklist_until': 0,
			'order': 1,
			'status': {
				'state': 0,
				'thumb_url': 'https://x-default-stgec.uplynk.com/ausw/slices/d7b/...000009C.jpg'
			},
			'hostname': '101-174-253-64.slicer.uplynk.net',
			'enabled': True
		}, {
			'id': 'news02',
			'blacklist_until': 0,
			'order': 2,
			'status': {
				'state': 0,
				'thumb_url': 'https://x-default-stgec.uplynk.com/ausw/slices/d7b/...000003E.jpg'
			},
			'hostname': '104-174-253-63.slicer.uplynk.net',
			'enabled': True
		}
	]
}