Get All Failover Groups

Retrieves all failover groups.

Request

Request syntax:

GET /failover-groups

Response

The response for a successful request contains the following properties:

NameData TypeDescription
@idStringIndicates the relative path to this endpoint.
@typeStringReturns Collection.
itemsList of dictionariesContains a list of your failover groups.
total_itemsStringIndicates the total number of failover groups.

items List

The items list describes each failover group via 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_all_failover_groups module (Python 3) to retrieve all failover groups. This module imports names from the api_auth module.

import requests
from api_auth import APICredentials, APIParams

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

    def run(self):
        self._get_failover_groups()

    def _get_failover_groups(self):
        url = "{}{}".format(self.host, "/api/v4/failover-groups")

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

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

        print(response.json())

FailoverGroups().run()

Response:

{
	'@id': '/api/v4/failover-groups',
	'@type': 'Collection',
	'items': [{
			'@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
				}
			]
		}, {
			'@id': '/api/v4/failover-groups/054d58556a7441cbbe71d4fb7f366422',
			'@type': 'FailoverGroup',
			'owner': 'cb233864a92b46a1a286cdd49b0a9bc8',
			'id': '054d58556a7441cbbe71d4fb7f366422',
			'name': 'Premium Events',
			'hot_warm': 0,
			'mode': 'prioritized',
			'auto_failback': True,
			'failover_time': 1576090867072,
			'active': None,
			'active_slicer_id': 'sports01',
			'channels': [{
					'id': 'c8929b67f1354607877b319edb0c01af',
					'desc': 'Entertainment'
				}, {
					'id': '6c1455e88af8428e999bacf69c7dd203',
					'desc': 'Sports'
				}
			],
			'slicers': [{
					'id': 'sports01',
					'blacklist_until': 0,
					'order': 3,
					'status': {
						'state': -1,
						'thumb_url': ''
					},
					'hostname': '190-16-26-22.slicer.uplynk.net',
					'enabled': False
				}, {
					'id': 'sports02',
					'blacklist_until': 0,
					'order': 4,
					'status': {
						'state': -1,
						'thumb_url': ''
					},
					'hostname': '193-16-26-4.slicer.uplynk.net',
					'enabled': False
				}
			]
		}
	],
	'total_items': 2
}