api-php-lib icon indicating copy to clipboard operation
api-php-lib copied to clipboard

get all properties of subscriptions

Open aadlung opened this issue 5 years ago • 1 comments

Hi, in general, the API is just returning the gen_info tags mostly, there is no way of getting a full subscription, e.g. with a packet:

<packet>
	<webspace>
		<get>
			<filter/>
			<dataset>
				<gen_info/>
				<hosting/>
				<stat/>
				<prefs/>
				<disk_usage/>
				<performance/>
				<subscriptions/>
				<php-settings/>
				<resource-usage/>
			</dataset>
		</get>
	</webspace>
</packet>

Is there any plan to extend the API to really receive all properties, or a way to customize it without re-programming nearly the whole API?

@abashurov , any idea?

aadlung avatar Sep 19 '19 18:09 aadlung

Hey, I got the following working:

$this->plesk() gives me an instance of \PleskX\Api\Client. U can leave the filter empty and of course add or remove some datasets.

        $req = $this->plesk()->request([
            'webspace' => [
                [
                    'get' => [
                        'filter'  => ['name' => $this->subscription],
                        'dataset' => [
                            'gen_info'      => '',
                            'hosting'       => '',
                            'php-settings'  => '',
                            'performance'   => '',
                            'prefs'         => '',
                            'subscriptions' => '',
                            'limits'        => '',
                            'plan-items'    => ''
                        ]
                    ]
                ]
            ]
        ]);

dezio avatar Nov 17 '19 15:11 dezio