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.
In this document:
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
}
}
}
}
}
The APS type is used to create a singleton APS resource exposing its operations for API calls. The call syntax depends on the operation. For example, a call of an operation that accepts input parameters both in the URL string and in the body looks as follows:
POST /aps/2/services/pcp-notification-manager/<operation-path>?<query-params>
{/*<body params>*/}
In the above call, the verb can be either GET, PUT, POST, or DELETE as specified in the definition of the operation.
OPERATION |
VERB |
PATH |
RETURNS |
Description |
---|---|---|---|---|
GET |
/notifications/{notificationId} |
If successful, this method returns the RestPCPNotification structure in response body. |
Get PCP notification by its ID. |
|
POST |
/notifications |
If successful, this method returns the ID of the new notification in the response body. |
Create a PCP notification |
|
DELETE |
/notifications/{notificationId} |
If successful, this method returns the 200 OK standard status code. |
Delete the PCP notification specified by the ID. |
HTTP Request
GET /aps/2/services/pcp-notification-manager/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.
HTTP Request
POST /aps/2/services/pcp-notification-manager/notifications
Description
Create a PCP notification
Parameters
PARAMETER |
TYPE |
DESCRIPTION |
---|---|---|
message |
RestPCPNotification structure |
Returns
If successful, this method returns the ID of the new notification in the response body.
HTTP Request
DELETE /aps/2/services/pcp-notification-manager/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.
Defines the components of a notification.
NAME |
TYPE |
ATTRIBUTES |
DEFAULT |
DESCRIPTION |
---|---|---|---|---|
type |
String |
Required |
Specifies one of the notification types - {INFO, WARNING, ERROR}. |
|
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. |
|
keys |
Object |
Required |
A list of the keys and value pairs. |
The On-Screen Notifications in Provider Panel explains the concepts and provides examples on the APS type implementation.