Start an action on hosting

Request Information
URL POST {{basepath}}/hosting/:hosting_id/action
CategoryHosting

Description

Allows you start an action on a hosting object.

the request body should contain a HostingActionRequest object.

Returns a HostingActionResponse object.

Url variables
:hosting_id{{hosting_id}}
JSON
{
    "type": "recalculatestats"
}

Example responses

Start a malware scan
Request Method & URL
POST {{basepath}}/hosting/:hosting_id/action
Request Body:
{
    "type": "malwarescan"
}
Url variables
:hosting_id{{hosting_id}}
Response Code:
202 Accepted
Response Body:
{
    "responseId": "1_0a784bd588dca6de4b0e672e7c29e6bc83c05d50",
    "status": "pending",
    "message": "Action is queued for execution",
    "identifier": "cd11f08f5357358192e431273b7807a13c3f036f"
}
Force plesk to recalculate the stats (disk usage etc)
Request Method & URL
POST {{basepath}}/hosting/:hosting_id/action
Request Body:
{
    "type": "recalculatestats"
}
Url variables
:hosting_id{{hosting_id}}
Response Code:
202 Accepted
Response Body:
{
    "responseId": "1_0a784bd588dca6de4b0e672e7c29e6bc83c05d50",
    "status": "pending",
    "message": "Action is queued for execution",
    "identifier": "cd11f08f5357358192e431273b7807a13c3f036f"
}
Start a malware cleanup
Request Method & URL
POST {{basepath}}/hosting/:hosting_id/action
Request Body:
{
    "type": "malwarecleanup"
}
Url variables
:hosting_id{{hosting_id}}
Response Code:
202 Accepted
Response Body:
{
    "responseId": "1_0a784bd588dca6de4b0e672e7c29e6bc83c05d50",
    "status": "pending",
    "message": "Action is queued for execution",
    "identifier": "cd11f08f5357358192e431273b7807a13c3f036f"
}
Deblacklist an ipv4 or ipv6
Request Method & URL
POST {{basepath}}/hosting/:hosting_id/action
Request Body:
{
    "type": "deblacklist",
    "arguments": [
        "127.0.0.1"
    ]
}
Url variables
:hosting_id{{hosting_id}}
Response Code:
202 Accepted
Response Body:
{
    "responseId": "1_0a784bd588dca6de4b0e672e7c29e6bc83c05d50",
    "status": "pending",
    "message": "Action is queued for execution",
    "identifier": "cd11f08f5357358192e431273b7807a13c3f036f"
}
Cannot start because the hosting is not active
Request Method & URL
POST {{basepath}}/hosting/:hosting_id/action
Request Body:
{
    "type": "malwarescan"
}
Url variables
:hosting_id{{hosting_id}}
Response Code:
405 Method Not Allowed
Response Body:
{
    "responseId": "1_aaaa3324e5bd8df4c894ba55b69804497fe807f0",
    "status": "error",
    "errorCode": "not_active",
    "errorMessage": "This hosting is not in an active state or there are pending jobs so cannot be updated, please try again later"
}