Update hosting

Request Information
URL PATCH {{basepath}}/hosting/:hosting_id
CategoryHosting

Description

Allows you to update the hosting object.

the request body should contain a HostingUpdateRequest object.

Returns a HostingGetResponse object.

Url variables
:hosting_id{{hosting_id}}
JSON
{
    "package": "basic"
}

Example responses

Update hosting
Request Method & URL
PATCH {{basepath}}/hosting/:hosting_id
Request Body:
{
    "package": "pro"
}
Url variables
:hosting_id{{hosting_id}}The hosting you want to update
Response Code:
202 Accepted
Response Body:
{
    "responseId": "1_883e0316c4c053c9fc385baddcb40192937714ff",
    "status": "pending",
    "message": "Your update request is pending",
    "hosting": {
        "identifier": "1_aed1f3d95b069d5cdf88ef9d70392d359847e144",
        "status": "active",
        "domain": "example-2021-8-9-14-40-49.com",
        "info": {
            "serverPlan": "basic",
            "pleskUser": "h_00000001",
            "pleskFtpUser": "f_00000001",
            "pleskClientId": 282,
            "pleskHostingId": 235,
            "activeDomains": 1,
            "subdomains": 0,
            "diskspace": 0,
            "databases": 0,
            "traffic": 0,
            "trafficPrevDay": 0
        },
        "options": [
            {
                "name": "letsEncrypt",
                "value": "disabled",
                "arguments": []
            }
        ],
        "package": {
            "packageId": "basic",
            "type": "plesk",
            "status": "active",
            "spec": [
                {
                    "type": "diskspace",
                    "value": "1000"
                }
            ],
            "created": 1626272615,
            "modified": 1626272619
        },
        "server": {
            "identifier": "pleskdev",
            "hostname": "pleskdev.yourdomainprovider.net",
            "type": "plesk",
            "status": "active",
            "ips": [
                {
                    "address": "213.249.70.50",
                    "version": 4
                },
                {
                    "address": "2a01:448:1004::50",
                    "version": 6
                }
            ],
            "availablePackages": [
                "basic",
                "pro"
            ],
            "usage": 1,
            "capacity": 20,
            "created": 1626259040,
            "modified": 1626259045
        },
        "suspended": false,
        "renewalDay": 9,
        "period": 1,
        "nextRenewal": "2021-08-10",
        "openJobCount": 1,
        "servicePeriod": 7,
        "serviceStatus": "active",
        "serviceRenewalMonth": 8,
        "nextServiceRenewalDate": "2021-08-16",
        "created": 1628512849,
        "modified": 1628512882
    }
}
Trying to update package to the same package
Request Method & URL
PATCH {{basepath}}/hosting/:hosting_id
Request Body:
{
    "package": "basic2"
}
Url variables
:hosting_id{{hosting_id}}The hosting identifier
Response Code:
409 Conflict
Response Body:
{
    "responseId": "1_47b801880c83a83c22936089098df360d7fa336d",
    "status": "error",
    "errorCode": "would_not_change_anything",
    "errorMessage": "The hosting is already this package"
}
trying to switch to package that can only be used for creating a hosting product
Request Method & URL
PATCH {{basepath}}/hosting/:hosting_id
Request Body:
{
    "package": "basic_protest"
}
Url variables
:hosting_id{{hosting_id}}
Response Code:
409 Conflict
Response Body:
{
    "responseId": "1_2bd6e9eacbb1c76336074c914c9538b48a3ff756",
    "status": "error",
    "errorCode": "cannot_change_package",
    "errorMessage": "The supplied package can only be used to create products"
}