Add Ports

Adds a Port to a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: addPortsMonitoringPolicy
# Language: Perl
#
# Description: this function adds ports to monitoring policy
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
use JSON;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _addPortsMonitoringPolicy
{
	my ($id, $content) = @_;
	my $_command = $url ."/monitoring_policies/" .$id ."/ports";
	my $_method = 'POST';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Add additional parameters
	$request->content($content);

	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}			
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my @ports = [{"protocol" => "TCP", "port" => 22, "alert_if" => "RESPONDING", "email_notification" => JSON::true()}];

my %_query = ("ports" => @ports);
my $query = encode_json \%_query;

#Add ports
print _addPortsMonitoringPolicy($id, $query);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: addPortsMonitoringPolicy
# Language: PHP
#
# Description: this function adds ports to monitoring policy
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function addPortsMonitoringPolicy($id, $data){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/ports";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "POST");

	//Add parameters
	curl_setopt($request, CURLOPT_POSTFIELDS, $data);
	
	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$ports = array(array("protocol"=>"TCP", "port"=>22, "alert_if"=>"NOT_RESPONDING", "email_notification"=>true),
			   array("protocol"=>"TCP", "port"=>80, "alert_if"=>"NOT_RESPONDING", "email_notification"=>true));
					
$data = array('ports'=>$ports);
$data = json_encode($data);

echo addPortsMonitoringPolicy($id, $data);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: addPortsMonitoringPolicy
# Language: Python
#
# Description: this function adds ports to monitoring policy
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _addPortsMonitoringPolicy(id, content):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/ports"
    _method = 'POST'
    request = Request(_command, data=content.encode(encoding='utf_8'), 
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
ports = [{"protocol":"TCP", "port":80, "alert_if":"RESPONDING", "email_notification": True}]

data = json.dumps({'ports':ports})

#Add ports monitoring policy
print(_addPortsMonitoringPolicy(id, data))

Add Processes

Adds a Process to a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: addProcessesMonitoringPolicy
# Language: Perl
#
# Description: this function adds processes to monitoring policy
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
use JSON;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _addProcessesMonitoringPolicy
{
	my ($id, $content) = @_;
	my $_command = $url ."/monitoring_policies/" .$id ."/processes";
	my $_method = 'POST';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Add additional parameters
	$request->content($content);

	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}			
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my @processes = [{"process" => "process", "alert_if" => "RUNNING", "email_notification" => JSON::true()}];

my %_query = ("processes" => @processes);
my $query = encode_json \%_query;

#Add process
print _addProcessesMonitoringPolicy($id, $query);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: addProcessesMonitoringPolicy
# Language: PHP
#
# Description: this function adds processes to monitoring policy
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function addProcessesMonitoringPolicy($id, $data){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/processes";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "POST");

	//Add parameters
	curl_setopt($request, CURLOPT_POSTFIELDS, $data);
	
	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$processes = array(array("process"=>"test", "alert_if"=>"NOT_RUNNING", "email_notification"=>true),
			       array("process"=>"taskManager", "alert_if"=>"RUNNING", "email_notification"=>true));
					
$data = array('processes'=>$processes);
$data = json_encode($data);

echo addProcessesMonitoringPolicy($id, $data);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: addProcessesMonitoringPolicy
# Language: Python
#
# Description: this function adds processes to monitoring policy
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _addProcessesMonitoringPolicy(id, content):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/processes"
    _method = 'POST'
    request = Request(_command, data=content.encode(encoding='utf_8'), 
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
processes = [{"process":"iexplorer", "alert_if":"RUNNING", "email_notification": True}]

data = json.dumps({'processes':processes})

#Add processes monitoring policy
print(_addProcessesMonitoringPolicy(id, data))

Add Servers

Add a Server to a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: addServersMonitoringPolicy
# Language: Perl
#
# Description: this function assigns servers to monitoring policy
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
use JSON;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _addServersMonitoringPolicy
{
	my ($id, $content) = @_;
	my $_command = $url ."/monitoring_policies/" .$id ."/servers";
	my $_method = 'POST';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Add additional parameters
	$request->content($content);

	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}			
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my @_servers = ["{YOUR_SERVER_ID}"]; # e.g.: ["5340033E7FBBC308BC329414A0DF3C20"]

my %_query = ("servers" => @_servers);
my $query = encode_json \%_query;

#Add servers 
print _addServersMonitoringPolicy($id, $query);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: addServersMonitoringPolicy
# Language: PHP
#
# Description: this function assigns servers to monitoring policy
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function addServersMonitoringPolicy($id, $data){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/servers";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "POST");

	//Add parameters
	curl_setopt($request, CURLOPT_POSTFIELDS, $data);
	
	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$servers = array("{YOUR_SERVER_ID}"); # e.g.: array("5340033E7FBBC308BC329414A0DF3C20")
					
$data = array('servers'=>$servers);
$data = json_encode($data);

echo addServersMonitoringPolicy($id, $data);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: addServersMonitoringPolicy
# Language: Python
#
# Description: this function assigns servers to monitoring policy
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _addServersMonitoringPolicy(id, content):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/servers"
    _method = 'POST'
    request = Request(_command, data=content.encode(encoding='utf_8'), 
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
servers = ["{YOUR_SERVER_ID}"] # e.g.: ["5340033E7FBBC308BC329414A0DF3C20"] 

data = json.dumps({'servers':servers})

#Add servers
print(_addServersMonitoringPolicy(id, data))

Create

Creates a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: createMonitoringPolicy
# Language: Perl
#
# Description: this function creates a new monitoring policy
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
use JSON;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _createMonitoringPolicy
{
	my ($content) = @_;
	my $_command = $url ."/monitoring_policies";
	my $_method = 'POST';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Add additional parameters
	$request->content($content);

	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}			
}

#Parameters
my $name = "My monitoring policy API";
my $agent = JSON::true();
my $email = "";
my $thresholds = {"cpu" => {"warning" => {"value" => 90, "alert" => "false"}, "critical" => {"value" => 95, "alert" => "true"}},
                  "ram" => {"warning" => {"value" => 90, "alert" => "true"}, "critical" => {"value" => 95, "alert" => "true"}},
                  "disk" => {"warning" => {"value" => 80, "alert" => "true"}, "critical" => {"value" => 90, "alert" => "true"}},
                  "transfer" => {"warning" => {"value" => 100, "alert" => "true"}, "critical" => {"value" => 2000, "alert" => "true"}},
                  "internal_ping" => {"warning" => {"value" => 50, "alert" => "true"}, "critical" => {"value" => 100, "alert" => "true"}}};
my $ports = [];
my $processes = [];

my %_query = ("name" => $name, "agent" => $agent, "email" => $email, "thresholds" => $thresholds, "ports" => $ports, "processes" => $processes);
my $query = encode_json \%_query;

#Create monitoring policy
print _createMonitoringPolicy($query);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: createMonitoringPolicy
# Language: PHP
#
# Description: this function creates a new monitoring policy
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function createMonitoringPolicy($data){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "POST");

	//Add parameters
	curl_setopt($request, CURLOPT_POSTFIELDS, $data);
	
	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$name = "My monitoring";
$email = "example@example.com";
$agent = true;
$thresholds = Array("cpu"=>Array("warning"=>Array("value"=>3, "alert"=>false),"critical"=>Array("value"=>95, "alert"=> false)),
				    "ram"=>Array("warning"=>Array("value"=>90, "alert"=>false),"critical"=>Array("value"=>95, "alert"=> false)),
					"disk"=>Array("warning"=>Array("value"=>90, "alert"=>false),"critical"=>Array("value"=>95, "alert"=> false)),
					"transfer"=>Array("warning"=>Array("value"=>1000, "alert"=>false),"critical"=>Array("value"=>2000, "alert"=> false)),
					"internal_ping"=>Array("warning"=>Array("value"=>50, "alert"=>false),"critical"=>Array("value"=>100, "alert"=> false)));
$ports = array();
$processes = array();
					
$data = array('name'=>$name, 'email'=>$email, 'agent'=>$agent, 'thresholds'=>$thresholds, 'ports'=>$ports, 'processes'=>$processes);
$data = json_encode($data);

echo createMonitoringPolicy($data);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: createMonitoringPolicy
# Language: Python
#
# Description: this function creates a new monitoring policy
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _createMonitoringPolicy(content):
    #Configure the request
    _command = url + "/monitoring_policies"
    _method = 'POST'
    request = Request(_command, data=content.encode(encoding='utf_8'), 
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
name = 'My monitoring policy'
email = 'test@gmail.com'
agent = True
thresholds = {"cpu":{"warning":{"value":90, "alert":False}, "critical":{"value":95, "alert":True}},
              "ram":{"warning":{"value":90, "alert":True}, "critical":{"value":95, "alert":True}},
              "disk":{"warning":{"value":80, "alert":True}, "critical":{"value":90, "alert":True}},
              "transfer":{"warning":{"value":100, "alert":True}, "critical":{"value":2000, "alert":True}},
              "internal_ping":{"warning":{"value":50, "alert":True}, "critical":{"value":100, "alert":True}}};

ports = [{"protocol":"TCP", "port":22, "alert_if":"RESPONDING", "email_notification": True}]
processes = [{"process":"Test", "alert_if":"RUNNING", "email_notification": True}]

data = json.dumps({'name':name, 'email':email,
                   'agent':agent,
                   'thresholds':thresholds,
                   'ports':ports,
                   'processes':processes})

#Create monitoring policy
print(_createMonitoringPolicy(data))

Delete

Deletes a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deleteMonitoringPolicy
# Language: Perl
#
# Description: this function removes monitoring policy
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _deleteMonitoringPolicy
{	
	my ($id) = @_;
	my $_command = $url ."/monitoring_policies/" .$id;
	my $_method = 'DELETE';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}	
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Delete monitoring policy
print _deleteMonitoringPolicy($id);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deleteMonitoringPolicy
# Language: PHP
#
# Description: this function removes monitoring policy
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function deleteMonitoringPolicy($id){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "DELETE");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

echo deleteMonitoringPolicy($id);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deleteMonitoringPolicy
# Language: Python
#
# Description: this function removes monitoring policy
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _deleteMonitoringPolicy(id):
    #Configure the request
    _command = url + "/monitoring_policies/" + id
    _method = 'DELETE'
    request = Request(_command,
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Delete monitoring policy
print(_deleteMonitoringPolicy(id))

Delete Port

Deletes a Port from a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deletePortMonitoringPolicy
# Language: Perl
#
# Description: this function removes ports
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _deletePortMonitoringPolicy
{	
	my ($id, $port_id) = @_;
	my $_command = $url ."/monitoring_policies/$id/ports/$port_id";
	my $_method = 'DELETE';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}	
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my $port_id = "{YOUR_MONITORING_PORT_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Remove port
print _deletePortMonitoringPolicy($id, $port_id);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deletePortMonitoringPolicy
# Language: PHP
#
# Description: this function removes ports
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function deletePortMonitoringPolicy($id, $port_id){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/ports/$port_id";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "DELETE");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$port_id = "{YOUR_MONITORING_PORT_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

echo deletePortMonitoringPolicy($id, $port_id);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deletePortMonitoringPolicy
# Language: Python
#
# Description: this function removes ports
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _deletePortMonitoringPolicy(id, port_id):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/ports/" + port_id
    _method = 'DELETE'
    request = Request(_command,
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
port_id = "{YOUR_MONITORING_PORT_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Delete port
print(_deletePortMonitoringPolicy(id, port_id))

Delete Process

Deletes a Process from a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deleteProcessMonitoringPolicy
# Language: Perl
#
# Description: this function removes processes
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _deleteProcessMonitoringPolicy
{	
	my ($id, $process_id) = @_;
	my $_command = $url ."/monitoring_policies/$id/processes/$process_id";
	my $_method = 'DELETE';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}	
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my $process_id = "{YOUR_MONITORING_PROCESS_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Remove port
print _deleteProcessMonitoringPolicy($id, $process_id);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deleteProcessMonitoringPolicy
# Language: PHP
#
# Description: this function removes processes
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function deleteProcessMonitoringPolicy($id, $process_id){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/processes/$process_id";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "DELETE");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$process_id = "{YOUR_MONITORING_PROCESS_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

echo deleteProcessMonitoringPolicy($id, $process_id);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deleteProcessMonitoringPolicy
# Language: Python
#
# Description: this function removes processes
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _deleteProcessMonitoringPolicy(id, process_id):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/processes/" + process_id
    _method = 'DELETE'
    request = Request(_command,
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
process_id = "{YOUR_MONITORING_PROCESS_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Delete port
print(_deleteProcessMonitoringPolicy(id, process_id))

Remove Server

Removes a Server from a Monitoring Policy. The Server itself is not deleted..

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deleteServerMonitoringPolicy
# Language: Perl
#
# Description: this function removes servers
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
use JSON;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _deleteServerMonitoringPolicy
{
	my ($id, $server_id) = @_;
	my $_command = $url ."/monitoring_policies/$id/servers/$server_id";
	my $_method = 'DELETE';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');

	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}			
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my $server_id = "{YOUR_SERVER_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Remove server
print _deleteServerMonitoringPolicy($id, $server_id);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deleteServerMonitoringPolicy
# Language: PHP
#
# Description: this function removes servers
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function deleteServerMonitoringPolicy($id, $server_id){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/servers/$server_id";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "DELETE");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$server_id = "{YOUR_SERVER_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

echo deleteServerMonitoringPolicy($id, $server_id);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: deleteServerMonitoringPolicy
# Language: Python
#
# Description: this function removes servers
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _deleteServerMonitoringPolicy(id, server_id):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/servers/" + server_id
    _method = 'DELETE'
    request = Request(_command,
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
server_id = "{YOUR_SERVER_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Delete port
print(_deleteServerMonitoringPolicy(id, server_id))

Edit Port

Edits a Port of a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: editPortMonitoringPolicy
# Language: Perl
#
# Description: this function enable/disable port's alert
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
use JSON;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _editPortMonitoringPolicy
{
	my ($id, $port_id, $content) = @_;
	my $_command = $url ."/monitoring_policies/$id/ports/$port_id";
	my $_method = 'PUT';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Add additional parameters
	$request->content($content);

	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}			
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my $port_id = "{YOUR_MONITORING_PORT_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my $ports = {"protocol" => "TCP", "port" => 22, "alert_if" => "RESPONDING", "email_notification" => JSON::false()};

my %_query = ("ports" => $ports);
my $query = encode_json \%_query;

#Edit ports
print _editPortMonitoringPolicy($id, $port_id, $query);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: editPortMonitoringPolicy
# Language: PHP
#
# Description: this function enable/disable port's alert
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function editPortMonitoringPolicy($id, $port_id, $data){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/ports/$port_id";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "PUT");

	//Add parameters
	curl_setopt($request, CURLOPT_POSTFIELDS, $data);
	
	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$port_id = "{YOUR_MONITORING_PORT_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$ports = array("protocol"=>"TCP", "port"=>22, "alert_if"=>"NOT_RESPONDING", "email_notification"=>false);
					
$data = array('ports'=>$ports);
$data = json_encode($data);

echo editPortMonitoringPolicy($id, $port_id, $data);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: editPortMonitoringPolicy
# Language: Python
#
# Description: this function enable/disable port's alert
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _editPortMonitoringPolicy(id, port_id, content):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/ports/" + port_id
    _method = 'PUT'
    request = Request(_command, data=content.encode(encoding='utf_8'), 
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
port_id = "{YOUR_MONITORING_PORT_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
ports = {"protocol":"TCP", "port":80, "alert_if":"RESPONDING", "email_notification": False}

data = json.dumps({'ports':ports})

#Edit port
print(_editPortMonitoringPolicy(id, port_id, data))

Edit Process

Edits a Process of a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: editProcessMonitoringPolicy
# Language: Perl
#
# Description: this function enable/disable process' alert
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
use JSON;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _editProcessMonitoringPolicy
{
	my ($id, $process_id, $content) = @_;
	my $_command = $url ."/monitoring_policies/$id/processes/$process_id";
	my $_method = 'PUT';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Add additional parameters
	$request->content($content);

	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}			
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my $process_id = "{YOUR_MONITORING_PROCESS_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my $processes = {"process" => "process", "alert_if" => "RUNNING", "email_notification" => JSON::false()};

my %_query = ("processes" => $processes);
my $query = encode_json \%_query;

#Edit process
print _editProcessMonitoringPolicy($id, $process_id, $query);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: editProcessMonitoringPolicy
# Language: PHP
#
# Description: this function enable/disable process' alert
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function editProcessMonitoringPolicy($id, $process_id, $data){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/processes/$process_id";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "PUT");

	//Add parameters
	curl_setopt($request, CURLOPT_POSTFIELDS, $data);
	
	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$process_id = "{YOUR_MONITORING_PROCESS_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$processes = array("process"=>"test", "alert_if"=>"NOT_RUNNING", "email_notification"=>false);
					
$data = array('processes'=>$processes);
$data = json_encode($data);

echo editProcessMonitoringPolicy($id, $process_id, $data);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: editProcessMonitoringPolicy
# Language: Python
#
# Description: this function enable/disable process' alert
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _editProcessMonitoringPolicy(id, process_id, content):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/processes/" + process_id
    _method = 'PUT'
    request = Request(_command, data=content.encode(encoding='utf_8'), 
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
process_id = "{YOUR_MONITORING_PROCESS_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
processes = {"process":"iexplorer", "alert_if":"RUNNING", "email_notification": True}

data = json.dumps({'processes':processes})

#Edit process
print(_editProcessMonitoringPolicy(id, process_id, data))

Info

Returns the information of one Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoMonitoringPolicies
# Language: Perl
#
# Description: returns information of monitoring policy
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _infoMonitoringPolicy
{	
	my ($id) = @_;
	my $_command = $url ."/monitoring_policies/" .$id;
	my $_method = 'GET';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}	
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Info monitoring policy
print _infoMonitoringPolicy($id);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoMonitoringPolicies
# Language: PHP
#
# Description: returns information of monitoring policy
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function infoMonitoringPolicies($id){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "GET");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

echo infoMonitoringPolicies($id);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoMonitoringPolicies
# Language: Python
#
# Description: returns information of monitoring policy
###########################################################################
from urllib.request import Request, urlopen
import urllib

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _infoMonitoringPolicy(id):
    #Configure the request
    _command = url + "/monitoring_policies/" + id
    _method = 'GET'
    request = Request(_command,  
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Info monitoring policy
print(_infoMonitoringPolicy(id))

Info Port

Returns the information of one Port in a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoPortMonitoringPolicy
# Language: Perl
#
# Description: this function returns information about ports
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _infoPortMonitoringPolicy
{	
	my ($id, $port_id) = @_;
	my $_command = $url ."/monitoring_policies/$id/ports/$port_id";
	my $_method = 'GET';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}	
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my $port_id = "{YOUR_MONITORING_PORT_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Info port
print _infoPortMonitoringPolicy($id, $port_id);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoPortMonitoringPolicy
# Language: PHP
#
# Description: this function returns information about ports
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function infoPortMonitoringPolicy($id, $port_id){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/ports/$port_id";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "GET");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$port_id = "{YOUR_MONITORING_PORT_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

echo infoPortMonitoringPolicy($id, $port_id);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoPortMonitoringPolicy
# Language: Python
#
# Description: this function returns information about ports
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _infoPortMonitoringPolicy(id, port_id):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/ports/" + port_id
    _method = 'GET'
    request = Request(_command,
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
port_id = "{YOUR_MONITORING_PORT_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Info port
print(_infoPortMonitoringPolicy(id, port_id))

Info Process

Returns the information of one Process in a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoProcessMonitoringPolicy
# Language: Perl
#
# Description: this function returns information about process
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _infoProcessMonitoringPolicy
{	
	my ($id, $port_id) = @_;
	my $_command = $url ."/monitoring_policies/$id/processes/$port_id";
	my $_method = 'GET';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}	
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my $process_id = "{YOUR_MONITORING_PROCESS_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Info process
print _infoProcessMonitoringPolicy($id, $process_id);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoProcessMonitoringPolicy
# Language: Python
#
# Description: this function returns information about process
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function infoProcessMonitoringPolicy($id, $process_id){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/processes/$process_id";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "GET");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$process_id = "{YOUR_MONITORING_PROCESS_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

echo infoProcessMonitoringPolicy($id, $process_id);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoProcessMonitoringPolicy
# Language: Python
#
# Description: this function returns information about process
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _infoProcessMonitoringPolicy(id, process_id):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/processes/" + process_id
    _method = 'GET'
    request = Request(_command,
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
process_id = "{YOUR_MONITORING_PROCESS_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Info process
print(_infoProcessMonitoringPolicy(id, process_id))

Info Server

Returns the information of one Server in a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoServerMonitoringPolicy
# Language: Perl
#
# Description: this function returns information about servers
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
use JSON;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _infoServerMonitoringPolicy
{
	my ($id, $server_id) = @_;
	my $_command = $url ."/monitoring_policies/$id/servers/$server_id";
	my $_method = 'GET';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');

	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}			
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my $server_id = "{YOUR_SERVER_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Information about server
print _infoServerMonitoringPolicy($id, $server_id);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoServerMonitoringPolicy
# Language: PHP
#
# Description: this function returns information about servers
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function infoServerMonitoringPolicy($id, $server_id){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/servers/$server_id";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "GET");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$server_id = "{YOUR_SERVER_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

echo infoServerMonitoringPolicy($id, $server_id);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: infoServerMonitoringPolicy
# Language: Python
#
# Description: this function returns information about servers
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _infoServerMonitoringPolicy(id, server_id):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/servers/" + server_id
    _method = 'GET'
    request = Request(_command,
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
server_id = "{YOUR_SERVER_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Info server
print(_infoServerMonitoringPolicy(id, server_id))

List

Returns a list of all Monitoring Policies.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listMonitoringPolicies
# Language: Perl
#
# Description: retrieves a list with all monitoring policies
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _listMonitoringPolicies
{	
	my $_command = $url ."/monitoring_policies";
	my $_method = 'GET';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}	
}

#List monitoring policies
print _listMonitoringPolicies;
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listMonitoringPolicies
# Language: PHP
#
# Description: retrieves a list with all monitoring policies
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function listMonitoringPolicies(){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "GET");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS

echo listMonitoringPolicies();
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listMonitoringPolicies
# Language: Python
#
# Description: retrieves a list with all monitoring policies
###########################################################################
from urllib.request import Request, urlopen
import urllib

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _listMonitoringPolicies():
    #Configure the request
    _command = url + "/monitoring_policies"
    _method = 'GET'
    request = Request(_command,  
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS

#List monitoring policies
print(_listMonitoringPolicies())

List Ports

Returns a list of the Ports of a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listPortsMonitoringPolicies
# Language: Perl
#
# Description: returns monitoring policy's ports
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _listPortsMonitoringPolicy
{	
	my ($id) = @_;
	my $_command = $url ."/monitoring_policies/" .$id ."/ports";
	my $_method = 'GET';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}	
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Monitoring policy's ports
print _listPortsMonitoringPolicy($id);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listPortsMonitoringPolicies
# Language: PHP
#
# Description: returns monitoring policy's ports
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function listPortsMonitoringPolicy($id){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/ports";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "GET");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_PORTS_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

echo listPortsMonitoringPolicy($id);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listPortsMonitoringPolicies
# Language: Python
#
# Description: returns monitoring policy's ports
###########################################################################
from urllib.request import Request, urlopen
import urllib

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _listPortsMonitoringPolicy(id):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/ports"
    _method = 'GET'
    request = Request(_command,  
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#List ports
print(_listPortsMonitoringPolicy(id))

List Processes

Returns a list of the Processes of a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listProcessesMonitoringPolicies
# Language: Perl
#
# Description: returns monitoring policy's processes
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _listProcessesMonitoringPolicy
{	
	my ($id) = @_;
	my $_command = $url ."/monitoring_policies/" .$id ."/processes";
	my $_method = 'GET';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}	
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#Monitoring policy's processes
print _listProcessesMonitoringPolicy($id);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listProcessesMonitoringPolicies
# Language: PHP
#
# Description: returns monitoring policy's processes
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function listProcessesMonitoringPolicy($id){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/processes";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "GET");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_PROCESS_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

echo listProcessesMonitoringPolicy($id);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listProcessesMonitoringPolicies
# Language: Python
#
# Description: returns monitoring policy's processes
###########################################################################
from urllib.request import Request, urlopen
import urllib

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _listProcessesMonitoringPolicy(id):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/processes"
    _method = 'GET'
    request = Request(_command,  
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#List processes
print(_listProcessesMonitoringPolicy(id))

List Servers

Returns a list of the Servers of a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listServersMonitoringPolicies
# Language: Perl
#
# Description: returns a list of servers assigned to monitoring policy
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
use JSON;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _listServersMonitoringPolicy
{
	my ($id) = @_;
	my $_command = $url ."/monitoring_policies/" .$id ."/servers";
	my $_method = 'GET';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');

	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}			
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#List servers
print _listServersMonitoringPolicy($id);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listServersMonitoringPolicies
# Language: PHP
#
# Description: returns a list of servers assigned to monitoring policy
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function listServersMonitoringPolicy($id){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id/servers";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "GET");

	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

echo listServersMonitoringPolicy($id);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: listServersMonitoringPolicies
# Language: Python
#
# Description: returns a list of servers assigned to monitoring policy
###########################################################################
from urllib.request import Request, urlopen
import urllib

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _listServersMonitoringPolicy(id):
    #Configure the request
    _command = url + "/monitoring_policies/" + id + "/servers"
    _method = 'GET'
    request = Request(_command,  
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"

#List servers
print(_listServersMonitoringPolicy(id))

Reconfigure

Reconfigures a Monitoring Policy.

###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: reconfigureMonitoringPolicy
# Language: Perl
#
# Description: this function reconfigures monitoring policy
###########################################################################
use strict;
use LWP::UserAgent;
use URI::Escape;
use JSON;
require Http::Request::Common;

#ID access to API
my $TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
my $url = "https://cloudpanel-api.ionos.com/v1";

sub _reconfigureMonitoringPolicy
{
	my ($id, $content) = @_;
	my $_command = $url ."/monitoring_policies/" .$id;
	my $_method = 'PUT';

	#Create the request
	my $ua = LWP::UserAgent->new;
	my $request = HTTP::Request->new($_method => $_command);
	$request->header('X-TOKEN' => $TOKEN);
	$request->content_type('application/json');
	
	#Add additional parameters
	$request->content($content);

	#Get the response
	my $response = $ua->request($request);

	if($response)
	{
		#Get the response and close the handlers
		print $response->headers()->as_string ."\n";
		return $response->content;
		$response->close;
		$request->close;
	}
	else
	{
		#Get the error and close the handlers
		return "Http Error Code: ", $response->code, "\n";
		$request->close;
	}			
}

#Parameters
my $id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
my $name = "My monitoring policy";
my $description = "My monitoring policy description";
my $thresholds = {"cpu" => {"warning" => {"value" => 90, "alert" => "false"}, "critical" => {"value" => 95, "alert" => "true"}},
                  "ram" => {"warning" => {"value" => 90, "alert" => "true"}, "critical" => {"value" => 95, "alert" => "true"}},
                  "disk" => {"warning" => {"value" => 80, "alert" => "true"}, "critical" => {"value" => 90, "alert" => "true"}},
                  "transfer" => {"warning" => {"value" => 100, "alert" => "true"}, "critical" => {"value" => 2000, "alert" => "true"}},
                  "internal_ping" => {"warning" => {"value" => 50, "alert" => "true"}, "critical" => {"value" => 100, "alert" => "true"}}};

my %_query = ("name" => $name, "description" => $description, "thresholds" => $thresholds);
my $query = encode_json \%_query;

#Reconfigure monitoring policy
print _reconfigureMonitoringPolicy($id, $query);
<?php
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: reconfigureMonitoringPolicy
# Language: PHP
#
# Description: this function reconfigures monitoring policy
###########################################################################

#ID access to API
$TOKEN = "{YOUR_API_TOKEN}"; # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
$url = "https://cloudpanel-api.ionos.com/v1";

function reconfigureMonitoringPolicy($id, $data){
	global $url;
	global $TOKEN;
	$_command = $url . "/monitoring_policies/$id";
	$request = curl_init();

	//Set options
	curl_setopt($request, CURLOPT_URL, $_command);
	curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($request, CURLOPT_HTTPHEADER, array("X-TOKEN:$TOKEN", "Content-type:application/json"));
	curl_setopt($request, CURLOPT_CUSTOMREQUEST, "PUT");

	//Add parameters
	curl_setopt($request, CURLOPT_POSTFIELDS, $data);
	
	//Try to get the response
	$response = curl_exec($request);
	if ($response == false){
		return( curl_error($request));
	}
	else{
		return( $response);
	}

	curl_close($request);
}

#PARAMETERS
$id = "{YOUR_MONITORING_ID}"; # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
$name = "My monitoring policy";
$description = "My monitoring policy description";
$thresholds = Array("cpu"=>Array("warning"=>Array("value"=>3, "alert"=>false),"critical"=>Array("value"=>95, "alert"=> false)),
				    "ram"=>Array("warning"=>Array("value"=>90, "alert"=>false),"critical"=>Array("value"=>95, "alert"=> false)),
					"disk"=>Array("warning"=>Array("value"=>90, "alert"=>false),"critical"=>Array("value"=>95, "alert"=> false)),
					"transfer"=>Array("warning"=>Array("value"=>1000, "alert"=>false),"critical"=>Array("value"=>2000, "alert"=> false)),
					"internal_ping"=>Array("warning"=>Array("value"=>50, "alert"=>false),"critical"=>Array("value"=>100, "alert"=> false)));
					
$data = array('name'=>$name, 'description'=>$description, 'thresholds'=>$thresholds);
$data = json_encode($data);

echo reconfigureMonitoringPolicy($id, $data);
?>
###########################################################################
# CLOUD SERVER API DOCUMENTATION
#
# Name: reconfigureMonitoringPolicy
# Language: Python
#
# Description: this function reconfigures monitoring policy
###########################################################################
from urllib.request import Request, urlopen
import urllib
import json

#ID access to API
TOKEN = "{YOUR_API_TOKEN}" # e.g.: "f03c3c76cc853ee690b879909c9c6f2a"
url = "https://cloudpanel-api.ionos.com/v1"

def _reconfigureMonitoringPolicy(id, content):
    #Configure the request
    _command = url + "/monitoring_policies/" + id
    _method = 'PUT'
    request = Request(_command, data=content.encode(encoding='utf_8'), 
                      headers={'X-TOKEN':TOKEN, 'content-type':'application/json'}, 
                      method=_method)
    
    #Try to get the response
    try:
        response = urlopen(request)
        content = response.read()
        return (content.decode())
    #Fetch error
    except urllib.error.URLError as e:
        return("Error " + str(e.code) + ":" + e.reason) 

#PARAMETERS
id = "{YOUR_MONITORING_ID}" # e.g.: "5340033E7FBBC308BC329414A0DF3C20"
name = 'My monitoring policy'
description = 'My monitoring policy description'
email = 'test2@arsys.com'
thresholds = {"cpu":{"warning":{"value":90, "alert":False}, "critical":{"value":95, "alert":True}},
              "ram":{"warning":{"value":90, "alert":True}, "critical":{"value":95, "alert":True}},
              "disk":{"warning":{"value":80, "alert":True}, "critical":{"value":90, "alert":True}},
              "transfer":{"warning":{"value":100, "alert":True}, "critical":{"value":2000, "alert":True}},
              "internal_ping":{"warning":{"value":50, "alert":True}, "critical":{"value":100, "alert":True}}};

data = json.dumps({'name':name, 'description': description, 'email':email, 'thresholds':thresholds})

#Reconfigure monitoring policy
print(_reconfigureMonitoringPolicy(id, data))