actions/delete_alert.py
def run(self, alert_id=None, alias=None, user=None, source="StackStorm"):
        """
        Delete an OpsGenie alert.

        Args
        - alert_id: Id of the alert that will be deleted.
        - alias: Alias of the alert will be deleted.
        - user: Default owner of the execution.
        - source: User defined field to specify source of delete action.

        Returns:
        - dict: Data from OpsGenie.

        Raises:
        - ValueError: If alert_id and alias are None.
        """

        payload = {}
        if source:
            if len(source) > 100:
                raise ValueError("source is too long, can't be over 100 chars.")
            else:
                payload["source"] = source

        if alert_id:
            identifier = pathname2url(alert_id)
            payload["identifierType"] = "id"
        elif alias:
            identifier = pathname2url(alias)
            payload["identifierType"] = "alias"
        else:
            raise ValueError("Need one of alert_id or alias.")

        if user:
            if len(user) > 100:
                raise ValueError("User is too long, can't be over 100 chars.")
            else:
                payload["user"] = "user"

        data = self._req("DELETE", "v2/alerts/" + identifier, payload=payload)
        return data

        Delete an OpsGenie alert.

        Args
        - alert_id: Id of the alert that will be deleted.
        - alias: Alias of the alert will be deleted.
        - user: Default owner of the execution.
        - source: User defined field to specify source of delete action.

        Returns:
        - dict: Data from OpsGenie.

        Raises:
        - ValueError: If alert_id and alias are None.
        
Delete an OpsGenie alert.
Args
alert_id: Id of the alert that will be deleted.
alias: Alias of the alert will be deleted.
user: Default owner of the execution.
source: User defined field to specify source of delete action.



If alert_id and alias are None.
Delete an OpsGenie alert . Args alert_id : Id of the alert that will be deleted . alias : Alias of the alert will be deleted . user : Default owner of the execution . source : User defined field to specify source of delete action . If alert_id and alias are None .
def run(self, alert_id=None, alias=None, user=None, source="StackStorm"):
        payload = {}
        if source:
            if len(source) > 100:
                raise ValueError("source is too long, can't be over 100 chars.")
            else:
                payload["source"] = source
        if alert_id:
            identifier = pathname2url(alert_id)
            payload["identifierType"] = "id"
        elif alias:
            identifier = pathname2url(alias)
            payload["identifierType"] = "alias"
        else:
            raise ValueError("Need one of alert_id or alias.")
        if user:
            if len(user) > 100:
                raise ValueError("User is too long, can't be over 100 chars.")
            else:
                payload["user"] = "user"
        data = self._req("DELETE", "v2/alerts/" + identifier, payload=payload)
        return data
def run ( self , alert_id = None , alias = None , user = None , source = "StackStorm" ) : payload = { } if source : if len ( source ) > 100 : raise ValueError ( "source is too long, can't be over 100 chars." ) else : payload [ "source" ] = source if alert_id : identifier = pathname2url ( alert_id ) payload [ "identifierType" ] = "id" elif alias : identifier = pathname2url ( alias ) payload [ "identifierType" ] = "alias" else : raise ValueError ( "Need one of alert_id or alias." ) if user : if len ( user ) > 100 : raise ValueError ( "User is too long, can't be over 100 chars." ) else : payload [ "user" ] = "user" data = self . _req ( "DELETE" , "v2/alerts/" + identifier , payload = payload ) return data
Delete an OpsGenie alert.
Delete an OpsGenie alert .
"""
        Delete an OpsGenie alert.

        Args
        - alert_id: Id of the alert that will be deleted.
        - alias: Alias of the alert will be deleted.
        - user: Default owner of the execution.
        - source: User defined field to specify source of delete action.

        Returns:
        - dict: Data from OpsGenie.

        Raises:
        - ValueError: If alert_id and alias are None.
        """
self
alert_id
alias
user
source