actions/add_heartbeat.py
def run(
        self,
        name,
        interval=None,
        interval_unit=None,
        description=None,
        enabled=False,
        ownerTeamName=None,
        alertMessage=None,
        alertTags=None,
        alertPriority=None,
    ):
        """
        Add a Heartbeat to OpsGenie

        Args:
        - name: Name of the heartbeat
        - interval: Specifies how often a heartbeat message should be expected.
        - intervalUnit: interval specified as minutes, hours or days.
        - description: An optional description of the heartbeat.
        - enabled: Enable/disable heartbeat monitoring.
        - ownerTeam: Owner team of the heartbeat, consisting id and/or name of the owner team
        - alertMessage: Specifies the alert message for heartbeat expiration alert.
        - alertTags: Specifies the alert tags for heartbeat expiration alert.
        - alertPriority: Specifies the alert priority for heartbeat expiration alert.

        Returns:
        - dict: Data from OpsGenie
        """

        body = {"enabled": enabled}
        ownerTeam = {}

        if name:
            if len(name) > 200:
                raise ValueError("name is too long, can't be over 200 chars.")
            else:
                body["name"] = name

        if interval:
            body["interval"] = interval

        if interval_unit:
            body["intervalUnit"] = interval_unit

        if description:
            if len(description) > 10000:
                raise ValueError("name is too long, can't be over 200 chars.")
            else:
                body["description"] = description

        if ownerTeamName:
            ownerTeam["name"] = ownerTeamName
            body["ownerTeam"] = ownerTeam

        if alertMessage:
            if len(alertMessage) > 130:
                raise ValueError("alertMessage is too long, can't be over 130 chars.")
            else:
                body["alertMessage"] = alertMessage

        if alertTags:
            body["alertTags"] = alertTags

        if alertPriority:
            body["alertPriority"] = alertPriority

        data = self._req("POST", "v2/heartbeats", body=body)

        return data

        Add a Heartbeat to OpsGenie

        Args:
        - name: Name of the heartbeat
        - interval: Specifies how often a heartbeat message should be expected.
        - intervalUnit: interval specified as minutes, hours or days.
        - description: An optional description of the heartbeat.
        - enabled: Enable/disable heartbeat monitoring.
        - ownerTeam: Owner team of the heartbeat, consisting id and/or name of the owner team
        - alertMessage: Specifies the alert message for heartbeat expiration alert.
        - alertTags: Specifies the alert tags for heartbeat expiration alert.
        - alertPriority: Specifies the alert priority for heartbeat expiration alert.

        Returns:
        - dict: Data from OpsGenie
        
Add a Heartbeat to OpsGenie
Args:
name: Name of the heartbeat
interval: Specifies how often a heartbeat message should be expected.
intervalUnit: interval specified as minutes, hours or days.
description: An optional description of the heartbeat.
enabled: Enable/disable heartbeat monitoring.
ownerTeam: Owner team of the heartbeat, consisting id and/or name of the owner team
alertMessage: Specifies the alert message for heartbeat expiration alert.
alertTags: Specifies the alert tags for heartbeat expiration alert.
alertPriority: Specifies the alert priority for heartbeat expiration alert.


Add a Heartbeat to OpsGenie Args : name : Name of the heartbeat interval : Specifies how often a heartbeat message should be expected . intervalUnit : interval specified as minutes hours or days . description : An optional description of the heartbeat . enabled : Enable / disable heartbeat monitoring . ownerTeam : Owner team of the heartbeat consisting id and / or name of the owner team alertMessage : Specifies the alert message for heartbeat expiration alert . alertTags : Specifies the alert tags for heartbeat expiration alert . alertPriority : Specifies the alert priority for heartbeat expiration alert .
def run(
        self,
        name,
        interval=None,
        interval_unit=None,
        description=None,
        enabled=False,
        ownerTeamName=None,
        alertMessage=None,
        alertTags=None,
        alertPriority=None,
    ):
        body = {"enabled": enabled}
        ownerTeam = {}
        if name:
            if len(name) > 200:
                raise ValueError("name is too long, can't be over 200 chars.")
            else:
                body["name"] = name
        if interval:
            body["interval"] = interval
        if interval_unit:
            body["intervalUnit"] = interval_unit
        if description:
            if len(description) > 10000:
                raise ValueError("name is too long, can't be over 200 chars.")
            else:
                body["description"] = description
        if ownerTeamName:
            ownerTeam["name"] = ownerTeamName
            body["ownerTeam"] = ownerTeam
        if alertMessage:
            if len(alertMessage) > 130:
                raise ValueError("alertMessage is too long, can't be over 130 chars.")
            else:
                body["alertMessage"] = alertMessage
        if alertTags:
            body["alertTags"] = alertTags
        if alertPriority:
            body["alertPriority"] = alertPriority
        data = self._req("POST", "v2/heartbeats", body=body)
        return data
def run ( self , name , interval = None , interval_unit = None , description = None , enabled = False , ownerTeamName = None , alertMessage = None , alertTags = None , alertPriority = None , ) : body = { "enabled" : enabled } ownerTeam = { } if name : if len ( name ) > 200 : raise ValueError ( "name is too long, can't be over 200 chars." ) else : body [ "name" ] = name if interval : body [ "interval" ] = interval if interval_unit : body [ "intervalUnit" ] = interval_unit if description : if len ( description ) > 10000 : raise ValueError ( "name is too long, can't be over 200 chars." ) else : body [ "description" ] = description if ownerTeamName : ownerTeam [ "name" ] = ownerTeamName body [ "ownerTeam" ] = ownerTeam if alertMessage : if len ( alertMessage ) > 130 : raise ValueError ( "alertMessage is too long, can't be over 130 chars." ) else : body [ "alertMessage" ] = alertMessage if alertTags : body [ "alertTags" ] = alertTags if alertPriority : body [ "alertPriority" ] = alertPriority data = self . _req ( "POST" , "v2/heartbeats" , body = body ) return data
Add a Heartbeat to OpsGenie
Args:
 name: Name of the heartbeat
 interval: Specifies how often a heartbeat message should be expected.
Add a Heartbeat to OpsGenie Args : name : Name of the heartbeat interval : Specifies how often a heartbeat message should be expected .
"""
        Add a Heartbeat to OpsGenie

        Args:
        - name: Name of the heartbeat
        - interval: Specifies how often a heartbeat message should be expected.
        - intervalUnit: interval specified as minutes, hours or days.
        - description: An optional description of the heartbeat.
        - enabled: Enable/disable heartbeat monitoring.
        - ownerTeam: Owner team of the heartbeat, consisting id and/or name of the owner team
        - alertMessage: Specifies the alert message for heartbeat expiration alert.
        - alertTags: Specifies the alert tags for heartbeat expiration alert.
        - alertPriority: Specifies the alert priority for heartbeat expiration alert.

        Returns:
        - dict: Data from OpsGenie
        """
self
name
interval
interval_unit
description
enabled
ownerTeamName
alertMessage
alertTags
alertPriority