Пример #1
0
def notification(value, name):
    """
    Validates a given notification exits
    :param value:
    :param name:
    :return:
    """
    n = service.get(value)
    if not n:
        raise ValueError("Unable to find notification specified")
    return n
Пример #2
0
def notification(value, name):
    """
    Validates a given notification exits
    :param value:
    :param name:
    :return:
    """
    n = service.get(value)
    if not n:
        raise ValueError("Unable to find notification specified")
    return n
Пример #3
0
    def get(self, notification_id):
        """
        .. http:get:: /notifications/1

           Get a specific account

           **Example request**:

           .. sourcecode:: http

              GET /notifications/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                "description": "a test",
                "options": [
                    {
                        "name": "interval",
                        "required": true,
                        "value": 5,
                        "helpMessage": "Number of days to be alert before expiration.",
                        "validation": "^\\d+$",
                        "type": "int"
                    },
                    {
                        "available": [
                            "days",
                            "weeks",
                            "months"
                        ],
                        "name": "unit",
                        "required": true,
                        "value": "weeks",
                        "helpMessage": "Interval unit",
                        "validation": "",
                        "type": "select"
                    },
                    {
                        "name": "recipients",
                        "required": true,
                        "value": "[email protected],[email protected]",
                        "helpMessage": "Comma delimited list of email addresses",
                        "validation": "^([\\w+-.%]+@[\\w-.]+\\.[A-Za-z]{2,4},?)+$",
                        "type": "str"
                    }
                ],
                "label": "test",
                "pluginName": "email-notification",
                "active": true,
                "id": 2
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
        """
        return service.get(notification_id)
Пример #4
0
    def get(self, notification_id):
        """
        .. http:get:: /notifications/1

           Get a specific account

           **Example request**:

           .. sourcecode:: http

              GET /notifications/1 HTTP/1.1
              Host: example.com
              Accept: application/json, text/javascript

           **Example response**:

           .. sourcecode:: http

              HTTP/1.1 200 OK
              Vary: Accept
              Content-Type: text/javascript

              {
                "description": "a test",
                "notificationOptions": [
                    {
                        "name": "interval",
                        "required": true,
                        "value": 5,
                        "helpMessage": "Number of days to be alert before expiration.",
                        "validation": "^\\d+$",
                        "type": "int"
                    },
                    {
                        "available": [
                            "days",
                            "weeks",
                            "months"
                        ],
                        "name": "unit",
                        "required": true,
                        "value": "weeks",
                        "helpMessage": "Interval unit",
                        "validation": "",
                        "type": "select"
                    },
                    {
                        "name": "recipients",
                        "required": true,
                        "value": "[email protected],[email protected]",
                        "helpMessage": "Comma delimited list of email addresses",
                        "validation": "^([\\w+-.%]+@[\\w-.]+\\.[A-Za-z]{2,4},?)+$",
                        "type": "str"
                    }
                ],
                "label": "test",
                "pluginName": "email-notification",
                "active": true,
                "id": 2
              }

           :reqheader Authorization: OAuth token to authenticate
           :statuscode 200: no error
        """
        return service.get(notification_id)