Retrieves all failover groups.
Request
Request syntax:
GET /failover-groups
Response
The response for a successful request contains the following properties:
Name | Data Type | Description |
---|---|---|
@id | String | Indicates the relative path to this endpoint. |
@type | String | Returns Collection. |
items | List of dictionaries | Contains a list of your failover groups. |
total_items | String | Indicates the total number of failover groups. |
items List
The items list describes each failover group via the following properties:
Name | Data Type | Description | |
---|---|---|---|
@id | String | Indicates the relative path to an endpoint that returns this failover group. | |
@type | String | Returns FailoverGroup. | |
id | String | Identifies this failover group by its system-defined ID. | |
owner | String | Indicates the system-defined ID for the user that owns this failover group. | |
name | String | Indicates the name assigned to this failover group. | |
hot_warm | Integer | Indicates 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. | |
mode | String | Indicates how our system chooses a Live Slicers upon failover. Valid values are: prioritized | flat Learn more. |
auto_failback | Boolean | Indicates whether our system will automatically switch back to the primary Live Slicer when it resumes a healthy state. | |
failover_time | Integer | Indicates the date and time, in Unix time (milliseconds), for the last instance in which failover occurred. | |
active_slicer_id | String | Indicates 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. | |
channels | List of Dictionaries | Contains a list of the live channels associated with this failover group. | |
slicers | List of Dictionaries | Contains 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:
Name | Data Type | Description |
---|---|---|
id | String | Identifies this live channel by its system-defined ID. |
desc | String | Indicates 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:
Name | Data Type | Description |
---|---|---|
id | String | Identifies this Live Slicer by its system-defined ID. |
blacklist_until | Integer | Indicates 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. |
order | Integer | Indicates 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. |
status | Dictionary | Contains the Live Slicer's status and thumbnail URL. |
hostname | String | Indicates the Live Slicer's hostname. |
enabled | Boolean | Indicates whether failover has been enabled on the Live Slicer. |
status Dictionary
The status dictionary contains the following properties:
Name | Data Type | Description |
---|---|---|
state | Integer | Indicates the Live Slicer's status. Valid values are: -1: Inactive 0: Slicing 1: Ad Break 2: Replacing Content * 3: Blackout Learn more. |
thumb_url | String | Indicates 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
}