• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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