ashleyhood / php-lxd

A PHP library for interacting with the LXD REST API
MIT License
28 stars 15 forks source link

Logs endpoint error #32

Open piferrari opened 3 years ago

piferrari commented 3 years ago

Hi,

In Containers.php (line 504) and Containers/Logs.php (line 26) you have two time the same error:

        foreach ($this->get($this->getEndpoint().$name.'/logs/') as $log) {
            $logs[] = str_replace(
                '/'.$this->client->getApiVersion().'/containers/'.$name.'/logs/',
                '',
                $log
            );
        }

You must replace /containers/ by /instances/

Best Regards

PiF

piferrari commented 2 years ago

In my memory we do something like this:$r = $ldx->execute(....);if($r['return'] !== 0)   $whoami=$r['stdout'];Best Regards.piferrari

C0rn3j commented 11 months ago

Well this is somewhat of a dupe of https://github.com/ashleyhood/php-lxd/issues/34 as switching /containers/ to /instances/ fixes it.

@ashleyhood Do you have an interest in maintaining this project still? I could send a PR if so.

It's been broken for VMs for some time and a fork has popped up - https://github.com/turtle0x1/php-lxd

(I also forked it with just the VM fixes so far)

ashleyhood commented 11 months ago

Thanks @C0rn3j for you r offer of a PR but I don't use this library anymore and so don't have time to work on it.