• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Plesk Api PHP lib information

fferraro87

Basic Pleskian
Hi,

i'm using plesk api php lib in order to get all domains on my plesk server and their status (suspended, disable and so on).

My question is what's the difference between site and webspace?
because if i get all webspace, i've all domains on my plesk but if i get all site i've only subdomain.
So webspaces is only domains and sites only subdomains? and why i can't get status of webspaces?

Thanks
 
So why when i call getAll() method for site i've only subdomains? and with webspace i've all domains?
Thanks

webspace operator retrieves the list of primary (main) domains
site operator retrieves the list of non primary (additional) domains and subdomains

In your case getting only subdomains as a result of getAll() request might mean that you don't have any additional domains, only primary and their subdomains.
 
So
webspace operator retrieves the list of primary (main) domains
site operator retrieves the list of non primary (additional) domains and subdomains

In your case getting only subdomains as a result of getAll() request might mean that you don't have any additional domains, only primary and their subdomains.
Thanks but so i can't get status of primary domains? only for subdomains or non primary?
 
ok i've solved putting status property on \plesk\api-php-lib\src\Api\Struct\Webspace\GeneralInfo.php like this :
PHP:
<?php
// Copyright 1999-2019. Plesk International GmbH.

namespace PleskX\Api\Struct\Webspace;

class GeneralInfo extends \PleskX\Api\Struct
{
    /** @var string */
    public $name;

    /** @var string */
    public $guid;

    /** @var integer */
    public $realSize;

    /** @var string */
    public $status;

    public function __construct($apiResponse)
    {
        $this->_initScalarProperties($apiResponse, [
            'name',
            'guid',
            'real_size',
            'status',
        ]);
    }
}
 
Back
Top