Profiles#
Manage Profiles API: create, list, update, publish/rollback drafts, and reassign/delete profiles for servers and agents.
get_profiles#
Code samples
# You can also use wget
curl -X GET https://PEM-SERVER-IP/pem/api/v17/profiles/ \
-H Accept: application/json \
-H X-Auth-Token: string
import requests
headers = {
Accept: application/json,
X-Auth-Token: string
}
r = requests.get(https://PEM-SERVER-IP/pem/api/v17/profiles/, headers = headers)
print(r.json())
const headers = {
Accept: "application/json",
"X-Auth-Token": "string",
};
fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/", {
method: "GET",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
GET /profiles/
List profiles
Returns a summary list of published profiles only. If a draft exists for
a published profile, the item shows that profile’s ID and ‘published’ is
false. The response does not include ‘target_probe_configs’ or
‘target_alert_configs’. Supports optional name-based filtering via
name (exact match) or name_contains (substring search) query
parameters.
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
X-Auth-Token |
header |
string |
true |
Token for authentication purpose |
name |
query |
string |
false |
Filter profiles by exact name match (case-sensitive). Mutually exclusive with name_contains. |
name_contains |
query |
string |
false |
Filter profiles by substring match (case-insensitive). Mutually exclusive with name. |
Example responses
[
{
"id": 34,
"name": "Production Agents",
"description": "Monitoring production agents",
"target_kind": "a",
"active_assignments": 0,
"published": true
}
]
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Successful response |
Inline |
|
400 |
Mutual-exclusivity violation: name (or analogous exact-match filter) and name_contains (or analogous substring filter) were both supplied in the same request. Filtering accepts only one of the pair. |
Inline |
Response Schema#
Status Code 200
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
_anonymous_ |
false |
none |
[A trimmed profile representation for list operations (no probe/alert config arrays).] |
|
» id |
integer |
false |
none |
none |
» name |
string |
false |
none |
none |
» description |
string |
false |
none |
none |
» target_kind |
string |
false |
none |
Target type for the profile: 's' for server, 'a' for agent. |
» published |
boolean |
false |
none |
Convenience flag: true when status is 'published'. |
» active_assignments |
integer |
false |
none |
Count of active servers/agents assigned to this profile. |
Enumerated Values#
Property |
Value |
|---|---|
target_kind |
s |
target_kind |
a |
Status Code 400
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» success |
integer |
false |
none |
none |
» errormsg |
string |
false |
none |
none |
Note
This operation does not require authentication
post_profiles#
Code samples
# You can also use wget
curl -X POST https://PEM-SERVER-IP/pem/api/v17/profiles/ \
-H Content-Type: application/json \
-H Accept: application/json \
-H X-Auth-Token: string
import requests
headers = {
Content-Type: application/json,
Accept: application/json,
X-Auth-Token: string
}
r = requests.post(https://PEM-SERVER-IP/pem/api/v17/profiles/, headers = headers)
print(r.json())
const inputBody = {
"name": "Production Servers",
"description": "Monitoring production database servers",
"target_kind": "s"
};
const headers = {
Content-Type:application/json,
Accept:application/json,
X-Auth-Token:string
};
fetch(https://PEM-SERVER-IP/pem/api/v17/profiles/,
{
method: POST,
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /profiles/
Create a new profile
Creates a new profile with the specified name (required), description (optional), and target_kind (optional, defaults to ‘s’ for server). Probes and auto-created alerts will be automatically created based on target_kind.
Body parameter
{
"name": "Production Servers",
"description": "Monitoring production database servers",
"target_kind": "s"
}
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
X-Auth-Token |
header |
string |
true |
Token for authorization |
body |
body |
object |
false |
none |
» name |
body |
string |
true |
Profile name (required) |
» description |
body |
string |
false |
Profile description (optional) |
» target_kind |
body |
string |
false |
Target kind: 's' for server, 'a' for agent (optional, defaults to 's') |
Enumerated Values#
Parameter |
Value |
|---|---|
» target_kind |
s |
» target_kind |
a |
Example responses
{
"success": 0,
"data": "string"
}
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Profile created successfully |
Inline |
|
400 |
Bad request - missing required field 'name' |
None |
|
500 |
Internal server error |
None |
Response Schema#
Status Code 200
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» success |
integer |
false |
none |
none |
» data |
string |
false |
none |
none |
Note
This operation does not require authentication
get_profiles{profile_id}#
Code samples
# You can also use wget
curl -X GET https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id} \
-H Accept: application/json \
-H X-Auth-Token: string
import requests
headers = {
Accept: application/json,
X-Auth-Token: string
}
r = requests.get(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}, headers = headers)
print(r.json())
const headers = {
Accept: "application/json",
"X-Auth-Token": "string",
};
fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}", {
method: "GET",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
GET /profiles/{profile_id}
Get a profile by id
Returns a single profile with full probe and alert configurations. The response includes a boolean ‘published’ field (true when the profile is published).
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
profile_id |
path |
integer |
true |
none |
X-Auth-Token |
header |
string |
true |
Token for authorization |
Example responses
{
"id": 0,
"name": "string",
"description": "string",
"target_kind": "s",
"published": true,
"parent_id": 0,
"draft_id": 0,
"target_probe_configs": [
{
"probe_id": 0,
"probe_name": "string",
"enabled": true,
"interval": 0,
"lifetime": 0,
"default_enabled": true,
"default_interval": 0,
"default_lifetime": 0,
"target_type": 0,
"force_enabled": true
}
],
"target_alert_configs": [
{
"id": 0,
"alert_name": "string",
"alert_template": 0,
"description": "string",
"enabled": true,
"history_retention": 0,
"frequency_min": 0,
"auto_created": true,
"template_id": "string",
"params": [],
"param_names": ["string"],
"param_types": "string",
"params_units": ["string"],
"threshold_unit": "string",
"operator": "string",
"low_threshold_value": 0,
"medium_threshold_value": 0,
"high_threshold_value": 0,
"send_email": true,
"all_alert_enable": true,
"email_group_id": 0,
"low_alert_enable": true,
"low_email_group_id": 0,
"med_alert_enable": true,
"med_email_group_id": 0,
"high_alert_enable": true,
"high_email_group_id": 0,
"send_trap": true,
"snmp_trap_version": 0,
"low_send_trap": true,
"med_send_trap": true,
"high_send_trap": true,
"cleared_alert_enable": true,
"execute_script": true,
"execute_script_on_clear": true,
"execute_script_on_pem_server": true,
"script_code": "string",
"submit_to_nagios": true,
"override_default_config": true,
"send_notification": true,
"low_webhook_ids": [0],
"med_webhook_ids": [0],
"high_webhook_ids": [0],
"cleared_webhook_ids": [0]
}
]
}
Profile not found
{
"message": "Not found"
}
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Successful response |
||
404 |
Profile not found |
Inline |
Response Schema#
Status Code 404
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» message |
string |
false |
none |
none |
Note
This operation does not require authentication
put_profiles{profile_id}#
Code samples
# You can also use wget
curl -X PUT https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id} \
-H Content-Type: application/json \
-H Accept: application/json \
-H X-Auth-Token: string
import requests
headers = {
Content-Type: application/json,
Accept: application/json,
X-Auth-Token: string
}
r = requests.put(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}, headers = headers)
print(r.json())
const inputBody = {
"name": "Production Servers (v2)",
"description": "Tightened thresholds and probe intervals.",
"target_probe_configs": {
"changed": [
{
"probe_id": 7,
"execution_frequency": 5,
"lifetime": 60
},
{
"probe_id": 15,
"enabled": true,
"execution_frequency": 10,
"lifetime": 30
}
]
},
"target_alert_configs": {
"changed": [
{
"id": 101,
"enabled": true,
"frequency_min": 2
},
{
"id": 102,
"operator": ">",
"low_threshold_value": 70,
"medium_threshold_value": 85,
"high_threshold_value": 95
}
],
"added": [
{
"alert_name": "Replication Lag",
"alert_template": 18,
"enabled": true,
"history_retention": 30,
"frequency_min": 5,
"operator": ">",
"medium_threshold_value": 60,
"high_threshold_value": 120
}
],
"deleted": [
{
"id": 103
}
]
}
};
const headers = {
Content-Type:application/json,
Accept:application/json,
X-Auth-Token:string
};
fetch(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id},
{
method: PUT,
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
PUT /profiles/{profile_id}
Update a profile by id
Update a single profile identified by ‘profile_id’. Use ‘name’/‘description’ for metadata. For probes, use ‘target_probe_configs.changed’ to modify existing probe configs only (keys: probe_id, enabled?, enabled_by_default?, execution_frequency?, lifetime?; also accepts legacy ‘use_default_enabled’ and ‘interval’). Adding probes via this endpoint is not supported. For alerts, use ‘target_alert_configs’ with changed/added/deleted (deleted accepts objects with only ‘id’).
Body parameter
{
"name": "Production Servers (v2)",
"description": "Tightened thresholds and probe intervals.",
"target_probe_configs": {
"changed": [
{
"probe_id": 7,
"execution_frequency": 5,
"lifetime": 60
},
{
"probe_id": 15,
"enabled": true,
"execution_frequency": 10,
"lifetime": 30
}
]
},
"target_alert_configs": {
"changed": [
{
"id": 101,
"enabled": true,
"frequency_min": 2
},
{
"id": 102,
"operator": ">",
"low_threshold_value": 70,
"medium_threshold_value": 85,
"high_threshold_value": 95
}
],
"added": [
{
"alert_name": "Replication Lag",
"alert_template": 18,
"enabled": true,
"history_retention": 30,
"frequency_min": 5,
"operator": ">",
"medium_threshold_value": 60,
"high_threshold_value": 120
}
],
"deleted": [
{
"id": 103
}
]
}
}
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
profile_id |
path |
integer |
true |
none |
X-Auth-Token |
header |
string |
true |
Token for authorization |
body |
body |
object |
true |
none |
» name |
body |
string |
false |
New name for the profile (optional). |
» description |
body |
string |
false |
New description/notes for the profile (optional). |
» target_probe_configs |
body |
false |
Delta for probe configs when updating by profile id: only modify existing probes using 'changed'. Adding probes is not supported via this endpoint. |
|
»» changed |
body |
false |
Existing probe configs to modify (identified by probe_id). |
|
»»» probe_id |
body |
integer |
true |
Probe identifier to add/update. |
»»» enabled |
body |
boolean |
false |
Enable/disable this probe in the profile. |
»»» enabled_by_default |
body |
boolean |
false |
Whether the probe follows default enablement. Alias: 'use_default_enabled' accepted. |
»»» execution_frequency |
body |
integer |
false |
Probe execution frequency in minutes. Alias: 'interval' accepted. |
»»» lifetime |
body |
integer |
false |
History retention (days). |
» target_alert_configs |
body |
false |
Delta for alert configs within a profile. |
|
»» changed |
body |
[allOf] |
false |
Modify existing alerts. |
»»» id |
body |
integer |
false |
Alert ID to modify. |
»»» name |
body |
string |
false |
Alert name. |
»»» enabled |
body |
boolean |
false |
none |
»»» history_retention |
body |
integer |
false |
none |
»»» frequency_min |
body |
integer |
false |
none |
»»» operator |
body |
string |
false |
none |
»»» low_threshold_value |
body |
number |
false |
none |
»»» medium_threshold_value |
body |
number |
false |
none |
»»» high_threshold_value |
body |
number |
false |
none |
»»» all_alert_enable |
body |
boolean |
false |
none |
»»» email_group_id |
body |
integer |
false |
none |
»»» low_alert_enable |
body |
boolean |
false |
none |
»»» low_email_group_id |
body |
integer |
false |
none |
»»» med_alert_enable |
body |
boolean |
false |
none |
»»» med_email_group_id |
body |
integer |
false |
none |
»»» high_alert_enable |
body |
boolean |
false |
none |
»»» high_email_group_id |
body |
integer |
false |
none |
»» added |
body |
false |
Add new alerts. See AlertPayload for required fields. |
|
»»» alert_name |
body |
string |
false |
Name of the alert. NOTE: This property is a mandatory parameter for a POST request. |
»»» alert_template |
body |
integer |
false |
ID of the alert template. The ID must be a positive integer value. NOTE: This property is a mandatory parameter for a POST request. |
»»» description |
body |
string |
false |
none |
»»» enabled |
body |
boolean |
false |
Defines whether this alert is enabled/disabled. NOTE: This property is a mandatory parameter for a POST request. |
»»» history_retention |
body |
integer |
false |
Specifies how many days to keep the history of this alert. Possible values are from 1 to 99999. NOTE: This property is a mandatory parameter for a POST request. |
»»» frequency_min |
body |
integer |
false |
Defines how frequently (in minutes) the alert must be checked on PEM database server. Possible values are 1 to 65534. NOTE: This property is a mandatory parameter for a POST request. |
»»» operator |
body |
string |
false |
Defines the operator for checking threshold values. Valid string are ">" and "<". NOTE: This property is a mandatory parameter for the POST request. |
»»» low_threshold_value |
body |
number |
false |
Threshold value for triggering the low alert. This property can be any valid integer/float value. NOTE: It is a mandatory parameter for a POST request. |
»»» medium_threshold_value |
body |
number |
false |
Threshold value for triggering the medium alert. This property can be any valid integer/float value. NOTE: It is a mandatory parameter for a POST request. |
»»» high_threshold_value |
body |
number |
false |
Threshold value for triggering the high alert. This property can be any valid integer/float value. NOTE: It is a mandatory parameter for a POST request. |
»»» all_alert_enable |
body |
boolean |
false |
Determines whether to send an email notification to the group specified by the parameter 'email_group_id' when the state of the alert changes. |
»»» email_group_id |
body |
integer |
false |
Defines the email group to which email notification are sent, when the state of the alert changes. |
»»» low_alert_enable |
body |
boolean |
false |
Determines whether to send an email notification to the group specified by the parameter 'low_email_group_id' when the state of the alert is set to LOW. |
»»» low_email_group_id |
body |
integer |
false |
Defines the email group to which email notifications are sent when the state of the alert changes to LOW. |
»»» med_alert_enable |
body |
boolean |
false |
Determines whether to send an email notification to the group specified by the parameter 'medium_email_group_id' when the state of the alert is set to MEDIUM. |
»»» med_email_group_id |
body |
integer |
false |
Defines the email group to which email notifications are sent when the state of the alert changes to MEDIUM. |
»»» high_alert_enable |
body |
boolean |
false |
Determines whether to send an email notification to the group specified by the parameter 'high_email_group_id' when the state of the alert is set to HIGH. |
»»» high_email_group_id |
body |
integer |
false |
Defines the email group to which email notification are sent when the state of the alert changes to HIGH. |
»»» send_trap |
body |
boolean |
false |
Determines whether to send an SNMP trap notification when the state of the alert changes. |
»»» snmp_trap_version |
body |
integer |
false |
Defines the SNMP trap version. Supported SNMP trap versions are 1, 2 or 3. |
»»» low_send_trap |
body |
boolean |
false |
Determines whether to send SNMP trap notifications when the state of the alert changes to LOW. |
»»» med_send_trap |
body |
boolean |
false |
Determines whether to send SNMP trap notifications when the state of the alert changes to MEDIUM. |
»»» high_send_trap |
body |
boolean |
false |
Determines whether to send SNMP trap notifications when the state of the alert chagnes to HIGH. |
»»» cleared_alert_enable |
body |
boolean |
false |
Determines whether to mute the notification for 'clear alert'. |
»»» params |
body |
false |
List of parameter/value pairs to be used by the alert template for checking alerts. NOTE: The alert template requires the all parameter to be defined. |
|
»»»» paramname |
body |
string |
false |
Name of the parameter. NOTE: This property must present on the alert template parameter list.Example: |
»»»» paramvalue |
body |
string |
false |
Value for the given parameter |
»»» execute_script |
body |
boolean |
false |
Determines whether to execute the provided script if the state of the alert changes to LOW/MEDIUM/HIGH. |
»»» execute_script_on_clear |
body |
boolean |
false |
Determines whether to execute the provided script if the state of the alert clears. |
»»» execute_script_on_pem_server |
body |
boolean |
false |
Determines whether to execute the provided script on the PEM host or the host where the agent is monitoring the object. |
»»» script_code |
body |
string |
false |
The shell or batch script to be executed. Please read the documentation for detailed information. |
»»» submit_to_nagios |
body |
boolean |
false |
Defines whether to send notification to the nagios, when state of the alert is chagned. |
»»» override_default_config |
body |
boolean |
false |
Determines whether to override the default webhook configuration. |
»»» send_notification |
body |
boolean |
false |
Determines whether the webhook send notification is enabled. |
»»» low_webhook_ids |
body |
[integer] |
false |
Defines webhook IDs for which low alerts can be configured. |
»»» med_webhook_ids |
body |
[integer] |
false |
Defines webhook IDs for which medium alerts can be configured. |
»»» high_webhook_ids |
body |
[integer] |
false |
Defines webhook IDs for which high alerts can be configured. |
»»» cleared_webhook_ids |
body |
[integer] |
false |
Defines webhook IDs for which cleared alerts can be configured. |
»» deleted |
body |
false |
Delete existing alerts by id. |
|
»»» id |
body |
integer |
true |
Alert config id to delete. |
Enumerated Values#
Parameter |
Value |
|---|---|
»»» operator |
> |
»»» operator |
< |
»»»» paramname |
Exclude tables smaller than |
»»»» paramname |
mount point |
»»»» paramname |
Host IP Address |
»»»» paramname |
Time interval to monitor |
»»»» paramname |
Time since idle |
»»»» paramname |
Per CPU utilization (K%) |
Example responses
{
"message": "Invalid JSON body"
}
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Profile updated successfully |
None |
|
400 |
Invalid JSON body |
None |
Response Schema#
Note
This operation does not require authentication
delete_profiles{profile_id}#
Code samples
# You can also use wget
curl -X DELETE https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id} \
-H X-Auth-Token: string
import requests
headers = {
X-Auth-Token: string
}
r = requests.delete(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}, headers = headers)
print(r.json())
const headers = {
"X-Auth-Token": "string",
};
fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}", {
method: "DELETE",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
DELETE /profiles/{profile_id}
Delete a profile
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
profile_id |
path |
integer |
true |
none |
X-Auth-Token |
header |
string |
true |
Token for authorization |
Example responses
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Profile deleted successfully |
None |
Response Schema#
Note
This operation does not require authentication
get_profiles{profile_id}_assigned#
Code samples
# You can also use wget
curl -X GET https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/assigned \
-H Accept: application/json \
-H X-Auth-Token: string
import requests
headers = {
Accept: application/json,
X-Auth-Token: string
}
r = requests.get(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/assigned, headers = headers)
print(r.json())
const headers = {
Accept: "application/json",
"X-Auth-Token": "string",
};
fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/assigned", {
method: "GET",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
GET /profiles/{profile_id}/assigned
Get servers and agents assigned to a profile
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
profile_id |
path |
integer |
true |
none |
X-Auth-Token |
header |
string |
true |
Token for authorization |
Example responses
{
"servers": ["string"],
"agents": ["string"]
}
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Successful response |
Inline |
Response Schema#
Status Code 200
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» servers |
[string] |
false |
none |
none |
» agents |
[string] |
false |
none |
none |
Note
This operation does not require authentication
get_profiles{profile_id}_draft#
Code samples
# You can also use wget
curl -X GET https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/draft \
-H Accept: application/json \
-H X-Auth-Token: string
import requests
headers = {
Accept: application/json,
X-Auth-Token: string
}
r = requests.get(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/draft, headers = headers)
print(r.json())
const headers = {
Accept: "application/json",
"X-Auth-Token": "string",
};
fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/draft", {
method: "GET",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
GET /profiles/{profile_id}/draft
Get a draft by profile id
Returns the draft profile associated with the given published profile id, including full probe and alert configurations. The response does not include parent_id or draft_id fields.
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
profile_id |
path |
integer |
true |
none |
X-Auth-Token |
header |
string |
true |
Token for authorization |
Example responses
{
"id": 0,
"name": "string",
"description": "string",
"target_kind": "s",
"published": true,
"target_probe_configs": [
{
"probe_id": 0,
"probe_name": "string",
"enabled": true,
"interval": 0,
"lifetime": 0,
"default_enabled": true,
"default_interval": 0,
"default_lifetime": 0,
"target_type": 0,
"force_enabled": true
}
],
"target_alert_configs": [
{
"id": 0,
"alert_name": "string",
"alert_template": 0,
"description": "string",
"enabled": true,
"history_retention": 0,
"frequency_min": 0,
"auto_created": true,
"template_id": "string",
"params": [],
"param_names": ["string"],
"param_types": "string",
"params_units": ["string"],
"threshold_unit": "string",
"operator": "string",
"low_threshold_value": 0,
"medium_threshold_value": 0,
"high_threshold_value": 0,
"send_email": true,
"all_alert_enable": true,
"email_group_id": 0,
"low_alert_enable": true,
"low_email_group_id": 0,
"med_alert_enable": true,
"med_email_group_id": 0,
"high_alert_enable": true,
"high_email_group_id": 0,
"send_trap": true,
"snmp_trap_version": 0,
"low_send_trap": true,
"med_send_trap": true,
"high_send_trap": true,
"cleared_alert_enable": true,
"execute_script": true,
"execute_script_on_clear": true,
"execute_script_on_pem_server": true,
"script_code": "string",
"submit_to_nagios": true,
"override_default_config": true,
"send_notification": true,
"low_webhook_ids": [0],
"med_webhook_ids": [0],
"high_webhook_ids": [0],
"cleared_webhook_ids": [0]
}
]
}
Draft not found for profile
{
"message": "Not found"
}
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Successful response |
||
404 |
Draft not found for profile |
Inline |
Response Schema#
Status Code 404
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» message |
string |
false |
none |
none |
Note
This operation does not require authentication
delete_profiles{profile_id}_rollback#
Code samples
# You can also use wget
curl -X DELETE https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/rollback \
-H X-Auth-Token: string
import requests
headers = {
X-Auth-Token: string
}
r = requests.delete(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/rollback, headers = headers)
print(r.json())
const headers = {
"X-Auth-Token": "string",
};
fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/rollback", {
method: "DELETE",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
DELETE /profiles/{profile_id}/rollback
Rollback draft for a profile
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
profile_id |
path |
integer |
true |
none |
X-Auth-Token |
header |
string |
true |
Token for authorization |
Example responses
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Draft deleted or no draft available |
None |
Response Schema#
Note
This operation does not require authentication
post_profiles{profile_id}_publish#
Code samples
# You can also use wget
curl -X POST https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/publish \
-H Accept: application/json \
-H X-Auth-Token: string
import requests
headers = {
Accept: application/json,
X-Auth-Token: string
}
r = requests.post(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/publish, headers = headers)
print(r.json())
const headers = {
Accept: "application/json",
"X-Auth-Token": "string",
};
fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/publish", {
method: "POST",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
POST /profiles/{profile_id}/publish
Publish a profile
Publishes the draft for the given profile if present. Returns a message indicating the profile is already published when no draft exists.
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
profile_id |
path |
integer |
true |
none |
X-Auth-Token |
header |
string |
true |
Token for authorization |
Example responses
{
"message": "Not found"
}
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Profile published successfully or already published |
None |
|
404 |
Profile not found |
Inline |
Response Schema#
Status Code 404
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» message |
string |
false |
none |
none |
Note
This operation does not require authentication
post_profiles{source_id}_clone#
Code samples
# You can also use wget
curl -X POST https://PEM-SERVER-IP/pem/api/v17/profiles/{source_id}/clone \
-H Content-Type: application/json \
-H Accept: application/json \
-H X-Auth-Token: string
import requests
headers = {
Content-Type: application/json,
Accept: application/json,
X-Auth-Token: string
}
r = requests.post(https://PEM-SERVER-IP/pem/api/v17/profiles/{source_id}/clone, headers = headers)
print(r.json())
const inputBody = "{}";
const headers = {
"Content-Type": "application/json",
Accept: "application/json",
"X-Auth-Token": "string",
};
fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{source_id}/clone", {
method: "POST",
body: inputBody,
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
POST /profiles/{source_id}/clone
Clone an existing profile
Creates a new published profile by copying every probe and alert configuration from the source. The source must be a published profile; cloning a draft is rejected with 400. The clone is independent of the source (parent_id is NULL, status is ‘published’, no active assignments). All notification-channel IDs (email groups, webhook IDs, SNMP trap fields) are copied verbatim because clone happens inside one PEM instance. Auto-created alerts are copied and remain non-deletable on the clone. When ‘name’ is omitted, the server generates ‘Copy of ’ and appends ’ (2)‘,’ (3)’, … until the name is unique among published profiles.
Body parameter
{}
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
source_id |
path |
integer |
true |
Id of the published profile to clone. |
X-Auth-Token |
header |
string |
true |
Token for authorization |
body |
body |
object |
false |
none |
» name |
body |
string |
false |
Optional. Name for the clone. Must be unique among published profiles or the request returns 409. If omitted, the server generates 'Copy of <source />' with conflict-avoidance. |
» description |
body |
string |
false |
Optional. Description for the clone. If omitted, the source's description is copied. An explicit empty string clears the description. |
Example responses
{
"success": 1,
"data": {
"id": 42,
"name": "Copy of Production Servers",
"target_kind": "s",
"description": "Monitoring production database servers"
}
}
Bad request. The source is a draft (cannot be cloned), the supplied name is empty, the auto-generated name has been exhausted, or ‘name’/‘description’ is not a string.
{
"errormsg": "Cannot clone a draft profile. Publish or rollback the draft first."
}
Source profile not found.
{
"message": "Profile 999 does not exist."
}
409 Response
{
"message": "string"
}
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Profile cloned successfully. |
Inline |
|
400 |
Bad request. The source is a draft (cannot be cloned), the supplied name is empty, the auto-generated name has been exhausted, or 'name'/'description' is not a string. |
Inline |
|
404 |
Source profile not found. |
Inline |
|
409 |
The user-supplied 'name' conflicts with an existing published profile. |
Inline |
|
500 |
Internal server error. |
None |
Response Schema#
Status Code 200
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» success |
integer |
false |
none |
none |
» data |
object |
false |
none |
none |
»» id |
integer |
false |
none |
Id of the new profile. |
»» name |
string |
false |
none |
none |
»» target_kind |
string |
false |
none |
Preserved from the source. Cannot be changed at clone time. |
»» description |
string¦null |
false |
none |
none |
Enumerated Values#
Property |
Value |
|---|---|
target_kind |
s |
target_kind |
a |
Status Code 400
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» errormsg |
string |
false |
none |
none |
Status Code 404
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» message |
string |
false |
none |
none |
Status Code 409
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» message |
string |
false |
none |
none |
Note
This operation does not require authentication
delete_profiles{profile_id}_{new_profile_id}#
Code samples
# You can also use wget
curl -X DELETE https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/{new_profile_id} \
-H X-Auth-Token: string
import requests
headers = {
X-Auth-Token: string
}
r = requests.delete(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/{new_profile_id}, headers = headers)
print(r.json())
const headers = {
"X-Auth-Token": "string",
};
fetch(
"https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/{new_profile_id}",
{
method: "DELETE",
headers: headers,
},
)
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
DELETE /profiles/{profile_id}/{new_profile_id}
Delete a profile and reassign to new profile
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
profile_id |
path |
integer |
true |
none |
new_profile_id |
path |
integer |
true |
none |
X-Auth-Token |
header |
string |
true |
Token for authorization |
Example responses
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Profile deleted and reassigned successfully |
None |
Response Schema#
Note
This operation does not require authentication
post_profile_export#
Code samples
# You can also use wget
curl -X POST https://PEM-SERVER-IP/pem/api/v17/profile/export/ \
-H Content-Type: application/json \
-H Accept: application/json \
-H X-Auth-Token: string
import requests
headers = {
Content-Type: application/json,
Accept: application/json,
X-Auth-Token: string
}
r = requests.post(https://PEM-SERVER-IP/pem/api/v17/profile/export/, headers = headers)
print(r.json())
const inputBody = {
"profiles": [
0
]
};
const headers = {
Content-Type:application/json,
Accept:application/json,
X-Auth-Token:string
};
fetch(https://PEM-SERVER-IP/pem/api/v17/profile/export/,
{
method: POST,
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /profile/export/
Export profiles to a JSON bundle
Returns the requested profiles serialised as a .pemprf JSON bundle.
Selecting a draft transparently resolves to its published parent. All
email / SNMP / webhook / Nagios channel configuration is stripped on
export — routing IDs (email_group_id , *_email_group_id ,
*_webhook_ids , snmp_trap_version , *_send_trap ) and enable
flags (send_email , send_trap , submit_to_nagios ,
cleared_alert_enable , send_notification ,
override_default_config ) — the recipient instance opts in
per-channel via the UI post-import. Script execution (execute_script
, execute_script_on_clear , execute_script_on_pem_server , and
the script_code body) IS preserved; treat .pemprf files as
sensitive because script_code may contain credentials or
env-specific paths.
Body parameter
{
"profiles": [0]
}
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
X-Auth-Token |
header |
string |
true |
Token for authorization |
body |
body |
object |
true |
none |
» profiles |
body |
[integer] |
true |
Profile IDs to export. |
Example responses
{
"version": 0,
"profiles": [{}]
}
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Export bundle (application/json). |
Inline |
|
400 |
No profiles to export, profile id not found, orphan draft, or resolved profile is not published. |
None |
|
401 |
User lacks pem_manage_profile role. |
None |
Response Schema#
Status Code 200
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» version |
integer |
false |
none |
Export file format version. |
» profiles |
[object] |
false |
none |
none |
Note
This operation does not require authentication
post_profile_import#
Code samples
# You can also use wget
curl -X POST https://PEM-SERVER-IP/pem/api/v17/profile/import/ \
-H Content-Type: application/json \
-H Accept: application/json \
-H X-Auth-Token: string
import requests
headers = {
Content-Type: application/json,
Accept: application/json,
X-Auth-Token: string
}
r = requests.post(https://PEM-SERVER-IP/pem/api/v17/profile/import/, headers = headers)
print(r.json())
const inputBody = {
"version": 0,
"profiles": [
{}
],
"skip_overwrite": true
};
const headers = {
Content-Type:application/json,
Accept:application/json,
X-Auth-Token:string
};
fetch(https://PEM-SERVER-IP/pem/api/v17/profile/import/,
{
method: POST,
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /profile/import/
Import previously exported profiles
Each profile in the file is processed independently. New names land as
published; name conflicts default to Skipped (skip_overwrite=true)
or replace the existing profile’s configs as a DRAFT
(skip_overwrite=false) — the user clicks Apply in the UI to publish. The
response carries one result per profile: status is Success ,
Skipped , or Failed , with msg describing partial-skip
details (missing probe/template references).
Body parameter
{
"version": 0,
"profiles": [{}],
"skip_overwrite": true
}
Parameters#
Name |
In |
Type |
Required |
Description |
|---|---|---|---|---|
X-Auth-Token |
header |
string |
true |
Token for authorization |
body |
body |
object |
true |
none |
» version |
body |
integer |
true |
Export file format version. Must be supported by the target server. |
» profiles |
body |
[object] |
true |
none |
» skip_overwrite |
body |
boolean |
true |
When true, name conflicts produce Skipped. When false, the importer creates a draft on the existing profile (review and Apply to publish). |
Example responses
{
"success": 0,
"result": [
{
"name": "string",
"status": "Success",
"msg": "string"
}
]
}
Responses#
Status |
Meaning |
Description |
Schema |
|---|---|---|---|
200 |
Per-profile import results. |
Inline |
|
400 |
Malformed payload, missing skip_overwrite, or unsupported version. |
None |
|
401 |
User lacks pem_manage_profile role. |
None |
Response Schema#
Status Code 200
Name |
Type |
Required |
Restrictions |
Description |
|---|---|---|---|---|
» success |
integer |
false |
none |
none |
» result |
[object] |
false |
none |
none |
»» name |
string |
false |
none |
none |
»» status |
string |
false |
none |
none |
»» msg |
string¦null |
false |
none |
none |
Enumerated Values#
Property |
Value |
|---|---|
status |
Success |
status |
Skipped |
status |
Failed |
Note
This operation does not require authentication