import requests
from api_auth import APICredentials, APIParams

class GetLinkHealth:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        """
        Get link health.
        """
        self._get_link_health()

    def _get_link_health(self):
        csl_slicer_id = "bcc4d23b45ba43e8b1e93141a10fee7e" # Replace with your CSL slicer ID.
        url = "{}{}{}".format(self.host, "/api/v4/managed-slicer/slicer/monitor/", csl_slicer_id)

        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({})
        )

        if response.status_code == 200:
            print(response.json())
        else:
            print(response.status_code)

GetLinkHealth().run()

