Allows the user that owns a failover group to determine the set of users that are authorized to use it.
This endpoint does not replace the entire set of users that are authorized to use the failover group. Rather, it only adds or removes users from it.
Request
Request syntax:
PUT /failover-groups/Failover Group ID/allowed-owners
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 Required | Replace 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:
Name | Data Type | Description |
---|---|---|
owners_to_add | List of String Values | Contains a list of the users that will be granted authorization to this failover group. Identify each desired user by its system-defined ID. |
owners_to_remove | List of String Values | Contains a list of the users whose authorization to this failover group will be revoked. Identify each desired user by its system-defined ID. |
Where can I find my user ID?
- Load the User Settings page. How? From the main menu, navigate to Settings | User Settings.
- Your user ID is listed under the User ID label.
Response
The response for a successful request is a 204 No Content.
Sample Request/Response
Call the grant_deny_authorization module (Python 3) to grant or deny authorization to a failover group. 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._add_remove_allowed_users()
def _add_remove_allowed_users(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, "/allowed-owners")
payload = {
'owners_to_add': [
'gu137664292b46a1a286cdf79b1a9bm8',
't341643dn409198f523flniu1234n34h'
],
'owners_to_remove': [
'de137864292b46a1a286cdd79b3a9ba6'
]
}
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()