Module betterstack.uptime.objects
This module will house all derrivatives of BaseAPIObject. These are used to configure specific API enpoints, and their custom behaviour
Module contents
- class betterstack.uptime.objects.Monitor(api: RESTAPI, id: int, attributes: dict = None, **kwargs)[source]
Bases:
BaseAPIObject
Subclass in order to differentiate between endpoints and types. Can be used to store custom functionality
Initializes the object with a corresponding API client, id and optional attributes If only the ID is provided, it will fetch data from the API in order to fill it’s attributes. If attributes are provided, just assign them
- Parameters:
api (RESTAPI) – API Instance
id (int) – Object ID to get (optional)
attributes (dict) – Attributes to assign to class. Use only attributes fetched from API here!
- type = 'monitor'
- __init__(api: RESTAPI, id: int, attributes: dict = None, **kwargs)[source]
Initializes the object with a corresponding API client, id and optional attributes If only the ID is provided, it will fetch data from the API in order to fill it’s attributes. If attributes are provided, just assign them
- Parameters:
api (RESTAPI) – API Instance
id (int) – Object ID to get (optional)
attributes (dict) – Attributes to assign to class. Use only attributes fetched from API here!
- class betterstack.uptime.objects.MonitorSLA(api: RESTAPI, id: int, sla_from=None, sla_to=None, attributes: dict = None, force_update=False)[source]
Bases:
BaseAPIObject
Subclass in order to differentiate between endpoints and types. Can be used to store custom functionality
Initializes the object with a corresponding API client, id and optional attributes If only the ID is provided, it will fetch data from the API in order to fill it’s attributes. If attributes are provided, just assign them
- Parameters:
api (RESTAPI) – API Instance
id (int) – Object ID to get (optional)
attributes (dict) – Attributes to assign to class. Use only attributes fetched from API here!
- type = 'monitor_sla'
- __init__(api: RESTAPI, id: int, sla_from=None, sla_to=None, attributes: dict = None, force_update=False)[source]
Initializes the object with a corresponding API client, id and optional attributes If only the ID is provided, it will fetch data from the API in order to fill it’s attributes. If attributes are provided, just assign them
- Parameters:
api (RESTAPI) – API Instance
id (int) – Object ID to get (optional)
attributes (dict) – Attributes to assign to class. Use only attributes fetched from API here!
- property timeframe
- class betterstack.uptime.objects.MonitorGroup(api: RESTAPI, id: int, attributes: dict = None)[source]
Bases:
BaseAPIObject
Subclass in order to differentiate between endpoints and types. Can be used to store custom functionality
Initializes the object with a corresponding API client, id and optional attributes If only the ID is provided, it will fetch data from the API in order to fill it’s attributes. If attributes are provided, just assign them
- Parameters:
api (RESTAPI) – API Instance
id (int) – Object ID to get (optional)
attributes (dict) – Attributes to assign to class. Use only attributes fetched from API here!
- type = 'monitor_group'
- __init__(api: RESTAPI, id: int, attributes: dict = None)[source]
Initializes the object with a corresponding API client, id and optional attributes If only the ID is provided, it will fetch data from the API in order to fill it’s attributes. If attributes are provided, just assign them
- Parameters:
api (RESTAPI) – API Instance
id (int) – Object ID to get (optional)
attributes (dict) – Attributes to assign to class. Use only attributes fetched from API here!
- class betterstack.uptime.objects.Heartbeat(api: RESTAPI, id: int = None, attributes: dict = None, **kwargs)[source]
Bases:
BaseAPIObject
Subclass in order to differentiate between endpoints and types. Can be used to store custom functionality
Initializes the object with a corresponding API client, id and optional attributes If only the ID is provided, it will fetch data from the API in order to fill it’s attributes. If attributes are provided, just assign them
- Parameters:
api (RESTAPI) – API Instance
id (int) – Object ID to get (optional)
attributes (dict) – Attributes to assign to class. Use only attributes fetched from API here!
- type = 'heartbeat'
- class betterstack.uptime.objects.HeartbeatGroup(api: RESTAPI, id: int = None, attributes: dict = None, **kwargs)[source]
Bases:
BaseAPIObject
Subclass in order to differentiate between endpoints and types. Can be used to store custom functionality
Initializes the object with a corresponding API client, id and optional attributes If only the ID is provided, it will fetch data from the API in order to fill it’s attributes. If attributes are provided, just assign them
- Parameters:
api (RESTAPI) – API Instance
id (int) – Object ID to get (optional)
attributes (dict) – Attributes to assign to class. Use only attributes fetched from API here!
- type = 'heartbeat-group'
- class betterstack.uptime.objects.Incident(api: RESTAPI, id: int = None, attributes: dict = None, **kwargs)[source]
Bases:
BaseAPIObject
Subclass in order to differentiate between endpoints and types. Can be used to store custom functionality
Initializes the object with a corresponding API client, id and optional attributes If only the ID is provided, it will fetch data from the API in order to fill it’s attributes. If attributes are provided, just assign them
- Parameters:
api (RESTAPI) – API Instance
id (int) – Object ID to get (optional)
attributes (dict) – Attributes to assign to class. Use only attributes fetched from API here!
- type = 'incident'