Application Packaging Standard

Last updated 18-Mar-2019

PCPNotificationManager

This type defines the platform built-in Notification Manager that exposes common operations on notifications for the provider control panel (PCP) as explained in the On-Screen Notifications in Provider Panel concepts.

Schema

The considered APS type (download) extends the Resource APS type(s) and looks as follows:

{
  "name": "PCPNotificationManager",
  "id": "http://www.parallels.com/pa/pa-core-services/pcp-notification-manager/1.0",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "access": {
    "global": true
  },
  "operations": {
    "getNotification": {
      "path": "/notifications/{notificationId}",
      "verb": "GET",
      "response": {
        "type": "RestPCPNotification"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "notificationId": {
          "kind": "path",
          "type": "integer"
        }
      }
    },
    "sendNotification": {
      "path": "/notifications",
      "verb": "POST",
      "response": {
        "type": "integer"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "message": {
          "kind": "body",
          "type": "RestPCPNotification"
        }
      }
    },
    "deleteNotification": {
      "path": "/notifications/{notificationId}",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "notificationId": {
          "kind": "path",
          "type": "integer"
        }
      }
    }
  },
  "structures": {
    "RestPCPNotification": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "required": true,
          "enumTitles": [
            "info",
            "warning",
            "error"
          ]
        },
        "message": {
          "type": "string",
          "required": true
        },
        "packageId": {
          "type": "string",
          "required": true
        },
        "keys": {
          "type": "object",
          "required": true
        }
      }
    }
  }
}

Custom Operations

OPERATION VERB PATH RETURNS Description
deleteNotification DELETE /notifications/{notificationId} If successful, this method returns the 200 OK standard status code. Delete the PCP notification specified by the ID.
getNotification GET /notifications/{notificationId} If successful, this method returns the RestPCPNotification structure in response body. Get PCP notification by its ID.
sendNotification POST /notifications If successful, this method returns the ID of the new notification in the response body. Create a PCP notification

deleteNotification

HTTP Request

DELETE /aps/2/resources/{aps-id}/notifications/{notificationId}

Description

Delete the PCP notification specified by the ID.

Parameters

PARAMETER TYPE DESCRIPTION
notificationId Integer Notification identifier

Returns

If successful, this method returns the 200 OK standard status code.

getNotification

HTTP Request

GET /aps/2/resources/{aps-id}/notifications/{notificationId}

Description

Get PCP notification by its ID.

Parameters

PARAMETER TYPE DESCRIPTION
notificationId Integer Id of notification

Returns

If successful, this method returns the RestPCPNotification structure in response body.

sendNotification

HTTP Request

POST /aps/2/resources/{aps-id}/notifications

Description

Create a PCP notification

Parameters

PARAMETER TYPE DESCRIPTION
message RestPCPNotification RestPCPNotification structure

Returns

If successful, this method returns the ID of the new notification in the response body.

Structures

RestPCPNotification

Defines the components of a notification.

NAME TYPE ATTRIBUTES DEFAULT DESCRIPTION
keys key-value pairs of String Required   A list of the keys and value pairs.
message String Required   The message to be displayed to the PCP. Messages are localized using APS localization mechanism. The message is translated in PO files contained inside the package of the source application.
packageId String Required   The ID of the source application package. It is necessary to find out the message translations.
type String Required   Specifies one of the notification types - {INFO, WARNING, ERROR}.

Examples

Since the considered APS type contains custom operations, refer to Custom Operations for the general explanation of their structure and examples of operation calls.